From feb567d4eebec384e9ca2ecdb3c57f620e8ff564 Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Thu, 7 Jul 2011 02:34:22 -0430 Subject: [PATCH] Adding better help and documentation for loading plugins. The exception renderer will serve a helpful page if a plugin is missing --- app/Config/bootstrap.php | 13 +++++- .../Templates/skel/Config/bootstrap.php | 13 +++++- lib/Cake/View/Errors/missing_plugin.ctp | 45 +++++++++++++++++++ 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 lib/Cake/View/Errors/missing_plugin.ctp diff --git a/app/Config/bootstrap.php b/app/Config/bootstrap.php index dcf7f58b9..20688cf68 100644 --- a/app/Config/bootstrap.php +++ b/app/Config/bootstrap.php @@ -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 + * + */ \ No newline at end of file diff --git a/lib/Cake/Console/Templates/skel/Config/bootstrap.php b/lib/Cake/Console/Templates/skel/Config/bootstrap.php index dcf7f58b9..20688cf68 100644 --- a/lib/Cake/Console/Templates/skel/Config/bootstrap.php +++ b/lib/Cake/Console/Templates/skel/Config/bootstrap.php @@ -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 + * + */ \ No newline at end of file diff --git a/lib/Cake/View/Errors/missing_plugin.ctp b/lib/Cake/View/Errors/missing_plugin.ctp new file mode 100644 index 000000000..ef7004fb3 --- /dev/null +++ b/lib/Cake/View/Errors/missing_plugin.ctp @@ -0,0 +1,45 @@ + +

+

+ : + ' . $plugin . ''); ?> +

+

+ : + +

+
+<?php
+CakePlugin::load('');
+?>
+
+

+ : + +

+
+CakePlugin::loadAll();
+
+

+ : + +

+ +element('exception_stack_trace'); ?>