From 56143c663e14b810965da8146a9bde50ddf8b857 Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 11 Jun 2015 22:17:18 -0400 Subject: [PATCH] Update doc blocks for CakePlugin::load(). Refs #5665 --- lib/Cake/Core/CakePlugin.php | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/lib/Cake/Core/CakePlugin.php b/lib/Cake/Core/CakePlugin.php index 5f30887f4..1c2a31a44 100644 --- a/lib/Cake/Core/CakePlugin.php +++ b/lib/Cake/Core/CakePlugin.php @@ -37,14 +37,29 @@ class CakePlugin { * * Examples: * - * `CakePlugin::load('DebugKit')` will load the DebugKit plugin and will not load any bootstrap nor route files - * `CakePlugin::load('DebugKit', array('bootstrap' => true, 'routes' => true))` will load the bootstrap.php and routes.php files - * `CakePlugin::load('DebugKit', array('bootstrap' => false, 'routes' => true))` will load routes.php file but not bootstrap.php - * `CakePlugin::load('DebugKit', array('bootstrap' => array('config1', 'config2')))` will load config1.php and config2.php files - * `CakePlugin::load('DebugKit', array('bootstrap' => 'aCallableMethod'))` will run the aCallableMethod function to initialize it + * `CakePlugin::load('DebugKit')` * - * Bootstrap initialization functions can be expressed as a PHP callback type, including closures. Callbacks will receive two - * parameters (plugin name, plugin configuration) + * Will load the DebugKit plugin and will not load any bootstrap nor route files + * + * `CakePlugin::load('DebugKit', array('bootstrap' => true, 'routes' => true))` + * + * will load the bootstrap.php and routes.php files + * + * `CakePlugin::load('DebugKit', array('bootstrap' => false, 'routes' => true))` + * + * will load routes.php file but not bootstrap.php + * + * `CakePlugin::load('DebugKit', array('bootstrap' => array('config1', 'config2')))` + * + * will load config1.php and config2.php files + * + * `CakePlugin::load('DebugKit', array('bootstrap' => 'aCallableMethod'))` + * + * will run the aCallableMethod function to initialize it + * + * Bootstrap initialization functions can be expressed as a PHP callback type, + * including closures. Callbacks will receive two parameters + * (plugin name, plugin configuration) * * It is also possible to load multiple plugins at once. Examples: * @@ -63,7 +78,9 @@ class CakePlugin { * ), array('bootstrap' => true)) * ``` * - * Will only load the bootstrap for ApiGenerator and only the routes for DebugKit + * Will only load the bootstrap for ApiGenerator and only the routes for DebugKit. + * By using the `path` option you can specify an absolute path to the plugin. Make + * sure that the path is slash terminated or your plugin will not be located properly. * * @param string|array $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