mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Adding better help and documentation for loading plugins. The exception renderer will serve a helpful page if a plugin is missing
This commit is contained in:
parent
eaa80bbced
commit
feb567d4ee
3 changed files with 69 additions and 2 deletions
|
@ -46,9 +46,20 @@ Cache::config('default', array('engine' => 'File'));
|
|||
*/
|
||||
|
||||
/**
|
||||
* As of 1.3, additional rules for the inflector are added below
|
||||
* Custom Inflector rules, can be set to correctly pluralize or singularize table, model, controller names or whatever other
|
||||
* string is passed to the inflection functions
|
||||
*
|
||||
* Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
|
||||
* Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
|
||||
* Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more
|
||||
* advanced ways of loading plugins
|
||||
*
|
||||
* CakePlugin::loadAll(); // Loads all plugins at once
|
||||
* CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit
|
||||
*
|
||||
*/
|
|
@ -46,9 +46,20 @@ Cache::config('default', array('engine' => 'File'));
|
|||
*/
|
||||
|
||||
/**
|
||||
* As of 1.3, additional rules for the inflector are added below
|
||||
* Custom Inflector rules, can be set to correctly pluralize or singularize table, model, controller names or whatever other
|
||||
* string is passed to the inflection functions
|
||||
*
|
||||
* Inflector::rules('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
|
||||
* Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
|
||||
* Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more
|
||||
* advanced ways of loading plugins
|
||||
*
|
||||
* CakePlugin::loadAll(); // Loads all plugins at once
|
||||
* CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit
|
||||
*
|
||||
*/
|
45
lib/Cake/View/Errors/missing_plugin.ctp
Normal file
45
lib/Cake/View/Errors/missing_plugin.ctp
Normal file
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
* PHP 5
|
||||
*
|
||||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
||||
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
||||
* @link http://cakephp.org CakePHP(tm) Project
|
||||
* @package cake.libs.view.templates.errors
|
||||
* @since CakePHP(tm) v 0.10.0.1076
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
?>
|
||||
<h2><?php echo __d('cake_dev', 'Missing Plugin'); ?></h2>
|
||||
<p class="error">
|
||||
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
|
||||
<?php echo __d('cake_dev', 'The application is trying to load a file from the %s plugin', '<em>' . $plugin . '</em>'); ?>
|
||||
</p>
|
||||
<p class="error">
|
||||
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
|
||||
<?php echo __d('cake_dev', 'Make sure your plugin %s is in the ' . APP_DIR . DS . 'Plugin directory and was loaded', $plugin); ?>
|
||||
</p>
|
||||
<pre>
|
||||
<?php
|
||||
CakePlugin::load('<?php echo $plugin?>');
|
||||
?>
|
||||
</pre>
|
||||
<p class="notice">
|
||||
<strong><?php echo __d('cake_dev', 'Loading all plugins'); ?>: </strong>
|
||||
<?php echo __d('cake_dev', 'If you wish to load all plugins at once, use the following line in your ' . APP_DIR . DS . 'bootstrap.php file'); ?>
|
||||
</p>
|
||||
<pre>
|
||||
CakePlugin::loadAll();
|
||||
</pre>
|
||||
<p class="notice">
|
||||
<strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>
|
||||
<?php echo __d('cake_dev', 'If you want to customize this error message, create %s', APP_DIR . DS . 'View' . DS . 'Errors' . DS . 'missing_plugin.ctp'); ?>
|
||||
</p>
|
||||
|
||||
<?php echo $this->element('exception_stack_trace'); ?>
|
Loading…
Reference in a new issue