Skip to content

Commit

Permalink
ensure consistent order for loaded function
Browse files Browse the repository at this point in the history
Fixes the test case
  • Loading branch information
AD7six committed May 16, 2011
1 parent 20f5411 commit d63b4df
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/Cake/Core/CakePlugin.php
Expand Up @@ -23,19 +23,19 @@ class CakePlugin {
* parameters (plugin name, plugin configuration)
*
* It is also possible to load multiple plugins at once. Examples:
*
*
* `CakePlugin::load(array('DebugKit', 'ApiGenerator'))` will load the DebugKit and ApiGenerator plugins
* `CakePlugin::load(array('DebugKit', 'ApiGenerator'), array('bootstrap' => true))` will load bootstrap file for both plugins
*
*
* {{{
* CakePlugin::load(array(
* 'DebugKit' => array('routes' => true),
* 'ApiGenerator'
* ), array('bootstrap' => true))
* }}}
*
*
* Will only load the bootstrap for ApiGenerator and only the routes for DebugKit
*
*
* @param mixed $plugin name of the plugin to be loaded in CamelCase format or array or plugins to load
* @param array $config configuration options for the plugin
* @throws MissingPluginException if the folder for the plugin to be loaded is not found
Expand Down Expand Up @@ -94,7 +94,7 @@ public static function load($plugin, $config = array()) {
* The above example will load the bootstrap file for all plugins, but for DebugKit it will only load the routes file
* and will not look for any bootstrap script.
*
* @param array $options
* @param array $options
* @return void
*/
public function loadAll($options = array()) {
Expand Down Expand Up @@ -173,7 +173,9 @@ public static function loaded($plugin = null) {
if ($plugin) {
return isset(self::$_plugins[$plugin]);
}
return array_keys(self::$_plugins);
$return = array_keys(self::$_plugins);
sort($return);
return $return;
}

/**
Expand All @@ -189,4 +191,4 @@ public static function unload($plugin = null) {
unset(self::$_plugins[$plugin]);
}
}
}
}

0 comments on commit d63b4df

Please sign in to comment.