From e0c26282a603881e8d2f839d94c28dbbfc57d71b Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Mon, 29 Sep 2014 03:34:17 +0200 Subject: scrutinizer documentations issues --- inc/plugincontroller.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/plugincontroller.class.php') diff --git a/inc/plugincontroller.class.php b/inc/plugincontroller.class.php index d80cd4c9e..999f32937 100644 --- a/inc/plugincontroller.class.php +++ b/inc/plugincontroller.class.php @@ -66,7 +66,7 @@ class Doku_Plugin_Controller { * @param $name string name of the plugin to load * @param $new bool true to return a new instance of the plugin, false to use an already loaded instance * @param $disabled bool true to load even disabled plugins - * @return DokuWiki_Plugin|DokuWiki_Syntax_Plugin|null the plugin object or null on failure + * @return DokuWiki_Plugin|DokuWiki_Syntax_Plugin|DokuWiki_Auth_Plugin|DokuWiki_Admin_Plugin|DokuWiki_Action_Plugin|DokuWiki_Remote_Plugin|null the plugin object or null on failure */ public function load($type,$name,$new=false,$disabled=false){ -- cgit v1.2.3 From 59bc3b48fdffb76ee65a4b630be3ffa1f6c20c80 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Mon, 29 Sep 2014 21:45:27 +0200 Subject: more scrutinizer issue improvements --- inc/plugincontroller.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/plugincontroller.class.php') diff --git a/inc/plugincontroller.class.php b/inc/plugincontroller.class.php index 999f32937..86c10585e 100644 --- a/inc/plugincontroller.class.php +++ b/inc/plugincontroller.class.php @@ -73,7 +73,7 @@ class Doku_Plugin_Controller { //we keep all loaded plugins available in global scope for reuse global $DOKU_PLUGINS; - list($plugin,$component) = $this->_splitName($name); + list($plugin, /* $component */) = $this->_splitName($name); // check if disabled if(!$disabled && $this->isdisabled($plugin)){ -- cgit v1.2.3 From 42ea7f447f39fbc2f79eaaec31f8c10ede59c5d0 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Wed, 1 Oct 2014 11:30:27 +0200 Subject: Many PHPDocs, some unused and dyn declared vars many PHPDocs some unused variables some dynamically declared variables declared --- inc/plugincontroller.class.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'inc/plugincontroller.class.php') diff --git a/inc/plugincontroller.class.php b/inc/plugincontroller.class.php index 86c10585e..21d227ee4 100644 --- a/inc/plugincontroller.class.php +++ b/inc/plugincontroller.class.php @@ -114,7 +114,7 @@ class Doku_Plugin_Controller { * Whether plugin is disabled * * @param string $plugin name of plugin - * @return bool; true disabled, false enabled + * @return bool true disabled, false enabled */ public function isdisabled($plugin) { return empty($this->tmp_plugins[$plugin]); @@ -124,7 +124,7 @@ class Doku_Plugin_Controller { * Disable the plugin * * @param string $plugin name of plugin - * @return bool; true saving succeed, false saving failed + * @return bool true saving succeed, false saving failed */ public function disable($plugin) { if(array_key_exists($plugin,$this->plugin_cascade['protected'])) return false; @@ -136,7 +136,7 @@ class Doku_Plugin_Controller { * Enable the plugin * * @param string $plugin name of plugin - * @return bool; true saving succeed, false saving failed + * @return bool true saving succeed, false saving failed */ public function enable($plugin) { if(array_key_exists($plugin,$this->plugin_cascade['protected'])) return false; @@ -227,7 +227,7 @@ class Doku_Plugin_Controller { * @param bool $forceSave; * false to save only when config changed * true to always save - * @return bool; true saving succeed, false saving failed + * @return bool true saving succeed, false saving failed */ protected function saveList($forceSave = false) { global $conf; @@ -300,12 +300,9 @@ class Doku_Plugin_Controller { /** * Returns a list of available plugin components of given type * - * @param string $type, plugin_type name; - * the type of plugin to return, - * @param bool $enabled; - * true to return enabled plugins, - * false to return disabled plugins - * + * @param string $type plugin_type name; the type of plugin to return, + * @param bool $enabled true to return enabled plugins, + * false to return disabled plugins * @return array of plugin components of requested type */ protected function _getListByType($type, $enabled) { -- cgit v1.2.3 From fb15cab611b9b03bfde1bd3d64906c08fb443f3b Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Tue, 21 Oct 2014 14:47:21 +0200 Subject: use phpdocs deprecated notation --- inc/plugincontroller.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'inc/plugincontroller.class.php') diff --git a/inc/plugincontroller.class.php b/inc/plugincontroller.class.php index d80cd4c9e..4f0cd58e6 100644 --- a/inc/plugincontroller.class.php +++ b/inc/plugincontroller.class.php @@ -178,8 +178,10 @@ class Doku_Plugin_Controller { // to keep everything simple we just skip the plugin completely continue; } elseif (@file_exists(DOKU_PLUGIN.$plugin.'/disabled')) { - // treat this as a default disabled plugin(over-rideable by the plugin manager) - // deprecated 2011-09-10 (usage of disabled files) + /** + * treat this as a default disabled plugin(over-rideable by the plugin manager) + * @deprecated 2011-09-10 (usage of disabled files) + */ if (empty($this->plugin_cascade['local'][$plugin])) { $all_plugins[$plugin] = 0; } else { -- cgit v1.2.3 From e8b8a4027e0150f75db5ab381b7fee4ed959ea2f Mon Sep 17 00:00:00 2001 From: Yurii Korotia Date: Sat, 3 Jan 2015 13:28:56 +0200 Subject: fixes FASTCGI_UNEXPECTED_EXIT (error 0xff) in FastCGI/IIS for PHP5.6.x 64bit --- inc/plugincontroller.class.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'inc/plugincontroller.class.php') diff --git a/inc/plugincontroller.class.php b/inc/plugincontroller.class.php index dfd4d0a29..f8ba58563 100644 --- a/inc/plugincontroller.class.php +++ b/inc/plugincontroller.class.php @@ -309,25 +309,30 @@ class Doku_Plugin_Controller { */ protected function _getListByType($type, $enabled) { $master_list = $enabled ? array_keys(array_filter($this->tmp_plugins)) : array_keys(array_filter($this->tmp_plugins,array($this,'negate'))); - $plugins = array(); + foreach ($master_list as $plugin) { + $dir = $this->get_directory($plugin); - if (@file_exists(DOKU_PLUGIN."$dir/$type.php")){ $plugins[] = $plugin; - } else { - if ($dp = @opendir(DOKU_PLUGIN."$dir/$type/")) { + continue; + } + + $dir2 = DOKU_PLUGIN."$dir/$type/"; + if (is_dir($dir2)) { + if ($dp = opendir($dir2)) { while (false !== ($component = readdir($dp))) { if (substr($component,0,1) == '.' || strtolower(substr($component, -4)) != ".php") continue; - if (is_file(DOKU_PLUGIN."$dir/$type/$component")) { + if (is_file($dir2.$component)) { $plugins[] = $plugin.'_'.substr($component, 0, -4); } } closedir($dp); } } - } + + }//foreach return $plugins; } -- cgit v1.2.3 From 79e79377626799a77c11aa7849cb9c64305590c8 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 7 Jan 2015 10:47:45 +0100 Subject: Remove error supression for file_exists() In an older version of PHP a file_exists() call would issue a warning when the file did not exist. This was fixed in later PHP releases. Since we require PHP 5.3 now, there's no need to supress any error here anymore. This might even give a minor performance boost. --- inc/plugincontroller.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'inc/plugincontroller.class.php') diff --git a/inc/plugincontroller.class.php b/inc/plugincontroller.class.php index dfd4d0a29..ad73e1528 100644 --- a/inc/plugincontroller.class.php +++ b/inc/plugincontroller.class.php @@ -177,7 +177,7 @@ class Doku_Plugin_Controller { // disabling mechanism was changed back very soon again // to keep everything simple we just skip the plugin completely continue; - } elseif (@file_exists(DOKU_PLUGIN.$plugin.'/disabled')) { + } elseif (file_exists(DOKU_PLUGIN.$plugin.'/disabled')) { /** * treat this as a default disabled plugin(over-rideable by the plugin manager) * @deprecated 2011-09-10 (usage of disabled files) @@ -247,9 +247,9 @@ class Doku_Plugin_Controller { $out .= "\$plugins['$plugin'] = $value;\n"; } // backup current file (remove any existing backup) - if (@file_exists($file)) { + if (file_exists($file)) { $backup = $file.'.bak'; - if (@file_exists($backup)) @unlink($backup); + if (file_exists($backup)) @unlink($backup); if (!@copy($file,$backup)) return false; if (!empty($conf['fperm'])) chmod($backup, $conf['fperm']); } @@ -314,7 +314,7 @@ class Doku_Plugin_Controller { foreach ($master_list as $plugin) { $dir = $this->get_directory($plugin); - if (@file_exists(DOKU_PLUGIN."$dir/$type.php")){ + if (file_exists(DOKU_PLUGIN."$dir/$type.php")){ $plugins[] = $plugin; } else { if ($dp = @opendir(DOKU_PLUGIN."$dir/$type/")) { -- cgit v1.2.3