aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'application/plugin')
-rw-r--r--application/plugin/PluginManager.php13
-rw-r--r--application/plugin/exception/PluginFileNotFoundException.php1
2 files changed, 8 insertions, 6 deletions
diff --git a/application/plugin/PluginManager.php b/application/plugin/PluginManager.php
index da66dea3..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,7 +99,7 @@ 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_',
@@ -196,7 +197,7 @@ class PluginManager
196 */ 197 */
197 public function getPluginsMeta() 198 public function getPluginsMeta()
198 { 199 {
199 $metaData = array(); 200 $metaData = [];
200 $dirs = glob(self::$PLUGINS_PATH . '/*', GLOB_ONLYDIR | GLOB_MARK); 201 $dirs = glob(self::$PLUGINS_PATH . '/*', GLOB_ONLYDIR | GLOB_MARK);
201 202
202 // Browse all plugin directories. 203 // Browse all plugin directories.
@@ -217,9 +218,9 @@ class PluginManager
217 if (isset($metaData[$plugin]['parameters'])) { 218 if (isset($metaData[$plugin]['parameters'])) {
218 $params = explode(';', $metaData[$plugin]['parameters']); 219 $params = explode(';', $metaData[$plugin]['parameters']);
219 } else { 220 } else {
220 $params = array(); 221 $params = [];
221 } 222 }
222 $metaData[$plugin]['parameters'] = array(); 223 $metaData[$plugin]['parameters'] = [];
223 foreach ($params as $param) { 224 foreach ($params as $param) {
224 if (empty($param)) { 225 if (empty($param)) {
225 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;