Use more readable variable names

This commit is contained in:
Marc Würth 2017-04-03 12:17:32 +02:00
parent 6cdb2d2905
commit 9be647cefd

View file

@ -124,6 +124,7 @@ class CakePlugin {
/** /**
* Will load all the plugins located in the configured plugins folders * Will load all the plugins located in the configured plugins folders
*
* If passed an options array, it will be used as a common default for all plugins to be loaded * If passed an options array, it will be used as a common default for all plugins to be loaded
* It is possible to set specific defaults for each plugins in the options array. Examples: * It is possible to set specific defaults for each plugins in the options array. Examples:
* *
@ -155,12 +156,12 @@ class CakePlugin {
*/ */
public static function loadAll($options = array()) { public static function loadAll($options = array()) {
$plugins = App::objects('plugins'); $plugins = App::objects('plugins');
foreach ($plugins as $p) { foreach ($plugins as $plugin) {
$opts = isset($options[$p]) ? (array)$options[$p] : array(); $pluginOptions = isset($options[$plugin]) ? (array)$options[$plugin] : array();
if (isset($options[0])) { if (isset($options[0])) {
$opts += $options[0]; $pluginOptions += $options[0];
} }
static::load($p, $opts); static::load($plugin, $pluginOptions);
} }
} }