From f3eb2159eb5790a3de7b809865b703aac5458332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?= Date: Sat, 4 Dec 2010 13:40:24 -0430 Subject: [PATCH] Making helpers load --- lib/Cake/View/Helper/CacheHelper.php | 2 ++ lib/Cake/View/Helper/FormHelper.php | 2 ++ lib/Cake/View/Helper/HtmlHelper.php | 3 +++ lib/Cake/View/Helper/JsHelper.php | 1 + lib/Cake/View/Helper/MootoolsEngineHelper.php | 1 + lib/Cake/View/Helper/NumberHelper.php | 2 ++ lib/Cake/View/Helper/PaginatorHelper.php | 2 ++ lib/Cake/View/Helper/PrototypeEngineHelper.php | 1 + lib/Cake/View/Helper/RssHelper.php | 4 +++- lib/Cake/View/Helper/SessionHelper.php | 7 ++++--- lib/Cake/View/Helper/TextHelper.php | 3 ++- lib/Cake/View/Helper/TimeHelper.php | 2 ++ lib/Cake/View/HelperCollection.php | 17 +++++------------ lib/Cake/View/View.php | 1 - 14 files changed, 30 insertions(+), 18 deletions(-) diff --git a/lib/Cake/View/Helper/CacheHelper.php b/lib/Cake/View/Helper/CacheHelper.php index 6a1c430ea..d69c4b8f1 100644 --- a/lib/Cake/View/Helper/CacheHelper.php +++ b/lib/Cake/View/Helper/CacheHelper.php @@ -18,6 +18,8 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppHelper', 'View/Helper'); + /** * CacheHelper helps create full page view caching. * diff --git a/lib/Cake/View/Helper/FormHelper.php b/lib/Cake/View/Helper/FormHelper.php index 0fe0e0ad2..efce3d6a1 100644 --- a/lib/Cake/View/Helper/FormHelper.php +++ b/lib/Cake/View/Helper/FormHelper.php @@ -20,6 +20,8 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppHelper', 'View/Helper'); + /** * Form helper library. * diff --git a/lib/Cake/View/Helper/HtmlHelper.php b/lib/Cake/View/Helper/HtmlHelper.php index 2509e8d56..cacc7f1ee 100644 --- a/lib/Cake/View/Helper/HtmlHelper.php +++ b/lib/Cake/View/Helper/HtmlHelper.php @@ -17,6 +17,9 @@ * @since CakePHP(tm) v 0.9.1 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ + +App::uses('AppHelper', 'View/Helper'); + /** * Html Helper class for easy use of HTML widgets. * diff --git a/lib/Cake/View/Helper/JsHelper.php b/lib/Cake/View/Helper/JsHelper.php index a8a91adb8..7a605b423 100644 --- a/lib/Cake/View/Helper/JsHelper.php +++ b/lib/Cake/View/Helper/JsHelper.php @@ -18,6 +18,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppHelper', 'View/Helper'); App::uses('Multibyte', 'Core'); /** diff --git a/lib/Cake/View/Helper/MootoolsEngineHelper.php b/lib/Cake/View/Helper/MootoolsEngineHelper.php index ec226d500..d513527b1 100644 --- a/lib/Cake/View/Helper/MootoolsEngineHelper.php +++ b/lib/Cake/View/Helper/MootoolsEngineHelper.php @@ -25,6 +25,7 @@ * @since CakePHP(tm) v 1.3 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ + App::uses('JsHelper', 'Helper'); class MootoolsEngineHelper extends JsBaseEngineHelper { diff --git a/lib/Cake/View/Helper/NumberHelper.php b/lib/Cake/View/Helper/NumberHelper.php index b7d612471..dfd404ee7 100644 --- a/lib/Cake/View/Helper/NumberHelper.php +++ b/lib/Cake/View/Helper/NumberHelper.php @@ -20,6 +20,8 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppHelper', 'View/Helper'); + /** * Number helper library. * diff --git a/lib/Cake/View/Helper/PaginatorHelper.php b/lib/Cake/View/Helper/PaginatorHelper.php index 5816c6b6a..dca0562eb 100644 --- a/lib/Cake/View/Helper/PaginatorHelper.php +++ b/lib/Cake/View/Helper/PaginatorHelper.php @@ -18,6 +18,8 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppHelper', 'View/Helper'); + /** * Pagination Helper class for easy generation of pagination links. * diff --git a/lib/Cake/View/Helper/PrototypeEngineHelper.php b/lib/Cake/View/Helper/PrototypeEngineHelper.php index 779fb5c45..8781ba880 100644 --- a/lib/Cake/View/Helper/PrototypeEngineHelper.php +++ b/lib/Cake/View/Helper/PrototypeEngineHelper.php @@ -20,6 +20,7 @@ * @since CakePHP(tm) v 1.3 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ + App::uses('JsHelper', 'Helper'); class PrototypeEngineHelper extends JsBaseEngineHelper { diff --git a/lib/Cake/View/Helper/RssHelper.php b/lib/Cake/View/Helper/RssHelper.php index d85eb7a23..17ebe8628 100644 --- a/lib/Cake/View/Helper/RssHelper.php +++ b/lib/Cake/View/Helper/RssHelper.php @@ -17,7 +17,9 @@ * @since CakePHP(tm) v 1.2 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::uses('Xml', 'Core'); + +App::uses('AppHelper', 'View/Helper'); +App::uses('Xml', 'Utility'); /** * RSS Helper class for easy output RSS structures. diff --git a/lib/Cake/View/Helper/SessionHelper.php b/lib/Cake/View/Helper/SessionHelper.php index 0f6aa002d..997e2c422 100644 --- a/lib/Cake/View/Helper/SessionHelper.php +++ b/lib/Cake/View/Helper/SessionHelper.php @@ -17,9 +17,10 @@ * @since CakePHP(tm) v 1.1.7.3328 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -if (!class_exists('CakeSession')) { - require LIBS . 'cake_session.php'; -} + +App::uses('AppHelper', 'View/Helper'); +App::uses('CakeSession', 'Model'); + /** * Session Helper. * diff --git a/lib/Cake/View/Helper/TextHelper.php b/lib/Cake/View/Helper/TextHelper.php index c87455035..11b04c0a2 100644 --- a/lib/Cake/View/Helper/TextHelper.php +++ b/lib/Cake/View/Helper/TextHelper.php @@ -24,8 +24,9 @@ * Included libraries. * */ +App::uses('AppHelper', 'View/Helper'); App::uses('HtmlHelper', 'Helper'); -App::uses('Multibyte', 'Core'); +App::uses('Multibyte', 'Utility'); /** * Text helper library. diff --git a/lib/Cake/View/Helper/TimeHelper.php b/lib/Cake/View/Helper/TimeHelper.php index df1a34051..4c1d8aec3 100644 --- a/lib/Cake/View/Helper/TimeHelper.php +++ b/lib/Cake/View/Helper/TimeHelper.php @@ -18,6 +18,8 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('AppHelper', 'View/Helper'); + /** * Time Helper class for easy use of time data. * diff --git a/lib/Cake/View/HelperCollection.php b/lib/Cake/View/HelperCollection.php index 66200a44b..99e709c03 100644 --- a/lib/Cake/View/HelperCollection.php +++ b/lib/Cake/View/HelperCollection.php @@ -54,19 +54,12 @@ class HelperCollection extends ObjectCollection { return $this->_loaded[$name]; } $helperClass = $name . 'Helper'; + App::uses($helperClass, 'View/Helper'); if (!class_exists($helperClass)) { - if (!App::import('Helper', $helper)) { - throw new MissingHelperFileException(array( - 'class' => $helperClass, - 'file' => Inflector::underscore($name) . '.php' - )); - } - if (!class_exists($helperClass)) { - throw new MissingHelperClassException(array( - 'class' => $helperClass, - 'file' => Inflector::underscore($name) . '.php' - )); - } + throw new MissingHelperClassException(array( + 'class' => $helperClass, + 'file' => Inflector::underscore($name) . '.php' + )); } $this->_loaded[$name] = new $helperClass($this->_View, $settings); diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php index a9b5481e5..9ca29b464 100644 --- a/lib/Cake/View/View.php +++ b/lib/Cake/View/View.php @@ -22,7 +22,6 @@ * Included libraries. */ App::uses('HelperCollection', 'View'); -App::uses('Helper', 'View'); /** * View, the V in the MVC triad.