Permalink
Browse files

Adding better help and documentation for loading plugins. The excepti…

…on renderer will serve a helpful page if a plugin is missing
  • Loading branch information...
1 parent eaa80bb commit feb567d4eebec384e9ca2ecdb3c57f620e8ff564 @lorenzo lorenzo committed Jul 7, 2011
View
@@ -46,9 +46,20 @@
*/
/**
- * 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 @@
*/
/**
- * 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
+ *
+ */
@@ -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
@renan

renan Jul 7, 2011

Member

Should it be 2.0?

@lorenzo

lorenzo Jul 7, 2011

Owner

Not sure :P

@markstory

markstory Jul 8, 2011

Owner

I think so, this is a new file.

@lorenzo

lorenzo Jul 8, 2011

Owner

I was just kidding :)

+ * @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>
+&lt;?php
+CakePlugin::load('<?php echo $plugin?>');
+?&gt;
+</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'); ?>
@ceeram

ceeram Jul 7, 2011

Member

This should point to app/Config/bootstrap.php

@lorenzo

lorenzo Jul 7, 2011

Owner

Nice Catch!

+</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'); ?>

2 comments on commit feb567d

Owner

markstory replied Jul 7, 2011

Nice, should the error say to load the specific plugin or set all of them?

Owner

lorenzo replied Jul 8, 2011

It shows the two options, but the first one shown is a single one

Please sign in to comment.