mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Standardising docblock endings throughout.
This commit is contained in:
parent
5092262d4d
commit
0977b3fe15
97 changed files with 559 additions and 552 deletions
|
@ -236,7 +236,7 @@ class AclShell extends Shell {
|
|||
* @param integer $indent indent level.
|
||||
* @return void
|
||||
* @access protected
|
||||
**/
|
||||
*/
|
||||
function _outputNode($class, $node, $indent) {
|
||||
$indent = str_repeat(' ', $indent);
|
||||
$data = $node[$class];
|
||||
|
@ -521,7 +521,7 @@ class AclShell extends Shell {
|
|||
*
|
||||
* @param string $identifier Identifier to parse
|
||||
* @return mixed a string for aliases, and an array for model.foreignKey
|
||||
**/
|
||||
*/
|
||||
function parseIdentifier($identifier) {
|
||||
if (preg_match('/^([\w]+)\.(.*)$/', $identifier, $matches)) {
|
||||
return array(
|
||||
|
@ -539,7 +539,7 @@ class AclShell extends Shell {
|
|||
* @param string $class Class type you want (Aro/Aco)
|
||||
* @param mixed $identifier A mixed identifier for finding the node.
|
||||
* @return int Integer of NodeId. Will trigger an error if nothing is found.
|
||||
**/
|
||||
*/
|
||||
function _getNodeId($class, $identifier) {
|
||||
$node = $this->Acl->{$class}->node($identifier);
|
||||
if (empty($node)) {
|
||||
|
|
|
@ -242,7 +242,7 @@ class SchemaShell extends Shell {
|
|||
* Run database create commands. Alias for run create.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function create() {
|
||||
list($Schema, $table) = $this->_loadSchema();
|
||||
$this->__create($Schema, $table);
|
||||
|
@ -252,7 +252,7 @@ class SchemaShell extends Shell {
|
|||
* Run database create commands. Alias for run create.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function update() {
|
||||
list($Schema, $table) = $this->_loadSchema();
|
||||
$this->__update($Schema, $table);
|
||||
|
@ -262,7 +262,7 @@ class SchemaShell extends Shell {
|
|||
* Prepares the Schema objects for database operations.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function _loadSchema() {
|
||||
$name = $plugin = null;
|
||||
if (isset($this->params['name'])) {
|
||||
|
|
|
@ -642,7 +642,7 @@ class Shell extends Object {
|
|||
*
|
||||
* @param string $pluginName Name of the plugin you want ie. DebugKit
|
||||
* @return string $path path to the correct plugin.
|
||||
**/
|
||||
*/
|
||||
function _pluginPath($pluginName) {
|
||||
return App::pluginPath($pluginName);
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ class ControllerTask extends Shell {
|
|||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function all() {
|
||||
$this->interactive = false;
|
||||
$this->listAll($this->connection, false);
|
||||
|
@ -219,7 +219,7 @@ class ControllerTask extends Shell {
|
|||
* Confirm a to be baked controller with the user
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function confirmController($controllerName, $useDynamicScaffold, $helpers, $components) {
|
||||
$this->out();
|
||||
$this->hr();
|
||||
|
@ -257,7 +257,7 @@ class ControllerTask extends Shell {
|
|||
* Interact with the user and ask about which methods (admin or regular they want to bake)
|
||||
*
|
||||
* @return array Array containing (bakeRegular, bakeAdmin) answers
|
||||
**/
|
||||
*/
|
||||
function _askAboutMethods() {
|
||||
$wannaBakeCrud = $this->in(
|
||||
__("Would you like to create some basic class methods \n(index(), add(), view(), edit())?", true),
|
||||
|
@ -348,7 +348,7 @@ class ControllerTask extends Shell {
|
|||
* Interact with the user and get a list of additional helpers
|
||||
*
|
||||
* @return array Helpers that the user wants to use.
|
||||
**/
|
||||
*/
|
||||
function doHelpers() {
|
||||
return $this->_doPropertyChoices(
|
||||
__("Would you like this controller to use other helpers\nbesides HtmlHelper and FormHelper?", true),
|
||||
|
@ -360,7 +360,7 @@ class ControllerTask extends Shell {
|
|||
* Interact with the user and get a list of additional components
|
||||
*
|
||||
* @return array Components the user wants to use.
|
||||
**/
|
||||
*/
|
||||
function doComponents() {
|
||||
return $this->_doPropertyChoices(
|
||||
__("Would you like this controller to use any components?", true),
|
||||
|
@ -374,7 +374,7 @@ class ControllerTask extends Shell {
|
|||
* @param string $prompt A yes/no question to precede the list
|
||||
* @param sting $example A question for a comma separated list, with examples.
|
||||
* @return array Array of values for property.
|
||||
**/
|
||||
*/
|
||||
function _doPropertyChoices($prompt, $example) {
|
||||
$proceed = $this->in($prompt, array('y','n'), 'n');
|
||||
$property = array();
|
||||
|
|
|
@ -53,7 +53,7 @@ class DbConfigTask extends Shell {
|
|||
* Used for testing.
|
||||
*
|
||||
* @var string
|
||||
**/
|
||||
*/
|
||||
var $databaseClassName = 'DATABASE_CONFIG';
|
||||
|
||||
/**
|
||||
|
@ -351,7 +351,7 @@ class DbConfigTask extends Shell {
|
|||
* Get a user specified Connection name
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function getConfig() {
|
||||
App::import('Model', 'ConnectionManager', false);
|
||||
|
||||
|
|
|
@ -54,14 +54,14 @@ class FixtureTask extends Shell {
|
|||
* The db connection being used for baking
|
||||
*
|
||||
* @var string
|
||||
**/
|
||||
*/
|
||||
var $connection = null;
|
||||
|
||||
/**
|
||||
* Schema instance
|
||||
*
|
||||
* @var object
|
||||
**/
|
||||
*/
|
||||
var $_Schema = null;
|
||||
|
||||
/**
|
||||
|
@ -103,7 +103,7 @@ class FixtureTask extends Shell {
|
|||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function all() {
|
||||
$this->interactive = false;
|
||||
$this->Model->interactive = false;
|
||||
|
@ -140,7 +140,7 @@ class FixtureTask extends Shell {
|
|||
*
|
||||
* @param string $modelName Name of model you are dealing with.
|
||||
* @return array Array of import options.
|
||||
**/
|
||||
*/
|
||||
function importOptions($modelName) {
|
||||
$options = array();
|
||||
$doSchema = $this->in(__('Would you like to import schema for this fixture?', true), array('y', 'n'), 'n');
|
||||
|
@ -230,7 +230,7 @@ class FixtureTask extends Shell {
|
|||
* @param string $fixture Contents of the fixture file.
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function generateFixtureFile($model, $otherVars) {
|
||||
$defaults = array('table' => null, 'schema' => null, 'records' => null, 'import' => null, 'fields' => null);
|
||||
$vars = array_merge($defaults, $otherVars);
|
||||
|
@ -255,7 +255,7 @@ class FixtureTask extends Shell {
|
|||
*
|
||||
* @param array $table Table schema array
|
||||
* @return string fields definitions
|
||||
**/
|
||||
*/
|
||||
function _generateSchema($tableInfo) {
|
||||
$schema = $this->_Schema->generateTable('f', $tableInfo);
|
||||
return substr($schema, 10, -2);
|
||||
|
@ -266,7 +266,7 @@ class FixtureTask extends Shell {
|
|||
*
|
||||
* @param array $table Table schema array
|
||||
* @return array Array of records to use in the fixture.
|
||||
**/
|
||||
*/
|
||||
function _generateRecords($tableInfo, $recordCount = 1) {
|
||||
$records = array();
|
||||
for ($i = 0; $i < $recordCount; $i++) {
|
||||
|
@ -337,7 +337,7 @@ class FixtureTask extends Shell {
|
|||
*
|
||||
* @param array $records Array of records to be converted to string
|
||||
* @return string A string value of the $records array.
|
||||
**/
|
||||
*/
|
||||
function _makeRecordString($records) {
|
||||
$out = "array(\n";
|
||||
foreach ($records as $record) {
|
||||
|
@ -360,7 +360,7 @@ class FixtureTask extends Shell {
|
|||
* @param string $modelName name of the model to take records from.
|
||||
* @param string $useTable Name of table to use.
|
||||
* @return array Array of records.
|
||||
**/
|
||||
*/
|
||||
function _getRecordsFromTable($modelName, $useTable = null) {
|
||||
if ($this->interactive) {
|
||||
$condition = null;
|
||||
|
|
|
@ -64,14 +64,14 @@ class ModelTask extends Shell {
|
|||
* Holds tables found on connection.
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $__tables = array();
|
||||
|
||||
/**
|
||||
* Holds validation method map.
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $__validations = array();
|
||||
|
||||
/**
|
||||
|
@ -109,7 +109,7 @@ class ModelTask extends Shell {
|
|||
* Bake all models at once.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function all() {
|
||||
$this->listAll($this->connection, false);
|
||||
$unitTestExists = $this->_checkUnitTest();
|
||||
|
@ -129,7 +129,7 @@ class ModelTask extends Shell {
|
|||
*
|
||||
* @param string $className Name of class you want model to be.
|
||||
* @return object Model instance
|
||||
**/
|
||||
*/
|
||||
function &_getModelObject($className) {
|
||||
$object = new Model(array('name' => $className, 'ds' => $this->connection));
|
||||
return $object;
|
||||
|
@ -142,7 +142,7 @@ class ModelTask extends Shell {
|
|||
* @param string $prompt Prompt to use for options list.
|
||||
* @param integer $default The default option for the given prompt.
|
||||
* @return result of user choice.
|
||||
**/
|
||||
*/
|
||||
function inOptions($options, $prompt = null, $default = null) {
|
||||
$valid = false;
|
||||
$max = count($options);
|
||||
|
@ -262,7 +262,7 @@ class ModelTask extends Shell {
|
|||
* @param string $associations Collection of associations.
|
||||
* @access protected
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function _printAssociation($modelName, $type, $associations) {
|
||||
if (!empty($associations[$type])) {
|
||||
for ($i = 0; $i < count($associations[$type]); $i++) {
|
||||
|
@ -278,7 +278,7 @@ class ModelTask extends Shell {
|
|||
* @param array $fields Array of fields that might have a primary key.
|
||||
* @return string Name of field that is a primary key.
|
||||
* @access public
|
||||
**/
|
||||
*/
|
||||
function findPrimaryKey($fields) {
|
||||
foreach ($fields as $name => $field) {
|
||||
if (isset($field['key']) && $field['key'] == 'primary') {
|
||||
|
@ -293,7 +293,7 @@ class ModelTask extends Shell {
|
|||
*
|
||||
* @param array $fields Array of fields to look for and choose as a displayField
|
||||
* @return mixed Name of field to use for displayField or false if the user declines to choose
|
||||
**/
|
||||
*/
|
||||
function findDisplayField($fields) {
|
||||
$fieldNames = array_keys($fields);
|
||||
$prompt = __("A displayField could not be automatically detected\nwould you like to choose one?", true);
|
||||
|
@ -337,7 +337,7 @@ class ModelTask extends Shell {
|
|||
* Populate the __validations array
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function initValidations() {
|
||||
$options = $choices = array();
|
||||
if (class_exists('Validation')) {
|
||||
|
@ -363,7 +363,7 @@ class ModelTask extends Shell {
|
|||
* @param string $fieldName Name of field to be validated.
|
||||
* @param array $metaData metadata for field
|
||||
* @return array Array of validation for the field.
|
||||
**/
|
||||
*/
|
||||
function fieldValidation($fieldName, $metaData, $primaryKey = 'id') {
|
||||
$defaultChoice = count($this->__validations);
|
||||
$validate = $alreadyChosen = array();
|
||||
|
@ -484,7 +484,7 @@ class ModelTask extends Shell {
|
|||
* @param object $model Model instance of model being generated.
|
||||
* @param array $associations Array of inprogress associations
|
||||
* @return array $associations with belongsTo added in.
|
||||
**/
|
||||
*/
|
||||
function findBelongsTo(&$model, $associations) {
|
||||
$fields = $model->schema();
|
||||
foreach ($fields as $fieldName => $field) {
|
||||
|
@ -513,7 +513,7 @@ class ModelTask extends Shell {
|
|||
* @param object $model Model instance being generated
|
||||
* @param array $associations Array of inprogress associations
|
||||
* @return array $associations with hasOne and hasMany added in.
|
||||
**/
|
||||
*/
|
||||
function findHasOneAndMany(&$model, $associations) {
|
||||
$foreignKey = $this->_modelKey($model->name);
|
||||
foreach ($this->__tables as $otherTable) {
|
||||
|
@ -556,7 +556,7 @@ class ModelTask extends Shell {
|
|||
* @param object $model Model instance being generated
|
||||
* @param array $associations Array of inprogress associations
|
||||
* @return array $associations with hasAndBelongsToMany added in.
|
||||
**/
|
||||
*/
|
||||
function findHasAndBelongsToMany(&$model, $associations) {
|
||||
$foreignKey = $this->_modelKey($model->name);
|
||||
foreach ($this->__tables as $otherTable) {
|
||||
|
@ -596,7 +596,7 @@ class ModelTask extends Shell {
|
|||
* @param array $model Temporary Model instance.
|
||||
* @param array $associations Array of associations to be confirmed.
|
||||
* @return array Array of confirmed associations
|
||||
**/
|
||||
*/
|
||||
function confirmAssociations(&$model, $associations) {
|
||||
foreach ($associations as $type => $settings) {
|
||||
if (!empty($associations[$type])) {
|
||||
|
@ -624,7 +624,7 @@ class ModelTask extends Shell {
|
|||
* @param object $model Temporary model instance
|
||||
* @param array $associations Array of associations.
|
||||
* @return array Array of associations.
|
||||
**/
|
||||
*/
|
||||
function doMoreAssociations($model, $associations) {
|
||||
$prompt = __('Would you like to define some additional model associations?', true);
|
||||
$wannaDoMoreAssoc = $this->in($prompt, array('y','n'), 'n');
|
||||
|
@ -689,7 +689,7 @@ class ModelTask extends Shell {
|
|||
* Finds all possible keys to use on custom associations.
|
||||
*
|
||||
* @return array array of tables and possible keys
|
||||
**/
|
||||
*/
|
||||
function _generatePossibleKeys() {
|
||||
$possible = array();
|
||||
foreach ($this->__tables as $otherTable) {
|
||||
|
@ -782,7 +782,7 @@ class ModelTask extends Shell {
|
|||
* @param string $modelName Name of the model you want a table for.
|
||||
* @param string $useDbConfig Name of the database config you want to get tables from.
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function getTable($modelName, $useDbConfig = null) {
|
||||
if (!isset($useDbConfig)) {
|
||||
$useDbConfig = $this->connection;
|
||||
|
@ -811,7 +811,7 @@ class ModelTask extends Shell {
|
|||
*
|
||||
* @param string $useDbConfig Connection name to scan.
|
||||
* @return array Array of tables in the database.
|
||||
**/
|
||||
*/
|
||||
function getAllTables($useDbConfig = null) {
|
||||
if (!isset($useDbConfig)) {
|
||||
$useDbConfig = $this->connection;
|
||||
|
@ -906,7 +906,7 @@ class ModelTask extends Shell {
|
|||
* @access public
|
||||
* @return void
|
||||
* @see FixtureTask::bake
|
||||
**/
|
||||
*/
|
||||
function bakeFixture($className, $useTable = null) {
|
||||
$this->Fixture->connection = $this->connection;
|
||||
$this->Fixture->plugin = $this->plugin;
|
||||
|
|
|
@ -204,7 +204,7 @@ class PluginTask extends Shell {
|
|||
* find and change $this->path to the user selection
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function findPath($pathOptions) {
|
||||
$valid = false;
|
||||
$max = count($pathOptions);
|
||||
|
|
|
@ -30,7 +30,7 @@ class ProjectTask extends Shell {
|
|||
* configs path (used in testing).
|
||||
*
|
||||
* @var string
|
||||
**/
|
||||
*/
|
||||
var $configPath = null;
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,7 +23,7 @@ class TemplateTask extends Shell {
|
|||
* variables to add to template scope
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $templateVars = array();
|
||||
|
||||
/**
|
||||
|
@ -31,7 +31,7 @@ class TemplateTask extends Shell {
|
|||
* Contains a list of $theme => $path
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $templatePaths = array();
|
||||
|
||||
/**
|
||||
|
@ -39,7 +39,7 @@ class TemplateTask extends Shell {
|
|||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function initialize() {
|
||||
$this->templatePaths = $this->_findThemes();
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ class TemplateTask extends Shell {
|
|||
* Bake themes are directories not named `skel` inside a `vendors/shells/templates` path.
|
||||
*
|
||||
* @return array Array of bake themes that are installed.
|
||||
**/
|
||||
*/
|
||||
function _findThemes() {
|
||||
$paths = App::path('shells');
|
||||
$core = array_pop($paths);
|
||||
|
@ -128,7 +128,7 @@ class TemplateTask extends Shell {
|
|||
* @param string $vars Additional vars to set to template scope.
|
||||
* @access public
|
||||
* @return contents of generated code template
|
||||
**/
|
||||
*/
|
||||
function generate($directory, $filename, $vars = null) {
|
||||
if ($vars !== null) {
|
||||
$this->set($vars);
|
||||
|
@ -156,7 +156,7 @@ class TemplateTask extends Shell {
|
|||
* If there is more than one installed theme user interaction will happen
|
||||
*
|
||||
* @return string returns the path to the selected theme.
|
||||
**/
|
||||
*/
|
||||
function getThemePath() {
|
||||
if (count($this->templatePaths) == 1) {
|
||||
$paths = array_values($this->templatePaths);
|
||||
|
@ -193,7 +193,7 @@ class TemplateTask extends Shell {
|
|||
* @param string $filename lower_case_underscored filename you want.
|
||||
* @access public
|
||||
* @return string filename will exit program if template is not found.
|
||||
**/
|
||||
*/
|
||||
function _findTemplate($path, $directory, $filename) {
|
||||
$themeFile = $path . $directory . DS . $filename . '.ctp';
|
||||
if (file_exists($themeFile)) {
|
||||
|
|
|
@ -46,28 +46,28 @@ class TestTask extends Shell {
|
|||
* Tasks used.
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $tasks = array('Template');
|
||||
|
||||
/**
|
||||
* class types that methods can be generated for
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $classTypes = array('Model', 'Controller', 'Component', 'Behavior', 'Helper');
|
||||
|
||||
/**
|
||||
* Internal list of fixtures that have been added so far.
|
||||
*
|
||||
* @var string
|
||||
**/
|
||||
*/
|
||||
var $_fixtures = array();
|
||||
|
||||
/**
|
||||
* Flag for interactive mode
|
||||
*
|
||||
* @var boolean
|
||||
**/
|
||||
*/
|
||||
var $interactive = false;
|
||||
|
||||
/**
|
||||
|
@ -164,7 +164,7 @@ class TestTask extends Shell {
|
|||
* Interact with the user and get their chosen type. Can exit the script.
|
||||
*
|
||||
* @return string Users chosen type.
|
||||
**/
|
||||
*/
|
||||
function getObjectType() {
|
||||
$this->hr();
|
||||
$this->out(__("Select an object type:", true));
|
||||
|
@ -188,7 +188,7 @@ class TestTask extends Shell {
|
|||
*
|
||||
* @param string $objectType Type of object to list classes for i.e. Model, Controller.
|
||||
* @return string Class name the user chose.
|
||||
**/
|
||||
*/
|
||||
function getClassName($objectType) {
|
||||
$options = App::objects(strtolower($objectType));
|
||||
$this->out(sprintf(__('Choose a %s class', true), $objectType));
|
||||
|
@ -209,7 +209,7 @@ class TestTask extends Shell {
|
|||
* Currently only model, and controller are supported
|
||||
*
|
||||
* @return boolean
|
||||
**/
|
||||
*/
|
||||
function typeCanDetectFixtures($type) {
|
||||
$type = strtolower($type);
|
||||
return ($type == 'controller' || $type == 'model');
|
||||
|
@ -219,7 +219,7 @@ class TestTask extends Shell {
|
|||
* Check if a class with the given type is loaded or can be loaded.
|
||||
*
|
||||
* @return boolean
|
||||
**/
|
||||
*/
|
||||
function isLoadableClass($type, $class) {
|
||||
return App::import($type, $class);
|
||||
}
|
||||
|
@ -229,7 +229,7 @@ class TestTask extends Shell {
|
|||
* So that fixtures can be detected
|
||||
*
|
||||
* @return object
|
||||
**/
|
||||
*/
|
||||
function &buildTestSubject($type, $class) {
|
||||
ClassRegistry::flush();
|
||||
App::import($type, $class);
|
||||
|
@ -246,7 +246,7 @@ class TestTask extends Shell {
|
|||
* Gets the real class name from the cake short form.
|
||||
*
|
||||
* @return string Real classname
|
||||
**/
|
||||
*/
|
||||
function getRealClassName($type, $class) {
|
||||
if (strtolower($type) == 'model') {
|
||||
return $class;
|
||||
|
@ -260,7 +260,7 @@ class TestTask extends Shell {
|
|||
*
|
||||
* @param string $className Name of class to look at.
|
||||
* @return array Array of method names.
|
||||
**/
|
||||
*/
|
||||
function getTestableMethods($className) {
|
||||
$classMethods = get_class_methods($className);
|
||||
$parentMethods = get_class_methods(get_parent_class($className));
|
||||
|
@ -280,7 +280,7 @@ class TestTask extends Shell {
|
|||
*
|
||||
* @param object The object you want to generate fixtures for.
|
||||
* @return array Array of fixtures to be included in the test.
|
||||
**/
|
||||
*/
|
||||
function generateFixtureList(&$subject) {
|
||||
$this->_fixtures = array();
|
||||
if (is_a($subject, 'Model')) {
|
||||
|
@ -297,7 +297,7 @@ class TestTask extends Shell {
|
|||
*
|
||||
* @return void
|
||||
* @access protected
|
||||
**/
|
||||
*/
|
||||
function _processModel(&$subject) {
|
||||
$this->_addFixture($subject->name);
|
||||
$associated = $subject->getAssociated();
|
||||
|
@ -321,7 +321,7 @@ class TestTask extends Shell {
|
|||
*
|
||||
* @return void
|
||||
* @access protected
|
||||
**/
|
||||
*/
|
||||
function _processController(&$subject) {
|
||||
$subject->constructClasses();
|
||||
$models = array(Inflector::classify($subject->name));
|
||||
|
@ -339,7 +339,7 @@ class TestTask extends Shell {
|
|||
*
|
||||
* @return void
|
||||
* @access protected
|
||||
**/
|
||||
*/
|
||||
function _addFixture($name) {
|
||||
$parent = get_parent_class($name);
|
||||
$prefix = 'app.';
|
||||
|
@ -355,7 +355,7 @@ class TestTask extends Shell {
|
|||
* Interact with the user to get additional fixtures they want to use.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function getUserFixtures() {
|
||||
$proceed = $this->in(__('Bake could not detect fixtures, would you like to add some?', true), array('y','n'), 'n');
|
||||
$fixtures = array();
|
||||
|
@ -373,7 +373,7 @@ class TestTask extends Shell {
|
|||
* Controllers require a mock class.
|
||||
*
|
||||
* @return boolean
|
||||
**/
|
||||
*/
|
||||
function hasMockClass($type) {
|
||||
$type = strtolower($type);
|
||||
return $type == 'controller';
|
||||
|
@ -383,7 +383,7 @@ class TestTask extends Shell {
|
|||
* Generate a constructor code snippet for the type and classname
|
||||
*
|
||||
* @return string Constructor snippet for the thing you are building.
|
||||
**/
|
||||
*/
|
||||
function generateConstructor($type, $fullClassName) {
|
||||
$type = strtolower($type);
|
||||
if ($type == 'model') {
|
||||
|
@ -401,7 +401,7 @@ class TestTask extends Shell {
|
|||
* and get the plugin path if needed.
|
||||
*
|
||||
* @return string filename the test should be created on
|
||||
**/
|
||||
*/
|
||||
function testCaseFileName($type, $className) {
|
||||
$path = $this->path;
|
||||
if (isset($this->plugin)) {
|
||||
|
@ -418,7 +418,7 @@ class TestTask extends Shell {
|
|||
* Show help file.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function help() {
|
||||
$this->hr();
|
||||
$this->out("Usage: cake bake test <type> <class>");
|
||||
|
|
|
@ -144,7 +144,7 @@ class ViewTask extends Shell {
|
|||
* Get a list of actions that can / should have views baked for them.
|
||||
*
|
||||
* @return array Array of action names that should be baked
|
||||
**/
|
||||
*/
|
||||
function _methodsToBake() {
|
||||
$methods = array_diff(
|
||||
array_map('strtolower', get_class_methods($this->controllerName . 'Controller')),
|
||||
|
@ -176,7 +176,7 @@ class ViewTask extends Shell {
|
|||
* Bake All views for All controllers.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function all() {
|
||||
$this->Controller->interactive = false;
|
||||
$tables = $this->Controller->listAll($this->connection, false);
|
||||
|
@ -308,7 +308,7 @@ class ViewTask extends Shell {
|
|||
*
|
||||
* @param array $actions Array of actions to make files for.
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function bakeActions($actions, $vars) {
|
||||
foreach ($actions as $action) {
|
||||
$content = $this->getContent($action, $vars);
|
||||
|
@ -320,7 +320,7 @@ class ViewTask extends Shell {
|
|||
* handle creation of baking a custom action view file
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function customAction() {
|
||||
$action = '';
|
||||
while ($action == '') {
|
||||
|
|
|
@ -60,7 +60,7 @@ class CakeLog {
|
|||
*
|
||||
* @var array
|
||||
* @access protected
|
||||
**/
|
||||
*/
|
||||
var $_streams = array();
|
||||
|
||||
/**
|
||||
|
@ -68,7 +68,7 @@ class CakeLog {
|
|||
*
|
||||
* @return void
|
||||
* @static
|
||||
**/
|
||||
*/
|
||||
function &getInstance() {
|
||||
static $instance = array();
|
||||
if (!isset($instance[0])) {
|
||||
|
@ -85,7 +85,7 @@ class CakeLog {
|
|||
* @param array $config Array of configuration information for the logger
|
||||
* @return boolean success of configuration.
|
||||
* @static
|
||||
**/
|
||||
*/
|
||||
function config($key, $config) {
|
||||
if (empty($config['engine'])) {
|
||||
trigger_error(__('Missing logger classname', true), E_USER_WARNING);
|
||||
|
@ -107,7 +107,7 @@ class CakeLog {
|
|||
*
|
||||
* @return mixed boolean false on any failures, string of classname to use if search was successful.\
|
||||
* @access protected
|
||||
**/
|
||||
*/
|
||||
function _getLogger($loggerName) {
|
||||
$plugin = null;
|
||||
if (strpos($loggerName, '.') !== false) {
|
||||
|
@ -139,7 +139,7 @@ class CakeLog {
|
|||
*
|
||||
* @return array
|
||||
* @static
|
||||
**/
|
||||
*/
|
||||
function streams() {
|
||||
$self = CakeLog::getInstance();
|
||||
return array_keys($self->_streams);
|
||||
|
@ -152,7 +152,7 @@ class CakeLog {
|
|||
* @param string $keyname Key name of callable to remove.
|
||||
* @return void
|
||||
* @static
|
||||
**/
|
||||
*/
|
||||
function remove($streamName) {
|
||||
$self = CakeLog::getInstance();
|
||||
unset($self->_streams[$streamName]);
|
||||
|
@ -167,7 +167,7 @@ class CakeLog {
|
|||
* @param array $config Array of config information for the LogStream
|
||||
* @return boolean success
|
||||
* @static
|
||||
**/
|
||||
*/
|
||||
function addStream($key, $config) {
|
||||
$self = CakeLog::getInstance();
|
||||
$self->_streams[$key] = $config;
|
||||
|
@ -178,7 +178,7 @@ class CakeLog {
|
|||
*
|
||||
* @return void
|
||||
* @access protected
|
||||
**/
|
||||
*/
|
||||
function _autoConfig() {
|
||||
if (!class_exists('FileLog')) {
|
||||
App::import('Core', 'log/FileLog');
|
||||
|
@ -235,7 +235,7 @@ class CakeLog {
|
|||
* @param integer $line Line that triggered the error
|
||||
* @param array $context Context
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function handleError($code, $description, $file = null, $line = null, $context = null) {
|
||||
if ($code === 2048 || $code === 8192) {
|
||||
return;
|
||||
|
|
|
@ -244,7 +244,7 @@ class CakeSession extends Object {
|
|||
*
|
||||
* @return boolean
|
||||
* @deprecated Use CakeSession::delete instead
|
||||
**/
|
||||
*/
|
||||
function del($name) {
|
||||
trigger_error('CakeSession::del() is deprecated, use CakeSession::delete() instead.', E_USER_WARNING);
|
||||
return $this->delete($name);
|
||||
|
|
|
@ -685,7 +685,7 @@ class App extends Object {
|
|||
*
|
||||
* @param string $plugin CamelCased plugin name to find the path of.
|
||||
* @return string full path to the plugin.
|
||||
**/
|
||||
*/
|
||||
function pluginPath($plugin) {
|
||||
$_this =& App::getInstance();
|
||||
$pluginDir = Inflector::underscore($plugin);
|
||||
|
|
|
@ -56,7 +56,7 @@ class Component extends Object {
|
|||
*
|
||||
* @var array
|
||||
* @access private
|
||||
**/
|
||||
*/
|
||||
var $__settings = array();
|
||||
|
||||
/**
|
||||
|
|
|
@ -263,7 +263,7 @@ class CookieComponent extends Object {
|
|||
|
||||
/**
|
||||
* @deprecated use delete()
|
||||
**/
|
||||
*/
|
||||
function del($key) {
|
||||
trigger_error('Deprecated method, use CookieComponent::delete instead', E_USER_WARNING);
|
||||
return $this->delete($key);
|
||||
|
|
|
@ -37,7 +37,7 @@ class Inflector {
|
|||
*
|
||||
* @var array
|
||||
* @access protected
|
||||
**/
|
||||
*/
|
||||
var $_plural = array(
|
||||
'rules' => array(
|
||||
'/(s)tatus$/i' => '\1\2tatuses',
|
||||
|
@ -105,7 +105,7 @@ class Inflector {
|
|||
*
|
||||
* @var array
|
||||
* @access protected
|
||||
**/
|
||||
*/
|
||||
var $_singular = array(
|
||||
'rules' => array(
|
||||
'/(s)tatuses$/i' => '\1\2tatus',
|
||||
|
@ -155,7 +155,7 @@ class Inflector {
|
|||
*
|
||||
* @var array
|
||||
* @access protected
|
||||
**/
|
||||
*/
|
||||
var $_uninflected = array(
|
||||
'Amoyese', 'bison', 'Borghese', 'bream', 'breeches', 'britches', 'buffalo', 'cantus',
|
||||
'carp', 'chassis', 'clippers', 'cod', 'coitus', 'Congoese', 'contretemps', 'corps',
|
||||
|
@ -176,7 +176,7 @@ class Inflector {
|
|||
*
|
||||
* @var array
|
||||
* @access protected
|
||||
**/
|
||||
*/
|
||||
var $_pluralized = array();
|
||||
|
||||
/**
|
||||
|
@ -184,7 +184,7 @@ class Inflector {
|
|||
*
|
||||
* @var array
|
||||
* @access protected
|
||||
**/
|
||||
*/
|
||||
var $_singularized = array();
|
||||
|
||||
/**
|
||||
|
|
|
@ -31,7 +31,7 @@ class FileLog {
|
|||
* Path to save log files on.
|
||||
*
|
||||
* @var string
|
||||
**/
|
||||
*/
|
||||
var $_path = null;
|
||||
|
||||
/**
|
||||
|
@ -43,7 +43,7 @@ class FileLog {
|
|||
*
|
||||
* @param array $options Options for the FileLog, see above.
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function FileLog($options = array()) {
|
||||
$options += array('path' => LOGS);
|
||||
$this->_path = $options['path'];
|
||||
|
@ -55,7 +55,7 @@ class FileLog {
|
|||
* @param string $type The type of log you are making.
|
||||
* @param string $message The message you want to log.
|
||||
* @return boolean success of write.
|
||||
**/
|
||||
*/
|
||||
function write($type, $message) {
|
||||
$debugTypes = array('notice', 'info', 'debug');
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ class MagicDb extends Object {
|
|||
* Holds the parsed MagicDb for this class instance
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $db = array();
|
||||
|
||||
/**
|
||||
|
@ -45,7 +45,7 @@ class MagicDb extends Object {
|
|||
* @var $magicDb mixed Can be an array containing the db, a magic db as a string, or a filename pointing to a magic db in .db or magic.db.php format
|
||||
* @return boolean Returns false if reading / validation failed or true on success.
|
||||
* @author Felix
|
||||
**/
|
||||
*/
|
||||
function read($magicDb = null) {
|
||||
if (!is_string($magicDb) && !is_array($magicDb)) {
|
||||
return false;
|
||||
|
|
|
@ -63,7 +63,7 @@ class CakeSchema extends Object {
|
|||
* plugin name.
|
||||
*
|
||||
* @var string
|
||||
**/
|
||||
*/
|
||||
var $plugin = null;
|
||||
|
||||
/**
|
||||
|
@ -382,7 +382,7 @@ class CakeSchema extends Object {
|
|||
* @param string $table Table name you want returned.
|
||||
* @param array $fields Array of field information to generate the table with.
|
||||
* @return string Variable declaration for a schema class
|
||||
**/
|
||||
*/
|
||||
function generateTable($table, $fields) {
|
||||
$out = "\tvar \${$table} = array(\n";
|
||||
if (is_array($fields)) {
|
||||
|
@ -573,7 +573,7 @@ class CakeSchema extends Object {
|
|||
* @param array $new New indexes
|
||||
* @param array $old Old indexes
|
||||
* @return mixed False on failure, or an array of parameters to add & drop.
|
||||
**/
|
||||
*/
|
||||
function _compareTableParameters($new, $old) {
|
||||
if (!is_array($new) || !is_array($old)) {
|
||||
return false;
|
||||
|
|
|
@ -404,7 +404,7 @@ class DataSource extends Object {
|
|||
* before establishing a connection.
|
||||
*
|
||||
* @return boolean Whether or not the Datasources conditions for use are met.
|
||||
**/
|
||||
*/
|
||||
function enabled() {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ class DboAdodb extends DboSource {
|
|||
* Check that AdoDB is available.
|
||||
*
|
||||
* @return boolean
|
||||
**/
|
||||
*/
|
||||
function enabled() {
|
||||
return function_exists('NewADOConnection');
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ class DboDb2 extends DboSource {
|
|||
* Check that the DB2 extension is installed/loaded
|
||||
*
|
||||
* @return boolean
|
||||
**/
|
||||
*/
|
||||
function enabled() {
|
||||
return extension_loaded('ibm_db2');
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ class DboFirebird extends DboSource {
|
|||
* Firebird Transaction commands.
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $_commands = array(
|
||||
'begin' => 'SET TRANSACTION',
|
||||
'commit' => 'COMMIT',
|
||||
|
@ -143,7 +143,7 @@ class DboFirebird extends DboSource {
|
|||
* Check that the interbase extension is loaded
|
||||
*
|
||||
* @return boolean
|
||||
**/
|
||||
*/
|
||||
function enabled() {
|
||||
return extension_loaded('interbase');
|
||||
}
|
||||
|
|
|
@ -162,7 +162,7 @@ class DboMssql extends DboSource {
|
|||
* Check that MsSQL is installed/loaded
|
||||
*
|
||||
* @return boolean
|
||||
**/
|
||||
*/
|
||||
function enabled() {
|
||||
return extension_loaded('mssql');
|
||||
}
|
||||
|
|
|
@ -352,7 +352,7 @@ class DboMysqlBase extends DboSource {
|
|||
* @param array $parameters Parameters to add & drop.
|
||||
* @return array Array of table property alteration statementes.
|
||||
* @todo Implement this method.
|
||||
**/
|
||||
*/
|
||||
function _alterTableParameters($table, $parameters) {
|
||||
if (isset($parameters['change'])) {
|
||||
return $this->buildTableParameters($parameters['change']);
|
||||
|
@ -530,7 +530,7 @@ class DboMysql extends DboMysqlBase {
|
|||
* Check whether the MySQL extension is installed/loaded
|
||||
*
|
||||
* @return boolean
|
||||
**/
|
||||
*/
|
||||
function enabled() {
|
||||
return extension_loaded('mysql');
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ class DboMysqli extends DboMysqlBase {
|
|||
* Check that MySQLi is installed/enabled
|
||||
*
|
||||
* @return boolean
|
||||
**/
|
||||
*/
|
||||
function enabled() {
|
||||
return extension_loaded('mysqli');
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ class DboOdbc extends DboSource {
|
|||
* Check if the ODBC extension is installed/loaded
|
||||
*
|
||||
* @return boolean
|
||||
**/
|
||||
*/
|
||||
function enabled() {
|
||||
return extension_loaded('odbc');
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ class DboPostgres extends DboSource {
|
|||
* Check if PostgreSQL is enabled/loaded
|
||||
*
|
||||
* @return boolean
|
||||
**/
|
||||
*/
|
||||
function enabled() {
|
||||
return extension_loaded('pgsql');
|
||||
}
|
||||
|
|
|
@ -141,7 +141,7 @@ class DboSqlite extends DboSource {
|
|||
* Check that SQLite is enabled/installed
|
||||
*
|
||||
* @return boolean
|
||||
**/
|
||||
*/
|
||||
function enabled() {
|
||||
return extension_loaded('sqlite');
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ class DboSybase extends DboSource {
|
|||
* Check that one of the sybase extensions is installed
|
||||
*
|
||||
* @return boolean
|
||||
**/
|
||||
*/
|
||||
function enabled() {
|
||||
return extension_loaded('sybase') || extension_loaded('sybase_ct');
|
||||
}
|
||||
|
|
|
@ -495,7 +495,7 @@ class DboSource extends DataSource {
|
|||
*
|
||||
* @param boolean $sorted Get the queries sorted by time taken, defaults to false.
|
||||
* @return array Array of queries run as an array
|
||||
**/
|
||||
*/
|
||||
function getLog($sorted = false) {
|
||||
if ($sorted) {
|
||||
$log = sortByKey($this->_queriesLog, 'took', 'desc', SORT_NUMERIC);
|
||||
|
@ -967,7 +967,7 @@ class DboSource extends DataSource {
|
|||
* @param object $model Model being merged onto
|
||||
* @param object $linkModel Model being merged
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function __mergeHasMany(&$resultSet, $merge, $association, &$model, &$linkModel) {
|
||||
foreach ($resultSet as $i => $value) {
|
||||
$count = 0;
|
||||
|
@ -2483,7 +2483,7 @@ class DboSource extends DataSource {
|
|||
* @param array $columnData The array of column data.
|
||||
* @param string $position The position type to use. 'beforeDefault' or 'afterDefault' are common
|
||||
* @return string a built column with the field parameters added.
|
||||
**/
|
||||
*/
|
||||
function _buildFieldParameters($columnString, $columnData, $position) {
|
||||
foreach ($this->fieldParameters as $paramName => $value) {
|
||||
if (isset($columnData[$paramName]) && $value['position'] == $position) {
|
||||
|
|
|
@ -161,7 +161,7 @@ class Router {
|
|||
* Builds __prefixes
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function Router() {
|
||||
$this->__setPrefixes();
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ class Router {
|
|||
* @return void
|
||||
* @access private
|
||||
* @todo Remove support for Routing.admin in future versions.
|
||||
**/
|
||||
*/
|
||||
function __setPrefixes() {
|
||||
$routing = Configure::read('Routing');
|
||||
if (!empty($routing['admin'])) {
|
||||
|
|
|
@ -225,7 +225,7 @@ class Helper extends Overloadable {
|
|||
*
|
||||
* @param string $path The file path to timestamp, the path must be inside WWW_ROOT
|
||||
* @return string Path with a timestamp added, or not.
|
||||
**/
|
||||
*/
|
||||
function assetTimestamp($path) {
|
||||
$timestampEnabled = (
|
||||
(Configure::read('Asset.timestamp') === true && Configure::read() > 0) ||
|
||||
|
|
|
@ -143,14 +143,14 @@ class HtmlHelper extends AppHelper {
|
|||
*
|
||||
* @var array
|
||||
* @access private
|
||||
**/
|
||||
*/
|
||||
var $__includedScripts = array();
|
||||
/**
|
||||
* Options for the currently opened script block buffer if any.
|
||||
*
|
||||
* @var array
|
||||
* @access protected
|
||||
**/
|
||||
*/
|
||||
var $_scriptBlockOptions = array();
|
||||
/**
|
||||
* Document type definitions
|
||||
|
@ -436,7 +436,7 @@ class HtmlHelper extends AppHelper {
|
|||
* @param mixed $options Array of options, and html attributes see above. If boolean sets $options['inline'] = value
|
||||
* @return mixed String of <script /> tags or null if $inline is false or if $once is true and the file has been
|
||||
* included before.
|
||||
**/
|
||||
*/
|
||||
function script($url, $options = array()) {
|
||||
if (is_bool($options)) {
|
||||
list($inline, $options) = array($options, array());
|
||||
|
@ -492,7 +492,7 @@ class HtmlHelper extends AppHelper {
|
|||
* @param string $script The script to wrap
|
||||
* @param array $options The options to use.
|
||||
* @return mixed string or null depending on the value of `$options['inline']`
|
||||
**/
|
||||
*/
|
||||
function scriptBlock($script, $options = array()) {
|
||||
$options += array('safe' => true, 'inline' => true);
|
||||
if ($options['safe']) {
|
||||
|
@ -521,7 +521,7 @@ class HtmlHelper extends AppHelper {
|
|||
*
|
||||
* @param array $options Options for the code block.
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function scriptStart($options = array()) {
|
||||
$options += array('safe' => true, 'inline' => true);
|
||||
$this->_scriptBlockOptions = $options;
|
||||
|
@ -534,7 +534,7 @@ class HtmlHelper extends AppHelper {
|
|||
* used when the scriptBlock was started
|
||||
*
|
||||
* @return mixed depending on the settings of scriptStart() either a script tag or null
|
||||
**/
|
||||
*/
|
||||
function scriptEnd() {
|
||||
$buffer = ob_get_clean();
|
||||
$options = $this->_scriptBlockOptions;
|
||||
|
|
|
@ -319,7 +319,7 @@ class JavascriptHelper extends AppHelper {
|
|||
* Encode a string into JSON. Converts and escapes necessary characters.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function _utf8ToHex($string) {
|
||||
$length = strlen($string);
|
||||
$return = '';
|
||||
|
|
|
@ -27,7 +27,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
* Option mappings for jQuery
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $_optionMap = array(
|
||||
'request' => array(
|
||||
'type' => 'dataType',
|
||||
|
@ -55,7 +55,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
* callback arguments lists
|
||||
*
|
||||
* @var string
|
||||
**/
|
||||
*/
|
||||
var $_callbackArguments = array(
|
||||
'slider' => array(
|
||||
'start' => 'event, ui',
|
||||
|
@ -103,7 +103,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
* when jQuery is put into noConflict() mode.
|
||||
*
|
||||
* @var string
|
||||
**/
|
||||
*/
|
||||
var $jQueryObject = '$';
|
||||
|
||||
/**
|
||||
|
@ -116,7 +116,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
* @param string $callbacks Array of callback / special options.
|
||||
* @access public
|
||||
* @return string
|
||||
**/
|
||||
*/
|
||||
function _methodTemplate($method, $template, $options, $extraSafeKeys = array()) {
|
||||
$options = $this->_mapOptions($method, $options);
|
||||
$options = $this->_prepareCallbacks($method, $options);
|
||||
|
@ -133,7 +133,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
*
|
||||
* @param string $selector The selector that is targeted
|
||||
* @return object instance of $this. Allows chained methods.
|
||||
**/
|
||||
*/
|
||||
function get($selector) {
|
||||
if ($selector == 'window' || $selector == 'document') {
|
||||
$this->selection = $this->jQueryObject . '(' . $selector .')';
|
||||
|
@ -155,7 +155,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
* @param string $callback The Javascript function you wish to trigger or the function literal
|
||||
* @param array $options Options for the event.
|
||||
* @return string completed event handler
|
||||
**/
|
||||
*/
|
||||
function event($type, $callback, $options = array()) {
|
||||
$defaults = array('wrap' => true, 'stop' => true);
|
||||
$options = array_merge($defaults, $options);
|
||||
|
@ -175,7 +175,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
*
|
||||
* @param string $functionBody The code to run on domReady
|
||||
* @return string completed domReady method
|
||||
**/
|
||||
*/
|
||||
function domReady($functionBody) {
|
||||
$this->get('document');
|
||||
return $this->event('ready', $functionBody, array('stop' => false));
|
||||
|
@ -187,7 +187,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
* @param string $method The method you want to apply to the selection
|
||||
* @param string $callback The function body you wish to apply during the iteration.
|
||||
* @return string completed iteration
|
||||
**/
|
||||
*/
|
||||
function each($callback) {
|
||||
return $this->selection . '.each(function () {' . $callback . '});';
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
* @param array $options Array of options for the effect.
|
||||
* @return string completed string with effect.
|
||||
* @see JsBaseEngineHelper::effect()
|
||||
**/
|
||||
*/
|
||||
function effect($name, $options = array()) {
|
||||
$speed = null;
|
||||
if (isset($options['speed']) && in_array($options['speed'], array('fast', 'slow'))) {
|
||||
|
@ -230,7 +230,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
* @param mixed $url
|
||||
* @param array $options
|
||||
* @return string The completed ajax call.
|
||||
**/
|
||||
*/
|
||||
function request($url, $options = array()) {
|
||||
$url = $this->url($url);
|
||||
$options = $this->_mapOptions('request', $options);
|
||||
|
@ -266,7 +266,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
* @param array $options Array of options for the sortable.
|
||||
* @return string Completed sortable script.
|
||||
* @see JsHelper::sortable() for options list.
|
||||
**/
|
||||
*/
|
||||
function sortable($options = array()) {
|
||||
$template = '%s.sortable({%s});';
|
||||
return $this->_methodTemplate('sortable', $template, $options);
|
||||
|
@ -280,7 +280,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
* @param array $options Array of options for the draggable element.
|
||||
* @return string Completed Draggable script.
|
||||
* @see JsHelper::drag() for options list.
|
||||
**/
|
||||
*/
|
||||
function drag($options = array()) {
|
||||
$template = '%s.draggable({%s});';
|
||||
return $this->_methodTemplate('drag', $template, $options);
|
||||
|
@ -294,7 +294,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
* @param array $options Array of options for the droppable element.
|
||||
* @return string Completed Droppable script.
|
||||
* @see JsHelper::drop() for options list.
|
||||
**/
|
||||
*/
|
||||
function drop($options = array()) {
|
||||
$template = '%s.droppable({%s});';
|
||||
return $this->_methodTemplate('drop', $template, $options);
|
||||
|
@ -308,7 +308,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
* @param array $options Array of options for the droppable element.
|
||||
* @return string Completed Slider script.
|
||||
* @see JsHelper::slider() for options list.
|
||||
**/
|
||||
*/
|
||||
function slider($options = array()) {
|
||||
$callbacks = array('start', 'change', 'slide', 'stop');
|
||||
$template = '%s.slider({%s});';
|
||||
|
@ -322,7 +322,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
|
|||
* @param array $options Options for the serialization
|
||||
* @return string completed form serialization script
|
||||
* @see JsHelper::serializeForm() for option list.
|
||||
**/
|
||||
*/
|
||||
function serializeForm($options = array()) {
|
||||
$options = array_merge(array('isForm' => false, 'inline' => false), $options);
|
||||
$selector = $this->selection;
|
||||
|
|
|
@ -26,20 +26,20 @@
|
|||
*
|
||||
* @package cake
|
||||
* @subpackage cake.cake.libs.view.helpers
|
||||
**/
|
||||
*/
|
||||
class JsHelper extends AppHelper {
|
||||
/**
|
||||
* Whether or not you want scripts to be buffered or output.
|
||||
*
|
||||
* @var boolean
|
||||
**/
|
||||
*/
|
||||
var $bufferScripts = true;
|
||||
|
||||
/**
|
||||
* helpers
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $helpers = array('Html', 'Form');
|
||||
|
||||
/**
|
||||
|
@ -47,14 +47,14 @@ class JsHelper extends AppHelper {
|
|||
*
|
||||
* @var array
|
||||
* @see JsHelper::set()
|
||||
**/
|
||||
*/
|
||||
var $__jsVars = array();
|
||||
|
||||
/**
|
||||
* Scripts that are queued for output
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $__bufferedScripts = array();
|
||||
|
||||
/**
|
||||
|
@ -62,14 +62,14 @@ class JsHelper extends AppHelper {
|
|||
*
|
||||
* @var string
|
||||
* @access private
|
||||
**/
|
||||
*/
|
||||
var $__engineName;
|
||||
|
||||
/**
|
||||
* The javascript variable created by set() variables.
|
||||
*
|
||||
* @var string
|
||||
**/
|
||||
*/
|
||||
var $setVariable = APP_DIR;
|
||||
|
||||
/**
|
||||
|
@ -78,7 +78,7 @@ class JsHelper extends AppHelper {
|
|||
* @param array $settings Settings array contains name of engine helper.
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function __construct($settings = array()) {
|
||||
$className = 'Jquery';
|
||||
if (is_array($settings) && isset($settings[0])) {
|
||||
|
@ -115,7 +115,7 @@ class JsHelper extends AppHelper {
|
|||
* @param array $params Parameters for the method being called.
|
||||
* @access public
|
||||
* @return mixed Depends on the return of the dispatched method, or it could be an instance of the EngineHelper
|
||||
**/
|
||||
*/
|
||||
function call__($method, $params) {
|
||||
if (isset($this->{$this->__engineName}) && method_exists($this->{$this->__engineName}, $method)) {
|
||||
$buffer = false;
|
||||
|
@ -158,7 +158,7 @@ class JsHelper extends AppHelper {
|
|||
* @param array $options Options to use for encoding JSON. See JsBaseEngineHelper::object() for more details.
|
||||
* @return string encoded JSON
|
||||
* @deprecated Remove when support for PHP4 and Object::object are removed.
|
||||
**/
|
||||
*/
|
||||
function object($data = array(), $options = array()) {
|
||||
return $this->{$this->__engineName}->object($data, $options);
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ class JsHelper extends AppHelper {
|
|||
*
|
||||
* @param array $options options for the code block
|
||||
* @return string completed javascript tag.
|
||||
**/
|
||||
*/
|
||||
function writeBuffer($options = array()) {
|
||||
$defaults = array('onDomReady' => true, 'inline' => true, 'cache' => false, 'clear' => true, 'safe' => true);
|
||||
$options = array_merge($defaults, $options);
|
||||
|
@ -208,7 +208,7 @@ class JsHelper extends AppHelper {
|
|||
* Write a script to the cached scripts.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function buffer($script) {
|
||||
$this->__bufferedScripts[] = $script;
|
||||
}
|
||||
|
@ -218,7 +218,7 @@ class JsHelper extends AppHelper {
|
|||
*
|
||||
* @param boolean $clear Whether or not to clear the script caches (default true)
|
||||
* @return array Array of scripts added to the request.
|
||||
**/
|
||||
*/
|
||||
function getBuffer($clear = true) {
|
||||
$this->_createVars();
|
||||
$scripts = $this->__bufferedScripts;
|
||||
|
@ -233,7 +233,7 @@ class JsHelper extends AppHelper {
|
|||
* Generates the object string for variables passed to javascript.
|
||||
*
|
||||
* @return string
|
||||
**/
|
||||
*/
|
||||
function _createVars() {
|
||||
if (!empty($this->__jsVars)) {
|
||||
$setVar = (strpos($this->setVariable, '.')) ? $this->setVariable : 'var ' . $this->setVariable;
|
||||
|
@ -258,7 +258,7 @@ class JsHelper extends AppHelper {
|
|||
* @param mixed $url Mixed either a string URL or an cake url array.
|
||||
* @param array $options Options for both the HTML element and Js::request()
|
||||
* @return string Completed link. If buffering is disabled a script tag will be returned as well.
|
||||
**/
|
||||
*/
|
||||
function link($title, $url = null, $options = array()) {
|
||||
if (!isset($options['id'])) {
|
||||
$options['id'] = 'link-' . intval(mt_rand());
|
||||
|
@ -293,7 +293,7 @@ class JsHelper extends AppHelper {
|
|||
* @param mixed $one
|
||||
* @param mixed $two
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function set($one, $two = null) {
|
||||
$data = null;
|
||||
if (is_array($one)) {
|
||||
|
@ -322,7 +322,7 @@ class JsHelper extends AppHelper {
|
|||
* @param string $title The display text of the submit button.
|
||||
* @param array $options Array of options to use.
|
||||
* @return string Completed submit button.
|
||||
**/
|
||||
*/
|
||||
function submit($caption = null, $options = array()) {
|
||||
if (!isset($options['id'])) {
|
||||
$options['id'] = 'submit-' . intval(mt_rand());
|
||||
|
@ -364,7 +364,7 @@ class JsHelper extends AppHelper {
|
|||
* @param array $options Options to filter.
|
||||
* @param array $additional Array of additional keys to extract and include in the return options array.
|
||||
* @return array Array of options for non-js.
|
||||
**/
|
||||
*/
|
||||
function _getHtmlOptions(&$options, $additional = array()) {
|
||||
$htmlKeys = array_merge(array('class', 'id', 'escape', 'onblur', 'onfocus', 'rel', 'title'), $additional);
|
||||
$htmlOptions = array();
|
||||
|
@ -388,14 +388,14 @@ class JsHelper extends AppHelper {
|
|||
* Abstract Base Class for All JsEngines to extend. Provides generic methods.
|
||||
*
|
||||
* @package cake.view.helpers
|
||||
**/
|
||||
*/
|
||||
class JsBaseEngineHelper extends AppHelper {
|
||||
/**
|
||||
* Determines whether native JSON extension is used for encoding. Set by object constructor.
|
||||
*
|
||||
* @var boolean
|
||||
* @access public
|
||||
**/
|
||||
*/
|
||||
var $useNative = false;
|
||||
|
||||
/**
|
||||
|
@ -403,7 +403,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
*
|
||||
* @var string
|
||||
* @access public
|
||||
**/
|
||||
*/
|
||||
var $selection;
|
||||
|
||||
/**
|
||||
|
@ -412,7 +412,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* for end user use though.
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $_optionMap = array();
|
||||
|
||||
/**
|
||||
|
@ -420,21 +420,21 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* This allows specific 'end point' methods to be automatically buffered by the JsHelper.
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $bufferedMethods = array('event', 'sortable', 'drag', 'drop', 'slider');
|
||||
|
||||
/**
|
||||
* Contains a list of callback names -> default arguments.
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $_callbackArguments = array();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function __construct() {
|
||||
$this->useNative = function_exists('json_encode');
|
||||
}
|
||||
|
@ -445,7 +445,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* @param string $message Message you want to alter.
|
||||
* @access public
|
||||
* @return string completed alert()
|
||||
**/
|
||||
*/
|
||||
function alert($message) {
|
||||
return 'alert("' . $this->escape($message) . '");';
|
||||
}
|
||||
|
@ -456,7 +456,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* @param mixed $url
|
||||
* @param array $options
|
||||
* @return string completed redirect in javascript
|
||||
**/
|
||||
*/
|
||||
function redirect($url = null) {
|
||||
return 'window.location = "' . Router::url($url) . '";';
|
||||
}
|
||||
|
@ -467,7 +467,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* @param string $message Message you want confirmed.
|
||||
* @access public
|
||||
* @return string completed confirm()
|
||||
**/
|
||||
*/
|
||||
function confirm($message) {
|
||||
return 'confirm("' . $this->escape($message) . '");';
|
||||
}
|
||||
|
@ -479,7 +479,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* @param string $message Message to use in the confirm dialog.
|
||||
* @access public
|
||||
* @return string
|
||||
**/
|
||||
*/
|
||||
function confirmReturn($message) {
|
||||
$out = 'var _confirm = ' . $this->confirm($message);
|
||||
$out .= "if (!_confirm) {\n\treturn false;\n}";
|
||||
|
@ -493,7 +493,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* @param string $default Default message
|
||||
* @access public
|
||||
* @return string completed prompt()
|
||||
**/
|
||||
*/
|
||||
function prompt($message, $default = '') {
|
||||
return 'prompt("' . $this->escape($message) . '", "' . $this->escape($default) . '");';
|
||||
}
|
||||
|
@ -511,7 +511,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* @param array $options Set of options, see above.
|
||||
* @return string A JSON code block
|
||||
* @access public
|
||||
**/
|
||||
*/
|
||||
function object($data = array(), $options = array()) {
|
||||
$defaultOptions = array(
|
||||
'prefix' => '', 'postfix' => '',
|
||||
|
@ -571,7 +571,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* @param boolean $quoteStrings If false, leaves string values unquoted
|
||||
* @return string a JavaScript-safe/JSON representation of $val
|
||||
* @access public
|
||||
**/
|
||||
*/
|
||||
function value($val, $quoteString = true) {
|
||||
switch (true) {
|
||||
case (is_array($val) || is_object($val)):
|
||||
|
@ -611,7 +611,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* @param string $script String that needs to get escaped.
|
||||
* @return string Escaped string.
|
||||
* @access public
|
||||
**/
|
||||
*/
|
||||
function escape($string) {
|
||||
App::import('Core', 'Multibyte');
|
||||
return $this->_utf8ToHex($string);
|
||||
|
@ -621,7 +621,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* Encode a string into JSON. Converts and escapes necessary characters.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function _utf8ToHex($string) {
|
||||
$length = strlen($string);
|
||||
$return = '';
|
||||
|
@ -716,7 +716,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
*
|
||||
* @param string $selector The selector that is targeted
|
||||
* @return object instance of $this. Allows chained methods.
|
||||
**/
|
||||
*/
|
||||
function get($selector) {
|
||||
trigger_error(sprintf(__('%s does not have get() implemented', true), get_class($this)), E_USER_WARNING);
|
||||
return $this;
|
||||
|
@ -734,7 +734,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* @param string $callback The Javascript function you wish to trigger or the function literal
|
||||
* @param array $options Options for the event.
|
||||
* @return string completed event handler
|
||||
**/
|
||||
*/
|
||||
function event($type, $callback, $options = array()) {
|
||||
trigger_error(sprintf(__('%s does not have event() implemented', true), get_class($this)), E_USER_WARNING);
|
||||
}
|
||||
|
@ -744,7 +744,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
*
|
||||
* @param string $functionBody The code to run on domReady
|
||||
* @return string completed domReady method
|
||||
**/
|
||||
*/
|
||||
function domReady($functionBody) {
|
||||
trigger_error(sprintf(__('%s does not have domReady() implemented', true), get_class($this)), E_USER_WARNING);
|
||||
}
|
||||
|
@ -754,7 +754,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
*
|
||||
* @param string $callback The function body you wish to apply during the iteration.
|
||||
* @return string completed iteration
|
||||
**/
|
||||
*/
|
||||
function each($callback) {
|
||||
trigger_error(sprintf(__('%s does not have each() implemented', true), get_class($this)), E_USER_WARNING);
|
||||
}
|
||||
|
@ -781,7 +781,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* @param string $name The name of the effect to trigger.
|
||||
* @param array $options Array of options for the effect.
|
||||
* @return string completed string with effect.
|
||||
**/
|
||||
*/
|
||||
function effect($name, $options) {
|
||||
trigger_error(sprintf(__('%s does not have effect() implemented', true), get_class($this)), E_USER_WARNING);
|
||||
}
|
||||
|
@ -810,7 +810,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* @param mixed $url Array or String URL to target with the request.
|
||||
* @param array $options Array of options. See above for cross library supported options
|
||||
* @return string XHR request.
|
||||
**/
|
||||
*/
|
||||
function request($url, $options = array()) {
|
||||
trigger_error(sprintf(__('%s does not have request() implemented', true), get_class($this)), E_USER_WARNING);
|
||||
}
|
||||
|
@ -833,7 +833,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
*
|
||||
* @param array $options Options array see above.
|
||||
* @return string Completed drag script
|
||||
**/
|
||||
*/
|
||||
function drag($options = array()) {
|
||||
trigger_error(sprintf(__('%s does not have drag() implemented', true), get_class($this)), E_USER_WARNING);
|
||||
}
|
||||
|
@ -854,7 +854,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* - `leave` - Event fired when a drag is removed from a drop zone without being dropped.
|
||||
*
|
||||
* @return string Completed drop script
|
||||
**/
|
||||
*/
|
||||
function drop($options = array()) {
|
||||
trigger_error(sprintf(__('%s does not have drop() implemented', true), get_class($this)), E_USER_WARNING);
|
||||
}
|
||||
|
@ -878,7 +878,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
*
|
||||
* @param array $options Array of options for the sortable. See above.
|
||||
* @return string Completed sortable script.
|
||||
**/
|
||||
*/
|
||||
function sortable() {
|
||||
trigger_error(sprintf(__('%s does not have sortable() implemented', true), get_class($this)), E_USER_WARNING);
|
||||
}
|
||||
|
@ -901,7 +901,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* - `complete` - Fired when the user stops sliding the handle
|
||||
*
|
||||
* @return string Completed slider script
|
||||
**/
|
||||
*/
|
||||
function slider() {
|
||||
trigger_error(sprintf(__('%s does not have slider() implemented', true), get_class($this)), E_USER_WARNING);
|
||||
}
|
||||
|
@ -919,7 +919,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
*
|
||||
* @param array $options options for serialization generation.
|
||||
* @return string completed form serialization script
|
||||
**/
|
||||
*/
|
||||
function serializeForm() {
|
||||
trigger_error(
|
||||
sprintf(__('%s does not have serializeForm() implemented', true), get_class($this)), E_USER_WARNING
|
||||
|
@ -935,7 +935,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* @param array $safeKeys Keys that should not be escaped.
|
||||
* @return string
|
||||
* @access protected
|
||||
**/
|
||||
*/
|
||||
function _parseOptions($options, $safeKeys = array()) {
|
||||
$out = array();
|
||||
$safeKeys = array_flip($safeKeys);
|
||||
|
@ -957,7 +957,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* @param array $options Array of options to map.
|
||||
* @return array Array of mapped options.
|
||||
* @access protected
|
||||
**/
|
||||
*/
|
||||
function _mapOptions($method, $options) {
|
||||
if (!isset($this->_optionMap[$method])) {
|
||||
return $options;
|
||||
|
@ -980,7 +980,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* @param string $callbacks Additional Keys that contain callbacks
|
||||
* @access protected
|
||||
* @return array Array of options with callbacks added.
|
||||
**/
|
||||
*/
|
||||
function _prepareCallbacks($method, $options, $callbacks = array()) {
|
||||
$wrapCallbacks = true;
|
||||
if (isset($options['wrapCallbacks'])) {
|
||||
|
@ -1016,7 +1016,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* @param string $method Name of method processing options for.
|
||||
* @param array $options Array of options to process.
|
||||
* @return string Parsed options string.
|
||||
**/
|
||||
*/
|
||||
function _processOptions($method, $options) {
|
||||
$options = $this->_mapOptions($method, $options);
|
||||
$options = $this->_prepareCallbacks($method, $options);
|
||||
|
@ -1030,7 +1030,7 @@ class JsBaseEngineHelper extends AppHelper {
|
|||
* @param array $parameters Array of parameters to convert to a query string
|
||||
* @return string Querystring fragment
|
||||
* @access protected
|
||||
**/
|
||||
*/
|
||||
function _toQuerystring($parameters) {
|
||||
$out = '';
|
||||
$keys = array_keys($parameters);
|
||||
|
|
|
@ -32,7 +32,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
* Option mappings for MooTools
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $_optionMap = array(
|
||||
'request' => array(
|
||||
'complete' => 'onComplete',
|
||||
|
@ -70,7 +70,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
* Contains a list of callback names -> default arguments.
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $_callbackArguments = array(
|
||||
'slider' => array(
|
||||
'onTick' => 'position',
|
||||
|
@ -116,7 +116,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
*
|
||||
* @param string $selector The selector that is targeted
|
||||
* @return object instance of $this. Allows chained methods.
|
||||
**/
|
||||
*/
|
||||
function get($selector) {
|
||||
$this->_multipleSelection = false;
|
||||
if ($selector == 'window' || $selector == 'document') {
|
||||
|
@ -144,7 +144,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
* @param string $callback The Javascript function you wish to trigger or the function literal
|
||||
* @param array $options Options for the event.
|
||||
* @return string completed event handler
|
||||
**/
|
||||
*/
|
||||
function event($type, $callback, $options = array()) {
|
||||
$defaults = array('wrap' => true, 'stop' => true);
|
||||
$options = array_merge($defaults, $options);
|
||||
|
@ -165,7 +165,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
*
|
||||
* @param string $functionBody The code to run on domReady
|
||||
* @return string completed domReady method
|
||||
**/
|
||||
*/
|
||||
function domReady($functionBody) {
|
||||
$this->selection = 'window';
|
||||
return $this->event('domready', $functionBody, array('stop' => false));
|
||||
|
@ -177,7 +177,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
* @param string $method The method you want to apply to the selection
|
||||
* @param string $callback The function body you wish to apply during the iteration.
|
||||
* @return string completed iteration
|
||||
**/
|
||||
*/
|
||||
function each($callback) {
|
||||
return $this->selection . '.each(function (item, index) {' . $callback . '});';
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
* @param array $options Array of options for the effect.
|
||||
* @return string completed string with effect.
|
||||
* @see JsBaseEngineHelper::effect()
|
||||
**/
|
||||
*/
|
||||
function effect($name, $options = array()) {
|
||||
$speed = null;
|
||||
if (isset($options['speed']) && in_array($options['speed'], array('fast', 'slow'))) {
|
||||
|
@ -231,7 +231,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
* @param mixed $url
|
||||
* @param array $options
|
||||
* @return string The completed ajax call.
|
||||
**/
|
||||
*/
|
||||
function request($url, $options = array()) {
|
||||
$url = $this->url($url);
|
||||
$options = $this->_mapOptions('request', $options);
|
||||
|
@ -270,7 +270,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
* @param array $options Array of options for the sortable.
|
||||
* @return string Completed sortable script.
|
||||
* @see JsHelper::sortable() for options list.
|
||||
**/
|
||||
*/
|
||||
function sortable($options = array()) {
|
||||
$options = $this->_processOptions('sortable', $options);
|
||||
return 'var jsSortable = new Sortables(' . $this->selection . ', {' . $options . '});';
|
||||
|
@ -284,7 +284,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
* @param array $options Array of options for the draggable.
|
||||
* @return string Completed draggable script.
|
||||
* @see JsHelper::drag() for options list.
|
||||
**/
|
||||
*/
|
||||
function drag($options = array()) {
|
||||
$options = $this->_processOptions('drag', $options);
|
||||
return $this->selection . '.makeDraggable({' . $options . '});';
|
||||
|
@ -303,7 +303,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
* @param array $options Array of options for the droppable.
|
||||
* @return string Completed droppable script.
|
||||
* @see JsHelper::drop() for options list.
|
||||
**/
|
||||
*/
|
||||
function drop($options = array()) {
|
||||
if (empty($options['drag'])) {
|
||||
trigger_error(
|
||||
|
@ -333,7 +333,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
* @param array $options Array of options for the slider.
|
||||
* @return string Completed slider script.
|
||||
* @see JsHelper::slider() for options list.
|
||||
**/
|
||||
*/
|
||||
function slider($options = array()) {
|
||||
$slider = $this->selection;
|
||||
$this->get($options['handle']);
|
||||
|
@ -358,7 +358,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
|||
* @param array $options Array of options.
|
||||
* @return string Completed serializeForm() snippet
|
||||
* @see JsHelper::serializeForm()
|
||||
**/
|
||||
*/
|
||||
function serializeForm($options = array()) {
|
||||
$options = array_merge(array('isForm' => false, 'inline' => false), $options);
|
||||
$selection = $this->selection;
|
||||
|
|
|
@ -36,7 +36,7 @@ class NumberHelper extends AppHelper {
|
|||
*
|
||||
* @var array
|
||||
* @access protected
|
||||
**/
|
||||
*/
|
||||
var $_currencies = array(
|
||||
'USD' => array(
|
||||
'before' => '$', 'after' => 'c', 'zero' => 0, 'places' => 2, 'thousands' => ',',
|
||||
|
@ -57,7 +57,7 @@ class NumberHelper extends AppHelper {
|
|||
*
|
||||
* @var array
|
||||
* @access protected
|
||||
**/
|
||||
*/
|
||||
var $_currencyDefaults = array(
|
||||
'before'=>'', 'after' => '', 'zero' => '0', 'places' => 2, 'thousands' => ',',
|
||||
'decimals' => '.','negative' => '()', 'escape' => true
|
||||
|
@ -222,7 +222,7 @@ class NumberHelper extends AppHelper {
|
|||
* @param string $formatName The format name to be used in the future.
|
||||
* @param array $options The array of options for this format.
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function addFormat($formatName, $options) {
|
||||
$this->_currencies[$formatName] = $options + $this->_currencyDefaults;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ class PaginatorHelper extends AppHelper {
|
|||
* The class used for 'Ajax' pagination links.
|
||||
*
|
||||
* @var string
|
||||
**/
|
||||
*/
|
||||
var $_ajaxHelperClass = 'Js';
|
||||
|
||||
/**
|
||||
|
@ -83,7 +83,7 @@ class PaginatorHelper extends AppHelper {
|
|||
* The chosen custom helper must implement a `link()` method.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function __construct($config = array()) {
|
||||
$ajaxProvider = isset($config['ajax']) ? $config['ajax'] : 'Js';
|
||||
$this->helpers[] = $ajaxProvider;
|
||||
|
|
|
@ -27,13 +27,13 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
* Is the current selection a multiple selection? or is it just a single element.
|
||||
*
|
||||
* @var boolean
|
||||
**/
|
||||
*/
|
||||
var $_multiple = false;
|
||||
/**
|
||||
* Option mappings for Prototype
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $_optionMap = array(
|
||||
'request' => array(
|
||||
'async' => 'asynchronous',
|
||||
|
@ -73,7 +73,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
* Contains a list of callback names -> default arguments.
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $_callbackArguments = array(
|
||||
'slider' => array(
|
||||
'onSlide' => 'value',
|
||||
|
@ -108,7 +108,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
*
|
||||
* @param string $selector The selector that is targeted
|
||||
* @return object instance of $this. Allows chained methods.
|
||||
**/
|
||||
*/
|
||||
function get($selector) {
|
||||
$this->_multiple = false;
|
||||
if ($selector == 'window' || $selector == 'document') {
|
||||
|
@ -135,7 +135,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
* @param string $callback The Javascript function you wish to trigger or the function literal
|
||||
* @param array $options Options for the event.
|
||||
* @return string completed event handler
|
||||
**/
|
||||
*/
|
||||
function event($type, $callback, $options = array()) {
|
||||
$defaults = array('wrap' => true, 'stop' => true);
|
||||
$options = array_merge($defaults, $options);
|
||||
|
@ -155,7 +155,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
*
|
||||
* @param string $functionBody The code to run on domReady
|
||||
* @return string completed domReady method
|
||||
**/
|
||||
*/
|
||||
function domReady($functionBody) {
|
||||
$this->selection = 'document';
|
||||
return $this->event('dom:loaded', $functionBody, array('stop' => false));
|
||||
|
@ -166,7 +166,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
* @param string $method The method you want to apply to the selection
|
||||
* @param string $callback The function body you wish to apply during the iteration.
|
||||
* @return string completed iteration
|
||||
**/
|
||||
*/
|
||||
function each($callback) {
|
||||
return $this->selection . '.each(function (item, index) {' . $callback . '});';
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
* @param array $options Array of options for the effect.
|
||||
* @return string completed string with effect.
|
||||
* @see JsBaseEngineHelper::effect()
|
||||
**/
|
||||
*/
|
||||
function effect($name, $options = array()) {
|
||||
$effect = '';
|
||||
$optionString = null;
|
||||
|
@ -220,7 +220,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
* @param mixed $url
|
||||
* @param array $options
|
||||
* @return string The completed ajax call.
|
||||
**/
|
||||
*/
|
||||
function request($url, $options = array()) {
|
||||
$url = '"'. $this->url($url) . '"';
|
||||
$options = $this->_mapOptions('request', $options);
|
||||
|
@ -255,7 +255,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
* @param array $options Array of options for the sortable.
|
||||
* @return string Completed sortable script.
|
||||
* @see JsHelper::sortable() for options list.
|
||||
**/
|
||||
*/
|
||||
function sortable($options = array()) {
|
||||
$options = $this->_processOptions('sortable', $options);
|
||||
if (!empty($options)) {
|
||||
|
@ -271,7 +271,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
* @param array $options Array of options for the draggable.
|
||||
* @return string Completed draggable script.
|
||||
* @see JsHelper::draggable() for options list.
|
||||
**/
|
||||
*/
|
||||
function drag($options = array()) {
|
||||
$options = $this->_processOptions('drag', $options);
|
||||
if (!empty($options)) {
|
||||
|
@ -290,7 +290,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
* @param array $options Array of options for the droppable.
|
||||
* @return string Completed droppable script.
|
||||
* @see JsHelper::droppable() for options list.
|
||||
**/
|
||||
*/
|
||||
function drop($options = array()) {
|
||||
$options = $this->_processOptions('drop', $options);
|
||||
if (!empty($options)) {
|
||||
|
@ -306,7 +306,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
* @param array $options Array of options for the slider.
|
||||
* @return string Completed slider script.
|
||||
* @see JsHelper::slider() for options list.
|
||||
**/
|
||||
*/
|
||||
function slider($options = array()) {
|
||||
$slider = $this->selection;
|
||||
$this->get($options['handle']);
|
||||
|
@ -330,7 +330,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
|
|||
* @param array $options Array of options.
|
||||
* @return string Completed serializeForm() snippet
|
||||
* @see JsHelper::serializeForm()
|
||||
**/
|
||||
*/
|
||||
function serializeForm($options = array()) {
|
||||
$options = array_merge(array('isForm' => false, 'inline' => false), $options);
|
||||
$selection = $this->selection;
|
||||
|
|
|
@ -34,7 +34,7 @@ class RssHelper extends XmlHelper {
|
|||
*
|
||||
* @var array
|
||||
* @access public
|
||||
**/
|
||||
*/
|
||||
var $helpers = array('Time');
|
||||
|
||||
/**
|
||||
|
|
|
@ -252,7 +252,7 @@ class View extends Object {
|
|||
* Holds View output.
|
||||
*
|
||||
* @var string
|
||||
**/
|
||||
*/
|
||||
var $output = false;
|
||||
|
||||
/**
|
||||
|
|
|
@ -33,8 +33,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* setUp method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function setUp() {
|
||||
App::build(array(
|
||||
|
@ -46,8 +46,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* tearDown method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function tearDown() {
|
||||
App::build();
|
||||
|
@ -58,7 +58,8 @@ class BasicsTest extends CakeTestCase {
|
|||
* test the array_diff_key compatibility function.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
* @access public
|
||||
*/
|
||||
function testArrayDiffKey() {
|
||||
$one = array('one' => 1, 'two' => 2, 'three' => 3);
|
||||
$two = array('one' => 'one', 'two' => 'two');
|
||||
|
@ -175,8 +176,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* test uses()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
* @deprecated
|
||||
*/
|
||||
function testUses() {
|
||||
|
@ -194,8 +195,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* Test h()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testH() {
|
||||
$string = '<foo>';
|
||||
|
@ -211,8 +212,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* Test a()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testA() {
|
||||
$result = a('this', 'that', 'bar');
|
||||
|
@ -222,8 +223,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* Test aa()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testAa() {
|
||||
$result = aa('a', 'b', 'c', 'd');
|
||||
|
@ -238,8 +239,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* Test am()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testAm() {
|
||||
$result = am(array('one', 'two'), 2, 3, 4);
|
||||
|
@ -254,8 +255,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* test cache()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testCache() {
|
||||
$_cacheDisable = Configure::read('Cache.disable');
|
||||
|
@ -290,8 +291,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* test clearCache()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testClearCache() {
|
||||
$cacheOff = Configure::read('Cache.disable');
|
||||
|
@ -338,8 +339,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* test __()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function test__() {
|
||||
Configure::write('Config.language', 'rule_1_po');
|
||||
|
@ -362,8 +363,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* test __n()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function test__n() {
|
||||
Configure::write('Config.language', 'rule_1_po');
|
||||
|
@ -390,8 +391,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* test __d()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function test__d() {
|
||||
Configure::write('Config.language', 'rule_1_po');
|
||||
|
@ -418,8 +419,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* test __dn()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function test__dn() {
|
||||
Configure::write('Config.language', 'rule_1_po');
|
||||
|
@ -450,8 +451,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* test __c()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function test__c() {
|
||||
Configure::write('Config.language', 'rule_1_po');
|
||||
|
@ -474,8 +475,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* test __dc()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function test__dc() {
|
||||
Configure::write('Config.language', 'rule_1_po');
|
||||
|
@ -506,8 +507,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* test __dcn()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function test__dcn() {
|
||||
Configure::write('Config.language', 'rule_1_po');
|
||||
|
@ -534,8 +535,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* test LogError()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testLogError() {
|
||||
@unlink(LOGS . 'error.log');
|
||||
|
@ -552,8 +553,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* test fileExistsInPath()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testFileExistsInPath() {
|
||||
$this->skipUnless(function_exists('ini_set'), '%s ini_set function not available');
|
||||
|
@ -597,8 +598,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* test convertSlash()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testConvertSlash() {
|
||||
$result = convertSlash('\path\to\location\\');
|
||||
|
@ -613,8 +614,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* test debug()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testDebug() {
|
||||
ob_start();
|
||||
|
@ -637,8 +638,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* test pr()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testPr() {
|
||||
ob_start();
|
||||
|
@ -657,8 +658,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* test params()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testParams() {
|
||||
$this->assertNull(params('weekend'));
|
||||
|
@ -675,8 +676,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* test stripslashes_deep()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testStripslashesDeep() {
|
||||
$this->skipIf(ini_get('magic_quotes_sybase') === '1', '%s magic_quotes_sybase is on');
|
||||
|
@ -713,8 +714,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* test stripslashes_deep() with magic_quotes_sybase on
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testStripslashesDeepSybase() {
|
||||
$this->skipUnless(ini_get('magic_quotes_sybase') === '1', '%s magic_quotes_sybase is off');
|
||||
|
@ -747,8 +748,8 @@ class BasicsTest extends CakeTestCase {
|
|||
/**
|
||||
* test ife()
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testIfe() {
|
||||
$this->assertEqual(ife(true, 'a', 'b'), 'a');
|
||||
|
|
|
@ -41,8 +41,8 @@ class TestDispatcher extends Dispatcher {
|
|||
* @param mixed $controller
|
||||
* @param mixed $params
|
||||
* @param mixed $missingAction
|
||||
* @access protected
|
||||
* @return void
|
||||
* @access protected
|
||||
*/
|
||||
function _invoke(&$controller, $params) {
|
||||
restore_error_handler();
|
||||
|
@ -60,8 +60,8 @@ class TestDispatcher extends Dispatcher {
|
|||
* cakeError method
|
||||
*
|
||||
* @param mixed $filename
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function cakeError($filename, $params) {
|
||||
return array($filename, $params);
|
||||
|
@ -70,8 +70,8 @@ class TestDispatcher extends Dispatcher {
|
|||
/**
|
||||
* _stop method
|
||||
*
|
||||
* @access protected
|
||||
* @return void
|
||||
* @access protected
|
||||
*/
|
||||
function _stop() {
|
||||
return true;
|
||||
|
@ -114,8 +114,8 @@ class MyPluginController extends MyPluginAppController {
|
|||
/**
|
||||
* index method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function index() {
|
||||
return true;
|
||||
|
@ -124,8 +124,8 @@ class MyPluginController extends MyPluginAppController {
|
|||
/**
|
||||
* add method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function add() {
|
||||
return true;
|
||||
|
@ -135,8 +135,8 @@ class MyPluginController extends MyPluginAppController {
|
|||
* admin_add method
|
||||
*
|
||||
* @param mixed $id
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function admin_add($id = null) {
|
||||
return $id;
|
||||
|
@ -171,8 +171,8 @@ class SomePagesController extends AppController {
|
|||
* display method
|
||||
*
|
||||
* @param mixed $page
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function display($page = null) {
|
||||
return $page;
|
||||
|
@ -181,8 +181,8 @@ class SomePagesController extends AppController {
|
|||
/**
|
||||
* index method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function index() {
|
||||
return true;
|
||||
|
@ -191,8 +191,8 @@ class SomePagesController extends AppController {
|
|||
/**
|
||||
* protected method
|
||||
*
|
||||
* @access protected
|
||||
* @return void
|
||||
* @access protected
|
||||
*/
|
||||
function _protected() {
|
||||
return true;
|
||||
|
@ -201,8 +201,8 @@ class SomePagesController extends AppController {
|
|||
/**
|
||||
* redirect method overriding
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function redirect() {
|
||||
echo 'this should not be accessible';
|
||||
|
@ -237,8 +237,8 @@ class OtherPagesController extends MyPluginAppController {
|
|||
* display method
|
||||
*
|
||||
* @param mixed $page
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function display($page = null) {
|
||||
return $page;
|
||||
|
@ -247,8 +247,8 @@ class OtherPagesController extends MyPluginAppController {
|
|||
/**
|
||||
* index method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function index() {
|
||||
return true;
|
||||
|
@ -282,8 +282,8 @@ class TestDispatchPagesController extends AppController {
|
|||
/**
|
||||
* admin_index method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function admin_index() {
|
||||
return true;
|
||||
|
@ -292,8 +292,8 @@ class TestDispatchPagesController extends AppController {
|
|||
/**
|
||||
* camelCased method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function camelCased() {
|
||||
return true;
|
||||
|
@ -336,8 +336,8 @@ class ArticlesTestController extends ArticlesTestAppController {
|
|||
/**
|
||||
* admin_index method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function admin_index() {
|
||||
return true;
|
||||
|
@ -379,8 +379,8 @@ class SomePostsController extends AppController {
|
|||
/**
|
||||
* beforeFilter method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function beforeFilter() {
|
||||
if ($this->params['action'] == 'index') {
|
||||
|
@ -394,8 +394,8 @@ class SomePostsController extends AppController {
|
|||
/**
|
||||
* index method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function index() {
|
||||
return true;
|
||||
|
@ -404,8 +404,8 @@ class SomePostsController extends AppController {
|
|||
/**
|
||||
* change method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function change() {
|
||||
return true;
|
||||
|
@ -466,8 +466,8 @@ class TestCachedPagesController extends AppController {
|
|||
/**
|
||||
* index method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function index() {
|
||||
$this->render();
|
||||
|
@ -476,8 +476,8 @@ class TestCachedPagesController extends AppController {
|
|||
/**
|
||||
* test_nocache_tags method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function test_nocache_tags() {
|
||||
$this->render();
|
||||
|
@ -486,8 +486,8 @@ class TestCachedPagesController extends AppController {
|
|||
/**
|
||||
* view method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function view($id = null) {
|
||||
$this->render('index');
|
||||
|
@ -521,8 +521,8 @@ class TimesheetsController extends AppController {
|
|||
/**
|
||||
* index method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function index() {
|
||||
return true;
|
||||
|
@ -540,8 +540,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* setUp method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function startTest() {
|
||||
$this->_get = $_GET;
|
||||
|
@ -567,8 +567,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* tearDown method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function endTest() {
|
||||
$_GET = $this->_get;
|
||||
|
@ -584,8 +584,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testParseParamsWithoutZerosAndEmptyPost method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testParseParamsWithoutZerosAndEmptyPost() {
|
||||
$Dispatcher =& new Dispatcher();
|
||||
|
@ -601,8 +601,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testParseParamsReturnsPostedData method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testParseParamsReturnsPostedData() {
|
||||
$_POST['testdata'] = "My Posted Content";
|
||||
|
@ -615,8 +615,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testParseParamsWithSingleZero method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testParseParamsWithSingleZero() {
|
||||
$Dispatcher =& new Dispatcher();
|
||||
|
@ -631,8 +631,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testParseParamsWithManySingleZeros method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testParseParamsWithManySingleZeros() {
|
||||
$Dispatcher =& new Dispatcher();
|
||||
|
@ -648,8 +648,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testParseParamsWithManyZerosInEachSectionOfUrl method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testParseParamsWithManyZerosInEachSectionOfUrl() {
|
||||
$Dispatcher =& new Dispatcher();
|
||||
|
@ -665,8 +665,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testParseParamsWithMixedOneToManyZerosInEachSectionOfUrl method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testParseParamsWithMixedOneToManyZerosInEachSectionOfUrl() {
|
||||
$Dispatcher =& new Dispatcher();
|
||||
|
@ -682,8 +682,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testQueryStringOnRoot method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testQueryStringOnRoot() {
|
||||
Router::reload();
|
||||
|
@ -712,8 +712,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testFileUploadArrayStructure method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testFileUploadArrayStructure() {
|
||||
$_FILES = array('data' => array('name' => array(
|
||||
|
@ -965,8 +965,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testGetUrl method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testGetUrl() {
|
||||
$Dispatcher =& new Dispatcher();
|
||||
|
@ -1005,8 +1005,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testBaseUrlAndWebrootWithModRewrite method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testBaseUrlAndWebrootWithModRewrite() {
|
||||
$Dispatcher =& new Dispatcher();
|
||||
|
@ -1081,8 +1081,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testBaseUrlwithModRewriteAlias method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testBaseUrlwithModRewriteAlias() {
|
||||
$_SERVER['DOCUMENT_ROOT'] = '/home/aplusnur/public_html';
|
||||
|
@ -1116,8 +1116,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testBaseUrlAndWebrootWithBaseUrl method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testBaseUrlAndWebrootWithBaseUrl() {
|
||||
$Dispatcher =& new Dispatcher();
|
||||
|
@ -1186,8 +1186,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testBaseUrlAndWebrootWithBase method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testBaseUrlAndWebrootWithBase() {
|
||||
$Dispatcher =& new Dispatcher();
|
||||
|
@ -1217,8 +1217,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testMissingController method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testMissingController() {
|
||||
$Dispatcher =& new TestDispatcher();
|
||||
|
@ -1237,8 +1237,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testPrivate method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testPrivate() {
|
||||
$Dispatcher =& new TestDispatcher();
|
||||
|
@ -1260,8 +1260,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testMissingAction method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testMissingAction() {
|
||||
$Dispatcher =& new TestDispatcher();
|
||||
|
@ -1298,8 +1298,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testDispatch method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testDispatch() {
|
||||
$Dispatcher =& new TestDispatcher();
|
||||
|
@ -1353,8 +1353,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testDispatchWithArray method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testDispatchWithArray() {
|
||||
$Dispatcher =& new TestDispatcher();
|
||||
|
@ -1373,8 +1373,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testAdminDispatch method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testAdminDispatch() {
|
||||
$_POST = array();
|
||||
|
@ -1404,8 +1404,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testPluginDispatch method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testPluginDispatch() {
|
||||
$_POST = array();
|
||||
|
@ -1453,8 +1453,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testAutomaticPluginDispatch method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testAutomaticPluginDispatch() {
|
||||
$_POST = array();
|
||||
|
@ -1491,8 +1491,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testAutomaticPluginControllerDispatch method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testAutomaticPluginControllerDispatch() {
|
||||
$_POST = array();
|
||||
|
@ -1594,7 +1594,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
* plugin short form instead.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
* @access public
|
||||
*/
|
||||
function testAutomaticPluginDispatchWithShortAccess() {
|
||||
$_POST = array();
|
||||
$_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php';
|
||||
|
@ -1642,8 +1643,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testAutomaticPluginControllerMissingActionDispatch method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testAutomaticPluginControllerMissingActionDispatch() {
|
||||
$_POST = array();
|
||||
|
@ -1685,8 +1686,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testPrefixProtection method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testPrefixProtection() {
|
||||
$_POST = array();
|
||||
|
@ -1715,7 +1716,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
* undocumented function
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
* @access public
|
||||
*/
|
||||
function testTestPluginDispatch() {
|
||||
$Dispatcher =& new TestDispatcher();
|
||||
App::build(array(
|
||||
|
@ -1734,8 +1736,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testChangingParamsFromBeforeFilter method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testChangingParamsFromBeforeFilter() {
|
||||
$_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php';
|
||||
|
@ -1768,8 +1770,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testStaticAssets method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testStaticAssets() {
|
||||
Router::reload();
|
||||
|
@ -1845,8 +1847,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testFullPageCachingDispatch method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testFullPageCachingDispatch() {
|
||||
Configure::write('Cache.disable', false);
|
||||
|
@ -1981,8 +1983,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testHttpMethodOverrides method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testHttpMethodOverrides() {
|
||||
Router::reload();
|
||||
|
@ -2036,6 +2038,7 @@ class DispatcherTest extends CakeTestCase {
|
|||
* Tests that invalid characters cannot be injected into the application base path.
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testBasePathInjection() {
|
||||
$self = $_SERVER['PHP_SELF'];
|
||||
|
@ -2052,8 +2055,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* testEnvironmentDetection method
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testEnvironmentDetection() {
|
||||
$dispatcher =& new Dispatcher();
|
||||
|
@ -2158,8 +2161,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* Tests that the Dispatcher does not return an empty action
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function testTrailingSlash() {
|
||||
$_POST = array();
|
||||
|
@ -2184,8 +2187,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* backupEnvironment method
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
* @access private
|
||||
*/
|
||||
function __backupEnvironment() {
|
||||
return array(
|
||||
|
@ -2199,8 +2202,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
/**
|
||||
* reloadEnvironment method
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
* @access private
|
||||
*/
|
||||
function __reloadEnvironment() {
|
||||
foreach ($_GET as $key => $val) {
|
||||
|
@ -2219,8 +2222,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
* loadEnvironment method
|
||||
*
|
||||
* @param mixed $env
|
||||
* @access private
|
||||
* @return void
|
||||
* @access private
|
||||
*/
|
||||
function __loadEnvironment($env) {
|
||||
if ($env['reload']) {
|
||||
|
@ -2254,8 +2257,8 @@ class DispatcherTest extends CakeTestCase {
|
|||
* cachePath method
|
||||
*
|
||||
* @param mixed $her
|
||||
* @access private
|
||||
* @return string
|
||||
* @access private
|
||||
*/
|
||||
function __cachePath($here) {
|
||||
$path = $here;
|
||||
|
|
|
@ -32,7 +32,7 @@ class CakeLogTest extends CakeTestCase {
|
|||
* Start test callback, clears all streams enabled.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function startTest() {
|
||||
$streams = CakeLog::streams();
|
||||
foreach ($streams as $stream) {
|
||||
|
@ -44,7 +44,7 @@ class CakeLogTest extends CakeTestCase {
|
|||
* test importing loggers from app/libs and plugins.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testImportingLoggers() {
|
||||
App::build(array(
|
||||
'libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS),
|
||||
|
@ -70,7 +70,7 @@ class CakeLogTest extends CakeTestCase {
|
|||
* test all the errors from failed logger imports
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testImportingLoggerFailure() {
|
||||
$this->expectError('Missing logger classname');
|
||||
CakeLog::config('fail', array());
|
||||
|
@ -87,7 +87,7 @@ class CakeLogTest extends CakeTestCase {
|
|||
* When no streams are there.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testAutoConfig() {
|
||||
@unlink(LOGS . 'error.log');
|
||||
CakeLog::write(LOG_WARNING, 'Test warning');
|
||||
|
@ -102,7 +102,7 @@ class CakeLogTest extends CakeTestCase {
|
|||
* test configuring log streams
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testConfig() {
|
||||
CakeLog::config('file', array(
|
||||
'engine' => 'FileLog',
|
||||
|
@ -145,7 +145,7 @@ class CakeLogTest extends CakeTestCase {
|
|||
* Test logging with the error handler.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testLoggingWithErrorHandling() {
|
||||
@unlink(LOGS . 'debug.log');
|
||||
Configure::write('log', E_ALL & ~E_DEPRECATED);
|
||||
|
|
|
@ -257,7 +257,7 @@ class CakeTestCaseTest extends CakeTestCase {
|
|||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testTestAction() {
|
||||
App::build(array(
|
||||
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
|
||||
|
@ -389,7 +389,7 @@ class CakeTestCaseTest extends CakeTestCase {
|
|||
* testSkipIf
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testSkipIf() {
|
||||
$this->assertTrue($this->Case->skipIf(true));
|
||||
$this->assertFalse($this->Case->skipIf(false));
|
||||
|
|
|
@ -110,7 +110,7 @@ class CakeTestFixtureDefaultImportFixture extends CakeTestFixture {
|
|||
*
|
||||
* @package default
|
||||
* @subpackage cake.cake.tests.cases.libs.
|
||||
**/
|
||||
*/
|
||||
class FixtureImportTestModel extends Model {
|
||||
var $name = 'FixtureImport';
|
||||
var $useTable = 'fixture_tests';
|
||||
|
|
|
@ -45,7 +45,7 @@ class CodeCoverageManagerTest extends CakeTestCase {
|
|||
* Store reference of $_GET to restore later.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function startCase() {
|
||||
$this->_get = $_GET;
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ class CodeCoverageManagerTest extends CakeTestCase {
|
|||
* End Case - restore GET vars.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function endCase() {
|
||||
$_GET = $this->_get;
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ class ConfigureTest extends CakeTestCase {
|
|||
* testSetErrorReporting Level
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testSetErrorReportingLevel() {
|
||||
Configure::write('log', false);
|
||||
|
||||
|
@ -160,7 +160,7 @@ class ConfigureTest extends CakeTestCase {
|
|||
* test that log and debug configure values interact well.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testInteractionOfDebugAndLog() {
|
||||
Configure::write('log', false);
|
||||
|
||||
|
|
|
@ -477,7 +477,7 @@ class ComponentTest extends CakeTestCase {
|
|||
* Ensure that settings are not duplicated when passed into component initialize.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testComponentParamsNoDuplication() {
|
||||
if ($this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController')) {
|
||||
return;
|
||||
|
|
|
@ -767,7 +767,7 @@ class AuthTest extends CakeTestCase {
|
|||
* test authorize = 'actions' setting.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testAuthorizeActions() {
|
||||
$this->AuthUser =& new AuthUser();
|
||||
$user = $this->AuthUser->find();
|
||||
|
@ -827,7 +827,7 @@ class AuthTest extends CakeTestCase {
|
|||
* test the action() method
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testActionMethod() {
|
||||
$this->Controller->params['controller'] = 'auth_test';
|
||||
$this->Controller->params['action'] = 'add';
|
||||
|
@ -856,7 +856,7 @@ class AuthTest extends CakeTestCase {
|
|||
* test that deny() converts camel case inputs to lowercase.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testDenyWithCamelCaseMethods() {
|
||||
$this->Controller->Auth->initialize($this->Controller);
|
||||
$this->Controller->Auth->allow('*');
|
||||
|
@ -873,7 +873,7 @@ class AuthTest extends CakeTestCase {
|
|||
* test that allow() and allowedActions work with camelCase method names.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testAllowedActionsWithCamelCaseMethods() {
|
||||
$url = '/auth_test/camelCase';
|
||||
$this->Controller->params = Router::parse($url);
|
||||
|
@ -1099,7 +1099,7 @@ class AuthTest extends CakeTestCase {
|
|||
* And the user doesn't have a session.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testNoRedirectOn404() {
|
||||
$this->Controller->Session->delete('Auth');
|
||||
$this->Controller->Auth->initialize($this->Controller);
|
||||
|
@ -1201,7 +1201,7 @@ class AuthTest extends CakeTestCase {
|
|||
* test Hashing of passwords
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testHashPasswords() {
|
||||
$this->Controller->Auth->userModel = 'AuthUser';
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ class RequestHandlerTestController extends Controller {
|
|||
*
|
||||
* @var string
|
||||
* @access public
|
||||
**/
|
||||
*/
|
||||
var $name = 'RequestHandlerTest';
|
||||
|
||||
/**
|
||||
|
@ -66,7 +66,7 @@ class RequestHandlerTestController extends Controller {
|
|||
* test method for ajax redirection
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function destination() {
|
||||
$this->viewPath = 'posts';
|
||||
$this->render('index');
|
||||
|
@ -245,7 +245,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* testStartupCallback with charset.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testStartupCallbackCharset() {
|
||||
$_SERVER['REQUEST_METHOD'] = 'PUT';
|
||||
$_SERVER['CONTENT_TYPE'] = 'application/xml; charset=UTF-8';
|
||||
|
@ -287,7 +287,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
*
|
||||
* @link #6466
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testRenderAsCalledTwice() {
|
||||
$this->RequestHandler->renderAs($this->Controller, 'xml');
|
||||
$this->assertEqual($this->Controller->viewPath, 'request_handler_test' . DS . 'xml');
|
||||
|
@ -551,7 +551,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
|
|||
* test that ajax requests involving redirects trigger requestAction instead.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testAjaxRedirectAsRequestAction() {
|
||||
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
|
||||
$this->_init();
|
||||
|
|
|
@ -564,7 +564,7 @@ DIGEST;
|
|||
* test that validatePost fails if any of its required fields are missing.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testValidatePostFormHacking() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
$key = $this->Controller->params['_Token']['key'];
|
||||
|
@ -676,7 +676,7 @@ DIGEST;
|
|||
* test ValidatePost with multiple select elements.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testValidatePostMultipleSelect() {
|
||||
$this->Controller->Security->startup($this->Controller);
|
||||
$key = $this->Controller->params['_Token']['key'];
|
||||
|
|
|
@ -252,7 +252,7 @@ class ControllerPaginateModel extends CakeTestModel {
|
|||
*
|
||||
* @return void
|
||||
* @access public
|
||||
**/
|
||||
*/
|
||||
function paginate($conditions, $fields, $order, $limit, $page, $recursive, $extra) {
|
||||
$this->extra = $extra;
|
||||
}
|
||||
|
@ -673,7 +673,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* Test that special paginate types are called and that the type param doesn't leak out into defaults or options.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testPaginateSpecialType() {
|
||||
$Controller =& new Controller();
|
||||
$Controller->uses = array('ControllerPost', 'ControllerComment');
|
||||
|
@ -1029,7 +1029,7 @@ class ControllerTest extends CakeTestCase {
|
|||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testChildComponentOptionsSupercedeParents() {
|
||||
if ($this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController')) {
|
||||
return;
|
||||
|
@ -1046,7 +1046,7 @@ class ControllerTest extends CakeTestCase {
|
|||
* AppController when you make an instance of Controller
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testMergeVarsNotGreedy() {
|
||||
$Controller =& new Controller();
|
||||
$Controller->components = array();
|
||||
|
|
|
@ -20,23 +20,26 @@
|
|||
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
|
||||
*/
|
||||
if (!class_exists('AppController')) {
|
||||
/**
|
||||
* Test case AppController requred
|
||||
*
|
||||
* @package cake.tests.cases.libs.controller
|
||||
**/
|
||||
|
||||
/**
|
||||
* Test case AppController
|
||||
*
|
||||
* @package cake
|
||||
* @subpackage cake.tests.cases.libs.controller
|
||||
*/
|
||||
class AppController extends Controller {
|
||||
/**
|
||||
* components
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
|
||||
/**
|
||||
* components
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $components = array('MergeVar' => array('flag', 'otherFlag', 'redirect' => false));
|
||||
/**
|
||||
* helpers
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
/**
|
||||
* helpers
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $helpers = array('MergeVar' => array('format' => 'html', 'terse'));
|
||||
}
|
||||
} elseif (!defined('APP_CONTROLLER_EXISTS')) {
|
||||
|
@ -47,7 +50,7 @@ if (!class_exists('AppController')) {
|
|||
* MergeVar Component
|
||||
*
|
||||
* @package cake.tests.cases.libs.controller
|
||||
**/
|
||||
*/
|
||||
class MergeVarComponent extends Object {
|
||||
|
||||
}
|
||||
|
@ -56,21 +59,21 @@ class MergeVarComponent extends Object {
|
|||
* Additional controller for testing
|
||||
*
|
||||
* @package cake.tests.cases.libs.controller
|
||||
**/
|
||||
*/
|
||||
class MergeVariablesController extends AppController {
|
||||
|
||||
/**
|
||||
* name
|
||||
*
|
||||
* @var string
|
||||
**/
|
||||
*/
|
||||
var $name = 'MergeVariables';
|
||||
|
||||
/**
|
||||
* uses
|
||||
*
|
||||
* @var arrays
|
||||
**/
|
||||
*/
|
||||
var $uses = array();
|
||||
}
|
||||
|
||||
|
@ -78,21 +81,21 @@ class MergeVariablesController extends AppController {
|
|||
* MergeVarPlugin App Controller
|
||||
*
|
||||
* @package cake.tests.cases.libs.controller
|
||||
**/
|
||||
*/
|
||||
class MergeVarPluginAppController extends AppController {
|
||||
|
||||
/**
|
||||
* components
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $components = array('Auth' => array('setting' => 'val', 'otherVal'));
|
||||
|
||||
/**
|
||||
* helpers
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $helpers = array('Javascript');
|
||||
}
|
||||
|
||||
|
@ -100,21 +103,21 @@ class MergeVarPluginAppController extends AppController {
|
|||
* MergePostsController
|
||||
*
|
||||
* @package cake.tests.cases.libs.controller
|
||||
**/
|
||||
*/
|
||||
class MergePostsController extends MergeVarPluginAppController {
|
||||
|
||||
/**
|
||||
* name
|
||||
*
|
||||
* @var string
|
||||
**/
|
||||
*/
|
||||
var $name = 'MergePosts';
|
||||
|
||||
/**
|
||||
* uses
|
||||
*
|
||||
* @var array
|
||||
**/
|
||||
*/
|
||||
var $uses = array();
|
||||
}
|
||||
|
||||
|
@ -123,13 +126,13 @@ class MergePostsController extends MergeVarPluginAppController {
|
|||
* Test Case for Controller Merging of Vars.
|
||||
*
|
||||
* @package cake.tests.cases.libs.controller
|
||||
**/
|
||||
*/
|
||||
class ControllerMergeVarsTestCase extends CakeTestCase {
|
||||
/**
|
||||
* Skips the case if APP_CONTROLLER_EXISTS is defined
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function skip() {
|
||||
$this->skipIf(defined('APP_CONTROLLER_EXISTS'), 'APP_CONTROLLER_EXISTS cannot run. %s');
|
||||
}
|
||||
|
@ -137,7 +140,7 @@ class ControllerMergeVarsTestCase extends CakeTestCase {
|
|||
* end test
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function endTest() {
|
||||
ClassRegistry::flush();
|
||||
}
|
||||
|
@ -146,7 +149,7 @@ class ControllerMergeVarsTestCase extends CakeTestCase {
|
|||
* test that component settings are not duplicated when merging component settings
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testComponentParamMergingNoDuplication() {
|
||||
$Controller =& new MergeVariablesController();
|
||||
$Controller->constructClasses();
|
||||
|
@ -159,7 +162,7 @@ class ControllerMergeVarsTestCase extends CakeTestCase {
|
|||
* test component merges with redeclared components
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testComponentMergingWithRedeclarations() {
|
||||
$Controller =& new MergeVariablesController();
|
||||
$Controller->components['MergeVar'] = array('remote', 'redirect' => true);
|
||||
|
@ -173,7 +176,7 @@ class ControllerMergeVarsTestCase extends CakeTestCase {
|
|||
* test merging of helpers array, ensure no duplication occurs
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testHelperSettingMergingNoDuplication() {
|
||||
$Controller =& new MergeVariablesController();
|
||||
$Controller->constructClasses();
|
||||
|
@ -186,7 +189,7 @@ class ControllerMergeVarsTestCase extends CakeTestCase {
|
|||
* test merging of vars with plugin
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testMergeVarsWithPlugin() {
|
||||
$Controller =& new MergePostsController();
|
||||
$Controller->components = array('Email' => array('ports' => 'open'));
|
||||
|
@ -223,7 +226,7 @@ class ControllerMergeVarsTestCase extends CakeTestCase {
|
|||
* AppController when you make an instance of Controller
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testMergeVarsNotGreedy() {
|
||||
$Controller =& new Controller();
|
||||
$Controller->components = array();
|
||||
|
|
|
@ -153,7 +153,7 @@ class ScaffoldMock extends CakeTestModel {
|
|||
* hasAndBelongsToMany property
|
||||
*
|
||||
* @var string
|
||||
**/
|
||||
*/
|
||||
var $hasAndBelongsToMany = array(
|
||||
'ScaffoldTag' => array(
|
||||
'className' => 'ScaffoldTag',
|
||||
|
@ -387,7 +387,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testIndexScaffold() {
|
||||
$this->Controller->action = 'index';
|
||||
$this->Controller->here = '/scaffold_mock';
|
||||
|
@ -426,7 +426,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testViewScaffold() {
|
||||
$this->Controller->action = 'view';
|
||||
$this->Controller->here = '/scaffold_mock';
|
||||
|
@ -468,7 +468,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testEditScaffold() {
|
||||
$this->Controller->action = 'edit';
|
||||
$this->Controller->here = '/scaffold_mock';
|
||||
|
@ -509,7 +509,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testAdminIndexScaffold() {
|
||||
$_backAdmin = Configure::read('Routing.prefixes');
|
||||
|
||||
|
@ -554,7 +554,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testAdminEditScaffold() {
|
||||
$_backAdmin = Configure::read('Routing.prefixes');
|
||||
|
||||
|
@ -597,7 +597,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
*
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testMultiplePrefixScaffold() {
|
||||
$_backAdmin = Configure::read('Routing.prefixes');
|
||||
|
||||
|
@ -718,7 +718,7 @@ class ScaffoldTest extends CakeTestCase {
|
|||
* test that the proper names and variable values are set by Scaffold
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testScaffoldVariableSetting() {
|
||||
$this->Controller->action = 'admin_edit';
|
||||
$this->Controller->here = '/admin/scaffold_mock/edit';
|
||||
|
@ -757,7 +757,7 @@ class ScaffoldTest extends CakeTestCase {
|
|||
* test that scaffold outputs flash messages when sessions are unset.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testScaffoldFlashMessages() {
|
||||
$this->Controller->action = 'edit';
|
||||
$this->Controller->here = '/scaffold_mock';
|
||||
|
@ -797,7 +797,7 @@ class ScaffoldTest extends CakeTestCase {
|
|||
*
|
||||
* @see http://code.cakephp.org/tickets/view/48
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testHabtmFieldAdditionWithScaffoldForm() {
|
||||
$this->Controller->action = 'edit';
|
||||
$this->Controller->here = '/scaffold_mock';
|
||||
|
@ -830,7 +830,7 @@ class ScaffoldTest extends CakeTestCase {
|
|||
* test that the proper names and variable values are set by Scaffold
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testEditScaffoldWithScaffoldFields() {
|
||||
$this->Controller = new ScaffoldMockControllerWithFields();
|
||||
$this->Controller->action = 'edit';
|
||||
|
|
|
@ -218,7 +218,7 @@ class MyCustomErrorHandler extends ErrorHandler {
|
|||
* custom error message type.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function missingWidgetThing() {
|
||||
echo 'widget thing is missing';
|
||||
}
|
||||
|
@ -276,7 +276,7 @@ class ErrorHandlerTest extends CakeTestCase {
|
|||
* into error404 when debug == 0
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testSubclassMethodsNotBeingConvertedToError() {
|
||||
$back = Configure::read('debug');
|
||||
Configure::write('debug', 2);
|
||||
|
|
|
@ -222,7 +222,7 @@ class FolderTest extends CakeTestCase {
|
|||
* test Adding path elements to a path
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testAddPathElement() {
|
||||
$result = Folder::addPathElement(DS . 'some' . DS . 'dir', 'another_path');
|
||||
$this->assertEqual($result, DS . 'some' . DS . 'dir' . DS . 'another_path');
|
||||
|
|
|
@ -67,7 +67,7 @@ class FileLogTest extends CakeTestCase {
|
|||
* test using the path setting to write logs in other places.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testPathSetting() {
|
||||
$path = TMP . 'tests' . DS;
|
||||
@unlink($path . 'error.log');
|
||||
|
|
|
@ -172,7 +172,7 @@ class MagicDbTestData extends Object {
|
|||
*
|
||||
* @param string $key
|
||||
* @access public
|
||||
**/
|
||||
*/
|
||||
function get($key) {
|
||||
/**
|
||||
* data property
|
||||
|
|
|
@ -463,7 +463,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
* test reading schema from plugins.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testSchemaReadWithPlugins() {
|
||||
App::objects('model', null, false);
|
||||
App::build(array(
|
||||
|
@ -489,7 +489,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
* test that tables are generated correctly
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testGenerateTable() {
|
||||
$fields = array(
|
||||
'id' => array('type' => 'integer', 'null' => false, 'default' => 0, 'key' => 'primary'),
|
||||
|
@ -567,7 +567,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
* Test comparing tableParameters and indexes.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testTableParametersAndIndexComparison() {
|
||||
$old = array(
|
||||
'posts' => array(
|
||||
|
@ -670,7 +670,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
* test loading schema files inside of plugins.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testSchemaLoadingFromPlugin() {
|
||||
App::build(array(
|
||||
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
|
||||
|
|
|
@ -196,7 +196,7 @@ class DboAdodbTest extends CakeTestCase {
|
|||
*
|
||||
* @var string
|
||||
* @access public
|
||||
**/
|
||||
*/
|
||||
var $fixtures = array('core.article');
|
||||
|
||||
/**
|
||||
|
|
|
@ -203,7 +203,7 @@ class DboMysqlTest extends CakeTestCase {
|
|||
* startCase
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function startCase() {
|
||||
$this->_debug = Configure::read('debug');
|
||||
Configure::write('debug', 1);
|
||||
|
@ -213,7 +213,7 @@ class DboMysqlTest extends CakeTestCase {
|
|||
* endCase
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function endCase() {
|
||||
Configure::write('debug', $this->_debug);
|
||||
}
|
||||
|
@ -418,7 +418,7 @@ class DboMysqlTest extends CakeTestCase {
|
|||
* Using a mock ensure that MySQL 4.x output is properly parsed.
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testIndexOnMySQL4Output() {
|
||||
$name = $this->db->fullTableName('simple');
|
||||
|
||||
|
@ -631,7 +631,7 @@ class DboMysqlTest extends CakeTestCase {
|
|||
* test saving and retrieval of blobs
|
||||
*
|
||||
* @return void
|
||||
**/
|
||||
*/
|
||||
function testBlobSaving() {
|
||||
$this->db->cacheSources = false;
|
||||
$data = "GIF87ab |