mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #10469 from ravage84/2.x-cakeplugin-docblocks
Improve punctuation & code examples in doc blocks
This commit is contained in:
commit
01abf29bed
1 changed files with 29 additions and 26 deletions
|
@ -17,8 +17,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CakePlugin is responsible for loading and unloading plugins. It also can
|
* CakePlugin is responsible for loading and unloading plugins.
|
||||||
* retrieve plugin paths and load their bootstrap and routes files.
|
*
|
||||||
|
* It also can retrieve plugin paths and load their bootstrap and routes files.
|
||||||
*
|
*
|
||||||
* @package Cake.Core
|
* @package Cake.Core
|
||||||
* @link http://book.cakephp.org/2.0/en/plugins.html
|
* @link http://book.cakephp.org/2.0/en/plugins.html
|
||||||
|
@ -37,45 +38,47 @@ class CakePlugin {
|
||||||
*
|
*
|
||||||
* Examples:
|
* 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,
|
* Bootstrap initialization functions can be expressed as a PHP callback type,
|
||||||
* including closures. Callbacks will receive two parameters
|
* 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:
|
* 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(
|
* CakePlugin::load(array(
|
||||||
* 'DebugKit' => array('routes' => true),
|
* 'DebugKit' => array('routes' => true),
|
||||||
* 'ApiGenerator'
|
* 'ApiGenerator'
|
||||||
* ), array('bootstrap' => true))
|
* ),
|
||||||
|
* 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.
|
||||||
|
@ -132,7 +135,7 @@ class CakePlugin {
|
||||||
* CakePlugin::loadAll(array(
|
* CakePlugin::loadAll(array(
|
||||||
* array('bootstrap' => true),
|
* array('bootstrap' => true),
|
||||||
* 'DebugKit' => array('routes' => true, 'bootstrap' => false),
|
* 'DebugKit' => array('routes' => true, 'bootstrap' => false),
|
||||||
* ))
|
* ));
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* The above example will load the bootstrap file for all plugins, but for DebugKit it will only load
|
* The above example will load the bootstrap file for all plugins, but for DebugKit it will only load
|
||||||
|
@ -141,11 +144,11 @@ class CakePlugin {
|
||||||
* each plugin you can use the `ignoreMissing` option:
|
* each plugin you can use the `ignoreMissing` option:
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* CakePlugin::loadAll(array(
|
* CakePlugin::loadAll(array(
|
||||||
* 'ignoreMissing' => true,
|
* 'ignoreMissing' => true,
|
||||||
* 'bootstrap' => true,
|
* 'bootstrap' => true,
|
||||||
* 'routes' => true,
|
* 'routes' => true,
|
||||||
* ));
|
* ));
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* The ignoreMissing option will do additional file_exists() calls but is simpler
|
* The ignoreMissing option will do additional file_exists() calls but is simpler
|
||||||
|
|
Loading…
Reference in a new issue