From 1cf67b1e5511a85b4f15ada6b359ec8f4316be3f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Renan=20Gonc=CC=A7alves?=
Date: Sat, 15 Oct 2011 20:06:31 +0200
Subject: [PATCH 1/9] Little cleanup in exceptions.
- Removed duplicated or non-used exceptions.
- Making the error messages more descriptive and stardard.
---
lib/Cake/Console/ShellDispatcher.php | 7 +-
lib/Cake/Console/TaskCollection.php | 6 +-
lib/Cake/Controller/ComponentCollection.php | 5 +-
lib/Cake/Error/exceptions.php | 78 +++++--------------
lib/Cake/Model/BehaviorCollection.php | 5 +-
lib/Cake/Model/ConnectionManager.php | 9 ++-
.../Test/Case/Console/TaskCollectionTest.php | 6 +-
.../Controller/ComponentCollectionTest.php | 4 +-
.../Test/Case/Error/ExceptionRendererTest.php | 54 ++++---------
.../Case/Model/BehaviorCollectionTest.php | 2 +-
.../Test/Case/Model/ConnectionManagerTest.php | 2 +-
.../Test/Case/View/HelperCollectionTest.php | 4 +-
lib/Cake/TestSuite/ControllerTestCase.php | 12 +--
...ehavior_class.ctp => missing_behavior.ctp} | 12 +--
.../View/Errors/missing_behavior_file.ctp | 39 ----------
...mponent_file.ctp => missing_component.ctp} | 10 +--
.../View/Errors/missing_component_class.ctp | 39 ----------
lib/Cake/View/Errors/missing_controller.ctp | 2 +-
...source_file.ctp => missing_datasource.ctp} | 6 +-
...ng_helper_class.ctp => missing_helper.ctp} | 12 +--
lib/Cake/View/Errors/missing_helper_file.ctp | 39 ----------
lib/Cake/View/HelperCollection.php | 7 +-
22 files changed, 89 insertions(+), 271 deletions(-)
rename lib/Cake/View/Errors/{missing_behavior_class.ctp => missing_behavior.ctp} (71%)
delete mode 100644 lib/Cake/View/Errors/missing_behavior_file.ctp
rename lib/Cake/View/Errors/{missing_component_file.ctp => missing_component.ctp} (72%)
delete mode 100644 lib/Cake/View/Errors/missing_component_class.ctp
rename lib/Cake/View/Errors/{missing_datasource_file.ctp => missing_datasource.ctp} (82%)
rename lib/Cake/View/Errors/{missing_helper_class.ctp => missing_helper.ctp} (71%)
delete mode 100644 lib/Cake/View/Errors/missing_helper_file.ctp
diff --git a/lib/Cake/Console/ShellDispatcher.php b/lib/Cake/Console/ShellDispatcher.php
index dfc92bd07..9b32568a3 100644
--- a/lib/Cake/Console/ShellDispatcher.php
+++ b/lib/Cake/Console/ShellDispatcher.php
@@ -201,12 +201,11 @@ class ShellDispatcher {
*
* @param string $shell Optionally the name of a plugin
* @return mixed An object
- * @throws MissingShellFileException when errors are encountered.
+ * @throws MissingShellException when errors are encountered.
*/
protected function _getShell($shell) {
list($plugin, $shell) = pluginSplit($shell, true);
-
$class = Inflector::camelize($shell) . 'Shell';
App::uses('Shell', 'Console');
@@ -214,7 +213,9 @@ class ShellDispatcher {
App::uses($class, $plugin . 'Console/Command');
if (!class_exists($class)) {
- throw new MissingShellFileException(array('shell' => $shell));
+ throw new MissingShellException(array(
+ 'class' => $class
+ ));
}
$Shell = new $class();
return $Shell;
diff --git a/lib/Cake/Console/TaskCollection.php b/lib/Cake/Console/TaskCollection.php
index 55e77327d..c82ddb560 100644
--- a/lib/Cake/Console/TaskCollection.php
+++ b/lib/Cake/Console/TaskCollection.php
@@ -54,7 +54,7 @@ class TaskCollection extends ObjectCollection {
* @param string $task Task name to load
* @param array $settings Settings for the task.
* @return Task A task object, Either the existing loaded task or a new one.
- * @throws MissingTaskFileException, MissingTaskClassException when the task could not be found
+ * @throws MissingTaskException when the task could not be found
*/
public function load($task, $settings = array()) {
list($plugin, $name) = pluginSplit($task, true);
@@ -66,7 +66,9 @@ class TaskCollection extends ObjectCollection {
App::uses($taskClass, $plugin . 'Console/Command/Task');
if (!class_exists($taskClass)) {
if (!class_exists($taskClass)) {
- throw new MissingTaskClassException($taskClass);
+ throw new MissingTaskException(array(
+ 'class' => $taskClass
+ ));
}
}
diff --git a/lib/Cake/Controller/ComponentCollection.php b/lib/Cake/Controller/ComponentCollection.php
index 68cc443b3..59b218450 100644
--- a/lib/Cake/Controller/ComponentCollection.php
+++ b/lib/Cake/Controller/ComponentCollection.php
@@ -73,7 +73,7 @@ class ComponentCollection extends ObjectCollection {
* @param string $component Component name to load
* @param array $settings Settings for the component.
* @return Component A component object, Either the existing loaded component or a new one.
- * @throws MissingComponentFileException, MissingComponentClassException when the component could not be found
+ * @throws MissingComponentException when the component could not be found
*/
public function load($component, $settings = array()) {
if (is_array($settings) && isset($settings['className'])) {
@@ -90,8 +90,7 @@ class ComponentCollection extends ObjectCollection {
$componentClass = $name . 'Component';
App::uses($componentClass, $plugin . 'Controller/Component');
if (!class_exists($componentClass)) {
- throw new MissingComponentClassException(array(
- 'file' => Inflector::underscore($componentClass) . '.php',
+ throw new MissingComponentException(array(
'class' => $componentClass
));
}
diff --git a/lib/Cake/Error/exceptions.php b/lib/Cake/Error/exceptions.php
index 65b4fb5ab..12863463b 100644
--- a/lib/Cake/Error/exceptions.php
+++ b/lib/Cake/Error/exceptions.php
@@ -241,37 +241,23 @@ class PrivateActionException extends CakeException {
}
/**
- * Used when a Component file cannot be found.
+ * Used when a component cannot be found.
*
* @package Cake.Error
*/
-class MissingComponentFileException extends CakeException {
- protected $_messageTemplate = 'Component file "%s" is missing.';
+class MissingComponentException extends CakeException {
+ protected $_messageTemplate = 'Component class %s could not be found.';
}
/**
- * Used when a Component class cannot be found.
+ * Used when a behavior cannot be found.
*
* @package Cake.Error
*/
-class MissingComponentClassException extends CakeException {
- protected $_messageTemplate = 'Component class "%s" is missing.';
+class MissingBehaviorException extends CakeException {
+ protected $_messageTemplate = 'Behavior class %s could not be found.';
}
-/**
- * Used when a Behavior file cannot be found.
- *
- * @package Cake.Error
- */
-class MissingBehaviorFileException extends CakeException { }
-
-/**
- * Used when a Behavior class cannot be found.
- *
- * @package Cake.Error
- */
-class MissingBehaviorClassException extends CakeException { }
-
/**
* Used when a view file cannot be found.
*
@@ -291,24 +277,14 @@ class MissingLayoutException extends CakeException {
}
/**
- * Used when a helper file cannot be found.
+ * Used when a helper cannot be found.
*
* @package Cake.Error
*/
-class MissingHelperFileException extends CakeException {
- protected $_messageTemplate = 'Helper file "%s" is missing.';
+class MissingHelperException extends CakeException {
+ protected $_messageTemplate = 'Helper class %s could not be found.';
}
-/**
- * Used when a helper class cannot be found.
- *
- * @package Cake.Error
- */
-class MissingHelperClassException extends CakeException {
- protected $_messageTemplate = 'Helper class "%s" is missing.';
-}
-
-
/**
* Runtime Exceptions for ConnectionManager
*
@@ -328,21 +304,12 @@ class MissingConnectionException extends CakeException {
}
/**
- * Used when a Task file cannot be found.
+ * Used when a Task cannot be found.
*
* @package Cake.Error
*/
-class MissingTaskFileException extends CakeException {
- protected $_messageTemplate = 'Task file "%s" is missing.';
-}
-
-/**
- * Used when a Task class cannot be found.
- *
- * @package Cake.Error
- */
-class MissingTaskClassException extends CakeException {
- protected $_messageTemplate = 'Task class "%s" is missing.';
+class MissingTaskException extends CakeException {
+ protected $_messageTemplate = 'Task class %s could not be found.';
}
/**
@@ -355,21 +322,12 @@ class MissingShellMethodException extends CakeException {
}
/**
- * Used when a shell class cannot be found.
+ * Used when a shell cannot be found.
*
* @package Cake.Error
*/
-class MissingShellClassException extends CakeException {
- protected $_messageTemplate = "Shell class %s could not be loaded.";
-}
-
-/**
- * Used when a shell file cannot be found.
- *
- * @package Cake.Error
- */
-class MissingShellFileException extends CakeException {
- protected $_messageTemplate = "Shell file %s could not be loaded.";
+class MissingShellException extends CakeException {
+ protected $_messageTemplate = 'Shell class %s could not be found.';
}
/**
@@ -382,12 +340,12 @@ class MissingDatasourceConfigException extends CakeException {
}
/**
- * Exception class to be thrown when a datasource is not found
+ * Used when a datasource cannot be found.
*
* @package Cake.Error
*/
-class MissingDatasourceFileException extends CakeException {
- protected $_messageTemplate = 'Datasource "%s" was not found.';
+class MissingDatasourceException extends CakeException {
+ protected $_messageTemplate = 'Datasource class %s could not be found.';
}
/**
diff --git a/lib/Cake/Model/BehaviorCollection.php b/lib/Cake/Model/BehaviorCollection.php
index 086fba3d7..1c3bfbfed 100644
--- a/lib/Cake/Model/BehaviorCollection.php
+++ b/lib/Cake/Model/BehaviorCollection.php
@@ -99,7 +99,7 @@ class BehaviorCollection extends ObjectCollection {
* @param string $behavior CamelCased name of the behavior to load
* @param array $config Behavior configuration parameters
* @return boolean True on success, false on failure
- * @throws MissingBehaviorClassException when a behavior could not be found.
+ * @throws MissingBehaviorException when a behavior could not be found.
*/
public function load($behavior, $config = array()) {
if (is_array($config) && isset($config['className'])) {
@@ -115,8 +115,7 @@ class BehaviorCollection extends ObjectCollection {
App::uses($class, $plugin . 'Model/Behavior');
if (!class_exists($class)) {
- throw new MissingBehaviorClassException(array(
- 'file' => Inflector::underscore($behavior) . '.php',
+ throw new MissingBehaviorException(array(
'class' => $class
));
}
diff --git a/lib/Cake/Model/ConnectionManager.php b/lib/Cake/Model/ConnectionManager.php
index 2e74b5c13..30e8efb9f 100644
--- a/lib/Cake/Model/ConnectionManager.php
+++ b/lib/Cake/Model/ConnectionManager.php
@@ -75,7 +75,7 @@ class ConnectionManager {
* @param string $name The name of the DataSource, as defined in app/Config/database.php
* @return DataSource Instance
* @throws MissingDatasourceConfigException
- * @throws MissingDatasourceFileException
+ * @throws MissingDatasourceException
*/
public static function getDataSource($name) {
if (empty(self::$_init)) {
@@ -141,7 +141,7 @@ class ConnectionManager {
* or an array containing the filename (without extension) and class name of the object,
* to be found in app/Model/Datasource/ or lib/Cake/Model/Datasource/.
* @return boolean True on success, null on failure or false if the class is already loaded
- * @throws MissingDatasourceFileException
+ * @throws MissingDatasourceException
*/
public static function loadDataSource($connName) {
if (empty(self::$_init)) {
@@ -168,7 +168,10 @@ class ConnectionManager {
App::uses($conn['classname'], $plugin . 'Model/Datasource' . $package);
if (!class_exists($conn['classname'])) {
- throw new MissingDatasourceFileException(array('class' => $conn['classname'], 'plugin' => $plugin));
+ throw new MissingDatasourceException(array(
+ 'class' => $conn['classname'],
+ 'plugin' => $plugin
+ ));
}
return true;
}
diff --git a/lib/Cake/Test/Case/Console/TaskCollectionTest.php b/lib/Cake/Test/Case/Console/TaskCollectionTest.php
index 89edbe914..75b7908ee 100644
--- a/lib/Cake/Test/Case/Console/TaskCollectionTest.php
+++ b/lib/Cake/Test/Case/Console/TaskCollectionTest.php
@@ -70,12 +70,12 @@ class TaskCollectionTest extends CakeTestCase {
$this->assertFalse($this->Tasks->enabled('DbConfig'), 'DbConfigTask should be disabled');
}
/**
- * test missinghelper exception
+ * test missingtask exception
*
- * @expectedException MissingTaskClassException
+ * @expectedException MissingTaskException
* @return void
*/
- public function testLoadMissingTaskFile() {
+ public function testLoadMissingTask() {
$result = $this->Tasks->load('ThisTaskShouldAlwaysBeMissing');
}
diff --git a/lib/Cake/Test/Case/Controller/ComponentCollectionTest.php b/lib/Cake/Test/Case/Controller/ComponentCollectionTest.php
index ba850d39f..960532ee3 100644
--- a/lib/Cake/Test/Case/Controller/ComponentCollectionTest.php
+++ b/lib/Cake/Test/Case/Controller/ComponentCollectionTest.php
@@ -111,10 +111,10 @@ class ComponentCollectionTest extends CakeTestCase {
/**
* test missingcomponent exception
*
- * @expectedException MissingComponentClassException
+ * @expectedException MissingComponentException
* @return void
*/
- public function testLoadMissingComponentFile() {
+ public function testLoadMissingComponent() {
$this->Components->load('ThisComponentShouldAlwaysBeMissing');
}
diff --git a/lib/Cake/Test/Case/Error/ExceptionRendererTest.php b/lib/Cake/Test/Case/Error/ExceptionRendererTest.php
index bbdab7675..11145c8b7 100644
--- a/lib/Cake/Test/Case/Error/ExceptionRendererTest.php
+++ b/lib/Cake/Test/Case/Error/ExceptionRendererTest.php
@@ -505,62 +505,36 @@ class ExceptionRendererTest extends CakeTestCase {
500
),
array(
- new MissingDatasourceFileException(array('class' => 'MyDatasource', 'plugin' => 'MyPlugin')),
+ new MissingDatasourceException(array('class' => 'MyDatasource', 'plugin' => 'MyPlugin')),
array(
- '/Missing Datasource Class<\/h2>/',
- '/Datasource class MyDatasource<\/em> was not found/'
+ '/Missing Datasource<\/h2>/',
+ '/Datasource class MyDatasource<\/em> could not be found/'
),
500
),
array(
- new MissingHelperFileException(array('file' => 'MyCustomHelper.php', 'class' => 'MyCustomHelper')),
+ new MissingHelperException(array('class' => 'MyCustomHelper')),
array(
- '/Missing Helper File<\/h2>/',
- '/Create the class below in file:/',
+ '/Missing Helper<\/h2>/',
+ '/Create the class MyCustomHelper<\/em> below in file:/',
'/(\/|\\\)MyCustomHelper.php/'
),
500
),
array(
- new MissingHelperClassException(array('file' => 'MyCustomHelper.php', 'class' => 'MyCustomHelper')),
+ new MissingBehaviorException(array('class' => 'MyCustomBehavior')),
array(
- '/Missing Helper Class<\/h2>/',
- '/The helper class MyCustomHelper<\/em> can not be found or does not exist./',
- '/(\/|\\\)MyCustomHelper.php/',
- ),
- 500
- ),
- array(
- new MissingBehaviorFileException(array('file' => 'MyCustomBehavior.php', 'class' => 'MyCustomBehavior')),
- array(
- '/Missing Behavior File<\/h2>/',
- '/Create the class below in file:/',
- '/(\/|\\\)MyCustomBehavior.php/',
- ),
- 500
- ),
- array(
- new MissingBehaviorClassException(array('file' => 'MyCustomBehavior.php', 'class' => 'MyCustomBehavior')),
- array(
- '/The behavior class MyCustomBehavior<\/em> can not be found or does not exist./',
+ '/Missing Behavior<\/h2>/',
+ '/Create the class MyCustomBehavior<\/em> below in file:/',
'/(\/|\\\)MyCustomBehavior.php/'
),
500
),
array(
- new MissingComponentFileException(array('file' => 'SideboxComponent.php', 'class' => 'SideboxComponent')),
+ new MissingComponentException(array('class' => 'SideboxComponent')),
array(
- '/Missing Component File<\/h2>/',
- '/Create the class SideboxComponent<\/em> in file:/',
- '/(\/|\\\)SideboxComponent.php/'
- ),
- 500
- ),
- array(
- new MissingComponentClassException(array('file' => 'SideboxComponent.php', 'class' => 'SideboxComponent')),
- array(
- '/Missing Component Class<\/h2>/',
- '/Create the class SideboxComponent<\/em> in file:/',
+ '/Missing Component<\/h2>/',
+ '/Create the class SideboxComponent<\/em> below in file:/',
'/(\/|\\\)SideboxComponent.php/'
),
500
@@ -620,7 +594,7 @@ class ExceptionRendererTest extends CakeTestCase {
* @return void
*/
public function testMissingRenderSafe() {
- $exception = new MissingHelperFileException(array('class' => 'Fail'));
+ $exception = new MissingHelperException(array('class' => 'Fail'));
$ExceptionRenderer = new ExceptionRenderer($exception);
$ExceptionRenderer->controller = $this->getMock('Controller');
@@ -628,7 +602,7 @@ class ExceptionRendererTest extends CakeTestCase {
$ExceptionRenderer->controller->request = $this->getMock('CakeRequest');
$ExceptionRenderer->controller->expects($this->at(2))
->method('render')
- ->with('missingHelperFile')
+ ->with('missingHelper')
->will($this->throwException($exception));
$ExceptionRenderer->controller->expects($this->at(3))
diff --git a/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php b/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php
index 757216c4e..46246354a 100644
--- a/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php
+++ b/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php
@@ -538,7 +538,7 @@ class BehaviorCollectionTest extends CakeTestCase {
/**
* test that attaching a non existant Behavior triggers a cake error.
*
- * @expectedException MissingBehaviorClassException
+ * @expectedException MissingBehaviorException
* @return void
*/
public function testInvalidBehaviorCausingCakeError() {
diff --git a/lib/Cake/Test/Case/Model/ConnectionManagerTest.php b/lib/Cake/Test/Case/Model/ConnectionManagerTest.php
index c2c34894e..38679ed48 100644
--- a/lib/Cake/Test/Case/Model/ConnectionManagerTest.php
+++ b/lib/Cake/Test/Case/Model/ConnectionManagerTest.php
@@ -224,7 +224,7 @@ class ConnectionManagerTest extends CakeTestCase {
* testLoadDataSourceException() method
*
* @return void
- * @expectedException MissingDatasourceFileException
+ * @expectedException MissingDatasourceException
*/
public function testLoadDataSourceException() {
$connection = array('classname' => 'NonExistentDataSource', 'filename' => 'non_existent');
diff --git a/lib/Cake/Test/Case/View/HelperCollectionTest.php b/lib/Cake/Test/Case/View/HelperCollectionTest.php
index 00a859ea9..e38dcdf2a 100644
--- a/lib/Cake/Test/Case/View/HelperCollectionTest.php
+++ b/lib/Cake/Test/Case/View/HelperCollectionTest.php
@@ -109,10 +109,10 @@ class HelperCollectionTest extends CakeTestCase {
/**
* test missinghelper exception
*
- * @expectedException MissingHelperClassException
+ * @expectedException MissingHelperException
* @return void
*/
- public function testLoadMissingHelperFile() {
+ public function testLoadMissingHelper() {
$result = $this->Helpers->load('ThisHelperShouldAlwaysBeMissing');
}
diff --git a/lib/Cake/TestSuite/ControllerTestCase.php b/lib/Cake/TestSuite/ControllerTestCase.php
index 56e15f2b9..f2539b439 100644
--- a/lib/Cake/TestSuite/ControllerTestCase.php
+++ b/lib/Cake/TestSuite/ControllerTestCase.php
@@ -315,14 +315,14 @@ abstract class ControllerTestCase extends CakeTestCase {
$methods = array();
}
list($plugin, $name) = pluginSplit($component, true);
- App::uses($name . 'Component', $plugin . 'Controller/Component');
- if (!class_exists($name . 'Component')) {
- throw new MissingComponentFileException(array(
- 'file' => $name . 'Component.php',
- 'class' => $name.'Component'
+ $componentClass = $name . 'Component';
+ App::uses($componentClass, $plugin . 'Controller/Component');
+ if (!class_exists($componentClass)) {
+ throw new MissingComponentException(array(
+ 'class' => $componentClass
));
}
- $_component = $this->getMock($name.'Component', $methods, array(), '', false);
+ $_component = $this->getMock($componentClass, $methods, array(), '', false);
$_controller->Components->set($name, $_component);
}
diff --git a/lib/Cake/View/Errors/missing_behavior_class.ctp b/lib/Cake/View/Errors/missing_behavior.ctp
similarity index 71%
rename from lib/Cake/View/Errors/missing_behavior_class.ctp
rename to lib/Cake/View/Errors/missing_behavior.ctp
index 10e9f92f3..70869980c 100644
--- a/lib/Cake/View/Errors/missing_behavior_class.ctp
+++ b/lib/Cake/View/Errors/missing_behavior.ctp
@@ -16,24 +16,24 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
-
+
:
- %s
can not be found or does not exist.', $class); ?>
+ ' . $class . '
'); ?>
-
+
:
-
+ ' . $class . '', APP_DIR . DS . 'Model' . DS . 'Behavior' . DS . $class . '.php'); ?>
<?php
-class extends ModelBehavior {
+class extends ModelBehavior {
}
:
-
+
element('exception_stack_trace'); ?>
diff --git a/lib/Cake/View/Errors/missing_behavior_file.ctp b/lib/Cake/View/Errors/missing_behavior_file.ctp
deleted file mode 100644
index 8a02602c7..000000000
--- a/lib/Cake/View/Errors/missing_behavior_file.ctp
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
- :
-
-
-
- :
-
-
-
-<?php
-class extends ModelBehavior {
-
-}
-
-
- :
-
-
-
-element('exception_stack_trace'); ?>
diff --git a/lib/Cake/View/Errors/missing_component_file.ctp b/lib/Cake/View/Errors/missing_component.ctp
similarity index 72%
rename from lib/Cake/View/Errors/missing_component_file.ctp
rename to lib/Cake/View/Errors/missing_component.ctp
index b67254a6d..8625c9a5a 100644
--- a/lib/Cake/View/Errors/missing_component_file.ctp
+++ b/lib/Cake/View/Errors/missing_component.ctp
@@ -16,24 +16,24 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
-
+
:
-
+ ' . $class . ''); ?>
:
- ' . $class . '', APP_DIR . DS . 'Controller' . DS . 'Component' . DS . Inflector::camelize($file)); ?>
+ ' . $class . '', APP_DIR . DS . 'Controller' . DS . 'Component' . DS . $class . '.php'); ?>
<?php
-class extends Component {
+class extends Component {
}
:
-
+
element('exception_stack_trace'); ?>
diff --git a/lib/Cake/View/Errors/missing_component_class.ctp b/lib/Cake/View/Errors/missing_component_class.ctp
deleted file mode 100644
index 42d810b7b..000000000
--- a/lib/Cake/View/Errors/missing_component_class.ctp
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
- :
- ' . $class . ''); ?>
-
-
- :
- ' . $class . '', APP_DIR . DS . 'Controller' . DS . 'Component' . DS . Inflector::camelize($file)); ?>
-
-
-<?php
-class extends Component {
-
-}
-
-
- :
-
-
-
-element('exception_stack_trace'); ?>
diff --git a/lib/Cake/View/Errors/missing_controller.ctp b/lib/Cake/View/Errors/missing_controller.ctp
index e695d5fd8..aabcb0ba4 100644
--- a/lib/Cake/View/Errors/missing_controller.ctp
+++ b/lib/Cake/View/Errors/missing_controller.ctp
@@ -27,7 +27,7 @@
<?php
-class extends AppController {
+class extends AppController {
}
diff --git a/lib/Cake/View/Errors/missing_datasource_file.ctp b/lib/Cake/View/Errors/missing_datasource.ctp
similarity index 82%
rename from lib/Cake/View/Errors/missing_datasource_file.ctp
rename to lib/Cake/View/Errors/missing_datasource.ctp
index b358c0e7d..712e6dab1 100644
--- a/lib/Cake/View/Errors/missing_datasource_file.ctp
+++ b/lib/Cake/View/Errors/missing_datasource.ctp
@@ -16,14 +16,14 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
-
+
:
- ' . $class . ''); ?>
+ ' . $class . ''); ?>
:
-
+
element('exception_stack_trace'); ?>
diff --git a/lib/Cake/View/Errors/missing_helper_class.ctp b/lib/Cake/View/Errors/missing_helper.ctp
similarity index 71%
rename from lib/Cake/View/Errors/missing_helper_class.ctp
rename to lib/Cake/View/Errors/missing_helper.ctp
index 91ec2c66a..c17305157 100644
--- a/lib/Cake/View/Errors/missing_helper_class.ctp
+++ b/lib/Cake/View/Errors/missing_helper.ctp
@@ -16,24 +16,24 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
-
+
:
- %s can not be found or does not exist.', $class); ?>
+ ' . $class . ''); ?>
-
+
:
-
+ ' . $class . '', APP_DIR . DS . 'View' . DS . 'Helper' . DS . $class . '.php'); ?>
<?php
-class extends AppHelper {
+class extends AppHelper {
}
:
-
+
element('exception_stack_trace'); ?>
diff --git a/lib/Cake/View/Errors/missing_helper_file.ctp b/lib/Cake/View/Errors/missing_helper_file.ctp
deleted file mode 100644
index 9b3909a90..000000000
--- a/lib/Cake/View/Errors/missing_helper_file.ctp
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
- :
-
-
-
- :
-
-
-
-<?php
-class extends AppHelper {
-
-}
-
-
- :
-
-
-
-element('exception_stack_trace'); ?>
diff --git a/lib/Cake/View/HelperCollection.php b/lib/Cake/View/HelperCollection.php
index 9aceb9f35..98ddce7b4 100644
--- a/lib/Cake/View/HelperCollection.php
+++ b/lib/Cake/View/HelperCollection.php
@@ -55,7 +55,7 @@ class HelperCollection extends ObjectCollection {
* @param string $helper Helper name to load
* @param array $settings Settings for the helper.
* @return Helper A helper object, Either the existing loaded helper or a new one.
- * @throws MissingHelperFileException, MissingHelperClassException when the helper could not be found
+ * @throws MissingHelperException when the helper could not be found
*/
public function load($helper, $settings = array()) {
if (is_array($settings) && isset($settings['className'])) {
@@ -73,9 +73,8 @@ class HelperCollection extends ObjectCollection {
$helperClass = $name . 'Helper';
App::uses($helperClass, $plugin . 'View/Helper');
if (!class_exists($helperClass)) {
- throw new MissingHelperClassException(array(
- 'class' => $helperClass,
- 'file' => $helperClass . '.php'
+ throw new MissingHelperException(array(
+ 'class' => $helperClass
));
}
$this->_loaded[$alias] = new $helperClass($this->_View, $settings);
From 282d322523500cf38a6a42642d522ac456ca75d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Renan=20Gonc=CC=A7alves?=
Date: Sat, 15 Oct 2011 20:17:44 +0200
Subject: [PATCH 2/9] Fixing @package tag in Cake/View files.
---
lib/Cake/View/Elements/exception_stack_trace.ctp | 2 +-
lib/Cake/View/Elements/sql_dump.ctp | 2 +-
lib/Cake/View/Emails/html/default.ctp | 2 +-
lib/Cake/View/Emails/text/default.ctp | 2 +-
lib/Cake/View/Errors/error400.ctp | 2 +-
lib/Cake/View/Errors/error500.ctp | 2 +-
lib/Cake/View/Errors/missing_action.ctp | 2 +-
lib/Cake/View/Errors/missing_behavior.ctp | 2 +-
lib/Cake/View/Errors/missing_component.ctp | 2 +-
lib/Cake/View/Errors/missing_connection.ctp | 2 +-
lib/Cake/View/Errors/missing_controller.ctp | 2 +-
lib/Cake/View/Errors/missing_database.ctp | 4 ++--
lib/Cake/View/Errors/missing_datasource.ctp | 2 +-
lib/Cake/View/Errors/missing_datasource_config.ctp | 2 +-
lib/Cake/View/Errors/missing_helper.ctp | 2 +-
lib/Cake/View/Errors/missing_layout.ctp | 2 +-
lib/Cake/View/Errors/missing_plugin.ctp | 2 +-
lib/Cake/View/Errors/missing_table.ctp | 2 +-
lib/Cake/View/Errors/missing_view.ctp | 2 +-
lib/Cake/View/Errors/pdo_error.ctp | 2 +-
lib/Cake/View/Errors/private_action.ctp | 2 +-
lib/Cake/View/Errors/scaffold_error.ctp | 2 +-
lib/Cake/View/Layouts/Emails/html/default.ctp | 2 +-
lib/Cake/View/Layouts/Emails/text/default.ctp | 2 +-
lib/Cake/View/Layouts/ajax.ctp | 2 +-
lib/Cake/View/Layouts/default.ctp | 2 +-
lib/Cake/View/Layouts/flash.ctp | 2 +-
lib/Cake/View/Pages/home.ctp | 2 +-
lib/Cake/View/Scaffolds/form.ctp | 2 +-
lib/Cake/View/Scaffolds/index.ctp | 2 +-
lib/Cake/View/Scaffolds/view.ctp | 2 +-
31 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/lib/Cake/View/Elements/exception_stack_trace.ctp b/lib/Cake/View/Elements/exception_stack_trace.ctp
index 4e8e2eabd..23c0b4572 100644
--- a/lib/Cake/View/Elements/exception_stack_trace.ctp
+++ b/lib/Cake/View/Elements/exception_stack_trace.ctp
@@ -12,7 +12,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.elements
+ * @package Cake.View.Elements
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Elements/sql_dump.ctp b/lib/Cake/View/Elements/sql_dump.ctp
index 1152b0ecd..82aca3052 100644
--- a/lib/Cake/View/Elements/sql_dump.ctp
+++ b/lib/Cake/View/Elements/sql_dump.ctp
@@ -12,7 +12,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.elements
+ * @package Cake.View.Elements
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Emails/html/default.ctp b/lib/Cake/View/Emails/html/default.ctp
index ff132cc94..9d8734706 100644
--- a/lib/Cake/View/Emails/html/default.ctp
+++ b/lib/Cake/View/Emails/html/default.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.elements.email.html
+ * @package Cake.View.Emails.html
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Emails/text/default.ctp b/lib/Cake/View/Emails/text/default.ctp
index ac40c7d84..29873b198 100644
--- a/lib/Cake/View/Emails/text/default.ctp
+++ b/lib/Cake/View/Emails/text/default.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.elements.email.text
+ * @package Cake.View.Emails.text
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Errors/error400.ctp b/lib/Cake/View/Errors/error400.ctp
index d2c6b1541..09d590170 100644
--- a/lib/Cake/View/Errors/error400.ctp
+++ b/lib/Cake/View/Errors/error400.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.errors
+ * @package Cake.View.Errors
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Errors/error500.ctp b/lib/Cake/View/Errors/error500.ctp
index 7f05547a4..6c500aa73 100644
--- a/lib/Cake/View/Errors/error500.ctp
+++ b/lib/Cake/View/Errors/error500.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.errors
+ * @package Cake.View.Errors
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Errors/missing_action.ctp b/lib/Cake/View/Errors/missing_action.ctp
index 0b14ff1b0..c9f1f1fb7 100644
--- a/lib/Cake/View/Errors/missing_action.ctp
+++ b/lib/Cake/View/Errors/missing_action.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.errors
+ * @package Cake.View.Errors
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Errors/missing_behavior.ctp b/lib/Cake/View/Errors/missing_behavior.ctp
index 70869980c..a432fc949 100644
--- a/lib/Cake/View/Errors/missing_behavior.ctp
+++ b/lib/Cake/View/Errors/missing_behavior.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.errors
+ * @package Cake.View.Errors
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Errors/missing_component.ctp b/lib/Cake/View/Errors/missing_component.ctp
index 8625c9a5a..e3a207f94 100644
--- a/lib/Cake/View/Errors/missing_component.ctp
+++ b/lib/Cake/View/Errors/missing_component.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.errors
+ * @package Cake.View.Errors
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Errors/missing_connection.ctp b/lib/Cake/View/Errors/missing_connection.ctp
index c9d21af13..515467d5c 100644
--- a/lib/Cake/View/Errors/missing_connection.ctp
+++ b/lib/Cake/View/Errors/missing_connection.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.errors
+ * @package Cake.View.Errors
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Errors/missing_controller.ctp b/lib/Cake/View/Errors/missing_controller.ctp
index aabcb0ba4..187289a24 100644
--- a/lib/Cake/View/Errors/missing_controller.ctp
+++ b/lib/Cake/View/Errors/missing_controller.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.errors
+ * @package Cake.View.Errors
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Errors/missing_database.ctp b/lib/Cake/View/Errors/missing_database.ctp
index 48b44ad5a..6d02ec070 100644
--- a/lib/Cake/View/Errors/missing_database.ctp
+++ b/lib/Cake/View/Errors/missing_database.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.errors
+ * @package Cake.View.Errors
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
@@ -27,7 +27,7 @@
:
-
+
element('exception_stack_trace'); ?>
diff --git a/lib/Cake/View/Errors/missing_datasource.ctp b/lib/Cake/View/Errors/missing_datasource.ctp
index 712e6dab1..56e7be6e2 100644
--- a/lib/Cake/View/Errors/missing_datasource.ctp
+++ b/lib/Cake/View/Errors/missing_datasource.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.errors
+ * @package Cake.View.Errors
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Errors/missing_datasource_config.ctp b/lib/Cake/View/Errors/missing_datasource_config.ctp
index d1996b1d5..2d030a434 100644
--- a/lib/Cake/View/Errors/missing_datasource_config.ctp
+++ b/lib/Cake/View/Errors/missing_datasource_config.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.errors
+ * @package Cake.View.Errors
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Errors/missing_helper.ctp b/lib/Cake/View/Errors/missing_helper.ctp
index c17305157..a2854d382 100644
--- a/lib/Cake/View/Errors/missing_helper.ctp
+++ b/lib/Cake/View/Errors/missing_helper.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.errors
+ * @package Cake.View.Errors
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Errors/missing_layout.ctp b/lib/Cake/View/Errors/missing_layout.ctp
index 79937dc06..8a50456b9 100644
--- a/lib/Cake/View/Errors/missing_layout.ctp
+++ b/lib/Cake/View/Errors/missing_layout.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.errors
+ * @package Cake.View.Errors
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Errors/missing_plugin.ctp b/lib/Cake/View/Errors/missing_plugin.ctp
index 1f3bea69a..710b388bd 100644
--- a/lib/Cake/View/Errors/missing_plugin.ctp
+++ b/lib/Cake/View/Errors/missing_plugin.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.errors
+ * @package Cake.View.Errors
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Errors/missing_table.ctp b/lib/Cake/View/Errors/missing_table.ctp
index 780cea322..2190ec54a 100644
--- a/lib/Cake/View/Errors/missing_table.ctp
+++ b/lib/Cake/View/Errors/missing_table.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.errors
+ * @package Cake.View.Errors
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Errors/missing_view.ctp b/lib/Cake/View/Errors/missing_view.ctp
index f912277d5..65aceebca 100644
--- a/lib/Cake/View/Errors/missing_view.ctp
+++ b/lib/Cake/View/Errors/missing_view.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.errors
+ * @package Cake.View.Errors
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Errors/pdo_error.ctp b/lib/Cake/View/Errors/pdo_error.ctp
index f977b45fe..34d438ed2 100644
--- a/lib/Cake/View/Errors/pdo_error.ctp
+++ b/lib/Cake/View/Errors/pdo_error.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.errors
+ * @package Cake.View.Errors
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Errors/private_action.ctp b/lib/Cake/View/Errors/private_action.ctp
index 25213303f..294ba0641 100644
--- a/lib/Cake/View/Errors/private_action.ctp
+++ b/lib/Cake/View/Errors/private_action.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.errors
+ * @package Cake.View.Errors
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Errors/scaffold_error.ctp b/lib/Cake/View/Errors/scaffold_error.ctp
index f934ad798..045586e16 100644
--- a/lib/Cake/View/Errors/scaffold_error.ctp
+++ b/lib/Cake/View/Errors/scaffold_error.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.errors
+ * @package Cake.View.Errors
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Layouts/Emails/html/default.ctp b/lib/Cake/View/Layouts/Emails/html/default.ctp
index 790a86e06..a01f6824c 100644
--- a/lib/Cake/View/Layouts/Emails/html/default.ctp
+++ b/lib/Cake/View/Layouts/Emails/html/default.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.layouts.email.html
+ * @package Cake.View.Layouts.Emails.html
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Layouts/Emails/text/default.ctp b/lib/Cake/View/Layouts/Emails/text/default.ctp
index 1f2bc480d..7cb5fe5e8 100644
--- a/lib/Cake/View/Layouts/Emails/text/default.ctp
+++ b/lib/Cake/View/Layouts/Emails/text/default.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.layouts.email.text
+ * @package Cake.View.Layouts.Emails.text
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Layouts/ajax.ctp b/lib/Cake/View/Layouts/ajax.ctp
index 177bee8d3..e878d0b72 100644
--- a/lib/Cake/View/Layouts/ajax.ctp
+++ b/lib/Cake/View/Layouts/ajax.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.layouts
+ * @package Cake.View.Layouts
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Layouts/default.ctp b/lib/Cake/View/Layouts/default.ctp
index 4dbd80859..5bf91f225 100644
--- a/lib/Cake/View/Layouts/default.ctp
+++ b/lib/Cake/View/Layouts/default.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.layouts
+ * @package Cake.View.Layouts
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Layouts/flash.ctp b/lib/Cake/View/Layouts/flash.ctp
index c49b62a72..a6fd50258 100644
--- a/lib/Cake/View/Layouts/flash.ctp
+++ b/lib/Cake/View/Layouts/flash.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.layouts
+ * @package Cake.View.Layouts
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Pages/home.ctp b/lib/Cake/View/Pages/home.ctp
index 09532dcf5..d6737469d 100644
--- a/lib/Cake/View/Pages/home.ctp
+++ b/lib/Cake/View/Pages/home.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.pages
+ * @package Cake.View.Pages
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Scaffolds/form.ctp b/lib/Cake/View/Scaffolds/form.ctp
index 4341ef8fd..379ff6f19 100644
--- a/lib/Cake/View/Scaffolds/form.ctp
+++ b/lib/Cake/View/Scaffolds/form.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.scaffolds
+ * @package Cake.View.Scaffolds
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Scaffolds/index.ctp b/lib/Cake/View/Scaffolds/index.ctp
index 31d850752..0b5434004 100644
--- a/lib/Cake/View/Scaffolds/index.ctp
+++ b/lib/Cake/View/Scaffolds/index.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.console.libs.templates.views
+ * @package Cake.View.Scaffolds
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/View/Scaffolds/view.ctp b/lib/Cake/View/Scaffolds/view.ctp
index d18e70661..9e36fffd4 100644
--- a/lib/Cake/View/Scaffolds/view.ctp
+++ b/lib/Cake/View/Scaffolds/view.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.scaffolds
+ * @package Cake.View.Scaffolds
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
From 507eb2f653d386332116d8dd7a94dffde3f26764 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Renan=20Gonc=CC=A7alves?=
Date: Sat, 15 Oct 2011 20:26:48 +0200
Subject: [PATCH 3/9] Fixing @package at in Cake/Console/Templates files.
---
.../Console/Templates/default/actions/controller_actions.ctp | 2 +-
lib/Cake/Console/Templates/default/classes/controller.ctp | 2 +-
lib/Cake/Console/Templates/default/classes/fixture.ctp | 2 +-
lib/Cake/Console/Templates/default/classes/model.ctp | 2 +-
lib/Cake/Console/Templates/default/classes/test.ctp | 2 +-
lib/Cake/Console/Templates/default/views/form.ctp | 2 +-
lib/Cake/Console/Templates/default/views/index.ctp | 2 +-
lib/Cake/Console/Templates/default/views/view.ctp | 2 +-
8 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/lib/Cake/Console/Templates/default/actions/controller_actions.ctp b/lib/Cake/Console/Templates/default/actions/controller_actions.ctp
index 7665047b3..e61424fdb 100644
--- a/lib/Cake/Console/Templates/default/actions/controller_actions.ctp
+++ b/lib/Cake/Console/Templates/default/actions/controller_actions.ctp
@@ -12,7 +12,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.console.libs.template.objects
+ * @package Cake.Console.Templates.default.actions
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/Console/Templates/default/classes/controller.ctp b/lib/Cake/Console/Templates/default/classes/controller.ctp
index ba3c343f7..eec49119c 100644
--- a/lib/Cake/Console/Templates/default/classes/controller.ctp
+++ b/lib/Cake/Console/Templates/default/classes/controller.ctp
@@ -14,7 +14,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package Cake.Console.Templates.default.actions
+ * @package Cake.Console.Templates.default.classes
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/Console/Templates/default/classes/fixture.ctp b/lib/Cake/Console/Templates/default/classes/fixture.ctp
index d8049a5a9..64f1d1a36 100644
--- a/lib/Cake/Console/Templates/default/classes/fixture.ctp
+++ b/lib/Cake/Console/Templates/default/classes/fixture.ctp
@@ -14,7 +14,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package Cake.Console.Templates.default.actions
+ * @package Cake.Console.Templates.default.classes
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/Console/Templates/default/classes/model.ctp b/lib/Cake/Console/Templates/default/classes/model.ctp
index 8b1c51996..6b6224881 100644
--- a/lib/Cake/Console/Templates/default/classes/model.ctp
+++ b/lib/Cake/Console/Templates/default/classes/model.ctp
@@ -14,7 +14,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package Cake.Console.Templates.default.actions
+ * @package Cake.Console.Templates.default.classes
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/Console/Templates/default/classes/test.ctp b/lib/Cake/Console/Templates/default/classes/test.ctp
index 29183eff5..ca394cf20 100644
--- a/lib/Cake/Console/Templates/default/classes/test.ctp
+++ b/lib/Cake/Console/Templates/default/classes/test.ctp
@@ -13,7 +13,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package Cake.Console.Templates.default.actions
+ * @package Cake.Console.Templates.default.classes
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/Console/Templates/default/views/form.ctp b/lib/Cake/Console/Templates/default/views/form.ctp
index 1c24cfbd5..ccbed5454 100644
--- a/lib/Cake/Console/Templates/default/views/form.ctp
+++ b/lib/Cake/Console/Templates/default/views/form.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.console.libs.templates.views
+ * @package Cake.Console.Templates.default.views
* @since CakePHP(tm) v 1.2.0.5234
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/Console/Templates/default/views/index.ctp b/lib/Cake/Console/Templates/default/views/index.ctp
index e5eb593aa..b332daced 100644
--- a/lib/Cake/Console/Templates/default/views/index.ctp
+++ b/lib/Cake/Console/Templates/default/views/index.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.console.libs.templates.views
+ * @package Cake.Console.Templates.default.views
* @since CakePHP(tm) v 1.2.0.5234
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/Console/Templates/default/views/view.ctp b/lib/Cake/Console/Templates/default/views/view.ctp
index 3e25b6918..7095f7dfe 100644
--- a/lib/Cake/Console/Templates/default/views/view.ctp
+++ b/lib/Cake/Console/Templates/default/views/view.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.console.libs.templates.views
+ * @package Cake.Console.Templates.default.views
* @since CakePHP(tm) v 1.2.0.5234
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
From d2a664c2df427fab12c699d018c5dd6bce0bbb6f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Renan=20Gonc=CC=A7alves?=
Date: Sat, 15 Oct 2011 20:30:49 +0200
Subject: [PATCH 4/9] Fixing @package at in Cake/Console/Templates/skel files.
---
lib/Cake/Console/Templates/skel/Controller/AppController.php | 2 +-
.../Console/Templates/skel/Controller/PagesController.php | 4 ++--
lib/Cake/Console/Templates/skel/Model/AppModel.php | 2 +-
lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp | 2 +-
lib/Cake/Console/Templates/skel/View/Emails/text/default.ctp | 2 +-
lib/Cake/Console/Templates/skel/View/Helper/AppHelper.php | 3 ++-
lib/Cake/Console/Templates/skel/View/Layouts/ajax.ctp | 2 +-
7 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/lib/Cake/Console/Templates/skel/Controller/AppController.php b/lib/Cake/Console/Templates/skel/Controller/AppController.php
index 15db7c208..a46563f02 100644
--- a/lib/Cake/Console/Templates/skel/Controller/AppController.php
+++ b/lib/Cake/Console/Templates/skel/Controller/AppController.php
@@ -28,7 +28,7 @@ App::uses('Controller', 'Controller');
* Add your application-wide methods in the class below, your controllers
* will inherit them.
*
- * @package Cake.Console.Templates.skel.Controller
+ * @package app.Controller
*/
class AppController extends Controller {
}
diff --git a/lib/Cake/Console/Templates/skel/Controller/PagesController.php b/lib/Cake/Console/Templates/skel/Controller/PagesController.php
index cf34b0a2a..0fd243970 100644
--- a/lib/Cake/Console/Templates/skel/Controller/PagesController.php
+++ b/lib/Cake/Console/Templates/skel/Controller/PagesController.php
@@ -14,7 +14,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package Cake.Console.Templates.skel.Controller
+ * @package app.Controller
* @since CakePHP(tm) v 0.2.9
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
@@ -24,7 +24,7 @@
*
* Override this controller by placing a copy in controllers directory of an application
*
- * @package Cake.Console.Templates.skel.Controller
+ * @package app.Controller
*/
class PagesController extends AppController {
diff --git a/lib/Cake/Console/Templates/skel/Model/AppModel.php b/lib/Cake/Console/Templates/skel/Model/AppModel.php
index 141ec88e8..4c9b8bde7 100644
--- a/lib/Cake/Console/Templates/skel/Model/AppModel.php
+++ b/lib/Cake/Console/Templates/skel/Model/AppModel.php
@@ -28,7 +28,7 @@ App::uses('Model', 'Model');
* Add your application-wide methods in the class below, your models
* will inherit them.
*
- * @package Cake.Console.Templates.skel.Model
+ * @package app.Model
*/
class AppModel extends Model {
}
diff --git a/lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp b/lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp
index 0f59cc229..15f15ea39 100644
--- a/lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp
+++ b/lib/Cake/Console/Templates/skel/View/Emails/html/default.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.elements.email.html
+ * @package app.View.Emails.html
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/Console/Templates/skel/View/Emails/text/default.ctp b/lib/Cake/Console/Templates/skel/View/Emails/text/default.ctp
index ac40c7d84..097ffd8c6 100644
--- a/lib/Cake/Console/Templates/skel/View/Emails/text/default.ctp
+++ b/lib/Cake/Console/Templates/skel/View/Emails/text/default.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.elements.email.text
+ * @package app.View.Emails.text
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
diff --git a/lib/Cake/Console/Templates/skel/View/Helper/AppHelper.php b/lib/Cake/Console/Templates/skel/View/Helper/AppHelper.php
index a4b496bf1..c31df1ab6 100644
--- a/lib/Cake/Console/Templates/skel/View/Helper/AppHelper.php
+++ b/lib/Cake/Console/Templates/skel/View/Helper/AppHelper.php
@@ -15,6 +15,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
+ * @package app.View.Helper
* @since CakePHP(tm) v 0.2.9
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
@@ -27,7 +28,7 @@ App::uses('Helper', 'View');
* Add your application-wide methods in the class below, your helpers
* will inherit them.
*
- * @package Cake.Console.Templates.skel.View.Helper
+ * @package app.View.Helper
*/
class AppHelper extends Helper {
}
diff --git a/lib/Cake/Console/Templates/skel/View/Layouts/ajax.ctp b/lib/Cake/Console/Templates/skel/View/Layouts/ajax.ctp
index 177bee8d3..a4aa997ff 100644
--- a/lib/Cake/Console/Templates/skel/View/Layouts/ajax.ctp
+++ b/lib/Cake/Console/Templates/skel/View/Layouts/ajax.ctp
@@ -11,7 +11,7 @@
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
- * @package cake.libs.view.templates.layouts
+ * @package app.View.Layouts
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
From 3a04bb473371f4f27a861257ba0f9a24ca399968 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Renan=20Gonc=CC=A7alves?=
Date: Sat, 15 Oct 2011 20:52:41 +0200
Subject: [PATCH 5/9] Dropping short syntax support for Behavior configuration.
Also making sure that $settings comming from ObjectCollection::normalizeObjectArray() is always an array.
---
lib/Cake/Model/AclNode.php | 2 +-
lib/Cake/Model/Behavior/AclBehavior.php | 5 +----
lib/Cake/Model/Behavior/ContainableBehavior.php | 3 ---
lib/Cake/Model/Behavior/TreeBehavior.php | 3 ---
lib/Cake/Test/Case/Model/Behavior/AclBehaviorTest.php | 6 +++---
lib/Cake/Test/Case/Utility/ObjectCollectionTest.php | 10 ++++++++++
lib/Cake/Utility/ObjectCollection.php | 3 ++-
7 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/lib/Cake/Model/AclNode.php b/lib/Cake/Model/AclNode.php
index 313a297bd..e74cb01b9 100644
--- a/lib/Cake/Model/AclNode.php
+++ b/lib/Cake/Model/AclNode.php
@@ -41,7 +41,7 @@ class AclNode extends AppModel {
*
* @var array
*/
- public $actsAs = array('Tree' => array('nested'));
+ public $actsAs = array('Tree' => array('type' => 'nested'));
/**
* Constructor
diff --git a/lib/Cake/Model/Behavior/AclBehavior.php b/lib/Cake/Model/Behavior/AclBehavior.php
index 3d106394b..c5d2380e8 100644
--- a/lib/Cake/Model/Behavior/AclBehavior.php
+++ b/lib/Cake/Model/Behavior/AclBehavior.php
@@ -36,16 +36,13 @@ class AclBehavior extends ModelBehavior {
protected $_typeMaps = array('requester' => 'Aro', 'controlled' => 'Aco', 'both' => array('Aro', 'Aco'));
/**
- * Sets up the configuation for the model, and loads ACL models if they haven't been already
+ * Sets up the configuration for the model, and loads ACL models if they haven't been already
*
* @param Model $model
* @param array $config
* @return void
*/
public function setup($model, $config = array()) {
- if (is_string($config)) {
- $config = array('type' => $config);
- }
$this->settings[$model->name] = array_merge(array('type' => 'controlled'), (array)$config);
$this->settings[$model->name]['type'] = strtolower($this->settings[$model->name]['type']);
diff --git a/lib/Cake/Model/Behavior/ContainableBehavior.php b/lib/Cake/Model/Behavior/ContainableBehavior.php
index 9c057f40b..f76d2f8d2 100644
--- a/lib/Cake/Model/Behavior/ContainableBehavior.php
+++ b/lib/Cake/Model/Behavior/ContainableBehavior.php
@@ -64,9 +64,6 @@ class ContainableBehavior extends ModelBehavior {
if (!isset($this->settings[$Model->alias])) {
$this->settings[$Model->alias] = array('recursive' => true, 'notices' => true, 'autoFields' => true);
}
- if (!is_array($settings)) {
- $settings = array();
- }
$this->settings[$Model->alias] = array_merge($this->settings[$Model->alias], $settings);
}
diff --git a/lib/Cake/Model/Behavior/TreeBehavior.php b/lib/Cake/Model/Behavior/TreeBehavior.php
index dc1aa8cf3..d5a866fbc 100644
--- a/lib/Cake/Model/Behavior/TreeBehavior.php
+++ b/lib/Cake/Model/Behavior/TreeBehavior.php
@@ -55,9 +55,6 @@ class TreeBehavior extends ModelBehavior {
* @return void
*/
public function setup($Model, $config = array()) {
- if (!is_array($config)) {
- $config = array('type' => $config);
- }
$settings = array_merge($this->_defaults, $config);
if (in_array($settings['scope'], $Model->getAssociated('belongsTo'))) {
diff --git a/lib/Cake/Test/Case/Model/Behavior/AclBehaviorTest.php b/lib/Cake/Test/Case/Model/Behavior/AclBehaviorTest.php
index a4ebef417..cdaed2bca 100644
--- a/lib/Cake/Test/Case/Model/Behavior/AclBehaviorTest.php
+++ b/lib/Cake/Test/Case/Model/Behavior/AclBehaviorTest.php
@@ -53,7 +53,7 @@ class AclPerson extends CakeTestModel {
*
* @var array
*/
- public $actsAs = array('Acl' => 'both');
+ public $actsAs = array('Acl' => array('type' => 'both'));
/**
* belongsTo property
@@ -128,7 +128,7 @@ class AclUser extends CakeTestModel {
*
* @var array
*/
- public $actsAs = array('Acl' => 'requester');
+ public $actsAs = array('Acl' => array('type' => 'requester'));
/**
* parentNode
@@ -166,7 +166,7 @@ class AclPost extends CakeTestModel {
*
* @var array
*/
- public $actsAs = array('Acl' => 'Controlled');
+ public $actsAs = array('Acl' => array('type' => 'Controlled'));
/**
* parentNode
diff --git a/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php b/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php
index 92d1ad009..a7dbc1312 100644
--- a/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php
+++ b/lib/Cake/Test/Case/Utility/ObjectCollectionTest.php
@@ -402,6 +402,16 @@ class ObjectCollectionTest extends CakeTestCase {
'Apple' => array('class' => 'Banana.Apple', 'settings' => array('foo' => 'bar')),
);
$this->assertEquals($expected, $result);
+
+ // This is the result after Controller::_mergeVars
+ $components = array(
+ 'Html' => null,
+ 'Foo.Bar' => array('one', 'two'),
+ 'Something' => null,
+ 'Banana.Apple' => array('foo' => 'bar')
+ );
+ $result = ObjectCollection::normalizeObjectArray($components);
+ $this->assertEquals($expected, $result);
}
}
\ No newline at end of file
diff --git a/lib/Cake/Utility/ObjectCollection.php b/lib/Cake/Utility/ObjectCollection.php
index 2b6c68510..9406b76c6 100644
--- a/lib/Cake/Utility/ObjectCollection.php
+++ b/lib/Cake/Utility/ObjectCollection.php
@@ -247,7 +247,8 @@ abstract class ObjectCollection {
foreach ($objects as $i => $objectName) {
$options = array();
if (!is_int($i)) {
- list($options, $objectName) = array($objectName, $i);
+ $options = (array)$objectName;
+ $objectName = $i;
}
list($plugin, $name) = pluginSplit($objectName);
$normal[$name] = array('class' => $objectName, 'settings' => $options);
From 229bf8e9848b810ee386a57b94f421aa30d7f45d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Renan=20Gonc=CC=A7alves?=
Date: Sun, 16 Oct 2011 12:06:41 +0200
Subject: [PATCH 6/9] Keeping BC on short syntax for Acl and Tree behavior.
---
lib/Cake/Model/Behavior/AclBehavior.php | 6 +++++-
lib/Cake/Model/Behavior/TreeBehavior.php | 4 ++++
lib/Cake/Test/Case/Model/Behavior/AclBehaviorTest.php | 2 +-
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/lib/Cake/Model/Behavior/AclBehavior.php b/lib/Cake/Model/Behavior/AclBehavior.php
index c5d2380e8..ed1379411 100644
--- a/lib/Cake/Model/Behavior/AclBehavior.php
+++ b/lib/Cake/Model/Behavior/AclBehavior.php
@@ -43,7 +43,11 @@ class AclBehavior extends ModelBehavior {
* @return void
*/
public function setup($model, $config = array()) {
- $this->settings[$model->name] = array_merge(array('type' => 'controlled'), (array)$config);
+ if (isset($config[0])) {
+ $config['type'] = $config[0];
+ unset($config[0]);
+ }
+ $this->settings[$model->name] = array_merge(array('type' => 'controlled'), $config);
$this->settings[$model->name]['type'] = strtolower($this->settings[$model->name]['type']);
$types = $this->_typeMaps[$this->settings[$model->name]['type']];
diff --git a/lib/Cake/Model/Behavior/TreeBehavior.php b/lib/Cake/Model/Behavior/TreeBehavior.php
index d5a866fbc..2be27bd94 100644
--- a/lib/Cake/Model/Behavior/TreeBehavior.php
+++ b/lib/Cake/Model/Behavior/TreeBehavior.php
@@ -55,6 +55,10 @@ class TreeBehavior extends ModelBehavior {
* @return void
*/
public function setup($Model, $config = array()) {
+ if (isset($config[0])) {
+ $config['type'] = $config[0];
+ unset($config[0]);
+ }
$settings = array_merge($this->_defaults, $config);
if (in_array($settings['scope'], $Model->getAssociated('belongsTo'))) {
diff --git a/lib/Cake/Test/Case/Model/Behavior/AclBehaviorTest.php b/lib/Cake/Test/Case/Model/Behavior/AclBehaviorTest.php
index cdaed2bca..81c05ce8e 100644
--- a/lib/Cake/Test/Case/Model/Behavior/AclBehaviorTest.php
+++ b/lib/Cake/Test/Case/Model/Behavior/AclBehaviorTest.php
@@ -53,7 +53,7 @@ class AclPerson extends CakeTestModel {
*
* @var array
*/
- public $actsAs = array('Acl' => array('type' => 'both'));
+ public $actsAs = array('Acl' => 'both');
/**
* belongsTo property
From 573a34920987bdf6ac7bf5315d19897a6012fad6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Renan=20Gonc=CC=A7alves?=
Date: Sun, 16 Oct 2011 13:40:36 +0200
Subject: [PATCH 7/9] Using plugin name on exception thrown and in templates
files.
---
lib/Cake/Model/BehaviorCollection.php | 3 ++-
lib/Cake/Model/ConnectionManager.php | 2 +-
lib/Cake/Routing/Dispatcher.php | 3 ++-
lib/Cake/Test/Case/Error/ExceptionRendererTest.php | 5 +++--
lib/Cake/TestSuite/ControllerTestCase.php | 5 ++++-
lib/Cake/View/Errors/missing_behavior.ctp | 5 +++--
lib/Cake/View/Errors/missing_component.ctp | 5 +++--
lib/Cake/View/Errors/missing_controller.ctp | 7 ++++---
lib/Cake/View/Errors/missing_datasource.ctp | 3 ++-
lib/Cake/View/Errors/missing_helper.ctp | 5 +++--
lib/Cake/View/HelperCollection.php | 3 ++-
11 files changed, 29 insertions(+), 17 deletions(-)
diff --git a/lib/Cake/Model/BehaviorCollection.php b/lib/Cake/Model/BehaviorCollection.php
index 1c3bfbfed..b76c6cae0 100644
--- a/lib/Cake/Model/BehaviorCollection.php
+++ b/lib/Cake/Model/BehaviorCollection.php
@@ -116,7 +116,8 @@ class BehaviorCollection extends ObjectCollection {
App::uses($class, $plugin . 'Model/Behavior');
if (!class_exists($class)) {
throw new MissingBehaviorException(array(
- 'class' => $class
+ 'class' => $class,
+ 'plugin' => substr($plugin, 0, -1)
));
}
diff --git a/lib/Cake/Model/ConnectionManager.php b/lib/Cake/Model/ConnectionManager.php
index 30e8efb9f..a05b4b3a0 100644
--- a/lib/Cake/Model/ConnectionManager.php
+++ b/lib/Cake/Model/ConnectionManager.php
@@ -170,7 +170,7 @@ class ConnectionManager {
if (!class_exists($conn['classname'])) {
throw new MissingDatasourceException(array(
'class' => $conn['classname'],
- 'plugin' => $plugin
+ 'plugin' => substr($plugin, 0, -1)
));
}
return true;
diff --git a/lib/Cake/Routing/Dispatcher.php b/lib/Cake/Routing/Dispatcher.php
index 58f093691..f94bd2ae5 100644
--- a/lib/Cake/Routing/Dispatcher.php
+++ b/lib/Cake/Routing/Dispatcher.php
@@ -81,7 +81,8 @@ class Dispatcher {
if (!($controller instanceof Controller)) {
throw new MissingControllerException(array(
- 'controller' => Inflector::camelize($request->params['controller']) . 'Controller'
+ 'class' => Inflector::camelize($request->params['controller']) . 'Controller',
+ 'plugin' => empty($request->params['controller']) ? null : Inflector::camelize($request->params['plugin'])
));
}
diff --git a/lib/Cake/Test/Case/Error/ExceptionRendererTest.php b/lib/Cake/Test/Case/Error/ExceptionRendererTest.php
index 11145c8b7..c45a07b56 100644
--- a/lib/Cake/Test/Case/Error/ExceptionRendererTest.php
+++ b/lib/Cake/Test/Case/Error/ExceptionRendererTest.php
@@ -423,7 +423,7 @@ class ExceptionRendererTest extends CakeTestCase {
* @return void
*/
public function testMissingController() {
- $exception = new MissingControllerException(array('controller' => 'PostsController'));
+ $exception = new MissingControllerException(array('class' => 'PostsController'));
$ExceptionRenderer = $this->_mockResponse(new ExceptionRenderer($exception));
ob_start();
@@ -508,7 +508,7 @@ class ExceptionRendererTest extends CakeTestCase {
new MissingDatasourceException(array('class' => 'MyDatasource', 'plugin' => 'MyPlugin')),
array(
'/Missing Datasource<\/h2>/',
- '/Datasource class MyDatasource<\/em> could not be found/'
+ '/Datasource class MyPlugin.MyDatasource<\/em> could not be found/'
),
500
),
@@ -516,6 +516,7 @@ class ExceptionRendererTest extends CakeTestCase {
new MissingHelperException(array('class' => 'MyCustomHelper')),
array(
'/Missing Helper<\/h2>/',
+ '/MyCustomHelper<\/em> could not be found./',
'/Create the class MyCustomHelper<\/em> below in file:/',
'/(\/|\\\)MyCustomHelper.php/'
),
diff --git a/lib/Cake/TestSuite/ControllerTestCase.php b/lib/Cake/TestSuite/ControllerTestCase.php
index f2539b439..e55444176 100644
--- a/lib/Cake/TestSuite/ControllerTestCase.php
+++ b/lib/Cake/TestSuite/ControllerTestCase.php
@@ -272,7 +272,10 @@ abstract class ControllerTestCase extends CakeTestCase {
}
App::uses($controller . 'Controller', $plugin . 'Controller');
if (!class_exists($controller.'Controller')) {
- throw new MissingControllerException(array('controller' => $controller.'Controller'));
+ throw new MissingControllerException(array(
+ 'class' => $controller . 'Controller',
+ 'plugin' => substr($plugin, 0, -1)
+ ));
}
ClassRegistry::flush();
diff --git a/lib/Cake/View/Errors/missing_behavior.ctp b/lib/Cake/View/Errors/missing_behavior.ctp
index a432fc949..a0568ef9f 100644
--- a/lib/Cake/View/Errors/missing_behavior.ctp
+++ b/lib/Cake/View/Errors/missing_behavior.ctp
@@ -15,15 +15,16 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+$pluginDot = empty($plugin) ? null : $plugin . '.';
?>
:
- ' . $class . '
'); ?>
+ ' . $pluginDot . $class . ''); ?>
:
- ' . $class . '
', APP_DIR . DS . 'Model' . DS . 'Behavior' . DS . $class . '.php'); ?>
+ ' . $class . '', (empty($plugin) ? APP_DIR . DS : CakePlugin::path($plugin)) . 'Model' . DS . 'Behavior' . DS . $class . '.php'); ?>
<?php
diff --git a/lib/Cake/View/Errors/missing_component.ctp b/lib/Cake/View/Errors/missing_component.ctp
index e3a207f94..027065e00 100644
--- a/lib/Cake/View/Errors/missing_component.ctp
+++ b/lib/Cake/View/Errors/missing_component.ctp
@@ -15,15 +15,16 @@
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+$pluginDot = empty($plugin) ? null : $plugin . '.';
?>
:
- ' . $class . ''); ?>
+ ' . $pluginDot . $class . ''); ?>
:
- ' . $class . '', APP_DIR . DS . 'Controller' . DS . 'Component' . DS . $class . '.php'); ?>
+ ' . $class . '', (empty($plugin) ? APP_DIR . DS : CakePlugin::path($plugin)) . 'Controller' . DS . 'Component' . DS . $class . '.php'); ?>
<?php
diff --git a/lib/Cake/View/Errors/missing_controller.ctp b/lib/Cake/View/Errors/missing_controller.ctp
index 187289a24..9266ec522 100644
--- a/lib/Cake/View/Errors/missing_controller.ctp
+++ b/lib/Cake/View/Errors/missing_controller.ctp
@@ -15,19 +15,20 @@
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+$pluginDot = empty($plugin) ? null : $plugin . '.';
?>
:
- ' . $controller . ''); ?>
+ ' . $pluginDot . $class . ''); ?>
:
- ' . $controller . '', APP_DIR . DS . 'Controller' . DS . $controller . '.php'); ?>
+ ' . $class . '', (empty($plugin) ? APP_DIR . DS : CakePlugin::path($plugin)) . 'Controller' . DS . $class . '.php'); ?>
<?php
-class extends AppController {
+class extends AppController {
}
diff --git a/lib/Cake/View/Errors/missing_datasource.ctp b/lib/Cake/View/Errors/missing_datasource.ctp
index 56e7be6e2..a9dd200fd 100644
--- a/lib/Cake/View/Errors/missing_datasource.ctp
+++ b/lib/Cake/View/Errors/missing_datasource.ctp
@@ -15,11 +15,12 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+$pluginDot = empty($plugin) ? null : $plugin . '.';
?>
:
- ' . $class . ''); ?>
+ ' . $pluginDot . $class . ''); ?>
:
diff --git a/lib/Cake/View/Errors/missing_helper.ctp b/lib/Cake/View/Errors/missing_helper.ctp
index a2854d382..6acfb6904 100644
--- a/lib/Cake/View/Errors/missing_helper.ctp
+++ b/lib/Cake/View/Errors/missing_helper.ctp
@@ -15,15 +15,16 @@
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
+$pluginDot = empty($plugin) ? null : $plugin . '.';
?>
:
- ' . $class . ''); ?>
+ ' . $pluginDot . $class . ''); ?>
:
- ' . $class . '', APP_DIR . DS . 'View' . DS . 'Helper' . DS . $class . '.php'); ?>
+ ' . $class . '', (empty($plugin) ? APP_DIR . DS : CakePlugin::path($plugin)) . 'View' . DS . 'Helper' . DS . $class . '.php'); ?>
<?php
diff --git a/lib/Cake/View/HelperCollection.php b/lib/Cake/View/HelperCollection.php
index 98ddce7b4..fb1b55260 100644
--- a/lib/Cake/View/HelperCollection.php
+++ b/lib/Cake/View/HelperCollection.php
@@ -74,7 +74,8 @@ class HelperCollection extends ObjectCollection {
App::uses($helperClass, $plugin . 'View/Helper');
if (!class_exists($helperClass)) {
throw new MissingHelperException(array(
- 'class' => $helperClass
+ 'class' => $helperClass,
+ 'plugin' => substr($plugin, 0, -1)
));
}
$this->_loaded[$alias] = new $helperClass($this->_View, $settings);
From e37703efddaf45ef6dcaf3b24d6f5e88da9aee05 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Renan=20Gonc=CC=A7alves?=
Date: Sun, 16 Oct 2011 13:42:50 +0200
Subject: [PATCH 8/9] Fixed typo from last commit.
---
lib/Cake/Routing/Dispatcher.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/Cake/Routing/Dispatcher.php b/lib/Cake/Routing/Dispatcher.php
index f94bd2ae5..5875406ec 100644
--- a/lib/Cake/Routing/Dispatcher.php
+++ b/lib/Cake/Routing/Dispatcher.php
@@ -82,7 +82,7 @@ class Dispatcher {
if (!($controller instanceof Controller)) {
throw new MissingControllerException(array(
'class' => Inflector::camelize($request->params['controller']) . 'Controller',
- 'plugin' => empty($request->params['controller']) ? null : Inflector::camelize($request->params['plugin'])
+ 'plugin' => empty($request->params['plugin']) ? null : Inflector::camelize($request->params['plugin'])
));
}
From 6ecbcccf25114db1946f5ab9d1755481ae6e9fd0 Mon Sep 17 00:00:00 2001
From: mark_story
Date: Sun, 16 Oct 2011 09:36:51 -0400
Subject: [PATCH 9/9] Updating links to the book.
---
lib/Cake/View/Helper/TimeHelper.php | 34 ++++++++++++++---------------
lib/Cake/basics.php | 14 ++++++------
2 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/lib/Cake/View/Helper/TimeHelper.php b/lib/Cake/View/Helper/TimeHelper.php
index 25a0bc501..7e1620d8e 100644
--- a/lib/Cake/View/Helper/TimeHelper.php
+++ b/lib/Cake/View/Helper/TimeHelper.php
@@ -196,7 +196,7 @@ class TimeHelper extends AppHelper {
* @param string $dateString Datetime string
* @param integer $userOffset User's offset from GMT (in hours)
* @return string Parsed timestamp
- * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formattingview/1471/Formatting
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/
public function fromString($dateString, $userOffset = null) {
if (empty($dateString)) {
@@ -226,7 +226,7 @@ class TimeHelper extends AppHelper {
* @param integer $userOffset User's offset from GMT (in hours)
* @param string $format The format to use. If null, `TimeHelper::$niceFormat` is used
* @return string Formatted date string
- * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formattingview/1471/Formatting
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/
public function nice($dateString = null, $userOffset = null, $format = null) {
if ($dateString != null) {
@@ -252,7 +252,7 @@ class TimeHelper extends AppHelper {
* @param string $dateString Datetime string or Unix timestamp
* @param integer $userOffset User's offset from GMT (in hours)
* @return string Described, relative date string
- * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formattingview/1471/Formatting
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/
public function niceShort($dateString = null, $userOffset = null) {
$date = $dateString ? $this->fromString($dateString, $userOffset) : time();
@@ -279,7 +279,7 @@ class TimeHelper extends AppHelper {
* @param string $fieldName Name of database field to compare with
* @param integer $userOffset User's offset from GMT (in hours)
* @return string Partial SQL string.
- * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formattingview/1471/Formatting
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/
public function daysAsSql($begin, $end, $fieldName, $userOffset = null) {
$begin = $this->fromString($begin, $userOffset);
@@ -298,7 +298,7 @@ class TimeHelper extends AppHelper {
* @param string $fieldName Name of database field to compare with
* @param integer $userOffset User's offset from GMT (in hours)
* @return string Partial SQL string.
- * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formattingview/1471/Formatting
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/
public function dayAsSql($dateString, $fieldName, $userOffset = null) {
$date = $this->fromString($dateString, $userOffset);
@@ -323,7 +323,7 @@ class TimeHelper extends AppHelper {
* @param string $dateString
* @param integer $userOffset User's offset from GMT (in hours)
* @return boolean True if datetime string is within current week
- * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-timeview/1472/Testing-Time
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
*/
public function isThisWeek($dateString, $userOffset = null) {
$date = $this->fromString($dateString, $userOffset);
@@ -335,7 +335,7 @@ class TimeHelper extends AppHelper {
* @param string $dateString
* @param integer $userOffset User's offset from GMT (in hours)
* @return boolean True if datetime string is within current month
- * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-timeview/1472/Testing-Time
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
*/
public function isThisMonth($dateString, $userOffset = null) {
$date = $this->fromString($dateString);
@@ -348,7 +348,7 @@ class TimeHelper extends AppHelper {
* @param string $dateString Datetime string or Unix timestamp
* @param integer $userOffset User's offset from GMT (in hours)
* @return boolean True if datetime string is within current year
- * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-timeview/1472/Testing-Time
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
*/
public function isThisYear($dateString, $userOffset = null) {
$date = $this->fromString($dateString, $userOffset);
@@ -361,7 +361,7 @@ class TimeHelper extends AppHelper {
* @param string $dateString Datetime string or Unix timestamp
* @param integer $userOffset User's offset from GMT (in hours)
* @return boolean True if datetime string was yesterday
- * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-timeview/1472/Testing-Time
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
*
*/
public function wasYesterday($dateString, $userOffset = null) {
@@ -375,7 +375,7 @@ class TimeHelper extends AppHelper {
* @param string $dateString Datetime string or Unix timestamp
* @param integer $userOffset User's offset from GMT (in hours)
* @return boolean True if datetime string was yesterday
- * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-timeview/1472/Testing-Time
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
*/
public function isTomorrow($dateString, $userOffset = null) {
$date = $this->fromString($dateString, $userOffset);
@@ -388,7 +388,7 @@ class TimeHelper extends AppHelper {
* @param string $dateString
* @param boolean $range if true returns a range in Y-m-d format
* @return boolean True if datetime string is within current week
- * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formattingview/1471/Formatting
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/
public function toQuarter($dateString, $range = false) {
$time = $this->fromString($dateString);
@@ -425,7 +425,7 @@ class TimeHelper extends AppHelper {
* @param string $dateString Datetime string to be represented as a Unix timestamp
* @param integer $userOffset User's offset from GMT (in hours)
* @return integer Unix timestamp
- * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formattingview/1471/Formatting
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/
public function toUnix($dateString, $userOffset = null) {
return $this->fromString($dateString, $userOffset);
@@ -437,7 +437,7 @@ class TimeHelper extends AppHelper {
* @param string $dateString Datetime string or Unix timestamp
* @param integer $userOffset User's offset from GMT (in hours)
* @return string Formatted date string
- * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formattingview/1471/Formatting
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/
public function toAtom($dateString, $userOffset = null) {
$date = $this->fromString($dateString, $userOffset);
@@ -450,7 +450,7 @@ class TimeHelper extends AppHelper {
* @param string $dateString Datetime string or Unix timestamp
* @param integer $userOffset User's offset from GMT (in hours)
* @return string Formatted date string
- * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formattingview/1471/Formatting
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/
public function toRSS($dateString, $userOffset = null) {
$date = $this->fromString($dateString, $userOffset);
@@ -491,7 +491,7 @@ class TimeHelper extends AppHelper {
* @param string $dateTime Datetime string or Unix timestamp
* @param array $options Default format if timestamp is used in $dateString
* @return string Relative time string.
- * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formattingview/1471/Formatting
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/
public function timeAgoInWords($dateTime, $options = array()) {
$userOffset = null;
@@ -657,7 +657,7 @@ class TimeHelper extends AppHelper {
* @param mixed $dateString the datestring or unix timestamp to compare
* @param integer $userOffset User's offset from GMT (in hours)
* @return boolean
- * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-timeview/1472/Testing-Time
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
*/
public function wasWithinLast($timeInterval, $dateString, $userOffset = null) {
$tmp = str_replace(' ', '', $timeInterval);
@@ -680,7 +680,7 @@ class TimeHelper extends AppHelper {
*
* @param string $string Datetime string
* @return string Formatted date string
- * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formattingview/1471/Formatting
+ * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/
public function gmt($string = null) {
if ($string != null) {
diff --git a/lib/Cake/basics.php b/lib/Cake/basics.php
index 1e853155b..92a322685 100644
--- a/lib/Cake/basics.php
+++ b/lib/Cake/basics.php
@@ -152,7 +152,7 @@ if (!function_exists('sortByKey')) {
* @param boolean $double Encode existing html entities
* @param string $charset Character set to use when escaping. Defaults to config value in 'App.encoding' or 'UTF-8'
* @return string Wrapped text
- * @link http://book.cakephp.org/2.0/en/development/debugging.html#h
+ * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#h
*/
function h($text, $double = true, $charset = null) {
if (is_array($text)) {
@@ -204,7 +204,7 @@ function pluginSplit($name, $dotAppend = false, $plugin = null) {
*
* @see debug()
* @param array $var Variable to print out
- * @link http://book.cakephp.org/2.0/en/development/debugging.html#pr
+ * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#pr
*/
function pr($var) {
if (Configure::read('debug') > 0) {
@@ -244,7 +244,7 @@ function am() {
*
* @param string $key Environment variable name.
* @return string Environment variable setting.
- * @link http://book.cakephp.org/2.0/en/development/debugging.html#env
+ * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#env
*/
function env($key) {
if ($key === 'HTTPS') {
@@ -464,7 +464,7 @@ function clearCache($params = null, $type = 'views', $ext = '.php') {
*
* @param array $values Array of values to strip slashes
* @return mixed What is returned from calling stripslashes
- * @link http://book.cakephp.org/2.0/en/development/debugging.html#stripslashes_deep
+ * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#stripslashes_deep
*/
function stripslashes_deep($values) {
if (is_array($values)) {
@@ -483,7 +483,7 @@ function stripslashes_deep($values) {
* @param string $singular Text to translate
* @param mixed $args Array with arguments or multiple arguments in function
* @return mixed translated string
- * @link http://book.cakephp.org/2.0/en/development/debugging.html#__
+ * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#__
*/
function __($singular, $args = null) {
if (!$singular) {
@@ -701,7 +701,7 @@ function LogError($message) {
*
* @param string $file File to look for
* @return Full path to file if exists, otherwise false
- * @link http://book.cakephp.org/2.0/en/development/debugging.html#fileExistsInPath
+ * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#fileExistsInPath
*/
function fileExistsInPath($file) {
$paths = explode(PATH_SEPARATOR, ini_get('include_path'));
@@ -722,7 +722,7 @@ function fileExistsInPath($file) {
*
* @param string String to convert
* @return string with underscore remove from start and end of string
- * @link http://book.cakephp.org/2.0/en/development/debugging.html#convertSlash
+ * @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#convertSlash
*/
function convertSlash($string) {
$string = trim($string, '/');