diff --git a/lib/Cake/Core/Plugin.php b/lib/Cake/Core/Plugin.php index cdcc938d933..3b099cce1ad 100644 --- a/lib/Cake/Core/Plugin.php +++ b/lib/Cake/Core/Plugin.php @@ -62,14 +62,6 @@ class Plugin { * * Will load routes.php file but not bootstrap.php * - * `Plugin::load('DebugKit', ['bootstrap' => ['config1', 'config2']]) - * - * Will load config1.php and config2.php files - * - * `Plugin::load('DebugKit', ['bootstrap' => '\DebugKit\SomeClass::bootstrap'])` - * - * Will run the \DebugKit\SomeClass::bootstrap() function to initialize it - * * `Plugin::load('DebugKit', ['namespace' => 'Cake\DebugKit'])` * * Will load files on APP/Plugin/Cake/DebugKit/... @@ -99,8 +91,7 @@ class Plugin { * * ## Configuration options * - * - `bootstrap` - array|boolean - Whether or not you want the $plugin/Config/bootstrap.php file loaded. - * Can also be an array of files to load from $plugin/Config. + * - `bootstrap` - array - Whether or not you want the $plugin/Config/bootstrap.php file loaded. * - `routes` - boolean - Whether or not you want to load the $plugin/Config/routes.php file. * - `namespace` - string - A custom namespace for the plugin. It will default to the plugin name. * - `ignoreMissing` - boolean - Set to true to ignore missing bootstrap/routes files. @@ -215,11 +206,6 @@ public static function bootstrap($plugin) { if ($config['bootstrap'] === false) { return false; } - if (is_callable($config['bootstrap'])) { - $cb = $config['bootstrap']; - return $cb($plugin, $config); - } - $path = static::path($plugin); if ($config['bootstrap'] === true) { return static::_includeFile( @@ -227,16 +213,6 @@ public static function bootstrap($plugin) { $config['ignoreMissing'] ); } - - $bootstrap = (array)$config['bootstrap']; - foreach ($bootstrap as $file) { - static::_includeFile( - $path . 'Config' . DS . $file . '.php', - $config['ignoreMissing'] - ); - } - - return true; } /** diff --git a/lib/Cake/Test/TestCase/Core/PluginTest.php b/lib/Cake/Test/TestCase/Core/PluginTest.php index 20c88bc9321..65053d8a7af 100644 --- a/lib/Cake/Test/TestCase/Core/PluginTest.php +++ b/lib/Cake/Test/TestCase/Core/PluginTest.php @@ -161,28 +161,6 @@ public function testLoadMultipleWithDefaultsAndOverride() { $this->assertEquals(null, Configure::read('PluginTest.test_plugin_two.bootstrap')); } -/** - * Tests that it is possible to load multiple bootstrap files at once - * - * @return void - */ - public function testMultipleBootstrapFiles() { - Plugin::load('TestPlugin', array('bootstrap' => array('bootstrap', 'custom_config'))); - $this->assertTrue(Plugin::loaded('TestPlugin')); - $this->assertEquals('loaded plugin bootstrap', Configure::read('PluginTest.test_plugin.bootstrap')); - } - -/** - * Tests that it is possible to load plugin bootstrap by calling a callback function - * - * @return void - */ - public function testCallbackBootstrap() { - Plugin::load('TestPlugin', array('bootstrap' => array($this, 'pluginBootstrap'))); - $this->assertTrue(Plugin::loaded('TestPlugin')); - $this->assertEquals('called plugin bootstrap callback', Configure::read('PluginTest.test_plugin.bootstrap')); - } - /** * Tests that loading a missing routes file throws a warning * @@ -289,12 +267,4 @@ public function testLoadAllWithDefaultsAndOverride() { $this->assertEquals('loaded plugin two bootstrap', Configure::read('PluginTest.test_plugin_two.bootstrap')); } -/** - * Auxiliary function to test plugin bootstrap callbacks - * - * @return void - */ - public function pluginBootstrap() { - Configure::write('PluginTest.test_plugin.bootstrap', 'called plugin bootstrap callback'); - } }