Merge branch '2.0' of github.com:cakephp/cakephp into 2.0

This commit is contained in:
Jose Lorenzo Rodriguez 2011-10-16 15:45:47 -04:30
commit e47b970811
73 changed files with 201 additions and 360 deletions

View file

@ -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;

View file

@ -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
));
}
}

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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 {
}

View file

@ -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 {

View file

@ -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 {
}

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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 {
}

View file

@ -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)
*/

View file

@ -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
));
}

View file

@ -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.';
}
/**

View file

@ -41,7 +41,7 @@ class AclNode extends AppModel {
*
* @var array
*/
public $actsAs = array('Tree' => array('nested'));
public $actsAs = array('Tree' => array('type' => 'nested'));
/**
* Constructor

View file

@ -36,17 +36,18 @@ 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);
if (isset($config[0])) {
$config['type'] = $config[0];
unset($config[0]);
}
$this->settings[$model->name] = array_merge(array('type' => 'controlled'), (array)$config);
$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']];

View file

@ -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);
}

View file

@ -55,8 +55,9 @@ class TreeBehavior extends ModelBehavior {
* @return void
*/
public function setup($Model, $config = array()) {
if (!is_array($config)) {
$config = array('type' => $config);
if (isset($config[0])) {
$config['type'] = $config[0];
unset($config[0]);
}
$settings = array_merge($this->_defaults, $config);

View file

@ -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,9 +115,9 @@ class BehaviorCollection extends ObjectCollection {
App::uses($class, $plugin . 'Model/Behavior');
if (!class_exists($class)) {
throw new MissingBehaviorClassException(array(
'file' => Inflector::underscore($behavior) . '.php',
'class' => $class
throw new MissingBehaviorException(array(
'class' => $class,
'plugin' => substr($plugin, 0, -1)
));
}

View file

@ -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' => substr($plugin, 0, -1)
));
}
return true;
}

View file

@ -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['plugin']) ? null : Inflector::camelize($request->params['plugin'])
));
}

View file

@ -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');
}

View file

@ -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');
}

View file

@ -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();
@ -505,62 +505,37 @@ class ExceptionRendererTest extends CakeTestCase {
500
),
array(
new MissingDatasourceFileException(array('class' => 'MyDatasource', 'plugin' => 'MyPlugin')),
new MissingDatasourceException(array('class' => 'MyDatasource', 'plugin' => 'MyPlugin')),
array(
'/<h2>Missing Datasource Class<\/h2>/',
'/Datasource class <em>MyDatasource<\/em> was not found/'
'/<h2>Missing Datasource<\/h2>/',
'/Datasource class <em>MyPlugin.MyDatasource<\/em> could not be found/'
),
500
),
array(
new MissingHelperFileException(array('file' => 'MyCustomHelper.php', 'class' => 'MyCustomHelper')),
new MissingHelperException(array('class' => 'MyCustomHelper')),
array(
'/<h2>Missing Helper File<\/h2>/',
'/Create the class below in file:/',
'/<h2>Missing Helper<\/h2>/',
'/<em>MyCustomHelper<\/em> could not be found./',
'/Create the class <em>MyCustomHelper<\/em> below in file:/',
'/(\/|\\\)MyCustomHelper.php/'
),
500
),
array(
new MissingHelperClassException(array('file' => 'MyCustomHelper.php', 'class' => 'MyCustomHelper')),
new MissingBehaviorException(array('class' => 'MyCustomBehavior')),
array(
'/<h2>Missing Helper Class<\/h2>/',
'/The helper class <em>MyCustomHelper<\/em> can not be found or does not exist./',
'/(\/|\\\)MyCustomHelper.php/',
),
500
),
array(
new MissingBehaviorFileException(array('file' => 'MyCustomBehavior.php', 'class' => 'MyCustomBehavior')),
array(
'/<h2>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 <em>MyCustomBehavior<\/em> can not be found or does not exist./',
'/<h2>Missing Behavior<\/h2>/',
'/Create the class <em>MyCustomBehavior<\/em> below in file:/',
'/(\/|\\\)MyCustomBehavior.php/'
),
500
),
array(
new MissingComponentFileException(array('file' => 'SideboxComponent.php', 'class' => 'SideboxComponent')),
new MissingComponentException(array('class' => 'SideboxComponent')),
array(
'/<h2>Missing Component File<\/h2>/',
'/Create the class <em>SideboxComponent<\/em> in file:/',
'/(\/|\\\)SideboxComponent.php/'
),
500
),
array(
new MissingComponentClassException(array('file' => 'SideboxComponent.php', 'class' => 'SideboxComponent')),
array(
'/<h2>Missing Component Class<\/h2>/',
'/Create the class <em>SideboxComponent<\/em> in file:/',
'/<h2>Missing Component<\/h2>/',
'/Create the class <em>SideboxComponent<\/em> below in file:/',
'/(\/|\\\)SideboxComponent.php/'
),
500
@ -620,7 +595,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 +603,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))

View file

@ -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

View file

@ -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() {

View file

@ -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');

View file

@ -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);
}
}

View file

@ -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');
}

View file

@ -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();
@ -315,14 +318,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);
}

View file

@ -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);

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -11,29 +11,30 @@
*
* @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)
*/
$pluginDot = empty($plugin) ? null : $plugin . '.';
?>
<h2><?php echo __d('cake_dev', 'Missing Behavior Class'); ?></h2>
<h2><?php echo __d('cake_dev', 'Missing Behavior'); ?></h2>
<p class="error">
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
<?php echo __d('cake_dev', 'The behavior class <em>%s</em> can not be found or does not exist.', $class); ?>
<?php echo __d('cake_dev', '%s could not be found.', '<em>' . $pluginDot . $class . '</em>'); ?>
</p>
<p class="error">
<p class="error">
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
<?php echo __d('cake_dev', 'Create the class below in file: %s', APP_DIR . DS . 'Model' . DS . 'Behavior' . DS . Inflector::camelize($file)); ?>
<?php echo __d('cake_dev', 'Create the class %s below in file: %s', '<em>' . $class . '</em>', (empty($plugin) ? APP_DIR . DS : CakePlugin::path($plugin)) . 'Model' . DS . 'Behavior' . DS . $class . '.php'); ?>
</p>
<pre>
&lt;?php
class <?php echo $class;?> extends ModelBehavior {
class <?php echo $class; ?> extends ModelBehavior {
}
</pre>
<p class="notice">
<strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>
<?php echo __d('cake_dev', 'If you want to customize this error message, create %s', APP_DIR . DS . 'View' . DS . 'Errors' . DS . 'missing_behavior_class.ctp'); ?>
<?php echo __d('cake_dev', 'If you want to customize this error message, create %s', APP_DIR . DS . 'View' . DS . 'Errors' . DS . 'missing_behavior.ctp'); ?>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -1,39 +0,0 @@
<?php
/**
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake.libs.view.templates.errors
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<h2><?php echo __d('cake_dev', 'Missing Behavior File'); ?></h2>
<p class="error">
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
<?php echo __d('cake_dev', 'The Behavior file %s can not be found or does not exist.', APP_DIR . DS . 'Model' . DS . 'Behavior' . DS . Inflector::camelize($file)); ?>
</p>
<p class="error">
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
<?php echo __d('cake_dev', 'Create the class below in file: %s', APP_DIR . DS . 'Model' . DS . 'Behavior' . DS . Inflector::camelize($file)); ?>
</p>
<pre>
&lt;?php
class <?php echo $class;?> extends ModelBehavior {
}
</pre>
<p class="notice">
<strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>
<?php echo __d('cake_dev', 'If you want to customize this error message, create %s', APP_DIR . DS . 'View' . DS . 'Errors' . DS . 'missing_behavior_file.ctp'); ?>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -11,29 +11,30 @@
*
* @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)
*/
$pluginDot = empty($plugin) ? null : $plugin . '.';
?>
<h2><?php echo __d('cake_dev', 'Missing Component File'); ?></h2>
<h2><?php echo __d('cake_dev', 'Missing Component'); ?></h2>
<p class="error">
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
<?php echo __d('cake_dev', 'The component file was not found.'); ?>
<?php echo __d('cake_dev', '%s could not be found.', '<em>' . $pluginDot . $class . '</em>'); ?>
</p>
<p class="error">
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
<?php echo __d('cake_dev', 'Create the class %s in file: %s', '<em>' . $class . '</em>', APP_DIR . DS . 'Controller' . DS . 'Component' . DS . Inflector::camelize($file)); ?>
<?php echo __d('cake_dev', 'Create the class %s below in file: %s', '<em>' . $class . '</em>', (empty($plugin) ? APP_DIR . DS : CakePlugin::path($plugin)) . 'Controller' . DS . 'Component' . DS . $class . '.php'); ?>
</p>
<pre>
&lt;?php
class <?php echo $class;?> extends Component {<br />
class <?php echo $class; ?> extends Component {
}
</pre>
<p class="notice">
<strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>
<?php echo __d('cake_dev', 'If you want to customize this error message, create %s', APP_DIR . DS . 'View' . DS . 'Errors' . DS . 'missing_component_file.ctp'); ?>
<?php echo __d('cake_dev', 'If you want to customize this error message, create %s', APP_DIR . DS . 'View' . DS . 'Errors' . DS . 'missing_component.ctp'); ?>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -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)
*/

View file

@ -11,23 +11,24 @@
*
* @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)
*/
$pluginDot = empty($plugin) ? null : $plugin . '.';
?>
<h2><?php echo __d('cake_dev', 'Missing Controller'); ?></h2>
<p class="error">
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
<?php echo __d('cake_dev', '%s could not be found.', '<em>' . $controller . '</em>'); ?>
<?php echo __d('cake_dev', '%s could not be found.', '<em>' . $pluginDot . $class . '</em>'); ?>
</p>
<p class="error">
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
<?php echo __d('cake_dev', 'Create the class %s below in file: %s', '<em>' . $controller . '</em>', APP_DIR . DS . 'Controller' . DS . $controller . '.php'); ?>
<?php echo __d('cake_dev', 'Create the class %s below in file: %s', '<em>' . $class . '</em>', (empty($plugin) ? APP_DIR . DS : CakePlugin::path($plugin)) . 'Controller' . DS . $class . '.php'); ?>
</p>
<pre>
&lt;?php
class <?php echo $controller;?> extends AppController {
class <?php echo $class; ?> extends AppController {
}
</pre>

View file

@ -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 @@
</p>
<p class="notice">
<strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>
<?php echo __d('cake_dev', 'If you want to customize this error message, create %s', APP_DIR . DS . 'View' . DS . 'Errors' . DS . 'missing_scaffolddb.ctp'); ?>
<?php echo __d('cake_dev', 'If you want to customize this error message, create %s', APP_DIR . DS . 'View' . DS . 'Errors' . DS . 'missing_database.ctp'); ?>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -11,19 +11,20 @@
*
* @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)
*/
$pluginDot = empty($plugin) ? null : $plugin . '.';
?>
<h2><?php echo __d('cake_dev', 'Missing Datasource Class'); ?></h2>
<h2><?php echo __d('cake_dev', 'Missing Datasource'); ?></h2>
<p class="error">
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
<?php echo __d('cake_dev', 'Datasource class %1$s was not found.', '<em>' . $class . '</em>'); ?>
<?php echo __d('cake_dev', 'Datasource class %s could not be found.', '<em>' . $pluginDot . $class . '</em>'); ?>
</p>
<p class="notice">
<strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>
<?php echo __d('cake_dev', 'If you want to customize this error message, create %s', APP_DIR . DS . 'View' . DS . 'Errors' . DS . 'missing_datasource_file.ctp'); ?>
<?php echo __d('cake_dev', 'If you want to customize this error message, create %s', APP_DIR . DS . 'View' . DS . 'Errors' . DS . 'missing_datasource.ctp'); ?>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -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)
*/

View file

@ -11,29 +11,30 @@
*
* @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)
*/
$pluginDot = empty($plugin) ? null : $plugin . '.';
?>
<h2><?php echo __d('cake_dev', 'Missing Component Class'); ?></h2>
<h2><?php echo __d('cake_dev', 'Missing Helper'); ?></h2>
<p class="error">
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
<?php echo __d('cake_dev', 'Component class %1$s was not found.', '<em>' . $class . '</em>'); ?>
<?php echo __d('cake_dev', '%s could not be found.', '<em>' . $pluginDot . $class . '</em>'); ?>
</p>
<p class="error">
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
<?php echo __d('cake_dev', 'Create the class %s in file: %s', '<em>' . $class . '</em>', APP_DIR . DS . 'Controller' . DS . 'Component' . DS . Inflector::camelize($file)); ?>
<?php echo __d('cake_dev', 'Create the class %s below in file: %s', '<em>' . $class . '</em>', (empty($plugin) ? APP_DIR . DS : CakePlugin::path($plugin)) . 'View' . DS . 'Helper' . DS . $class . '.php'); ?>
</p>
<pre>
&lt;?php
class <?php echo $class;?> extends Component {<br />
class <?php echo $class; ?> extends AppHelper {
}
</pre>
<p class="notice">
<strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>
<?php echo __d('cake_dev', 'If you want to customize this error message, create %s', APP_DIR . DS . 'View' . DS . 'Errors' . DS . 'missing_component_class.ctp'); ?>
<?php echo __d('cake_dev', 'If you want to customize this error message, create %s', APP_DIR . DS . 'View' . DS . 'Errors' . DS . 'missing_helper.ctp'); ?>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -1,39 +0,0 @@
<?php
/**
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake.libs.view.templates.errors
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<h2><?php echo __d('cake_dev', 'Missing Helper Class'); ?></h2>
<p class="error">
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
<?php echo __d('cake_dev', 'The helper class <em>%s</em> can not be found or does not exist.', $class); ?>
</p>
<p class="error">
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
<?php echo __d('cake_dev', 'Create the class below in file: %s', APP_DIR . DS . 'View' . DS . 'Helper' . DS . Inflector::camelize($file)); ?>
</p>
<pre>
&lt;?php
class <?php echo $class;?> extends AppHelper {
}
</pre>
<p class="notice">
<strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>
<?php echo __d('cake_dev', 'If you want to customize this error message, create %s', APP_DIR . DS . 'View' . DS . 'Errors' . DS . 'missing_helper_class.ctp'); ?>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -1,39 +0,0 @@
<?php
/**
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package cake.libs.view.templates.errors
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<h2><?php echo __d('cake_dev', 'Missing Helper File'); ?></h2>
<p class="error">
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
<?php echo __d('cake_dev', 'The helper file %s can not be found or does not exist.', APP_DIR . DS . 'View' . DS . 'Helper' . DS . Inflector::camelize($file)); ?>
</p>
<p class="error">
<strong><?php echo __d('cake_dev', 'Error'); ?>: </strong>
<?php echo __d('cake_dev', 'Create the class below in file: %s', APP_DIR . DS . 'View' . DS . 'Helper' . DS . Inflector::camelize($file)); ?>
</p>
<pre>
&lt;?php
class <?php echo $class;?> extends AppHelper {
}
</pre>
<p class="notice">
<strong><?php echo __d('cake_dev', 'Notice'); ?>: </strong>
<?php echo __d('cake_dev', 'If you want to customize this error message, create %s', APP_DIR . DS . 'View' . DS . 'Errors' . DS . 'missing_helper_file.ctp'); ?>
</p>
<?php echo $this->element('exception_stack_trace'); ?>

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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) {

View file

@ -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,9 @@ class HelperCollection extends ObjectCollection {
$helperClass = $name . 'Helper';
App::uses($helperClass, $plugin . 'View/Helper');
if (!class_exists($helperClass)) {
throw new MissingHelperClassException(array(
throw new MissingHelperException(array(
'class' => $helperClass,
'file' => $helperClass . '.php'
'plugin' => substr($plugin, 0, -1)
));
}
$this->_loaded[$alias] = new $helperClass($this->_View, $settings);

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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)
*/

View file

@ -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, '/');