mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-06 03:22:39 +00:00
Improving CakePlugin::loaded() to accept a plugin name as first parameter
This commit is contained in:
parent
2093b11296
commit
2fab0b0e1c
2 changed files with 12 additions and 11 deletions
|
@ -163,11 +163,16 @@ class CakePlugin {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all loaded plugins
|
||||
* Retruns true if the plugin $plugin is already loaded
|
||||
* If plugin is null, it will return a list of all loaded plugins
|
||||
*
|
||||
* @return array list of plugins that have been loaded
|
||||
* @return mixed boolean true if $plugin is already loaded.
|
||||
* If $plugin is null, returns a list of plugins that have been loaded
|
||||
*/
|
||||
public static function loaded() {
|
||||
public static function loaded($plugin = null) {
|
||||
if ($plugin) {
|
||||
return isset(self::$_plugins[$plugin]);
|
||||
}
|
||||
return array_keys(self::$_plugins);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue