Skip to content

Commit d63b4df

Browse files
committed
ensure consistent order for loaded function
Fixes the test case
1 parent 20f5411 commit d63b4df

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lib/Cake/Core/CakePlugin.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ class CakePlugin {
2323
* parameters (plugin name, plugin configuration)
2424
*
2525
* It is also possible to load multiple plugins at once. Examples:
26-
*
26+
*
2727
* `CakePlugin::load(array('DebugKit', 'ApiGenerator'))` will load the DebugKit and ApiGenerator plugins
2828
* `CakePlugin::load(array('DebugKit', 'ApiGenerator'), array('bootstrap' => true))` will load bootstrap file for both plugins
29-
*
29+
*
3030
* {{{
3131
* CakePlugin::load(array(
3232
* 'DebugKit' => array('routes' => true),
3333
* 'ApiGenerator'
3434
* ), array('bootstrap' => true))
3535
* }}}
36-
*
36+
*
3737
* Will only load the bootstrap for ApiGenerator and only the routes for DebugKit
38-
*
38+
*
3939
* @param mixed $plugin name of the plugin to be loaded in CamelCase format or array or plugins to load
4040
* @param array $config configuration options for the plugin
4141
* @throws MissingPluginException if the folder for the plugin to be loaded is not found
@@ -94,7 +94,7 @@ public static function load($plugin, $config = array()) {
9494
* The above example will load the bootstrap file for all plugins, but for DebugKit it will only load the routes file
9595
* and will not look for any bootstrap script.
9696
*
97-
* @param array $options
97+
* @param array $options
9898
* @return void
9999
*/
100100
public function loadAll($options = array()) {
@@ -173,7 +173,9 @@ public static function loaded($plugin = null) {
173173
if ($plugin) {
174174
return isset(self::$_plugins[$plugin]);
175175
}
176-
return array_keys(self::$_plugins);
176+
$return = array_keys(self::$_plugins);
177+
sort($return);
178+
return $return;
177179
}
178180

179181
/**
@@ -189,4 +191,4 @@ public static function unload($plugin = null) {
189191
unset(self::$_plugins[$plugin]);
190192
}
191193
}
192-
}
194+
}

0 commit comments

Comments
 (0)