aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/plugin/PluginManager.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/plugin/PluginManager.php')
-rw-r--r--application/plugin/PluginManager.php14
1 files changed, 8 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;