Merge pull request #10469 from ravage84/2.x-cakeplugin-docblocks

Improve punctuation & code examples in doc blocks
This commit is contained in:
Mark Story 2017-04-03 09:18:40 -04:00 committed by GitHub
commit 01abf29bed

View file

@ -17,8 +17,9 @@
*/
/**
* CakePlugin is responsible for loading and unloading plugins. It also can
* retrieve plugin paths and load their bootstrap and routes files.
* CakePlugin is responsible for loading and unloading plugins.
*
* It also can retrieve plugin paths and load their bootstrap and routes files.
*
* @package Cake.Core
* @link http://book.cakephp.org/2.0/en/plugins.html
@ -37,45 +38,47 @@ class CakePlugin {
*
* Examples:
*
* `CakePlugin::load('DebugKit')`
* `CakePlugin::load('DebugKit');`
*
* Will load the DebugKit plugin and will not load any bootstrap nor route files
* Will load the DebugKit plugin and will not load any bootstrap nor route files.
*
* `CakePlugin::load('DebugKit', array('bootstrap' => true, 'routes' => true))`
* `CakePlugin::load('DebugKit', array('bootstrap' => true, 'routes' => true));`
*
* will load the bootstrap.php and routes.php files
* Will load the bootstrap.php and routes.php files.
*
* `CakePlugin::load('DebugKit', array('bootstrap' => false, 'routes' => true))`
* `CakePlugin::load('DebugKit', array('bootstrap' => false, 'routes' => true));`
*
* will load routes.php file but not bootstrap.php
* Will load routes.php file but not bootstrap.php.
*
* `CakePlugin::load('DebugKit', array('bootstrap' => array('config1', 'config2')))`
* `CakePlugin::load('DebugKit', array('bootstrap' => array('config1', 'config2')));`
*
* will load config1.php and config2.php files
* Will load config1.php and config2.php files.
*
* `CakePlugin::load('DebugKit', array('bootstrap' => 'aCallableMethod'))`
* `CakePlugin::load('DebugKit', array('bootstrap' => 'aCallableMethod'));`
*
* will run the aCallableMethod function to initialize it
* 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)
* (plugin name, plugin configuration).
*
* It is also possible to load multiple plugins at once. Examples:
*
* `CakePlugin::load(array('DebugKit', 'ApiGenerator'))`
* `CakePlugin::load(array('DebugKit', 'ApiGenerator'));`
*
* will load the DebugKit and ApiGenerator plugins
* Will load the DebugKit and ApiGenerator plugins.
*
* `CakePlugin::load(array('DebugKit', 'ApiGenerator'), array('bootstrap' => true))`
* `CakePlugin::load(array('DebugKit', 'ApiGenerator'), array('bootstrap' => true));`
*
* will load bootstrap file for both plugins
* Will load bootstrap file for both plugins.
*
* ```
* CakePlugin::load(array(
* 'DebugKit' => array('routes' => true),
* 'ApiGenerator'
* ), array('bootstrap' => true))
* ),
* array('bootstrap' => true)
* );
* ```
*
* Will only load the bootstrap for ApiGenerator and only the routes for DebugKit.
@ -132,7 +135,7 @@ class CakePlugin {
* CakePlugin::loadAll(array(
* array('bootstrap' => true),
* 'DebugKit' => array('routes' => true, 'bootstrap' => false),
* ))
* ));
* ```
*
* The above example will load the bootstrap file for all plugins, but for DebugKit it will only load