aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/plugin
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-11-12 13:02:36 +0100
committerArthurHoaro <arthur@hoa.ro>2020-11-12 13:02:36 +0100
commit1409f1c89a7ca01456ae2dcd6357d296e2b99f5a (patch)
treeffa30a9358e82d27be75d8fc5e57f3c8820dc6d3 /application/plugin
parent054e03f37fa29da8066f1a637919f13c7e7dc5d2 (diff)
parenta6935feb22df8d9634189ee87d257da9f03eedbd (diff)
downloadShaarli-0.12.1.tar.gz
Shaarli-0.12.1.tar.zst
Shaarli-0.12.1.zip
Merge branch 'master' into v0.12v0.12.1v0.12
Diffstat (limited to 'application/plugin')
-rw-r--r--application/plugin/PluginManager.php14
-rw-r--r--application/plugin/exception/PluginFileNotFoundException.php1
2 files changed, 9 insertions, 6 deletions
diff --git a/application/plugin/PluginManager.php b/application/plugin/PluginManager.php
index 1b2197c9..3ea55728 100644
--- a/application/plugin/PluginManager.php
+++ b/application/plugin/PluginManager.php
@@ -1,4 +1,5 @@
1<?php 1<?php
2
2namespace Shaarli\Plugin; 3namespace Shaarli\Plugin;
3 4
4use Shaarli\Config\ConfigManager; 5use Shaarli\Config\ConfigManager;
@@ -23,7 +24,7 @@ class PluginManager
23 * 24 *
24 * @var array $loadedPlugins 25 * @var array $loadedPlugins
25 */ 26 */
26 private $loadedPlugins = array(); 27 private $loadedPlugins = [];
27 28
28 /** 29 /**
29 * @var ConfigManager Configuration Manager instance. 30 * @var ConfigManager Configuration Manager instance.
@@ -57,7 +58,7 @@ class PluginManager
57 public function __construct(&$conf) 58 public function __construct(&$conf)
58 { 59 {
59 $this->conf = $conf; 60 $this->conf = $conf;
60 $this->errors = array(); 61 $this->errors = [];
61 } 62 }
62 63
63 /** 64 /**
@@ -98,12 +99,13 @@ class PluginManager
98 * 99 *
99 * @return void 100 * @return void
100 */ 101 */
101 public function executeHooks($hook, &$data, $params = array()) 102 public function executeHooks($hook, &$data, $params = [])
102 { 103 {
103 $metadataParameters = [ 104 $metadataParameters = [
104 'target' => '_PAGE_', 105 'target' => '_PAGE_',
105 'loggedin' => '_LOGGEDIN_', 106 'loggedin' => '_LOGGEDIN_',
106 'basePath' => '_BASE_PATH_', 107 'basePath' => '_BASE_PATH_',
108 'rootPath' => '_ROOT_PATH_',
107 'bookmarkService' => '_BOOKMARK_SERVICE_', 109 'bookmarkService' => '_BOOKMARK_SERVICE_',
108 ]; 110 ];
109 111
@@ -195,7 +197,7 @@ class PluginManager
195 */ 197 */
196 public function getPluginsMeta() 198 public function getPluginsMeta()
197 { 199 {
198 $metaData = array(); 200 $metaData = [];
199 $dirs = glob(self::$PLUGINS_PATH . '/*', GLOB_ONLYDIR | GLOB_MARK); 201 $dirs = glob(self::$PLUGINS_PATH . '/*', GLOB_ONLYDIR | GLOB_MARK);
200 202
201 // Browse all plugin directories. 203 // Browse all plugin directories.
@@ -216,9 +218,9 @@ class PluginManager
216 if (isset($metaData[$plugin]['parameters'])) { 218 if (isset($metaData[$plugin]['parameters'])) {
217 $params = explode(';', $metaData[$plugin]['parameters']); 219 $params = explode(';', $metaData[$plugin]['parameters']);
218 } else { 220 } else {
219 $params = array(); 221 $params = [];
220 } 222 }
221 $metaData[$plugin]['parameters'] = array(); 223 $metaData[$plugin]['parameters'] = [];
222 foreach ($params as $param) { 224 foreach ($params as $param) {
223 if (empty($param)) { 225 if (empty($param)) {
224 continue; 226 continue;
diff --git a/application/plugin/exception/PluginFileNotFoundException.php b/application/plugin/exception/PluginFileNotFoundException.php
index e5386f02..21ac6604 100644
--- a/application/plugin/exception/PluginFileNotFoundException.php
+++ b/application/plugin/exception/PluginFileNotFoundException.php
@@ -1,4 +1,5 @@
1<?php 1<?php
2
2namespace Shaarli\Plugin\Exception; 3namespace Shaarli\Plugin\Exception;
3 4
4use Exception; 5use Exception;