From b6fed414e8d705e0ca8344de9297358b716cc505 Mon Sep 17 00:00:00 2001 From: nate Date: Tue, 20 Jan 2009 14:06:00 -0500 Subject: [PATCH 0001/2083] Updating version number in core config --- cake/config/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/config/config.php b/cake/config/config.php index 352768331..61c56e8ee 100644 --- a/cake/config/config.php +++ b/cake/config/config.php @@ -22,5 +22,5 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ -return $config['Cake.version'] = '1.2.1.8004'; +return $config['Cake.version'] = '1.3.0'; ?> \ No newline at end of file From 5a7dc398dd103dc008d0ad08d26f971b75fbb03a Mon Sep 17 00:00:00 2001 From: nate Date: Tue, 20 Jan 2009 14:07:16 -0500 Subject: [PATCH 0002/2083] Setting default permissions on tmp directory --- app/tmp/cache/models/empty | 0 app/tmp/cache/persistent/empty | 0 app/tmp/cache/views/empty | 0 app/tmp/logs/empty | 0 app/tmp/sessions/empty | 0 app/tmp/tests/empty | 0 6 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 app/tmp/cache/models/empty mode change 100644 => 100755 app/tmp/cache/persistent/empty mode change 100644 => 100755 app/tmp/cache/views/empty mode change 100644 => 100755 app/tmp/logs/empty mode change 100644 => 100755 app/tmp/sessions/empty mode change 100644 => 100755 app/tmp/tests/empty diff --git a/app/tmp/cache/models/empty b/app/tmp/cache/models/empty old mode 100644 new mode 100755 diff --git a/app/tmp/cache/persistent/empty b/app/tmp/cache/persistent/empty old mode 100644 new mode 100755 diff --git a/app/tmp/cache/views/empty b/app/tmp/cache/views/empty old mode 100644 new mode 100755 diff --git a/app/tmp/logs/empty b/app/tmp/logs/empty old mode 100644 new mode 100755 diff --git a/app/tmp/sessions/empty b/app/tmp/sessions/empty old mode 100644 new mode 100755 diff --git a/app/tmp/tests/empty b/app/tmp/tests/empty old mode 100644 new mode 100755 From c7d133fc0f5491debb70dcc87be39dd111687c5b Mon Sep 17 00:00:00 2001 From: nate Date: Tue, 20 Jan 2009 14:36:39 -0500 Subject: [PATCH 0003/2083] Removing variable name inflection from Controller::set() --- cake/libs/controller/controller.php | 6 +----- cake/tests/cases/libs/controller/controller.test.php | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index fe3416170..25dc636ec 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -641,11 +641,7 @@ function set($one, $two = null) { if ($name === 'title') { $this->pageTitle = $value; } else { - if ($two === null && is_array($one)) { - $this->viewVars[Inflector::variable($name)] = $value; - } else { - $this->viewVars[$name] = $value; - } + $this->viewVars[$name] = $value; } } } diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index 859e320a9..0a86e9cde 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -657,7 +657,7 @@ function testControllerSet() { $Controller->viewVars = array(); $viewVars = array('ModelName' => array('id' => 1, 'name' => 'value')); $Controller->set($viewVars); - $this->assertTrue(array_key_exists('modelName', $Controller->viewVars)); + $this->assertTrue(array_key_exists('ModelName', $Controller->viewVars)); $Controller->viewVars = array(); $Controller->set('variable_with_underscores', 'value'); @@ -666,7 +666,7 @@ function testControllerSet() { $Controller->viewVars = array(); $viewVars = array('ModelName' => 'name'); $Controller->set($viewVars); - $this->assertTrue(array_key_exists('modelName', $Controller->viewVars)); + $this->assertTrue(array_key_exists('ModelName', $Controller->viewVars)); $Controller->set('title', 'someTitle'); $this->assertIdentical($Controller->pageTitle, 'someTitle'); From 03ddde69fd571ce644c37aa69499616091ca1e4b Mon Sep 17 00:00:00 2001 From: nate Date: Tue, 20 Jan 2009 17:58:12 -0500 Subject: [PATCH 0004/2083] Removing Flay library --- cake/libs/flay.php | 285 --------------------------------------------- 1 file changed, 285 deletions(-) delete mode 100644 cake/libs/flay.php diff --git a/cake/libs/flay.php b/cake/libs/flay.php deleted file mode 100644 index ed23cf7f4..000000000 --- a/cake/libs/flay.php +++ /dev/null @@ -1,285 +0,0 @@ -text = $text; - parent::__construct(); - } -/** - * Returns given text translated to HTML using the Flay syntax. - * - * @param string $text String to format - * @param boolean $bare Set this to only do

transforms and > to >, no typography additions. - * @param boolean $allowHtml Set this to trim whitespace and disable all HTML - * @return string Formatted text - * @access public - */ - function toHtml($text = null, $bare = false, $allowHtml = false) { - if (empty($text) && empty($this->text)) { - return false; - } - $text = $text ? $text : $this->text; - // trim whitespace and disable all HTML - if ($allowHtml) { - $text = trim($text); - } else { - $text = str_replace('<', '<', str_replace('>', '>', trim($text))); - } - - if (!$bare) { - // multi-paragraph functions - $text=preg_replace('#(?:[\n]{0,2})"""(.*)"""(?:[\n]{0,2})#s', "\n\n%BLOCKQUOTE%\n\n\\1\n\n%ENDBLOCKQUOTE%\n\n", $text); - $text=preg_replace('#(?:[\n]{0,2})===(.*)===(?:[\n]{0,2})#s', "\n\n%CENTER%\n\n\\1\n\n%ENDCENTER%\n\n", $text); - } - - // pre-parse newlines - $text=preg_replace("#\r\n#", "\n", $text); - $text=preg_replace("#[\n]{2,}#", "%PARAGRAPH%", $text); - $text=preg_replace('#[\n]{1}#', "%LINEBREAK%", $text); - $out =''; - - foreach (split('%PARAGRAPH%', $text)as $line) { - if ($line) { - if (!$bare) { - $links = array(); - $regs = null; - - if (preg_match_all('#\[([^\[]{4,})\]#', $line, $regs)) { - foreach ($regs[1] as $reg) { - $links[] = $reg; - $line = str_replace("[{$reg}]", '%LINK' . (count($links) - 1) . '%', $line); - } - } - // bold - $line = ereg_replace("\*([^\*]*)\*", "\\1", $line); - // italic - $line = ereg_replace("_([^_]*)_", "\\1", $line); - } - // entities - $line = str_replace(' - ', ' – ', $line); - $line = str_replace(' -- ', ' — ', $line); - $line = str_replace('(C)', '©', $line); - $line = str_replace('(R)', '®', $line); - $line = str_replace('(TM)', '™', $line); - // guess e-mails - $emails = null; - if (preg_match_all("#([_A-Za-z0-9+-+]+(?:\.[_A-Za-z0-9+-]+)*@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*)#", $line, $emails)) { - foreach ($emails[1] as $email) { - $line = str_replace($email, "{$email}", $line); - } - } - - if (!$bare) { - $urls = null; - if (preg_match_all("#((?:http|https|ftp|nntp)://[^ ]+)#", $line, $urls)) { - foreach ($urls[1] as $url) { - $line = str_replace($url, "{$url}", $line); - } - } - - if (preg_match_all("#(www\.[^\n\%\ ]+[^\n\%\,\.\ ])#", $line, $urls)) { - foreach ($urls[1] as $url) { - $line = str_replace($url, "{$url}", $line); - } - } - - if ($count = count($links)) { - for ($ii = 0; $ii < $count; $ii++) { - if (preg_match("#^(http|https|ftp|nntp)://#", $links[$ii])) { - $prefix = null; - } else { - $prefix = 'http://'; - } - if (preg_match('#^[^\ ]+\.(jpg|jpeg|gif|png)$#', $links[$ii])) { - $with = "\"\""; - } elseif (preg_match('#^([^\]\ ]+)(?:\ ([^\]]+))?$#', $links[$ii], $regs)) { - if (isset($regs[2])) { - if (preg_match('#\.(jpg|jpeg|gif|png)$#', $regs[2])) { - $body = "\"\""; - } else { - $body = $regs[2]; - } - } else { - $body = $links[$ii]; - } - $with = "{$body}"; - } else { - $with = $prefix . $links[$ii]; - } - $line = str_replace("%LINK{$ii}%", $with, $line); - } - } - } - $out .= str_replace('%LINEBREAK%', "
\n", "

{$line}

\n"); - } - } - - if (!$bare) { - $out = str_replace('

%BLOCKQUOTE%

', "
", $out); - $out = str_replace('

%ENDBLOCKQUOTE%

', "
", $out); - $out = str_replace('

%CENTER%

', "
", $out); - $out = str_replace('

%ENDCENTER%

', "
", $out); - } - return $out; - } -/** - * Return the words of the string as an array. - * - * @param string $string - * @return array Array of words - * @access public - */ - function extractWords($string) { - $split = preg_split('/[\s,\.:\/="!\(\)<>~\[\]]+/', $string); - return $split; - } -/** - * Return given string with words in array colorMarked, up to a number of times (defaults to 5). - * - * @param array $words Words to look for and markup - * @param string $string String to look in - * @param integer $max_snippets Max number of snippets to extract - * @return string String with words marked - * @see colorMark - * @access public - */ - function markedSnippets($words, $string, $max_snippets = 5) { - $string = strip_tags($string); - $snips = array(); - $rest = $string; - foreach ($words as $word) { - if (preg_match_all("/[\s,]+.{0,40}{$word}.{0,40}[\s,]+/i", $rest, $r)) { - foreach ($r as $result) { - $rest = str_replace($result, '', $rest); - } - $snips = array_merge($snips, $r[0]); - } - } - - if (count($snips) > $max_snippets) { - $snips = array_slice($snips, 0, $max_snippets); - } - $joined = join(' ... ', $snips); - $snips = $joined ? "... {$joined} ..." : substr($string, 0, 80) . '...'; - return $this->colorMark($words, $snips); - } -/** - * Returns string with EM elements with color classes added. - * - * @param array $words Array of words to be colorized - * @param string $string Text in which the words might be found - * @return string String with words colorized - * @access public - */ - function colorMark($words, $string) { - $colors=array('yl', 'gr', 'rd', 'bl', 'fu', 'cy'); - $nextColorIndex = 0; - foreach ($words as $word) { - $string = preg_replace("/({$word})/i", '\\1", $string); - $nextColorIndex++; - } - return $string; - } -/** - * Returns given text with tags stripped out. - * - * @param string $text Text to clean - * @return string Cleaned text - * @access public - */ - function toClean($text) { - $strip = strip_tags(html_entity_decode($text, ENT_QUOTES)); - return $strip; - } -/** - * Return parsed text with tags stripped out. - * - * @param string $text Text to parse and clean - * @return string Cleaned text - * @access public - */ - function toParsedAndClean($text) { - return $this->toClean(Flay::toHtml($text)); - } -/** - * Return a fragment of a text, up to $length characters long, with an ellipsis after it. - * - * @param string $text Text to be truncated. - * @param integer $length Max length of text. - * @param string $ellipsis Sign to print after truncated text. - * @return string Fragment - * @access public - */ - function fragment($text, $length, $ellipsis = '...') { - $soft = $length - 5; - $hard = $length + 5; - $rx = '/(.{' . $soft . ',' . $hard . '})[\s,\.:\/="!\(\)<>~\[\]]+.*/'; - - if (preg_match($rx, $text, $r)) { - $out = $r[1]; - } else { - $out = substr($text, 0, $length); - } - $out = $out . (strlen($out) < strlen($text) ? $ellipsis : null); - return $out; - } -} -?> \ No newline at end of file From bb6606a5bafb2244d51cee3a700bcadbbb51e518 Mon Sep 17 00:00:00 2001 From: nate Date: Mon, 26 Jan 2009 23:17:58 -0500 Subject: [PATCH 0005/2083] Removing Flay test case --- cake/tests/cases/libs/flay.test.php | 45 ----------------------------- 1 file changed, 45 deletions(-) delete mode 100644 cake/tests/cases/libs/flay.test.php diff --git a/cake/tests/cases/libs/flay.test.php b/cake/tests/cases/libs/flay.test.php deleted file mode 100644 index c8f60e145..000000000 --- a/cake/tests/cases/libs/flay.test.php +++ /dev/null @@ -1,45 +0,0 @@ - - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * - * Licensed under The Open Group Test Suite License - * Redistributions of files must retain the above copyright notice. - * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests - * @subpackage cake.tests.cases.libs - * @since CakePHP(tm) v 1.2.0.5432 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License - */ -uses('flay'); -/** - * Short description for class. - * - * @package cake.tests - * @subpackage cake.tests.cases.libs - */ -class FlayTest extends UnitTestCase { -/** - * skip method - * - * @access public - * @return void - */ - function skip() { - $this->skipif (true, 'FlayTest not implemented'); - } -} -?> \ No newline at end of file From c636b2868de47100061242700768db7eff51795b Mon Sep 17 00:00:00 2001 From: nate Date: Fri, 6 Feb 2009 11:37:28 -0500 Subject: [PATCH 0006/2083] Removing raw .sql files from app/config, renaming sql/ => schema/ --- app/config/{sql => schema}/db_acl.php | 0 app/config/{sql => schema}/i18n.php | 0 app/config/{sql => schema}/sessions.php | 0 app/config/sql/db_acl.sql | 40 ------------------------- app/config/sql/i18n.sql | 26 ---------------- app/config/sql/sessions.sql | 16 ---------- 6 files changed, 82 deletions(-) rename app/config/{sql => schema}/db_acl.php (100%) rename app/config/{sql => schema}/i18n.php (100%) rename app/config/{sql => schema}/sessions.php (100%) delete mode 100644 app/config/sql/db_acl.sql delete mode 100644 app/config/sql/i18n.sql delete mode 100644 app/config/sql/sessions.sql diff --git a/app/config/sql/db_acl.php b/app/config/schema/db_acl.php similarity index 100% rename from app/config/sql/db_acl.php rename to app/config/schema/db_acl.php diff --git a/app/config/sql/i18n.php b/app/config/schema/i18n.php similarity index 100% rename from app/config/sql/i18n.php rename to app/config/schema/i18n.php diff --git a/app/config/sql/sessions.php b/app/config/schema/sessions.php similarity index 100% rename from app/config/sql/sessions.php rename to app/config/schema/sessions.php diff --git a/app/config/sql/db_acl.sql b/app/config/sql/db_acl.sql deleted file mode 100644 index 6fc01b8ea..000000000 --- a/app/config/sql/db_acl.sql +++ /dev/null @@ -1,40 +0,0 @@ -# $Id$ -# -# Copyright 2005-2008, Cake Software Foundation, Inc. -# -# Licensed under The MIT License -# Redistributions of files must retain the above copyright notice. -# http://www.opensource.org/licenses/mit-license.php The MIT License - -CREATE TABLE acos ( - id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, - parent_id INTEGER(10) DEFAULT NULL, - model VARCHAR(255) DEFAULT '', - foreign_key INTEGER(10) UNSIGNED DEFAULT NULL, - alias VARCHAR(255) DEFAULT '', - lft INTEGER(10) DEFAULT NULL, - rght INTEGER(10) DEFAULT NULL, - PRIMARY KEY (id) -); - -CREATE TABLE aros_acos ( - id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, - aro_id INTEGER(10) UNSIGNED NOT NULL, - aco_id INTEGER(10) UNSIGNED NOT NULL, - _create CHAR(2) NOT NULL DEFAULT 0, - _read CHAR(2) NOT NULL DEFAULT 0, - _update CHAR(2) NOT NULL DEFAULT 0, - _delete CHAR(2) NOT NULL DEFAULT 0, - PRIMARY KEY(id) -); - -CREATE TABLE aros ( - id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT, - parent_id INTEGER(10) DEFAULT NULL, - model VARCHAR(255) DEFAULT '', - foreign_key INTEGER(10) UNSIGNED DEFAULT NULL, - alias VARCHAR(255) DEFAULT '', - lft INTEGER(10) DEFAULT NULL, - rght INTEGER(10) DEFAULT NULL, - PRIMARY KEY (id) -); diff --git a/app/config/sql/i18n.sql b/app/config/sql/i18n.sql deleted file mode 100644 index db1daea4a..000000000 --- a/app/config/sql/i18n.sql +++ /dev/null @@ -1,26 +0,0 @@ -# $Id$ -# -# Copyright 2005-2008, Cake Software Foundation, Inc. -# -# Licensed under The MIT License -# Redistributions of files must retain the above copyright notice. -# http://www.opensource.org/licenses/mit-license.php The MIT License - -CREATE TABLE i18n ( - id int(10) NOT NULL auto_increment, - locale varchar(6) NOT NULL, - model varchar(255) NOT NULL, - foreign_key int(10) NOT NULL, - field varchar(255) NOT NULL, - content mediumtext, - PRIMARY KEY (id), -# UNIQUE INDEX I18N_LOCALE_FIELD(locale, model, foreign_key, field), -# INDEX I18N_LOCALE_ROW(locale, model, foreign_key), -# INDEX I18N_LOCALE_MODEL(locale, model), -# INDEX I18N_FIELD(model, foreign_key, field), -# INDEX I18N_ROW(model, foreign_key), - INDEX locale (locale), - INDEX model (model), - INDEX row_id (foreign_key), - INDEX field (field) -); diff --git a/app/config/sql/sessions.sql b/app/config/sql/sessions.sql deleted file mode 100644 index 75be419a1..000000000 --- a/app/config/sql/sessions.sql +++ /dev/null @@ -1,16 +0,0 @@ -# $Id$ -# -# Copyright 2005-2008, Cake Software Foundation, Inc. -# 1785 E. Sahara Avenue, Suite 490-204 -# Las Vegas, Nevada 89104 -# -# Licensed under The MIT License -# Redistributions of files must retain the above copyright notice. -# http://www.opensource.org/licenses/mit-license.php The MIT License - -CREATE TABLE cake_sessions ( - id varchar(255) NOT NULL default '', - data text, - expires int(11) default NULL, - PRIMARY KEY (id) -); \ No newline at end of file From c200fcb062feb60236a557bd6d89eb152809e699 Mon Sep 17 00:00:00 2001 From: nate Date: Fri, 6 Feb 2009 18:12:18 -0500 Subject: [PATCH 0007/2083] Updating and refactoring help text for Cake console, adding support for reverse-route lookups --- cake/console/libs/console.php | 122 ++++++++++++++++++++-------------- 1 file changed, 72 insertions(+), 50 deletions(-) diff --git a/cake/console/libs/console.php b/cake/console/libs/console.php index 9d7f9aa49..e04ba782c 100644 --- a/cake/console/libs/console.php +++ b/cake/console/libs/console.php @@ -72,7 +72,7 @@ function initialize() { foreach ($this->models as $model) { $this->out(" - {$model}"); } - $this->__loadRoutes(); + $this->_loadRoutes(); } /** * Prints the help message @@ -80,7 +80,61 @@ function initialize() { * @access public */ function help() { - $this->main('help'); + $out = 'Console help:'; + $out .= '-------------'; + $out .= 'The interactive console is a tool for testing parts of your app before you'; + $out .= 'write code.'; + $out .= "\n"; + $out .= 'Model testing:'; + $out .= 'To test model results, use the name of your model without a leading $'; + $out .= 'e.g. Foo->find("all")'; + $out .= "\n"; + $out .= 'To dynamically set associations, you can do the following:'; + $out .= "\tModelA bind ModelB"; + $out .= "where the supported assocations are hasOne, hasMany, belongsTo, hasAndBelongsToMany"; + $out .= "\n"; + $out .= 'To dynamically remove associations, you can do the following:'; + $out .= "\t ModelA unbind ModelB"; + $out .= "where the supported associations are the same as above"; + $out .= "\n"; + $out .= "To save a new field in a model, you can do the following:"; + $out .= "\tModelA->save(array('foo' => 'bar', 'baz' => 0))"; + $out .= "where you are passing a hash of data to be saved in the format"; + $out .= "of field => value pairs"; + $out .= "\n"; + $out .= "To get column information for a model, use the following:"; + $out .= "\tModelA columns"; + $out .= "which returns a list of columns and their type"; + $out .= "\n"; + $out .= "\n"; + $out .= 'Route testing:'; + $out .= "\n"; + $out .= 'To test URLs against your app\'s route configuration, type:'; + $out .= "\n"; + $out .= "\tRoute "; + $out .= "\n"; + $out .= "where url is the path to your your action plus any query parameters,"; + $out .= "minus the application's base path. For example:"; + $out .= "\n"; + $out .= "\tRoute /posts/view/1"; + $out .= "\n"; + $out .= "will return something like the following:"; + $out .= "\n"; + $out .= "\tarray ("; + $out .= "\t [...]"; + $out .= "\t 'controller' => 'posts',"; + $out .= "\t 'action' => 'view',"; + $out .= "\t [...]"; + $out .= "\t)"; + $out .= "\n"; + $out .= 'Alternatively, you can use simple array syntax to test reverse'; + $out .= 'To reload your routes config (config/routes.php), do the following:'; + $out .= "\n"; + $out .= "\tRoutes reload"; + $out .= "\n"; + $out .= 'To show all connected routes, do the following:'; + $out .= "\tRoutes show"; + $this->out($out); } /** * Override main() to handle action @@ -95,44 +149,7 @@ function main($command = null) { switch ($command) { case 'help': - $this->out('Console help:'); - $this->out('-------------'); - $this->out('The interactive console is a tool for testing parts of your app before you commit code'); - $this->out(''); - $this->out('Model testing:'); - $this->out('To test model results, use the name of your model without a leading $'); - $this->out('e.g. Foo->find("all")'); - $this->out(''); - $this->out('To dynamically set associations, you can do the following:'); - $this->out("\tModelA bind ModelB"); - $this->out("where the supported assocations are hasOne, hasMany, belongsTo, hasAndBelongsToMany"); - $this->out(''); - $this->out('To dynamically remove associations, you can do the following:'); - $this->out("\t ModelA unbind ModelB"); - $this->out("where the supported associations are the same as above"); - $this->out(''); - $this->out("To save a new field in a model, you can do the following:"); - $this->out("\tModelA->save(array('foo' => 'bar', 'baz' => 0))"); - $this->out("where you are passing a hash of data to be saved in the format"); - $this->out("of field => value pairs"); - $this->out(''); - $this->out("To get column information for a model, use the following:"); - $this->out("\tModelA columns"); - $this->out("which returns a list of columns and their type"); - $this->out(''); - $this->out('Route testing:'); - $this->out('To test URLs against your app\'s route configuration, type:'); - $this->out("\tRoute "); - $this->out("where url is the path to your your action plus any query parameters, minus the"); - $this->out("application's base path"); - $this->out(''); - $this->out('To reload your routes config (config/routes.php), do the following:'); - $this->out("\tRoutes reload"); - $this->out(''); - $this->out(''); - $this->out('To show all connected routes, do the following:'); - $this->out("\tRoutes show"); - $this->out(''); + $this->help(); break; case 'quit': case 'exit': @@ -155,7 +172,7 @@ function main($command = null) { $association = $tmp[2]; $modelB = $tmp[3]; - if ($this->__isValidModel($modelA) && $this->__isValidModel($modelB) && in_array($association, $this->associations)) { + if ($this->_isValidModel($modelA) && $this->_isValidModel($modelB) && in_array($association, $this->associations)) { $this->{$modelA}->bindModel(array($association => array($modelB => array('className' => $modelB))), false); $this->out("Created $association association between $modelA and $modelB"); } else { @@ -182,7 +199,7 @@ function main($command = null) { } } - if ($this->__isValidModel($modelA) && $this->__isValidModel($modelB) && in_array($association, $this->associations) && $validCurrentAssociation) { + if ($this->_isValidModel($modelA) && $this->_isValidModel($modelB) && in_array($association, $this->associations) && $validCurrentAssociation) { $this->{$modelA}->unbindModel(array($association => array($modelB))); $this->out("Removed $association association between $modelA and $modelB"); } else { @@ -197,7 +214,7 @@ function main($command = null) { // Do we have a valid model? list($modelToCheck, $tmp) = explode('->', $command); - if ($this->__isValidModel($modelToCheck)) { + if ($this->_isValidModel($modelToCheck)) { $findCommand = "\$data = \$this->$command;"; @eval($findCommand); @@ -249,7 +266,7 @@ function main($command = null) { $command = str_replace($this->badCommandChars, "", $command); list($modelToSave, $tmp) = explode("->", $command); - if ($this->__isValidModel($modelToSave)) { + if ($this->_isValidModel($modelToSave)) { // Extract the array of data we are trying to build list($foo, $data) = explode("->save", $command); $badChars = array("(", ")"); @@ -262,7 +279,7 @@ function main($command = null) { case (preg_match("/^(\w+) columns/", $command, $tmp) == true): $modelToCheck = strip_tags(str_replace($this->badCommandChars, "", $tmp[1])); - if ($this->__isValidModel($modelToCheck)) { + if ($this->_isValidModel($modelToCheck)) { // Get the column info for this model $fieldsCommand = "\$data = \$this->{$modelToCheck}->getColumnTypes();"; @eval($fieldsCommand); @@ -278,7 +295,7 @@ function main($command = null) { break; case (preg_match("/^routes\s+reload/i", $command, $tmp) == true): $router =& Router::getInstance(); - if (!$this->__loadRoutes()) { + if (!$this->_loadRoutes()) { $this->out("There was an error loading the routes config. Please check that the file"); $this->out("exists and is free of parse errors."); break; @@ -289,6 +306,11 @@ function main($command = null) { $router =& Router::getInstance(); $this->out(join("\n", Set::extract($router->routes, '{n}.0'))); break; + case (preg_match("/^route\s+(\(.*\))$/i", $command, $tmp) == true): + if ($url = eval('return array' . $tmp[1] . ';')) { + $this->out(Router::url($url)); + } + break; case (preg_match("/^route\s+(.*)/i", $command, $tmp) == true): $this->out(var_export(Router::parse($tmp[1]), true)); break; @@ -304,9 +326,9 @@ function main($command = null) { * * @param string $modelToCheck * @return boolean true if is an available model, false otherwise - * @access private + * @access protected */ - function __isValidModel($modelToCheck) { + function _isValidModel($modelToCheck) { return in_array($modelToCheck, $this->models); } /** @@ -314,9 +336,9 @@ function __isValidModel($modelToCheck) { * all routes found * * @return boolean True if config reload was a success, otherwise false - * @access private + * @access protected */ - function __loadRoutes() { + function _loadRoutes() { $router =& Router::getInstance(); $router->reload(); From 23174203e3e17b34b8e56ac461a3b5bfd729e0b8 Mon Sep 17 00:00:00 2001 From: nate Date: Fri, 6 Feb 2009 18:13:17 -0500 Subject: [PATCH 0008/2083] Optimizing helper loading loop in View::_render() --- cake/libs/view/view.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index d0ad82bdf..a3c27b308 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -645,13 +645,13 @@ function _render($___viewFn, $___dataForView, $loadHelpers = true, $cached = fal if ($this->helpers != false && $loadHelpers === true) { $loadedHelpers = $this->_loadHelpers($loadedHelpers, $this->helpers); + $helpers = array_keys($loadedHelpers); + $helperNames = array_map(array('Inflector', 'variable'), $helpers); - foreach (array_keys($loadedHelpers) as $helper) { - $camelBackedHelper = Inflector::variable($helper); - ${$camelBackedHelper} =& $loadedHelpers[$helper]; - $this->loaded[$camelBackedHelper] =& ${$camelBackedHelper}; + for ($i = count($helpers) - 1; $i >= 0; $i--) { + ${$helperNames[$i]} =& $loadedHelpers[$helpers[$i]]; + $this->loaded[$helperNames[$i]] =& ${$helperNames[$i]}; } - $this->_triggerHelpers('beforeRender'); } From c2f111a45a2855d894d5748b576535adb2372df8 Mon Sep 17 00:00:00 2001 From: nate Date: Sat, 7 Feb 2009 08:41:15 -0500 Subject: [PATCH 0009/2083] Standardizing format string in PaginatorHelper::counter(), %page% becomes {:page}, old keys still work, but will be deprecated --- cake/libs/view/helpers/paginator.php | 31 ++++++++++--------- .../libs/view/helpers/paginator.test.php | 11 +++++-- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index 90b9d4b19..ef033cae1 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -390,6 +390,7 @@ function defaultModel() { * Returns a counter string for the paged result set * * @param mixed $options Options for the counter string. See #options for list of keys. + * @todo See about deprecating the keys in $map for formatting * @return string Counter string. */ function counter($options = array()) { @@ -429,7 +430,7 @@ function counter($options = array()) { $out = $paging['page'] . $options['separator'] . $paging['pageCount']; break; default: - $replace = array( + $map = array( '%page%' => $paging['page'], '%pages%' => $paging['pageCount'], '%current%' => $paging['current'], @@ -437,7 +438,12 @@ function counter($options = array()) { '%start%' => $start, '%end%' => $end ); - $out = str_replace(array_keys($replace), array_values($replace), $options['format']); + $out = str_replace(array_keys($map), array_values($map), $options['format']); + + $newKeys = array( + '{:page}', '{:pages}', '{:current}', '{:count}', '{:start}', '{:end}' + ); + $out = str_replace($newKeys, array_values($map), $out); break; } return $this->output($out); @@ -452,22 +458,17 @@ function counter($options = array()) { function numbers($options = array()) { if ($options === true) { $options = array( - 'before' => ' | ', 'after' => ' | ', - 'first' => 'first', 'last' => 'last', - ); + 'before' => ' | ', 'after' => ' | ', 'first' => 'first', 'last' => 'last' + ); } - $options = array_merge( - array( - 'tag' => 'span', - 'before'=> null, 'after'=> null, - 'model' => $this->defaultModel(), - 'modulus' => '8', 'separator' => ' | ', - 'first' => null, 'last' => null, - ), - (array)$options); + $defaults = array( + 'tag' => 'span', 'before' => null, 'after' => null, 'model' => $this->defaultModel(), + 'modulus' => '8', 'separator' => ' | ', 'first' => null, 'last' => null, + ); + $options += $defaults; - $params = array_merge(array('page'=> 1), (array)$this->params($options['model'])); + $params = (array)$this->params($options['model']) + array('page'=> 1); unset($options['model']); if ($params['pageCount'] <= 1) { diff --git a/cake/tests/cases/libs/view/helpers/paginator.test.php b/cake/tests/cases/libs/view/helpers/paginator.test.php index cef1ccea4..533c2ebc9 100644 --- a/cake/tests/cases/libs/view/helpers/paginator.test.php +++ b/cake/tests/cases/libs/view/helpers/paginator.test.php @@ -739,9 +739,16 @@ function testCounter() { ), ) ); - $input = 'Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%'; + $input = 'Page %page% of %pages%, showing %current% records out of %count% total, '; + $input .= 'starting on record %start%, ending on %end%'; + $result = $this->Paginator->counter($input); + $expected = 'Page 1 of 5, showing 3 records out of 13 total, starting on record 1, '; + $expected .= 'ending on 3'; + $this->assertEqual($result, $expected); + + $input = 'Page {:page} of {:pages}, showing {:current} records out of {:count} total, '; + $input .= 'starting on record {:start}, ending on {:end}'; $result = $this->Paginator->counter($input); - $expected = 'Page 1 of 5, showing 3 records out of 13 total, starting on record 1, ending on 3'; $this->assertEqual($result, $expected); $input = 'Page %page% of %pages%'; From 519db5e2811aab38ec56ea48bc794233e828bfab Mon Sep 17 00:00:00 2001 From: nate Date: Mon, 9 Feb 2009 11:39:37 -0500 Subject: [PATCH 0010/2083] Changing FormHelper::label() to allow param to be a string (class name) --- cake/libs/view/helpers/form.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 604f4823d..eff4fd736 100644 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -435,7 +435,7 @@ function error($field, $text = null, $options = array()) { * * @param string $fieldName This should be "Modelname.fieldname" * @param string $text Text that will appear in the label field. - * @param array $attributes Array of HTML attributes. + * @param Mixed $attributes An array of HTML attributes, or a string, to be used as a class name. * @return string The formatted LABEL element */ function label($fieldName = null, $text = null, $attributes = array()) { @@ -456,6 +456,10 @@ function label($fieldName = null, $text = null, $attributes = array()) { $text = __(Inflector::humanize(Inflector::underscore($text)), true); } + if (is_string($attributes)) { + $attributes = array('class' => $attributes); + } + if (isset($attributes['for'])) { $labelFor = $attributes['for']; unset($attributes['for']); From 133cb91fefc60725dc94d34f537fa0ac1bda2b6e Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 4 Mar 2009 23:07:40 -0500 Subject: [PATCH 0011/2083] Updating test suite header file. --- cake/tests/lib/header.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/tests/lib/header.php b/cake/tests/lib/header.php index 1fd6d9989..073382ef4 100644 --- a/cake/tests/lib/header.php +++ b/cake/tests/lib/header.php @@ -29,7 +29,7 @@ - CakePHP Test Suite v 1.2.0.0 + CakePHP Test Suite v 1.3.0.0 1Touch Screen KioskFinancial6Convert Sales15762<client_id>2</client_id><is_spotlight /><style_id>0</style_id><job_type_id>2</job_type_id><industry_id>2</industry_id><modified>2007-11-26 14:48:36</modified><created /><style><id /><name /></style><job_type><id>2</id><name>Awareness Campaign</name></job_type><industry><name>Education</name></industry><business_solution><id>4</id><name>Build Relationship</name></business_solution><business_solution><id>6</id><name>Convert Sales</name></business_solution><media_type>17</media_type><media_type>6</media_type></project>'; -// $this->assertEqual($expected, $result); -// } - -/* - * Broken due to a Set class issue - */ -// function testMixedArray() { -// $input = array('OptionGroup' => array( -// array('name' => 'OptA', 'id' => 12, 'OptA 1', 'OptA 2', 'OptA 3', 'OptA 4', 'OptA 5', 'OptA 6'), -// array('name' => 'OptB', 'id' => 12, 'OptB 1', 'OptB 2', 'OptB 3', 'OptB 4', 'OptB 5', 'OptB 6') -// )); -// $expected = '<option_group><name>OptA</name><id>12</id><option_group>OptA 1</option_group><option_group>OptA 2</option_group><option_group>OptA 3</option_group><option_group>OptA 4</option_group><option_group>OptA 5</option_group><option_group>OptA 6</option_group></option_group><option_group><name>OptB</name><id>12</id><option_group>OptB 1</option_group><option_group>OptB 2</option_group><option_group>OptB 3</option_group><option_group>OptB 4</option_group><option_group>OptB 5</option_group><option_group>OptB 6</option_group></option_group>'; -// $xml = new Xml($input, array('format' => 'tags')); -// $result = $xml->toString(array('header' => false, 'cdata' => false)); -// $this->assertEqual($expected, $result); -// } - -// function testMixedNestedArray() { -// $input = array( -// 'OptionA' => array( -// 'name' => 'OptA', -// 'id' => 12, -// 'opt' => array('OptA 1', 'OptA 2', 'OptA 3', 'OptA 4', 'OptA 5', 'OptA 6') -// ), -// 'OptionB' => array( -// 'name' => 'OptB', -// 'id' => 12, -// 'opt' => array('OptB 1', 'OptB 2', 'OptB 3', 'OptB 4', 'OptB 5', 'OptB 6') -// ) -// ); -// $expected = '<option_a><name>OptA</name><id>12</id><opt>OptA 1</opt><opt>OptA 2</opt><opt>OptA 3</opt><opt>OptA 4</opt><opt>OptA 5</opt><opt>OptA 6</opt></option_a><option_b><name>OptB</name><id>12</id><opt>OptB 1</opt><opt>OptB 2</opt><opt>OptB 3</opt><opt>OptB 4</opt><opt>OptB 5</opt><opt>OptB 6</opt></option_b>'; -// $xml = new Xml($input, array('format' => 'tags')); -// $result = $xml->toString(array('header' => false, 'cdata' => false)); -// $this->assertEqual($expected, $result); -// } - -// function testMixedArrayAttributes() { -// $input = array('OptionGroup' => array( -// array( -// 'name' => 'OptA', -// 'id' => 12, -// array('opt' => 'OptA 1'), -// array('opt' => 'OptA 2'), -// array('opt' => 'OptA 3'), -// array('opt' => 'OptA 4'), -// array('opt' => 'OptA 5'), -// array('opt' => 'OptA 6') -// ), -// array( -// 'name' => 'OptB', -// 'id' => 12, -// array('opt' => 'OptB 1'), -// array('opt' => 'OptB 2'), -// array('opt' => 'OptB 3'), -// array('opt' => 'OptB 4'), -// array('opt' => 'OptB 5'), -// array('opt' => 'OptB 6') -// ) -// )); -// $expected = '<option_group name="OptA" id="12"><opt>OptA 1</opt><opt>OptA 2</opt><opt>OptA 3</opt><opt>OptA 4</opt><opt>OptA 5</opt><opt>OptA 6</opt></option_group><option_group name="OptB" id="12"><opt>OptB 1</opt><opt>OptB 2</opt><opt>OptB 3</opt><opt>OptB 4</opt><opt>OptB 5</opt><opt>OptB 6</opt></option_group>'; -// -// $options = array('tags' => array('option_group' => array('attributes' => array('id', 'name')))); -// $xml = new Xml($input, $options); -// $result = $xml->toString(false); -// -// $this->assertEqual($expected, $result); -// } - -/* - * Not implemented yet - */ -// function testTagMap() { -// $input = array( -// array( -// 'Project' => array('id' => 1, 'title' => null, 'show' => 1, 'is_spotlight' => null, 'style_id' => 0, 'job_type_id' => 1, 'industry_id' => 1, 'modified' => null, 'created' => null), -// 'Style' => array('id' => null, 'name' => null), -// 'JobType' => array('id' => 1, 'name' => 'Touch Screen Kiosk'), -// 'Industry' => array('id' => 1, 'name' => 'Financial') -// ), -// array( -// 'Project' => array('id' => 2, 'title' => null, 'show' => 1, 'is_spotlight' => null, 'style_id' => 0, 'job_type_id' => 2, 'industry_id' => 2, 'modified' => '2007-11-26 14:48:36', 'created' => null), -// 'Style' => array('id' => null, 'name' => null), -// 'JobType' => array('id' => 2, 'name' => 'Awareness Campaign'), -// 'Industry' => array('id' => 2, 'name' => 'Education'), -// ) -// ); -// $expected = '<project id="1"><title /><show>1</show><is_spotlight /><style_id>0</style_id><job_type_id>1</job_type_id><industry_id>1</industry_id><modified /><created /><style id=""><name /></style><jobtype id="1">Touch Screen Kiosk</jobtype><industry id="1"><name>Financial</name></industry></project><project id="2"><title /><show>1</show><is_spotlight /><style_id>0</style_id><job_type_id>2</job_type_id><industry_id>2</industry_id><modified>2007-11-26 14:48:36</modified><created /><style id=""><name /></style><jobtype id="2">Awareness Campaign</jobtype><industry id="2"><name>Education</name></industry></project>'; -// -// $xml = new Xml($input, array('tags' => array( -// 'Project' => array('attributes' => array('id')), -// 'style' => array('attributes' => array('id')), -// 'JobType' => array('name' => 'jobtype', 'attributes' => array('id'), 'value' => 'name'), -// 'Industry' => array('attributes' => array('id')) -// ))); -// $result = $xml->toString(array('header' => false, 'cdata' => false)); -// $this->assertEqual($expected, $result); -// } + /* Not implemented yet */ + /* function testChildFilter() { + $input = array( + array( + 'Project' => array('id' => 1, 'title' => null, 'client_id' => 1, 'show' => 1, 'is_spotlight' => null, 'style_id' => 0, 'job_type_id' => 1, 'industry_id' => 1, 'modified' => null, 'created' => null), + 'Style' => array('id' => null, 'name' => null), + 'JobType' => array('id' => 1, 'name' => 'Touch Screen Kiosk'), + 'Industry' => array('id' => 1, 'name' => 'Financial'), + 'BusinessSolution' => array(array('id' => 6, 'name' => 'Convert Sales')), + 'MediaType' => array( + array('id' => 15, 'name' => 'Print'), + array('id' => 7, 'name' => 'Web Demo'), + array('id' => 6, 'name' => 'CD-ROM') + ) + ), + array( + 'Project' => array('id' => 2, 'title' => null, 'client_id' => 2, 'show' => 1, 'is_spotlight' => null, 'style_id' => 0, 'job_type_id' => 2, 'industry_id' => 2, 'modified' => '2007-11-26 14:48:36', 'created' => null), + 'Style' => array('id' => null, 'name' => null), + 'JobType' => array('id' => 2, 'name' => 'Awareness Campaign'), + 'Industry' => array('id' => 2, 'name' => 'Education'), + 'BusinessSolution' => array( + array('id' => 4, 'name' => 'Build Relationship'), + array('id' => 6, 'name' => 'Convert Sales') + ), + 'MediaType' => array( + array('id' => 17, 'name' => 'Web'), + array('id' => 6, 'name' => 'CD-ROM') + ) + ) + ); + + $xml = new Xml($input, array('format' => 'tags', 'tags' => array( + 'MediaType' => array('value' => 'id', 'children' => false), + 'JobType' => array('children' => array()), + 'Industry' => array('children' => array('name')), + 'show' => false + ))); + + $result = $xml->toString(array('header' => false, 'cdata' => false)); + $expected = '<project><id>1</id><title /><client_id>1</client_id><is_spotlight /><style_id>0</style_id><job_type_id>1</job_type_id><industry_id>1</industry_id><modified /><created /><style><id /><name /></style><job_type><id>1</id><name>Touch Screen Kiosk</name></job_type><industry><name>Financial</name></industry><business_solution><id>6</id><name>Convert Sales</name></business_solution><media_type>15</media_type><media_type>7</media_type><media_type>6</media_type></project><project><id>2</id><title /><client_id>2</client_id><is_spotlight /><style_id>0</style_id><job_type_id>2</job_type_id><industry_id>2</industry_id><modified>2007-11-26 14:48:36</modified><created /><style><id /><name /></style><job_type><id>2</id><name>Awareness Campaign</name></job_type><industry><name>Education</name></industry><business_solution><id>4</id><name>Build Relationship</name></business_solution><business_solution><id>6</id><name>Convert Sales</name></business_solution><media_type>17</media_type><media_type>6</media_type></project>'; + $this->assertEqual($expected, $result); + } */ + + /* Broken due to a Set class issue */ + /* function testMixedArray() { + $input = array('OptionGroup' => array( + array('name' => 'OptA', 'id' => 12, 'OptA 1', 'OptA 2', 'OptA 3', 'OptA 4', 'OptA 5', 'OptA 6'), + array('name' => 'OptB', 'id' => 12, 'OptB 1', 'OptB 2', 'OptB 3', 'OptB 4', 'OptB 5', 'OptB 6') + )); + $expected = '<option_group><name>OptA</name><id>12</id><option_group>OptA 1</option_group><option_group>OptA 2</option_group><option_group>OptA 3</option_group><option_group>OptA 4</option_group><option_group>OptA 5</option_group><option_group>OptA 6</option_group></option_group><option_group><name>OptB</name><id>12</id><option_group>OptB 1</option_group><option_group>OptB 2</option_group><option_group>OptB 3</option_group><option_group>OptB 4</option_group><option_group>OptB 5</option_group><option_group>OptB 6</option_group></option_group>'; + $xml = new Xml($input, array('format' => 'tags')); + $result = $xml->toString(array('header' => false, 'cdata' => false)); + $this->assertEqual($expected, $result); + } */ + + /* function testMixedNestedArray() { + $input = array( + 'OptionA' => array( + 'name' => 'OptA', + 'id' => 12, + 'opt' => array('OptA 1', 'OptA 2', 'OptA 3', 'OptA 4', 'OptA 5', 'OptA 6') + ), + 'OptionB' => array( + 'name' => 'OptB', + 'id' => 12, + 'opt' => array('OptB 1', 'OptB 2', 'OptB 3', 'OptB 4', 'OptB 5', 'OptB 6') + ) + ); + $expected = '<option_a><name>OptA</name><id>12</id><opt>OptA 1</opt><opt>OptA 2</opt><opt>OptA 3</opt><opt>OptA 4</opt><opt>OptA 5</opt><opt>OptA 6</opt></option_a><option_b><name>OptB</name><id>12</id><opt>OptB 1</opt><opt>OptB 2</opt><opt>OptB 3</opt><opt>OptB 4</opt><opt>OptB 5</opt><opt>OptB 6</opt></option_b>'; + $xml = new Xml($input, array('format' => 'tags')); + $result = $xml->toString(array('header' => false, 'cdata' => false)); + $this->assertEqual($expected, $result); + } */ + + /* function testMixedArrayAttributes() { + $input = array('OptionGroup' => array( + array( + 'name' => 'OptA', + 'id' => 12, + array('opt' => 'OptA 1'), + array('opt' => 'OptA 2'), + array('opt' => 'OptA 3'), + array('opt' => 'OptA 4'), + array('opt' => 'OptA 5'), + array('opt' => 'OptA 6') + ), + array( + 'name' => 'OptB', + 'id' => 12, + array('opt' => 'OptB 1'), + array('opt' => 'OptB 2'), + array('opt' => 'OptB 3'), + array('opt' => 'OptB 4'), + array('opt' => 'OptB 5'), + array('opt' => 'OptB 6') + ) + )); + $expected = '<option_group name="OptA" id="12"><opt>OptA 1</opt><opt>OptA 2</opt><opt>OptA 3</opt><opt>OptA 4</opt><opt>OptA 5</opt><opt>OptA 6</opt></option_group><option_group name="OptB" id="12"><opt>OptB 1</opt><opt>OptB 2</opt><opt>OptB 3</opt><opt>OptB 4</opt><opt>OptB 5</opt><opt>OptB 6</opt></option_group>'; + + $options = array('tags' => array('option_group' => array('attributes' => array('id', 'name')))); + $xml = new Xml($input, $options); + $result = $xml->toString(false); + + $this->assertEqual($expected, $result); + } */ + + /* Not implemented yet */ + /* function testTagMap() { + $input = array( + array( + 'Project' => array('id' => 1, 'title' => null, 'show' => 1, 'is_spotlight' => null, 'style_id' => 0, 'job_type_id' => 1, 'industry_id' => 1, 'modified' => null, 'created' => null), + 'Style' => array('id' => null, 'name' => null), + 'JobType' => array('id' => 1, 'name' => 'Touch Screen Kiosk'), + 'Industry' => array('id' => 1, 'name' => 'Financial') + ), + array( + 'Project' => array('id' => 2, 'title' => null, 'show' => 1, 'is_spotlight' => null, 'style_id' => 0, 'job_type_id' => 2, 'industry_id' => 2, 'modified' => '2007-11-26 14:48:36', 'created' => null), + 'Style' => array('id' => null, 'name' => null), + 'JobType' => array('id' => 2, 'name' => 'Awareness Campaign'), + 'Industry' => array('id' => 2, 'name' => 'Education'), + ) + ); + $expected = '<project id="1"><title /><show>1</show><is_spotlight /><style_id>0</style_id><job_type_id>1</job_type_id><industry_id>1</industry_id><modified /><created /><style id=""><name /></style><jobtype id="1">Touch Screen Kiosk</jobtype><industry id="1"><name>Financial</name></industry></project><project id="2"><title /><show>1</show><is_spotlight /><style_id>0</style_id><job_type_id>2</job_type_id><industry_id>2</industry_id><modified>2007-11-26 14:48:36</modified><created /><style id=""><name /></style><jobtype id="2">Awareness Campaign</jobtype><industry id="2"><name>Education</name></industry></project>'; + + $xml = new Xml($input, array('tags' => array( + 'Project' => array('attributes' => array('id')), + 'style' => array('attributes' => array('id')), + 'JobType' => array('name' => 'jobtype', 'attributes' => array('id'), 'value' => 'name'), + 'Industry' => array('attributes' => array('id')) + ))); + $result = $xml->toString(array('header' => false, 'cdata' => false)); + $this->assertEqual($expected, $result); + } */ /** * testAllCData method * @@ -530,18 +528,15 @@ function testAllCData() { $result = $xml->toString(array('header' => false, 'cdata' => true)); $this->assertEqual($expected, $result); } - -/* - * PHP-native Unicode support pending - */ -// function testConvertEntities() { -// $input = array('project' => 'écît'); -// $xml = new Xml($input); -// -// $result = $xml->toString(array('header' => false, 'cdata' => false, 'convertEntities' => true)); -// $expected = '<project>écît</project>'; -// $this->assertEqual($result, $expected); -// } + /* PHP-native Unicode support pending */ + /* function testConvertEntities() { + $input = array('project' => 'écît'); + $xml = new Xml($input); + + $result = $xml->toString(array('header' => false, 'cdata' => false, 'convertEntities' => true)); + $expected = '<project>écît</project>'; + $this->assertEqual($result, $expected); + } */ /** * testWhitespace method * @@ -973,8 +968,12 @@ function testToArray() { $this->assertEqual($result, $expected); } - - +/** + * testAppend method + * + * @access public + * @return void + */ function testAppend() { $parentNode = new XmlNode('ourParentNode'); $parentNode->append( new XmlNode('ourChildNode')); @@ -990,8 +989,12 @@ function testAppend() { $this->expectError(); $parentNode->append($parentNode); } - - +/** + * testNamespacing method + * + * @access public + * @return void + */ function testNamespacing() { $node = new Xml('<xml></xml>'); $node->addNamespace('cake', 'http://cakephp.org'); @@ -1008,7 +1011,12 @@ function testNamespacing() { $node->addNamespace('cake', 'http://cakephp.org'); $this->assertEqual($node->toString(), '<xml xmlns:cake="http://cakephp.org" />'); } - +/** + * testCamelize method + * + * @access public + * @return void + */ function testCamelize() { $xmlString = '<methodCall><methodName>examples.getStateName</methodName>' . '<params><param><value><i4>41</i4></value></param></params></methodCall>'; @@ -1029,7 +1037,12 @@ function testCamelize() { 'Param' => array('Value' => array('i4' => 41))))); $this->assertEqual($expected, $Xml->toArray()); } - +/** + * testNumericDataHandling method + * + * @access public + * @return void + */ function testNumericDataHandling() { $data = '<xml><data>012345</data></xml>'; @@ -1044,5 +1057,4 @@ function testNumericDataHandling() { $this->assertEqual($result->value, '012345'); } } - ?> \ No newline at end of file diff --git a/cake/tests/fixtures/account_fixture.php b/cake/tests/fixtures/account_fixture.php index 3825d84b1..5bd0e28c4 100644 --- a/cake/tests/fixtures/account_fixture.php +++ b/cake/tests/fixtures/account_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class AccountFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/aco_action_fixture.php b/cake/tests/fixtures/aco_action_fixture.php index 80481f4a5..2c35d5fe6 100644 --- a/cake/tests/fixtures/aco_action_fixture.php +++ b/cake/tests/fixtures/aco_action_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class AcoActionFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/aco_fixture.php b/cake/tests/fixtures/aco_fixture.php index 8af60f808..316925e81 100644 --- a/cake/tests/fixtures/aco_fixture.php +++ b/cake/tests/fixtures/aco_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class AcoFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/aco_two_fixture.php b/cake/tests/fixtures/aco_two_fixture.php index f24d56621..f139c9266 100644 --- a/cake/tests/fixtures/aco_two_fixture.php +++ b/cake/tests/fixtures/aco_two_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class AcoTwoFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/advertisement_fixture.php b/cake/tests/fixtures/advertisement_fixture.php index 080539bf5..f5062336a 100644 --- a/cake/tests/fixtures/advertisement_fixture.php +++ b/cake/tests/fixtures/advertisement_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class AdvertisementFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/another_article_fixture.php b/cake/tests/fixtures/another_article_fixture.php index a2b48796f..ec3d19c0c 100644 --- a/cake/tests/fixtures/another_article_fixture.php +++ b/cake/tests/fixtures/another_article_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class AnotherArticleFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/apple_fixture.php b/cake/tests/fixtures/apple_fixture.php index b5cf7ec7d..d8d3e1250 100644 --- a/cake/tests/fixtures/apple_fixture.php +++ b/cake/tests/fixtures/apple_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class AppleFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/aro_fixture.php b/cake/tests/fixtures/aro_fixture.php index e3846bd8d..96ae59828 100644 --- a/cake/tests/fixtures/aro_fixture.php +++ b/cake/tests/fixtures/aro_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class AroFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/aro_two_fixture.php b/cake/tests/fixtures/aro_two_fixture.php index 31f76dd46..a61d35c0b 100644 --- a/cake/tests/fixtures/aro_two_fixture.php +++ b/cake/tests/fixtures/aro_two_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class AroTwoFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/aros_aco_fixture.php b/cake/tests/fixtures/aros_aco_fixture.php index abe1250ad..be181c6fb 100644 --- a/cake/tests/fixtures/aros_aco_fixture.php +++ b/cake/tests/fixtures/aros_aco_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class ArosAcoFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/aros_aco_two_fixture.php b/cake/tests/fixtures/aros_aco_two_fixture.php index df6925fb0..74866e5fe 100644 --- a/cake/tests/fixtures/aros_aco_two_fixture.php +++ b/cake/tests/fixtures/aros_aco_two_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class ArosAcoTwoFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/article_featured_fixture.php b/cake/tests/fixtures/article_featured_fixture.php index de5ff45fa..67b967499 100644 --- a/cake/tests/fixtures/article_featured_fixture.php +++ b/cake/tests/fixtures/article_featured_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class ArticleFeaturedFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/article_featureds_tags_fixture.php b/cake/tests/fixtures/article_featureds_tags_fixture.php index 45bc2aed6..e1ac130f6 100644 --- a/cake/tests/fixtures/article_featureds_tags_fixture.php +++ b/cake/tests/fixtures/article_featureds_tags_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class ArticleFeaturedsTagsFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/article_fixture.php b/cake/tests/fixtures/article_fixture.php index 3e499b255..fe2721d74 100644 --- a/cake/tests/fixtures/article_fixture.php +++ b/cake/tests/fixtures/article_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class ArticleFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/articles_tag_fixture.php b/cake/tests/fixtures/articles_tag_fixture.php index d78dd521f..a19bcd142 100644 --- a/cake/tests/fixtures/articles_tag_fixture.php +++ b/cake/tests/fixtures/articles_tag_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class ArticlesTagFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/attachment_fixture.php b/cake/tests/fixtures/attachment_fixture.php index b48bc0d19..de0d8b492 100644 --- a/cake/tests/fixtures/attachment_fixture.php +++ b/cake/tests/fixtures/attachment_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class AttachmentFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/auth_user_custom_field_fixture.php b/cake/tests/fixtures/auth_user_custom_field_fixture.php index 9618d6c1e..ebc2c3f29 100644 --- a/cake/tests/fixtures/auth_user_custom_field_fixture.php +++ b/cake/tests/fixtures/auth_user_custom_field_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.1.8013 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class AuthUserCustomFieldFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/auth_user_fixture.php b/cake/tests/fixtures/auth_user_fixture.php index dba79d42e..d16c7759e 100644 --- a/cake/tests/fixtures/auth_user_fixture.php +++ b/cake/tests/fixtures/auth_user_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class AuthUserFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/author_fixture.php b/cake/tests/fixtures/author_fixture.php index 2144d5970..96ee0ea44 100644 --- a/cake/tests/fixtures/author_fixture.php +++ b/cake/tests/fixtures/author_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class AuthorFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/basket_fixture.php b/cake/tests/fixtures/basket_fixture.php index 8fd3326fe..c20014ff3 100644 --- a/cake/tests/fixtures/basket_fixture.php +++ b/cake/tests/fixtures/basket_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class BasketFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/bid_fixture.php b/cake/tests/fixtures/bid_fixture.php index 2b3dde78f..9b118cca8 100644 --- a/cake/tests/fixtures/bid_fixture.php +++ b/cake/tests/fixtures/bid_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class BidFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/binary_test_fixture.php b/cake/tests/fixtures/binary_test_fixture.php index 819b38de0..b9c09cbe2 100644 --- a/cake/tests/fixtures/binary_test_fixture.php +++ b/cake/tests/fixtures/binary_test_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.6700 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class BinaryTestFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/book_fixture.php b/cake/tests/fixtures/book_fixture.php index fd958420b..823408c8f 100644 --- a/cake/tests/fixtures/book_fixture.php +++ b/cake/tests/fixtures/book_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.7198 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class BookFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/cache_test_model_fixture.php b/cake/tests/fixtures/cache_test_model_fixture.php index 09449cf99..ff4f855c0 100644 --- a/cake/tests/fixtures/cache_test_model_fixture.php +++ b/cake/tests/fixtures/cache_test_model_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class CacheTestModelFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/callback_fixture.php b/cake/tests/fixtures/callback_fixture.php index c62e27465..6ef3d1eb5 100644 --- a/cake/tests/fixtures/callback_fixture.php +++ b/cake/tests/fixtures/callback_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class CallbackFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/category_fixture.php b/cake/tests/fixtures/category_fixture.php index b6abdb50f..5cb04f106 100644 --- a/cake/tests/fixtures/category_fixture.php +++ b/cake/tests/fixtures/category_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class CategoryFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/category_thread_fixture.php b/cake/tests/fixtures/category_thread_fixture.php index 04e00f1bd..5da10d7d8 100644 --- a/cake/tests/fixtures/category_thread_fixture.php +++ b/cake/tests/fixtures/category_thread_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class CategoryThreadFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/cd_fixture.php b/cake/tests/fixtures/cd_fixture.php index a639e13e9..16b74f565 100644 --- a/cake/tests/fixtures/cd_fixture.php +++ b/cake/tests/fixtures/cd_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.7198 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class CdFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/comment_fixture.php b/cake/tests/fixtures/comment_fixture.php index 3c563102b..b2283c9af 100644 --- a/cake/tests/fixtures/comment_fixture.php +++ b/cake/tests/fixtures/comment_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class CommentFixture extends CakeTestFixture { @@ -60,12 +60,12 @@ class CommentFixture extends CakeTestFixture { * @access public */ var $records = array( - array('id' => 1, 'article_id' => 1, 'user_id' => 2, 'comment' => 'First Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:45:23', 'updated' => '2007-03-18 10:47:31'), - array('id' => 2, 'article_id' => 1, 'user_id' => 4, 'comment' => 'Second Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:47:23', 'updated' => '2007-03-18 10:49:31'), - array('id' => 3, 'article_id' => 1, 'user_id' => 1, 'comment' => 'Third Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:49:23', 'updated' => '2007-03-18 10:51:31'), - array('id' => 4, 'article_id' => 1, 'user_id' => 1, 'comment' => 'Fourth Comment for First Article', 'published' => 'N', 'created' => '2007-03-18 10:51:23', 'updated' => '2007-03-18 10:53:31'), - array('id' => 5, 'article_id' => 2, 'user_id' => 1, 'comment' => 'First Comment for Second Article', 'published' => 'Y', 'created' => '2007-03-18 10:53:23', 'updated' => '2007-03-18 10:55:31'), - array('id' => 6, 'article_id' => 2, 'user_id' => 2, 'comment' => 'Second Comment for Second Article', 'published' => 'Y', 'created' => '2007-03-18 10:55:23', 'updated' => '2007-03-18 10:57:31') + array('article_id' => 1, 'user_id' => 2, 'comment' => 'First Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:45:23', 'updated' => '2007-03-18 10:47:31'), + array('article_id' => 1, 'user_id' => 4, 'comment' => 'Second Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:47:23', 'updated' => '2007-03-18 10:49:31'), + array('article_id' => 1, 'user_id' => 1, 'comment' => 'Third Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:49:23', 'updated' => '2007-03-18 10:51:31'), + array('article_id' => 1, 'user_id' => 1, 'comment' => 'Fourth Comment for First Article', 'published' => 'N', 'created' => '2007-03-18 10:51:23', 'updated' => '2007-03-18 10:53:31'), + array('article_id' => 2, 'user_id' => 1, 'comment' => 'First Comment for Second Article', 'published' => 'Y', 'created' => '2007-03-18 10:53:23', 'updated' => '2007-03-18 10:55:31'), + array('article_id' => 2, 'user_id' => 2, 'comment' => 'Second Comment for Second Article', 'published' => 'Y', 'created' => '2007-03-18 10:55:23', 'updated' => '2007-03-18 10:57:31') ); } diff --git a/cake/tests/fixtures/content_account_fixture.php b/cake/tests/fixtures/content_account_fixture.php index 3677861c6..8eb7be738 100644 --- a/cake/tests/fixtures/content_account_fixture.php +++ b/cake/tests/fixtures/content_account_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class ContentAccountFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/content_fixture.php b/cake/tests/fixtures/content_fixture.php index 1a9dc6c8f..b7e3131cd 100644 --- a/cake/tests/fixtures/content_fixture.php +++ b/cake/tests/fixtures/content_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class ContentFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/counter_cache_post_fixture.php b/cake/tests/fixtures/counter_cache_post_fixture.php index fdbb5a39c..eb9413072 100644 --- a/cake/tests/fixtures/counter_cache_post_fixture.php +++ b/cake/tests/fixtures/counter_cache_post_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision: 7848 $ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class CounterCachePostFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/counter_cache_user_fixture.php b/cake/tests/fixtures/counter_cache_user_fixture.php index 3ee6ec954..ad592386a 100644 --- a/cake/tests/fixtures/counter_cache_user_fixture.php +++ b/cake/tests/fixtures/counter_cache_user_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision: 7848 $ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class CounterCacheUserFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/data_test_fixture.php b/cake/tests/fixtures/data_test_fixture.php index c596d2289..afed9aa9b 100644 --- a/cake/tests/fixtures/data_test_fixture.php +++ b/cake/tests/fixtures/data_test_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.6700 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class DataTestFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/datatype_fixture.php b/cake/tests/fixtures/datatype_fixture.php index 3aa2e5872..281da2f48 100644 --- a/cake/tests/fixtures/datatype_fixture.php +++ b/cake/tests/fixtures/datatype_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.7026 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class DatatypeFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/dependency_fixture.php b/cake/tests/fixtures/dependency_fixture.php index c15412ef5..8b1720798 100644 --- a/cake/tests/fixtures/dependency_fixture.php +++ b/cake/tests/fixtures/dependency_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.6879//Correct version number as needed** * @version $Revision$ @@ -29,7 +29,7 @@ * * Long description for file * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.6879//Correct version number as needed** */ diff --git a/cake/tests/fixtures/device_fixture.php b/cake/tests/fixtures/device_fixture.php index 6a48987b8..3b0638d15 100644 --- a/cake/tests/fixtures/device_fixture.php +++ b/cake/tests/fixtures/device_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class DeviceFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/device_type_category_fixture.php b/cake/tests/fixtures/device_type_category_fixture.php index 1f02f0127..ee33c18b2 100644 --- a/cake/tests/fixtures/device_type_category_fixture.php +++ b/cake/tests/fixtures/device_type_category_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class DeviceTypeCategoryFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/device_type_fixture.php b/cake/tests/fixtures/device_type_fixture.php index 884bf3581..cb8970a57 100644 --- a/cake/tests/fixtures/device_type_fixture.php +++ b/cake/tests/fixtures/device_type_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class DeviceTypeFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/document_directory_fixture.php b/cake/tests/fixtures/document_directory_fixture.php index 3887c3a55..ff67dfa47 100644 --- a/cake/tests/fixtures/document_directory_fixture.php +++ b/cake/tests/fixtures/document_directory_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class DocumentDirectoryFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/document_fixture.php b/cake/tests/fixtures/document_fixture.php index 1825bfbce..fde15f92d 100644 --- a/cake/tests/fixtures/document_fixture.php +++ b/cake/tests/fixtures/document_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class DocumentFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/exterior_type_category_fixture.php b/cake/tests/fixtures/exterior_type_category_fixture.php index 8390c1f57..0905c3eca 100644 --- a/cake/tests/fixtures/exterior_type_category_fixture.php +++ b/cake/tests/fixtures/exterior_type_category_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class ExteriorTypeCategoryFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/feature_set_fixture.php b/cake/tests/fixtures/feature_set_fixture.php index e27fc300c..533601535 100644 --- a/cake/tests/fixtures/feature_set_fixture.php +++ b/cake/tests/fixtures/feature_set_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class FeatureSetFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/featured_fixture.php b/cake/tests/fixtures/featured_fixture.php index 35e449c2b..3f3e83372 100644 --- a/cake/tests/fixtures/featured_fixture.php +++ b/cake/tests/fixtures/featured_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class FeaturedFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/film_file_fixture.php b/cake/tests/fixtures/film_file_fixture.php index 7d8b2be1a..1483947a3 100644 --- a/cake/tests/fixtures/film_file_fixture.php +++ b/cake/tests/fixtures/film_file_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class FilmFileFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/flag_tree_fixture.php b/cake/tests/fixtures/flag_tree_fixture.php index 625d88732..d81744261 100644 --- a/cake/tests/fixtures/flag_tree_fixture.php +++ b/cake/tests/fixtures/flag_tree_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.5331 * @version $Revision$ diff --git a/cake/tests/fixtures/fruit_fixture.php b/cake/tests/fixtures/fruit_fixture.php index 9a0329d36..bf90baea8 100644 --- a/cake/tests/fixtures/fruit_fixture.php +++ b/cake/tests/fixtures/fruit_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.7953 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class FruitFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/fruits_uuid_tag_fixture.php b/cake/tests/fixtures/fruits_uuid_tag_fixture.php index bc0fce628..7c84c660d 100644 --- a/cake/tests/fixtures/fruits_uuid_tag_fixture.php +++ b/cake/tests/fixtures/fruits_uuid_tag_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.7953 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class FruitsUuidTagFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/home_fixture.php b/cake/tests/fixtures/home_fixture.php index 9abe255f4..f88b8f7b0 100644 --- a/cake/tests/fixtures/home_fixture.php +++ b/cake/tests/fixtures/home_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class HomeFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/image_fixture.php b/cake/tests/fixtures/image_fixture.php index 787193eac..e30862fc9 100644 --- a/cake/tests/fixtures/image_fixture.php +++ b/cake/tests/fixtures/image_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class ImageFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/item_fixture.php b/cake/tests/fixtures/item_fixture.php index bf6d40ef7..1602fb698 100644 --- a/cake/tests/fixtures/item_fixture.php +++ b/cake/tests/fixtures/item_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class ItemFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/items_portfolio_fixture.php b/cake/tests/fixtures/items_portfolio_fixture.php index df99f8261..fb7dd71bb 100644 --- a/cake/tests/fixtures/items_portfolio_fixture.php +++ b/cake/tests/fixtures/items_portfolio_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class ItemsPortfolioFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/join_a_b_fixture.php b/cake/tests/fixtures/join_a_b_fixture.php index 66276e99c..c1a5db5df 100644 --- a/cake/tests/fixtures/join_a_b_fixture.php +++ b/cake/tests/fixtures/join_a_b_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.6317 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class JoinABFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/join_a_c_fixture.php b/cake/tests/fixtures/join_a_c_fixture.php index 0c1094f95..2fc335b3e 100644 --- a/cake/tests/fixtures/join_a_c_fixture.php +++ b/cake/tests/fixtures/join_a_c_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.6317 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class JoinACFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/join_a_fixture.php b/cake/tests/fixtures/join_a_fixture.php index b05d3a709..a4401e452 100644 --- a/cake/tests/fixtures/join_a_fixture.php +++ b/cake/tests/fixtures/join_a_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.6317 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class JoinAFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/join_b_fixture.php b/cake/tests/fixtures/join_b_fixture.php index 47da00c4b..16294ce97 100644 --- a/cake/tests/fixtures/join_b_fixture.php +++ b/cake/tests/fixtures/join_b_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.6317 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class JoinBFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/join_c_fixture.php b/cake/tests/fixtures/join_c_fixture.php index c0d0d7f27..333f3e28b 100644 --- a/cake/tests/fixtures/join_c_fixture.php +++ b/cake/tests/fixtures/join_c_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.6317 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class JoinCFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/join_thing_fixture.php b/cake/tests/fixtures/join_thing_fixture.php index e0c9dd10e..59ebe680c 100644 --- a/cake/tests/fixtures/join_thing_fixture.php +++ b/cake/tests/fixtures/join_thing_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class JoinThingFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/message_fixture.php b/cake/tests/fixtures/message_fixture.php index f0153bd96..94b53d5ca 100644 --- a/cake/tests/fixtures/message_fixture.php +++ b/cake/tests/fixtures/message_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class MessageFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/my_categories_my_products_fixture.php b/cake/tests/fixtures/my_categories_my_products_fixture.php index b3ef7a429..b570340fc 100644 --- a/cake/tests/fixtures/my_categories_my_products_fixture.php +++ b/cake/tests/fixtures/my_categories_my_products_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class MyCategoriesMyProductsFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/my_categories_my_users_fixture.php b/cake/tests/fixtures/my_categories_my_users_fixture.php index 0c559b1be..d708d8dc5 100644 --- a/cake/tests/fixtures/my_categories_my_users_fixture.php +++ b/cake/tests/fixtures/my_categories_my_users_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class MyCategoriesMyUsersFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/my_category_fixture.php b/cake/tests/fixtures/my_category_fixture.php index 3900ad2b3..c333890c3 100644 --- a/cake/tests/fixtures/my_category_fixture.php +++ b/cake/tests/fixtures/my_category_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class MyCategoryFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/my_product_fixture.php b/cake/tests/fixtures/my_product_fixture.php index 3d90bd83b..9e2f7948a 100644 --- a/cake/tests/fixtures/my_product_fixture.php +++ b/cake/tests/fixtures/my_product_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class MyProductFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/my_user_fixture.php b/cake/tests/fixtures/my_user_fixture.php index a10d73100..1806851a8 100644 --- a/cake/tests/fixtures/my_user_fixture.php +++ b/cake/tests/fixtures/my_user_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class MyUserFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/node_fixture.php b/cake/tests/fixtures/node_fixture.php index 24b9e1bd6..a75ac25ae 100644 --- a/cake/tests/fixtures/node_fixture.php +++ b/cake/tests/fixtures/node_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.6879 //Correct version number as needed** * @version $Revision$ @@ -29,7 +29,7 @@ * * Long description for file * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.6879 //Correct version number as needed** */ diff --git a/cake/tests/fixtures/number_tree_fixture.php b/cake/tests/fixtures/number_tree_fixture.php index 5b2ac33a5..4e1b973e8 100644 --- a/cake/tests/fixtures/number_tree_fixture.php +++ b/cake/tests/fixtures/number_tree_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.5331 * @version $Revision$ diff --git a/cake/tests/fixtures/numeric_article_fixture.php b/cake/tests/fixtures/numeric_article_fixture.php index e6f69bf0a..44fdce11c 100644 --- a/cake/tests/fixtures/numeric_article_fixture.php +++ b/cake/tests/fixtures/numeric_article_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class NumericArticleFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/overall_favorite_fixture.php b/cake/tests/fixtures/overall_favorite_fixture.php index b27f5b681..b36ba1b44 100644 --- a/cake/tests/fixtures/overall_favorite_fixture.php +++ b/cake/tests/fixtures/overall_favorite_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.7198 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class OverallFavoriteFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/person_fixture.php b/cake/tests/fixtures/person_fixture.php index 795dff586..160befaeb 100644 --- a/cake/tests/fixtures/person_fixture.php +++ b/cake/tests/fixtures/person_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.6700 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class PersonFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/portfolio_fixture.php b/cake/tests/fixtures/portfolio_fixture.php index 68ce2f9eb..7b4bcb584 100644 --- a/cake/tests/fixtures/portfolio_fixture.php +++ b/cake/tests/fixtures/portfolio_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class PortfolioFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/post_fixture.php b/cake/tests/fixtures/post_fixture.php index d0b352ba0..9277517ed 100644 --- a/cake/tests/fixtures/post_fixture.php +++ b/cake/tests/fixtures/post_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class PostFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/posts_tag_fixture.php b/cake/tests/fixtures/posts_tag_fixture.php index f748f4ee5..2c4ae6c7f 100644 --- a/cake/tests/fixtures/posts_tag_fixture.php +++ b/cake/tests/fixtures/posts_tag_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class PostsTagFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/primary_model_fixture.php b/cake/tests/fixtures/primary_model_fixture.php index 0345a6dbf..8c0b3e7bc 100644 --- a/cake/tests/fixtures/primary_model_fixture.php +++ b/cake/tests/fixtures/primary_model_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class PrimaryModelFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/product_fixture.php b/cake/tests/fixtures/product_fixture.php index b3bfdc3bb..9355030eb 100644 --- a/cake/tests/fixtures/product_fixture.php +++ b/cake/tests/fixtures/product_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Rev$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class ProductFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/project_fixture.php b/cake/tests/fixtures/project_fixture.php index b2cd02879..6f48b05b8 100644 --- a/cake/tests/fixtures/project_fixture.php +++ b/cake/tests/fixtures/project_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class ProjectFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/sample_fixture.php b/cake/tests/fixtures/sample_fixture.php index 8561a9b88..87448938a 100644 --- a/cake/tests/fixtures/sample_fixture.php +++ b/cake/tests/fixtures/sample_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class SampleFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/secondary_model_fixture.php b/cake/tests/fixtures/secondary_model_fixture.php index e73049eb6..8c7ccfc3a 100644 --- a/cake/tests/fixtures/secondary_model_fixture.php +++ b/cake/tests/fixtures/secondary_model_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class SecondaryModelFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/session_fixture.php b/cake/tests/fixtures/session_fixture.php index ec843ed1a..1dc3c751a 100644 --- a/cake/tests/fixtures/session_fixture.php +++ b/cake/tests/fixtures/session_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Rev$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class SessionFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/something_else_fixture.php b/cake/tests/fixtures/something_else_fixture.php index d83d618b4..7b6dbd2cd 100644 --- a/cake/tests/fixtures/something_else_fixture.php +++ b/cake/tests/fixtures/something_else_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class SomethingElseFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/something_fixture.php b/cake/tests/fixtures/something_fixture.php index a4625bff9..cecfb3f9d 100644 --- a/cake/tests/fixtures/something_fixture.php +++ b/cake/tests/fixtures/something_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class SomethingFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/stories_tag_fixture.php b/cake/tests/fixtures/stories_tag_fixture.php index 9b5ecd3b6..b39566abb 100644 --- a/cake/tests/fixtures/stories_tag_fixture.php +++ b/cake/tests/fixtures/stories_tag_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class StoriesTagFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/story_fixture.php b/cake/tests/fixtures/story_fixture.php index 9a0940127..c8e90de6d 100644 --- a/cake/tests/fixtures/story_fixture.php +++ b/cake/tests/fixtures/story_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class StoryFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/syfile_fixture.php b/cake/tests/fixtures/syfile_fixture.php index a9ff72bc6..8e5a075ad 100644 --- a/cake/tests/fixtures/syfile_fixture.php +++ b/cake/tests/fixtures/syfile_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class SyfileFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/tag_fixture.php b/cake/tests/fixtures/tag_fixture.php index e37ee676d..afc205e57 100644 --- a/cake/tests/fixtures/tag_fixture.php +++ b/cake/tests/fixtures/tag_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class TagFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/test_plugin_article_fixture.php b/cake/tests/fixtures/test_plugin_article_fixture.php index 1d9d71ab8..148fea15d 100644 --- a/cake/tests/fixtures/test_plugin_article_fixture.php +++ b/cake/tests/fixtures/test_plugin_article_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 7660 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class TestPluginArticleFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/test_plugin_comment_fixture.php b/cake/tests/fixtures/test_plugin_comment_fixture.php index 1df50f191..847d2ce4b 100644 --- a/cake/tests/fixtures/test_plugin_comment_fixture.php +++ b/cake/tests/fixtures/test_plugin_comment_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 7660 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class TestPluginCommentFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/the_paper_monkies_fixture.php b/cake/tests/fixtures/the_paper_monkies_fixture.php index 95a4d2b55..f8efce2db 100644 --- a/cake/tests/fixtures/the_paper_monkies_fixture.php +++ b/cake/tests/fixtures/the_paper_monkies_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class ThePaperMonkiesFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/thread_fixture.php b/cake/tests/fixtures/thread_fixture.php index 7dff2320a..118aa0ff2 100644 --- a/cake/tests/fixtures/thread_fixture.php +++ b/cake/tests/fixtures/thread_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class ThreadFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/translate_article_fixture.php b/cake/tests/fixtures/translate_article_fixture.php index d5c4d8c8e..549872c34 100644 --- a/cake/tests/fixtures/translate_article_fixture.php +++ b/cake/tests/fixtures/translate_article_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.5669 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class TranslateArticleFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/translate_fixture.php b/cake/tests/fixtures/translate_fixture.php index b70dde9b2..17b97a956 100644 --- a/cake/tests/fixtures/translate_fixture.php +++ b/cake/tests/fixtures/translate_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.5669 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class TranslateFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/translate_table_fixture.php b/cake/tests/fixtures/translate_table_fixture.php index 09638db8d..1a645e375 100644 --- a/cake/tests/fixtures/translate_table_fixture.php +++ b/cake/tests/fixtures/translate_table_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.5669 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class TranslateTableFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/translated_article_fixture.php b/cake/tests/fixtures/translated_article_fixture.php index 10662ca2f..bce536975 100644 --- a/cake/tests/fixtures/translated_article_fixture.php +++ b/cake/tests/fixtures/translated_article_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.5669 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class TranslatedArticleFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/translated_item_fixture.php b/cake/tests/fixtures/translated_item_fixture.php index 7ca94c392..f8b93ce8a 100644 --- a/cake/tests/fixtures/translated_item_fixture.php +++ b/cake/tests/fixtures/translated_item_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.5669 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class TranslatedItemFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/unconventional_tree_fixture.php b/cake/tests/fixtures/unconventional_tree_fixture.php index 0fd236737..87b517842 100644 --- a/cake/tests/fixtures/unconventional_tree_fixture.php +++ b/cake/tests/fixtures/unconventional_tree_fixture.php @@ -14,7 +14,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.7879 * @version $Revision$ diff --git a/cake/tests/fixtures/underscore_field_fixture.php b/cake/tests/fixtures/underscore_field_fixture.php index a5f09e6e1..c87ace540 100644 --- a/cake/tests/fixtures/underscore_field_fixture.php +++ b/cake/tests/fixtures/underscore_field_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ diff --git a/cake/tests/fixtures/user_fixture.php b/cake/tests/fixtures/user_fixture.php index 1299bd7b3..bb8478034 100644 --- a/cake/tests/fixtures/user_fixture.php +++ b/cake/tests/fixtures/user_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class UserFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/uuid_fixture.php b/cake/tests/fixtures/uuid_fixture.php index a2d2946c7..12a0dd99f 100644 --- a/cake/tests/fixtures/uuid_fixture.php +++ b/cake/tests/fixtures/uuid_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.6700 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class UuidFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/uuid_tag_fixture.php b/cake/tests/fixtures/uuid_tag_fixture.php index 0eb3b2b88..0665b4649 100644 --- a/cake/tests/fixtures/uuid_tag_fixture.php +++ b/cake/tests/fixtures/uuid_tag_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.7953 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class UuidTagFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/uuid_tree_fixture.php b/cake/tests/fixtures/uuid_tree_fixture.php index 129767284..6cc36c43b 100644 --- a/cake/tests/fixtures/uuid_tree_fixture.php +++ b/cake/tests/fixtures/uuid_tree_fixture.php @@ -14,7 +14,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.7984 * @version $Revision$ diff --git a/cake/tests/fixtures/uuiditem_fixture.php b/cake/tests/fixtures/uuiditem_fixture.php index 26cbe667e..bbc9b0592 100644 --- a/cake/tests/fixtures/uuiditem_fixture.php +++ b/cake/tests/fixtures/uuiditem_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class UuiditemFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php b/cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php index db83d322b..c3c961282 100644 --- a/cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php +++ b/cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class UuiditemsUuidportfolioFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php b/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php index 08d20d4b5..9938db735 100644 --- a/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php +++ b/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php @@ -1,5 +1,5 @@ <?php -/* SVN FILE: $Id:$ */ +/* SVN FILE: $Id$ */ /** * Short description for file. * @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class UuiditemsUuidportfolioNumericidFixture extends CakeTestFixture { diff --git a/cake/tests/fixtures/uuidportfolio_fixture.php b/cake/tests/fixtures/uuidportfolio_fixture.php index abdb25184..96c65d978 100644 --- a/cake/tests/fixtures/uuidportfolio_fixture.php +++ b/cake/tests/fixtures/uuidportfolio_fixture.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.4667 * @version $Revision$ @@ -27,7 +27,7 @@ /** * Short description for class. * - * @package cake.tests + * @package cake * @subpackage cake.tests.fixtures */ class UuidportfolioFixture extends CakeTestFixture { diff --git a/cake/tests/groups/acl.group.php b/cake/tests/groups/acl.group.php index 25598425e..7dad05ff2 100644 --- a/cake/tests/groups/acl.group.php +++ b/cake/tests/groups/acl.group.php @@ -1,7 +1,7 @@ <?php /* SVN FILE: $Id$ */ /** - * Short description for file. + * AclAndAuthGroupTest file * * Long description for file * @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.groups * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ @@ -24,16 +24,11 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ -/** AclAndAuthGroupTest - * - * This test group will run the Acl and Auth tests - * - * @package cake.tests - * @subpackage cake.tests.groups - */ /** * AclAndAuthGroupTest class * + * This test group will run the Acl and Auth tests + * * @package cake * @subpackage cake.tests.groups */ @@ -44,7 +39,7 @@ class AclAndAuthGroupTest extends GroupTest { * @var string 'Acl and Auth Tests' * @access public */ - var $label = 'Acl and Auth Tests'; + var $label = 'Acl and Auth'; /** * AclAndAuthGroupTest method * @@ -57,4 +52,4 @@ function AclAndAuthGroupTest() { TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'components' . DS . 'auth'); } } -?> +?> \ No newline at end of file diff --git a/cake/tests/groups/cache.group.php b/cake/tests/groups/cache.group.php index 74d8bfb1a..fd7060909 100644 --- a/cake/tests/groups/cache.group.php +++ b/cake/tests/groups/cache.group.php @@ -1,7 +1,7 @@ <?php /* SVN FILE: $Id$ */ /** - * Short description for file. + * AllCacheEnginesGroupTest file * * Long description for file * @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.groups * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ @@ -24,16 +24,11 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ -/** AllCacheEngines - * - * This test group will run all the Cache class test and all core cache engine tests - * - * @package cake.tests - * @subpackage cake.tests.groups - */ /** * AllCacheEnginesGroupTest class * + * This test group will run all the Cache class test and all core cache engine tests + * * @package cake * @subpackage cake.tests.groups */ @@ -44,7 +39,7 @@ class AllCacheEnginesGroupTest extends GroupTest { * @var string 'All core cache engines' * @access public */ - var $label = 'All core cache engines'; + var $label = 'Cache and all CacheEngines'; /** * AllCacheEnginesGroupTest method * @@ -56,4 +51,4 @@ function AllCacheEnginesGroupTest() { TestManager::addTestCasesFromDirectory($this, CORE_TEST_CASES . DS . 'libs' . DS . 'cache'); } } -?> +?> \ No newline at end of file diff --git a/cake/tests/groups/components.group.php b/cake/tests/groups/components.group.php index a2e4a60da..ececd9021 100644 --- a/cake/tests/groups/components.group.php +++ b/cake/tests/groups/components.group.php @@ -1,7 +1,7 @@ <?php /* SVN FILE: $Id$ */ /** - * Short description for file. + * AllCoreComponentsGroupTest file * * Long description for file * @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.groups * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ @@ -24,16 +24,11 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ -/** AllCoreHelpersGroupTest - * - * This test group will run all tests in the cases/libs/controller/components directory. - * - * @package cake.tests - * @subpackage cake.tests.groups - */ /** * AllCoreComponentsGroupTest class * + * This test group will run all tests in the cases/libs/controller/components directory. + * * @package cake * @subpackage cake.tests.groups */ @@ -44,7 +39,7 @@ class AllCoreComponentsGroupTest extends GroupTest { * @var string 'All core components' * @access public */ - var $label = 'All core components'; + var $label = 'All Components'; /** * AllCoreComponentsGroupTest method * @@ -55,4 +50,4 @@ function AllCoreComponentsGroupTest() { TestManager::addTestCasesFromDirectory($this, CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'components'); } } -?> +?> \ No newline at end of file diff --git a/cake/tests/groups/configure.group.php b/cake/tests/groups/configure.group.php index f07652a15..e1e8f35fd 100644 --- a/cake/tests/groups/configure.group.php +++ b/cake/tests/groups/configure.group.php @@ -1,7 +1,7 @@ <?php /* SVN FILE: $Id$ */ /** - * Short description for file. + * ConfigureGroupTest file * * Long description for file * @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.groups * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ @@ -24,16 +24,11 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ -/** ConfigureGroupTest - * - * This test group will run all test for the configure and loader. - * - * @package cake.tests - * @subpackage cake.tests.groups - */ /** * ConfigureGroupTest class * + * This test group will run all test for the configure and loader. + * * @package cake * @subpackage cake.tests.groups */ @@ -44,7 +39,7 @@ class ConfigureGroupTest extends GroupTest { * @var string 'Configure, Loader, ClassRegistry Tests' * @access public */ - var $label = 'Configure, Loader, ClassRegistry Tests'; + var $label = 'Configure, App and ClassRegistry'; /** * ConfigureGroupTest method * @@ -56,4 +51,4 @@ function ConfigureGroupTest() { TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'class_registry'); } } -?> +?> \ No newline at end of file diff --git a/cake/tests/groups/console.group.php b/cake/tests/groups/console.group.php index 4e2e8188b..42391d114 100644 --- a/cake/tests/groups/console.group.php +++ b/cake/tests/groups/console.group.php @@ -1,7 +1,7 @@ <?php /* SVN FILE: $Id$ */ /** - * Short description for file. + * ConsoleGroupTest file * * Long description for file * @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.groups * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ @@ -24,16 +24,11 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ -/** AllConsoleGroupTest - * - * This test group will run all console tests - * - * @package cake.tests - * @subpackage cake.tests.groups - */ /** * AllConsoleGroupTest class * + * This test group will run all console tests + * * @package cake * @subpackage cake.tests.groups */ @@ -44,7 +39,7 @@ class AllConsoleGroupTest extends GroupTest { * @var string 'All core cache engines' * @access public */ - var $label = 'All console tests'; + var $label = 'ShellDispatcher, Shell and all Tasks'; /** * AllConsoleGroupTest method * diff --git a/cake/tests/groups/helpers.group.php b/cake/tests/groups/helpers.group.php index fe8ebab04..6dac7623b 100644 --- a/cake/tests/groups/helpers.group.php +++ b/cake/tests/groups/helpers.group.php @@ -1,7 +1,7 @@ <?php /* SVN FILE: $Id$ */ /** - * Short description for file. + * AllCoreHelpersGroupTest file * * Long description for file * @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.groups * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ @@ -24,16 +24,11 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ -/** AllCoreHelpersGroupTest - * - * This test group will run all test in the cases/libs/view/helpers directory. - * - * @package cake.tests - * @subpackage cake.tests.groups - */ /** * AllCoreHelpersGroupTest class * + * This test group will run all test in the cases/libs/view/helpers directory. + * * @package cake * @subpackage cake.tests.groups */ @@ -44,7 +39,7 @@ class AllCoreHelpersGroupTest extends GroupTest { * @var string 'All core helpers' * @access public */ - var $label = 'All core helpers'; + var $label = 'All Helpers'; /** * AllCoreHelpersGroupTest method * @@ -56,4 +51,4 @@ function AllCoreHelpersGroupTest() { TestManager::addTestCasesFromDirectory($this, CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'helpers'); } } -?> +?> \ No newline at end of file diff --git a/cake/tests/groups/lib.group.php b/cake/tests/groups/lib.group.php index e3fa8fa46..4e68dd3dc 100644 --- a/cake/tests/groups/lib.group.php +++ b/cake/tests/groups/lib.group.php @@ -1,7 +1,7 @@ <?php /* SVN FILE: $Id$ */ /** - * Short description for file. + * AllCoreLibGroupTest file * * Long description for file * @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.groups * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ @@ -24,16 +24,11 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ -/** AllCoreLibGroupTest - * - * This test group will run all test in the cases/libs directory. - * - * @package cake.tests - * @subpackage cake.tests.groups - */ /** * AllCoreLibGroupTest class * + * This test group will run all test in the cases/libs directory. + * * @package cake * @subpackage cake.tests.groups */ @@ -44,7 +39,7 @@ class AllCoreLibGroupTest extends GroupTest { * @var string 'All cake/libs/* (Not yet implemented)' * @access public */ - var $label = 'All cake/libs/* (Not yet implemented)'; + var $label = 'All Libs'; /** * AllCoreLibGroupTest method * @@ -55,4 +50,4 @@ function AllCoreLibGroupTest() { TestManager::addTestCasesFromDirectory($this, CORE_TEST_CASES . DS . 'libs'); } } -?> +?> \ No newline at end of file diff --git a/cake/tests/groups/lib_controller.group.php b/cake/tests/groups/lib_controller.group.php index 022c5d003..8a5afc07a 100644 --- a/cake/tests/groups/lib_controller.group.php +++ b/cake/tests/groups/lib_controller.group.php @@ -1,7 +1,7 @@ <?php /* SVN FILE: $Id$ */ /** - * Short description for file. + * LibControllerGroupTest file * * Long description for file * @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.groups * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ @@ -25,9 +25,9 @@ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ /** - * Short description for class. + * LibControllerGroupTest * - * @package cake.tests + * @package cake * @subpackage cake.tests.groups */ class LibControllerGroupTest extends GroupTest { @@ -37,7 +37,7 @@ class LibControllerGroupTest extends GroupTest { * @var string 'All cake/libs/controller/* (Not yet implemented)' * @access public */ - var $label = 'All cake/libs/controller/* (Not yet implemented)'; + var $label = 'All Controllers and Components'; /** * LibControllerGroupTest method * diff --git a/cake/tests/groups/model.group.php b/cake/tests/groups/model.group.php index bba4b7d7c..867b1ba50 100644 --- a/cake/tests/groups/model.group.php +++ b/cake/tests/groups/model.group.php @@ -1,7 +1,7 @@ <?php /* SVN FILE: $Id$ */ /** - * Short description for file. + * ModelGroupTest file * * Long description for file * @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.groups * @since CakePHP(tm) v 1.2.0.5517 * @version $Revision$ @@ -24,17 +24,12 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ -/** ModelGroupTest +/** + * ModelGroupTest class * * This test group will run all model-layer and related tests, (behaviors, etc.) excluding * database driver-specific tests * - * @package cake.tests - * @subpackage cake.tests.groups - */ -/** - * ModelGroupTest class - * * @package cake * @subpackage cake.tests.groups */ @@ -45,7 +40,7 @@ class ModelGroupTest extends GroupTest { * @var string 'All model tests' * @access public */ - var $label = 'All model tests'; + var $label = 'Model, all Behaviors and Datasources'; /** * ModelGroupTest method * @@ -60,4 +55,4 @@ function ModelGroupTest() { TestManager::addTestCasesFromDirectory($this, CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'behaviors'); } } -?> +?> \ No newline at end of file diff --git a/cake/tests/groups/no_database.group.php b/cake/tests/groups/no_database.group.php index bc367eec2..f8071959f 100644 --- a/cake/tests/groups/no_database.group.php +++ b/cake/tests/groups/no_database.group.php @@ -1,7 +1,7 @@ <?php /* SVN FILE: $Id$ */ /** - * Short description for file. + * AllCoreWithoutDatabaseGroupTest file * * Long description for file * @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.groups * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ @@ -24,34 +24,29 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ -/** AllCoreLibGroupTest - * - * This test group will run all test in the cases/libs directory. - * - * @package cake.tests - * @subpackage cake.tests.groups - */ /** * AllCoreWithOutDatabaseGroupTest class * + * This test group will run all test in the cases/libs directory. + * * @package cake * @subpackage cake.tests.groups */ -class AllCoreWithOutDatabaseGroupTest extends GroupTest { +class AllCoreWithoutDatabaseGroupTest extends GroupTest { /** * label property * * @var string 'All tests without a database connection' * @access public */ - var $label = 'All tests without a database connection'; + var $label = 'All Libs not requiring a database connection'; /** * AllCoreWithOutDatabaseGroupTest method * * @access public * @return void */ - function AllCoreWithOutDatabaseGroupTest() { + function AllCoreWithoutDatabaseGroupTest() { TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'dispatcher'); TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'router'); TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'inflector'); @@ -61,4 +56,4 @@ function AllCoreWithOutDatabaseGroupTest() { TestManager::addTestCasesFromDirectory($this, CORE_TEST_CASES . DS . 'libs' . DS . 'view'); } } -?> +?> \ No newline at end of file diff --git a/cake/tests/groups/routing_system.group.php b/cake/tests/groups/routing_system.group.php index 9104a9961..1afb59f12 100644 --- a/cake/tests/groups/routing_system.group.php +++ b/cake/tests/groups/routing_system.group.php @@ -1,7 +1,7 @@ <?php /* SVN FILE: $Id$ */ /** - * Short description for file. + * RoutingSystemGroupTest * * Long description for file * @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.groups * @since CakePHP(tm) v 1.2.0.5517 * @version $Revision$ @@ -24,16 +24,11 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ -/** RoutingSystemGroupTest - * - * This test group will run all the Router/Dispatcher (and related) tests - * - * @package cake.tests - * @subpackage cake.tests.groups - */ /** * RoutingSystemGroupTest class * + * This test group will run all the Router/Dispatcher (and related) tests + * * @package cake * @subpackage cake.tests.groups */ @@ -44,7 +39,7 @@ class RoutingSystemGroupTest extends GroupTest { * @var string 'Routing system' * @access public */ - var $label = 'Routing system'; + var $label = 'Router and Dispatcher'; /** * RoutingSystemGroupTest method * @@ -56,4 +51,4 @@ function RoutingSystemGroupTest() { TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'router'); } } -?> +?> \ No newline at end of file diff --git a/cake/tests/groups/socket.group.php b/cake/tests/groups/socket.group.php index a1b1f6bc0..6645dcb24 100644 --- a/cake/tests/groups/socket.group.php +++ b/cake/tests/groups/socket.group.php @@ -1,7 +1,7 @@ <?php /* SVN FILE: $Id$ */ /** - * Short description for file. + * SocketGroupTest file * * Long description for file * @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2007, Cake Software Foundation, Inc. * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.groups * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ @@ -24,16 +24,11 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ -/** Socket and HttpSocket tests - * - * This test group will run socket class tests (socket, http_socket). - * - * @package cake.tests - * @subpackage cake.tests.groups - */ /** * SocketGroupTest class * + * This test group will run socket class tests (socket, http_socket). + * * @package cake * @subpackage cake.tests.groups */ @@ -44,7 +39,7 @@ class SocketGroupTest extends GroupTest { * @var string 'Socket and HttpSocket tests' * @access public */ - var $label = 'Socket and HttpSocket tests'; + var $label = 'Socket and HttpSocket'; /** * SocketGroupTest method * @@ -56,4 +51,4 @@ function SocketGroupTest() { TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'http_socket'); } } -?> +?> \ No newline at end of file diff --git a/cake/tests/groups/test_suite.group.php b/cake/tests/groups/test_suite.group.php index 3b7262f14..bccb39955 100644 --- a/cake/tests/groups/test_suite.group.php +++ b/cake/tests/groups/test_suite.group.php @@ -1,7 +1,7 @@ <?php /* SVN FILE: $Id$ */ /** - * Test Suite Test Group + * TestSuiteGroupTest file * * Long description for file * @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2007, Cake Software Foundation, Inc. * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.groups * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ @@ -24,16 +24,11 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ -/** Test Suite Test Group - * - * This test group will run the test cases for the test suite classes. - * - * @package cake.tests - * @subpackage cake.tests.groups - */ /** * TestSuiteGroupTest class * + * This test group will run the test cases for the test suite classes. + * * @package cake * @subpackage cake.tests.groups */ @@ -44,7 +39,7 @@ class TestSuiteGroupTest extends GroupTest { * @var string 'Socket and HttpSocket tests' * @access public */ - var $label = 'Test Suite Tests'; + var $label = 'TestSuite'; /** * TestSuiteGroupTest method * @@ -59,4 +54,4 @@ function TestSuiteGroupTest() { } } -?> +?> \ No newline at end of file diff --git a/cake/tests/groups/view.group.php b/cake/tests/groups/view.group.php index c04276b40..5569e771f 100644 --- a/cake/tests/groups/view.group.php +++ b/cake/tests/groups/view.group.php @@ -1,7 +1,7 @@ <?php /* SVN FILE: $Id$ */ /** - * Short description for file. + * AllCoreViewsGroupTest file * * Long description for file * @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.groups * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ @@ -24,16 +24,11 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ -/** AllCoreViewsGroupTest - * - * This test group will run view class tests (view, theme). - * - * @package cake.tests - * @subpackage cake.tests.groups - */ /** * AllCoreViewsGroupTest class * + * This test group will run view class tests (view, theme) + * * @package cake * @subpackage cake.tests.groups */ @@ -44,7 +39,7 @@ class AllCoreViewsGroupTest extends GroupTest { * @var string 'All core views' * @access public */ - var $label = 'All core views'; + var $label = 'View and ThemeView'; /** * AllCoreViewsGroupTest method * @@ -56,4 +51,4 @@ function AllCoreViewsGroupTest() { TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'theme'); } } -?> +?> \ No newline at end of file diff --git a/cake/tests/groups/xml.group.php b/cake/tests/groups/xml.group.php index f746a85f3..95d945a48 100644 --- a/cake/tests/groups/xml.group.php +++ b/cake/tests/groups/xml.group.php @@ -1,7 +1,7 @@ <?php /* SVN FILE: $Id$ */ /** - * Xml Group test. + * XmlGroupTest file * * Long description for file * @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.groups * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ @@ -24,16 +24,11 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ -/** XmlGroupTest - * - * This test group will run view class tests (view, theme). - * - * @package cake.tests - * @subpackage cake.tests.groups - */ /** * XmlGroupTest class * + * This test group will run view class tests (view, theme). + * * @package cake * @subpackage cake.tests.groups */ @@ -44,7 +39,7 @@ class XmlGroupTest extends GroupTest { * @var string 'All core views' * @access public */ - var $label = 'All Xml based classes'; + var $label = 'Xml based classes (Xml, XmlHelper and RssHelper)'; /** * AllCoreViewsGroupTest method * @@ -57,4 +52,4 @@ function XmlGroupTest() { TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'helpers' . DS .'xml'); } } -?> +?> \ No newline at end of file diff --git a/cake/tests/test_app/controllers/tests_apps_controller.php b/cake/tests/test_app/controllers/tests_apps_controller.php index b9a8c3f18..4800490f5 100644 --- a/cake/tests/test_app/controllers/tests_apps_controller.php +++ b/cake/tests/test_app/controllers/tests_apps_controller.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ diff --git a/cake/tests/test_app/controllers/tests_apps_posts_controller.php b/cake/tests/test_app/controllers/tests_apps_posts_controller.php index 27d0c4c19..e9b0d0464 100644 --- a/cake/tests/test_app/controllers/tests_apps_posts_controller.php +++ b/cake/tests/test_app/controllers/tests_apps_posts_controller.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ diff --git a/cake/tests/test_app/models/behaviors/persister_one_behavior.php b/cake/tests/test_app/models/behaviors/persister_one_behavior.php new file mode 100644 index 000000000..63f5998a6 --- /dev/null +++ b/cake/tests/test_app/models/behaviors/persister_one_behavior.php @@ -0,0 +1,38 @@ +<?php +/* SVN FILE: $Id$ */ +/** + * Behavior for binding management. + * + * Behavior to simplify manipulating a model's bindings when doing a find operation + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.tests.test_app.models + * @since CakePHP(tm) v 1.2.0.5669 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Behavior to allow for dynamic and atomic manipulation of a Model's associations used for a find call. Most useful for limiting + * the amount of associations and data returned. + * + * @package cake + * @subpackage cake.cake.console.libs + */ +class PersisterOneBehaviorBehavior extends ModelBehavior { + + +} +?> \ No newline at end of file diff --git a/cake/tests/test_app/models/behaviors/persister_two_behavior.php b/cake/tests/test_app/models/behaviors/persister_two_behavior.php new file mode 100644 index 000000000..c032fc3e2 --- /dev/null +++ b/cake/tests/test_app/models/behaviors/persister_two_behavior.php @@ -0,0 +1,38 @@ +<?php +/* SVN FILE: $Id$ */ +/** + * Behavior for binding management. + * + * Behavior to simplify manipulating a model's bindings when doing a find operation + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.tests.test_app.models + * @since CakePHP(tm) v 1.2.0.5669 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Behavior to allow for dynamic and atomic manipulation of a Model's associations used for a find call. Most useful for limiting + * the amount of associations and data returned. + * + * @package cake + * @subpackage cake.cake.console.libs + */ +class PersisterTwoBehaviorBehavior extends ModelBehavior { + + +} +?> \ No newline at end of file diff --git a/cake/tests/test_app/models/persister_one.php b/cake/tests/test_app/models/persister_one.php new file mode 100644 index 000000000..76222829f --- /dev/null +++ b/cake/tests/test_app/models/persister_one.php @@ -0,0 +1,35 @@ +<?php +/* SVN FILE: $Id$ */ +/** + * Test App Comment Model + * + * + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2006-2008, Cake Software Foundation, Inc. + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @package cake + * @subpackage cake.tests.test_app.models + * @since CakePHP v 1.2.0.7726 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +class PersisterOne extends AppModel { + var $useTable = 'posts'; + var $name = 'PersisterOne'; + + var $actsAs = array('PersisterOneBehavior'); + + var $hasMany = array('Comment'); +} +?> \ No newline at end of file diff --git a/cake/tests/test_app/models/persister_two.php b/cake/tests/test_app/models/persister_two.php new file mode 100644 index 000000000..4596f9479 --- /dev/null +++ b/cake/tests/test_app/models/persister_two.php @@ -0,0 +1,35 @@ +<?php +/* SVN FILE: $Id$ */ +/** + * Test App Comment Model + * + * + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2006-2008, Cake Software Foundation, Inc. + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @package cake + * @subpackage cake.tests.test_app.models + * @since CakePHP v 1.2.0.7726 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +class PersisterTwo extends AppModel { + var $useTable = 'posts'; + var $name = 'PersisterTwo'; + + var $actsAs = array('PersisterOneBehavior'); + + var $hasMany = array('Comment'); +} +?> \ No newline at end of file diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/components/other_component.php b/cake/tests/test_app/plugins/test_plugin/controllers/components/other_component.php index aafb23b95..ab3cb7b22 100644 --- a/cake/tests/test_app/plugins/test_plugin/controllers/components/other_component.php +++ b/cake/tests/test_app/plugins/test_plugin/controllers/components/other_component.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php b/cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php index 4aea19621..6a80527d9 100644 --- a/cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php +++ b/cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers * @since CakePHP(tm) v 1.2.0.4206 * @version $Rev$ diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php b/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php index 40d46886e..23a462bf9 100644 --- a/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php +++ b/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php b/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php index 7d6811db5..560e0702f 100644 --- a/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php +++ b/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php b/cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php index 52eff57bf..565a4cd9a 100644 --- a/cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php +++ b/cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers * @since CakePHP(tm) v 1.2.0.4206 * @version $Rev$ diff --git a/cake/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php b/cake/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php index e556feef2..56ad96b9c 100644 --- a/cake/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php +++ b/cake/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.cases.libs * @since CakePHP(tm) v 1.2.0.5432 * @version $Rev$ diff --git a/cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php b/cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php index e7fb2d61b..b6510715b 100644 --- a/cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php +++ b/cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.cases.libs * @since CakePHP(tm) v 1.2.0.5432 * @version $Rev$ diff --git a/cake/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php b/cake/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php index f5a7b532e..d4152137e 100644 --- a/cake/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php +++ b/cake/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.vendors.sample * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ diff --git a/cake/tests/test_app/plugins/test_plugin/vendors/shells/example.php b/cake/tests/test_app/plugins/test_plugin/vendors/shells/example.php index de1bb8f66..d363e9217 100644 --- a/cake/tests/test_app/plugins/test_plugin/vendors/shells/example.php +++ b/cake/tests/test_app/plugins/test_plugin/vendors/shells/example.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.vendors.shells * @since CakePHP(tm) v 1.2.0.7871 * @version $Revision$ diff --git a/cake/tests/test_app/plugins/test_plugin/vendors/welcome.php b/cake/tests/test_app/plugins/test_plugin/vendors/welcome.php index b6fa6a85e..b5122b327 100644 --- a/cake/tests/test_app/plugins/test_plugin/vendors/welcome.php +++ b/cake/tests/test_app/plugins/test_plugin/vendors/welcome.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.vendors * @since CakePHP(tm) v 1.2.0.7629 * @version $Revision$ diff --git a/cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php b/cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php index 01d504683..9ec662708 100644 --- a/cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php +++ b/cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ diff --git a/cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php b/cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php index 3f91f3b33..084eee80e 100644 --- a/cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php +++ b/cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ diff --git a/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/example.php b/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/example.php index 9f590db93..9e4b23fd3 100644 --- a/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/example.php +++ b/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/example.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin_two.vendors.shells * @since CakePHP(tm) v 1.2.0.7871 * @version $Revision$ diff --git a/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/welcome.php b/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/welcome.php index 8bcb0e63a..57f09f3ee 100644 --- a/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/welcome.php +++ b/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/welcome.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin_two.vendors.shells * @since CakePHP(tm) v 1.2.0.7871 * @version $Revision$ diff --git a/cake/tests/test_app/vendors/Test/MyTest.php b/cake/tests/test_app/vendors/Test/MyTest.php index 6773aef9a..2705dffc2 100644 --- a/cake/tests/test_app/vendors/Test/MyTest.php +++ b/cake/tests/test_app/vendors/Test/MyTest.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.test_app.vendors.somename * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ diff --git a/cake/tests/test_app/vendors/Test/hello.php b/cake/tests/test_app/vendors/Test/hello.php index 72f983b00..d96fa7047 100644 --- a/cake/tests/test_app/vendors/Test/hello.php +++ b/cake/tests/test_app/vendors/Test/hello.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.test_app.vendors.Test * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ diff --git a/cake/tests/test_app/vendors/sample/configure_test_vendor_sample.php b/cake/tests/test_app/vendors/sample/configure_test_vendor_sample.php index 2fed84ac6..252c860d7 100644 --- a/cake/tests/test_app/vendors/sample/configure_test_vendor_sample.php +++ b/cake/tests/test_app/vendors/sample/configure_test_vendor_sample.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.test_app.vendors.sample * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ diff --git a/cake/tests/test_app/vendors/shells/sample.php b/cake/tests/test_app/vendors/shells/sample.php index 7c115fa92..738c57911 100644 --- a/cake/tests/test_app/vendors/shells/sample.php +++ b/cake/tests/test_app/vendors/shells/sample.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.test_app.vendors.shells * @since CakePHP(tm) v 1.2.0.7871 * @version $Revision$ diff --git a/cake/tests/test_app/vendors/somename/some.name.php b/cake/tests/test_app/vendors/somename/some.name.php index 65357c56d..442fabcd0 100644 --- a/cake/tests/test_app/vendors/somename/some.name.php +++ b/cake/tests/test_app/vendors/somename/some.name.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.test_app.vendors.somename * @since CakePHP(tm) v 1.2.0.4206 * @version $Revision$ diff --git a/cake/tests/test_app/vendors/welcome.php b/cake/tests/test_app/vendors/welcome.php index 8f235ac5a..edb18261b 100644 --- a/cake/tests/test_app/vendors/welcome.php +++ b/cake/tests/test_app/vendors/welcome.php @@ -16,7 +16,7 @@ * @filesource * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake.tests + * @package cake * @subpackage cake.tests.test_app.vendors * @since CakePHP(tm) v 1.2.0.7629 * @version $Revision$ From 0bd3cc97c105e0f5d94398da7fe5b03e604c3f68 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 19 Mar 2009 22:02:18 -0400 Subject: [PATCH 0058/2083] Adding tests and features for script caching to files. --- cake/libs/view/helpers/js.php | 6 ++++- .../tests/cases/libs/view/helpers/js.test.php | 22 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index d0c866504..7eeeb8438 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -142,7 +142,11 @@ function writeScripts($options = array()) { return $this->Html->scriptBlock($script, $options); } if ($options['cache'] && $options['inline']) { - //@todo cache to file and return script tag. + $filename = md5($script); + if (!file_exists(JS . $filename . '.js')) { + cache(str_replace(WWW_ROOT, '', JS) . $filename . '.js', $script, '+999 days', 'public'); + } + return $this->Html->script($filename); } $view =& ClassRegistry::getObject('view'); $view->addScript($script); diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index a6ee2a249..e70ef652d 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -159,6 +159,28 @@ function testWriteScriptsNoFile() { $view->expectAt(0, 'addScript', array(new PatternExpectation('/one\s=\s1;\ntwo\=\2;/'))); $result = $this->Js->writeScripts(array('onDomReady' => false, 'inline' => false, 'cache' => false)); } +/** + * test that writeScripts makes files, and puts the events into them. + * + * @return void + **/ + function testWriteScriptsInFile() { + if ($this->skipIf(!is_writable(JS), 'webroot/js is not Writable, script caching test has been skipped')) { + return; + } + $this->Js->JsBaseEngine = new TestJsEngineHelper(); + $this->Js->writeCache('one = 1;'); + $this->Js->writeCache('two = 2;'); + $result = $this->Js->writeScripts(array('onDomReady' => false)); + $expected = array( + 'script' => array('type' => 'text/javascript', 'src' => 'preg:/(.)*\.js/'), + ); + $this->assertTags($result, $expected); + preg_match('/src="(.*\.js)"/', $result, $filename); + $this->assertTrue(file_exists(WWW_ROOT . $filename[1])); + $contents = file_get_contents(WWW_ROOT . $filename[1]); + $this->assertPattern('/one\s=\s1;\ntwo\s=\s2;/', $contents); + } } From f15b793a4a35259af965222b92785d66034acc66 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 19 Mar 2009 22:05:06 -0400 Subject: [PATCH 0059/2083] Disabling caching of JS files by default. Requiring webroot to be writable by default it not a good idea. --- cake/libs/view/helpers/js.php | 4 ++-- cake/tests/cases/libs/view/helpers/js.test.php | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 7eeeb8438..6ead64246 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -122,7 +122,7 @@ function call__($method, $params) { * * - 'inline' - Set to true to have scripts output as a script block inline * if 'cache' is also true, a script link tag will be generated. (default true) - * - 'cache' - Set to true to have scripts cached to a file and linked in (default true) + * - 'cache' - Set to true to have scripts cached to a file and linked in (default false) * - 'clear' - Set to false to prevent script cache from being cleared (default true) * - 'onDomReady' - wrap cached scripts in domready event (default true) * - 'safe' - if an inline block is generated should it be wrapped in <![CDATA[ ... ]]> (default true) @@ -131,7 +131,7 @@ function call__($method, $params) { * @return string completed javascript tag. **/ function writeScripts($options = array()) { - $defaults = array('onDomReady' => true, 'inline' => true, 'cache' => true, 'clear' => true, 'safe' => true); + $defaults = array('onDomReady' => true, 'inline' => true, 'cache' => false, 'clear' => true, 'safe' => true); $options = array_merge($defaults, $options); $script = implode("\n", $this->getCache($options['clear'])); diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index e70ef652d..667fdb218 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -171,7 +171,7 @@ function testWriteScriptsInFile() { $this->Js->JsBaseEngine = new TestJsEngineHelper(); $this->Js->writeCache('one = 1;'); $this->Js->writeCache('two = 2;'); - $result = $this->Js->writeScripts(array('onDomReady' => false)); + $result = $this->Js->writeScripts(array('onDomReady' => false, 'cache' => true)); $expected = array( 'script' => array('type' => 'text/javascript', 'src' => 'preg:/(.)*\.js/'), ); @@ -180,6 +180,8 @@ function testWriteScriptsInFile() { $this->assertTrue(file_exists(WWW_ROOT . $filename[1])); $contents = file_get_contents(WWW_ROOT . $filename[1]); $this->assertPattern('/one\s=\s1;\ntwo\s=\s2;/', $contents); + + @unlink(WWW_ROOT . $filename[1]); } } From 6c1c6ada71ba99dae444cce126ef272d762a8bda Mon Sep 17 00:00:00 2001 From: jperras <joel.perras@gmail.com> Date: Sat, 21 Mar 2009 20:06:30 -0400 Subject: [PATCH 0060/2083] Fix Inflector::singularize bug with custom irregular singular rule not being parsed. --- cake/libs/inflector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index bd0f1d73b..ca62d0f64 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -281,7 +281,7 @@ function singularize($word) { extract($_this->singular); $uninflected = array_merge($uninflected, $_this->uninflected); - $irregular = array_flip($_this->plural['irregular']); + $irregular = array_merge($irregular, array_flip($_this->plural['irregular'])); if (!isset($_this->singular['cacheUninflected']) || !isset($_this->singular['cacheIrregular'])) { $_this->singular['cacheUninflected'] = '(?:' . join( '|', $uninflected) . ')'; From 0d8d8fa4014be9b5126643c68dbfd5a26aaabc48 Mon Sep 17 00:00:00 2001 From: jperras <joel.perras@gmail.com> Date: Sat, 21 Mar 2009 20:08:21 -0400 Subject: [PATCH 0061/2083] Adding tests for custom singular rules to Inflector. --- cake/tests/cases/libs/inflector.test.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/cake/tests/cases/libs/inflector.test.php b/cake/tests/cases/libs/inflector.test.php index 874cee2da..90efaabea 100644 --- a/cake/tests/cases/libs/inflector.test.php +++ b/cake/tests/cases/libs/inflector.test.php @@ -270,6 +270,30 @@ function testCustomPluralRule() { $this->assertEqual(Inflector::pluralize('amaze'), 'amazable'); $this->assertEqual(Inflector::pluralize('phone'), 'phonezes'); } +/** + * testCustomSingularRule method + * + * @access public + * @return void + */ + function testCustomSingularRule() { + Inflector::rules('singular', array('/(eple)r$/i' => '\1', '/(jente)r$/i' => '\1')); + + $this->assertEqual(Inflector::singularize('epler'), 'eple'); + $this->assertEqual(Inflector::singularize('jenter'), 'jente'); + + Inflector::rules('singular', array( + 'rules' => array('/^(bil)er$/i' => '\1', '/^(inflec|contribu)tors$/i' => '\1ta'), + 'uninflected' => array('singulars'), + 'irregular' => array('spins' => 'spinor') + )); + + $this->assertEqual(Inflector::singularize('inflectors'), 'inflecta'); + $this->assertEqual(Inflector::singularize('contributors'), 'contributa'); + $this->assertEqual(Inflector::singularize('spins'), 'spinor'); + $this->assertEqual(Inflector::singularize('singulars'), 'singulars'); + } + /** * tearDown method * From 5f035ca34071f20ead8dbec5d018236ab3f70814 Mon Sep 17 00:00:00 2001 From: jperras <joel.perras@gmail.com> Date: Sat, 21 Mar 2009 21:38:32 -0400 Subject: [PATCH 0062/2083] Adding doc blocks for new inflector class variables & rules method. --- cake/libs/inflector.php | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index ca62d0f64..aaaa7b3b1 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -46,7 +46,12 @@ * @link http://book.cakephp.org/view/491/Inflector */ class Inflector extends Object { - +/** + * Plural inflector rules + * + * @var array + * @access public + **/ var $plural = array( 'rules' => array( '/(s)tatus$/i' => '\1\2tatuses', @@ -107,7 +112,12 @@ class Inflector extends Object { 'turf' => 'turfs' ) ); - +/** + * Singular inflector rules + * + * @var array + * @access public + **/ var $singular = array( 'rules' => array( '/(s)tatuses$/i' => '\1\2tatus', @@ -149,7 +159,12 @@ class Inflector extends Object { ), 'irregular' => array() ); - +/** + * Words that should not be inflected + * + * @var array + * @access public + **/ var $uninflected = array( 'Amoyese', 'bison', 'Borghese', 'bream', 'breeches', 'britches', 'buffalo', 'cantus', 'carp', 'chassis', 'clippers', 'cod', 'coitus', 'Congoese', 'contretemps', 'corps', @@ -203,12 +218,19 @@ function &getInstance() { return $instance[0]; } /** - * undocumented function + * Adds custom inflection $rules, of either 'plural' or 'singular' $type. * - * @param string $type - * @param string $rules + * @param string $type The type of inflection, either 'singular' or 'plural' + * @param array $rules Array of rules to be added. Example usage: + * Inflector::rules('plural', array('/^(inflect)or$/i' => '\1ables')); + * Inflector::rules('plural', array( + * 'rules' => array('/^(inflect)ors$/i' => '\1ables'), + * 'uninflected' => array('dontinflectme'), + * 'irregular' => array('red' => 'redlings') + * )); + * @access public * @return void - * @author Joel Perras + * @static */ function rules($type, $rules = array()) { $_this =& Inflector::getInstance(); From 0b7d61f8cdb3c52e41e3b8bd2d3b13685cea2d9e Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Fri, 27 Mar 2009 23:24:08 -0400 Subject: [PATCH 0063/2083] Adding docs and errors for methods. --- cake/libs/view/helpers/js.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 6ead64246..050aa75a4 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -546,11 +546,10 @@ function request($url, $options = array()) { * Additional options may be supported by your library. * * ### Options - * - * - handle - selector to the handle element. * - start - Event fired when the drag starts * - drag - Event fired on every step of the drag * - stop - Event fired when dragging stops (mouse release) + * - handle - selector to the handle element. * - snapGrid - The pixel grid that movement snaps to, an array(x, y) * - container - The element that acts as a bounding box for the draggable element. * @@ -558,14 +557,13 @@ function request($url, $options = array()) { * @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); } /** * Create a droppable element. Allows for draggable elements to be dropped on it. * Additional options may be supported by your library. * - * ### Options - * + * ### Options * - drag - Elements that can be dragged into this droppable * - drop - Event fired when an element is dropped into the drop zone. * - hover - Event fired when a drag enters a drop zone. @@ -574,19 +572,26 @@ function drag($options = array()) { * @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); } /** * Create a sortable element. * * ### Options + * - containment - Container for move action + * - handle - Selector to handle element. Only this element will start sort action. + * - revert - Whether or not to use an effect to move sortable into final position. + * - opacity - Opacity of the placeholder + * - start - Event fired when sorting starts + * - sort - Event fired during sorting + * - complete - Event fired when sorting completes. * * * @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); } /** * Parse an options assoc array into an Javascript object literal. From dfe6fe1c0c2e816d8117b222a4246d5ca71d24ce Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Fri, 27 Mar 2009 23:30:03 -0400 Subject: [PATCH 0064/2083] Reformatting doc blocks --- cake/libs/view/helpers/js.php | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 050aa75a4..8883697fe 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -522,12 +522,15 @@ function effect($name, $options) { /** * Make an XHR request * - * ### Options + * ### Event Options * - * - 'method' - The method to make the request with defaults to GET in more libraries * - 'complete' - Callback to fire on complete. * - 'request' - Callback to fire on request initialization. * - 'error' - Callback to fire on request failure. + * + * ### Options + * + * - 'method' - The method to make the request with defaults to GET in more libraries * - 'async' - Whether or not you want an asynchronous request. * - 'data' - Additional data to send. * - 'update' - Dom selector to update with the content of the request. @@ -546,13 +549,17 @@ function request($url, $options = array()) { * Additional options may be supported by your library. * * ### Options - * - start - Event fired when the drag starts - * - drag - Event fired on every step of the drag - * - stop - Event fired when dragging stops (mouse release) + * * - handle - selector to the handle element. * - snapGrid - The pixel grid that movement snaps to, an array(x, y) * - container - The element that acts as a bounding box for the draggable element. * + * ### Event Options + * + * - start - Event fired when the drag starts + * - drag - Event fired on every step of the drag + * - stop - Event fired when dragging stops (mouse release) + * * @param array $options Options array see above. * @return string Completed drag script **/ @@ -563,7 +570,8 @@ function drag($options = array()) { * Create a droppable element. Allows for draggable elements to be dropped on it. * Additional options may be supported by your library. * - * ### Options + * ### Event Options + * * - drag - Elements that can be dragged into this droppable * - drop - Event fired when an element is dropped into the drop zone. * - hover - Event fired when a drag enters a drop zone. @@ -578,10 +586,15 @@ function drop($options = array()) { * Create a sortable element. * * ### Options + * * - containment - Container for move action * - handle - Selector to handle element. Only this element will start sort action. * - revert - Whether or not to use an effect to move sortable into final position. * - opacity - Opacity of the placeholder + * - distance - Distance a sortable must be dragged before sorting starts. + * + * ### Event Options + * * - start - Event fired when sorting starts * - sort - Event fired during sorting * - complete - Event fired when sorting completes. From d59a704fb1903ea56a833e1de358253d2331cf52 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Fri, 27 Mar 2009 23:44:57 -0400 Subject: [PATCH 0065/2083] Adding sortable to jQuery engine. --- cake/libs/view/helpers/jquery_engine.php | 19 +++++++++++++++++++ .../libs/view/helpers/jquery_engine.test.php | 16 ++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/cake/libs/view/helpers/jquery_engine.php b/cake/libs/view/helpers/jquery_engine.php index 3f1f4b9a6..eb1cddfa4 100644 --- a/cake/libs/view/helpers/jquery_engine.php +++ b/cake/libs/view/helpers/jquery_engine.php @@ -37,6 +37,9 @@ class JqueryEngineHelper extends JsBaseEngineHelper { 'type' => 'dataType', 'complete' => 'success', 'request' => 'beforeSend', + ), + 'sortable' => array( + 'complete' => 'stop', ) ); /** @@ -142,5 +145,21 @@ function request($url, $options = array()) { $options = $this->_parseOptions($options, $callbacks); return '$.ajax({' . $options .'});'; } +/** + * Create a sortable element. + * + * Requires both Ui.Core and Ui.Sortables to be loaded. + * + * @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->_mapOptions('sortable', $options); + $callbacks = array('start', 'sort', 'change', 'beforeStop', 'stop', 'update', 'receive', 'remove', + 'over', 'out', 'activate', 'deactivate'); + $options = $this->_parseOptions($options, $callbacks); + return $this->selection . '.sortable({' . $options . '});'; + } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php index 1758255e8..90e048c11 100644 --- a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php @@ -154,5 +154,21 @@ function testRequest() { $expected = '$.ajax({method:"post", error:handleError, data:"name=jim&height=185cm", dataType:"json", success:doSuccess, url:"/people/edit/1"});'; $this->assertEqual($result, $expected); } +/** + * test sortable list generation + * + * @return void + **/ + function testSortable() { + $result = $this->Jquery->get('#myList')->sortable(array( + 'distance' => 5, + 'containment' => 'parent', + 'start' => 'onStart', + 'complete' => 'onStop', + 'sort' => 'onSort', + )); + $expected = '$("#myList").sortable({distance:5, containment:"parent", start:onStart, sort:onSort, stop:onStop});'; + $this->assertEqual($result, $expected); + } } ?> \ No newline at end of file From 9708b2dc50d3e99a1bcf51231825e7c81aa95037 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 28 Mar 2009 00:15:05 -0400 Subject: [PATCH 0066/2083] Adding sortables to mootools engine. --- cake/libs/view/helpers/mootools_engine.php | 22 +++++++++++++++++++ .../view/helpers/mootools_engine.test.php | 16 ++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/cake/libs/view/helpers/mootools_engine.php b/cake/libs/view/helpers/mootools_engine.php index 0e6de428b..67330d8c7 100644 --- a/cake/libs/view/helpers/mootools_engine.php +++ b/cake/libs/view/helpers/mootools_engine.php @@ -40,6 +40,10 @@ class MootoolsEngineHelper extends JsBaseEngineHelper { 'complete' => 'onComplete', 'request' => 'onRequest', 'error' => 'onFailure' + ), + 'sortable' => array( + 'distance' => 'snap', + 'containment' => 'constrain', ) ); /** @@ -150,6 +154,9 @@ function effect($name, $options = array()) { } /** * Create an new Request. + * + * Requires ```Request```. If you wish to use 'update' key you must have ```Request.HTML``` + * if you wish to do Json requests you will need ```JSON``` and ```Request.JSON```. * * @param mixed $url * @param array $options @@ -180,5 +187,20 @@ function request($url, $options = array()) { $options = $this->_parseOptions($options, $callbacks); return "var jsRequest = new Request$type({{$options}}).send($data);"; } +/** + * Create a sortable element. + * + * Requires both the ```Sortables``` plugin from MootoolsMore + * + * @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->_mapOptions('sortable', $options); + $callbacks = array('start', 'sort', 'complete'); + $options = $this->_parseOptions($options, $callbacks); + return 'var mooSortable = new Sortables(' . $this->selection . ', {' . $options . '});'; + } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php index cb9be526f..29e016cd1 100644 --- a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php @@ -171,5 +171,21 @@ function testRequest() { $expected = 'var jsRequest = new Request.JSON({method:"post", onComplete:doSuccess, onFailure:handleError, url:"/people/edit/1"}).send({"name":"jim","height":"185cm"});'; $this->assertEqual($result, $expected); } +/** + * test sortable list generation + * + * @return void + **/ + function testSortable() { + $result = $this->Moo->get('#myList')->sortable(array( + 'distance' => 5, + 'containment' => 'parent', + 'start' => 'onStart', + 'complete' => 'onStop', + 'sort' => 'onSort', + )); + $expected = 'var mooSortable = new Sortables($("myList"), {start:onStart, complete:onStop, sort:onSort, snap:5, constrain:"parent"});'; + $this->assertEqual($result, $expected); + } } ?> \ No newline at end of file From 29b3a96cb2a53a9fe0fc006ecd790cb2515a09db Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 28 Mar 2009 00:31:08 -0400 Subject: [PATCH 0067/2083] Adding sort() to option parsing, makes testing easier. --- cake/libs/view/helpers/js.php | 1 + cake/tests/cases/libs/view/helpers/js.test.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 8883697fe..78acd57c1 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -624,6 +624,7 @@ function _parseOptions($options, $safeKeys = array()) { } $out[] = $key . ':' . $value; } + sort($out); return join(', ', $out); } /** diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index b8dbdff82..923b95f26 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -361,11 +361,11 @@ function testOptionParsing() { $JsEngine = new OptionEngineHelper(); $result = $JsEngine->testParseOptions(array('url' => '/posts/view/1', 'key' => 1)); - $expected = 'url:"/posts/view/1", key:1'; + $expected = 'key:1, url:"/posts/view/1"'; $this->assertEqual($result, $expected); $result = $JsEngine->testParseOptions(array('url' => '/posts/view/1', 'success' => 'doSuccess'), array('success')); - $expected = 'url:"/posts/view/1", success:doSuccess'; + $expected = 'success:doSuccess, url:"/posts/view/1"'; $this->assertEqual($result, $expected); } } From 977efe4e1d359757b14623fb5f64bdcd4d6206e6 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 28 Mar 2009 00:31:51 -0400 Subject: [PATCH 0068/2083] Fixing callback naming issues with mootools --- cake/libs/view/helpers/mootools_engine.php | 5 ++++- cake/tests/cases/libs/view/helpers/mootools_engine.test.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cake/libs/view/helpers/mootools_engine.php b/cake/libs/view/helpers/mootools_engine.php index 67330d8c7..3c8ed5629 100644 --- a/cake/libs/view/helpers/mootools_engine.php +++ b/cake/libs/view/helpers/mootools_engine.php @@ -44,6 +44,9 @@ class MootoolsEngineHelper extends JsBaseEngineHelper { 'sortable' => array( 'distance' => 'snap', 'containment' => 'constrain', + 'sort' => 'onSort', + 'complete' => 'onComplete', + 'start' => 'onStart', ) ); /** @@ -198,7 +201,7 @@ function request($url, $options = array()) { **/ function sortable($options = array()) { $options = $this->_mapOptions('sortable', $options); - $callbacks = array('start', 'sort', 'complete'); + $callbacks = array('onStart', 'onSort', 'onComplete'); $options = $this->_parseOptions($options, $callbacks); return 'var mooSortable = new Sortables(' . $this->selection . ', {' . $options . '});'; } diff --git a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php index 29e016cd1..3f19e8a94 100644 --- a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php @@ -184,7 +184,7 @@ function testSortable() { 'complete' => 'onStop', 'sort' => 'onSort', )); - $expected = 'var mooSortable = new Sortables($("myList"), {start:onStart, complete:onStop, sort:onSort, snap:5, constrain:"parent"});'; + $expected = 'var mooSortable = new Sortables($("myList"), {constrain:"parent", onComplete:onStop, onSort:onSort, onStart:onStart, snap:5});'; $this->assertEqual($result, $expected); } } From da2361de146d0043d3efecd5a96f5e8d05fbee27 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 28 Mar 2009 11:50:57 -0400 Subject: [PATCH 0069/2083] Adding get() + tests to prototype --- cake/libs/view/helpers/prototype_engine.php | 125 ++++++++++++++++++ .../view/helpers/prototype_engine.test.php | 122 +++++++++++++++++ 2 files changed, 247 insertions(+) create mode 100644 cake/libs/view/helpers/prototype_engine.php create mode 100644 cake/tests/cases/libs/view/helpers/prototype_engine.test.php diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php new file mode 100644 index 000000000..5d595a4c4 --- /dev/null +++ b/cake/libs/view/helpers/prototype_engine.php @@ -0,0 +1,125 @@ +<?php +/** + * Prototype Engine Helper for JsHelper + * + * Provides Prototype specific Javascript for JsHelper. + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2006-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @package cake + * @subpackage cake. + * @version + * @modifiedby + * @lastmodified + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +App::import('Helper', 'Js'); + +class PrototypeEngineHelper extends JsBaseEngineHelper { +/** + * Option mappings for Prototype + * + * @var array + **/ + var $_optionMap = array( + + ); +/** + * Create javascript selector for a CSS rule + * + * @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 = "$(" . $selector .")"; + return $this; + } + if (preg_match('/^#[^\s.]+$/', $selector)) { + $this->selection = '$("' . substr($selector, 1) . '")'; + return $this; + } + $this->selection = '$$("' . $selector . '")'; + return $this; + } +/** + * Add an event to the script cache. Operates on the currently selected elements. + * + * ### Options + * + * - 'wrap' - Whether you want the callback wrapped in an anonymous function. (defaults true) + * - 'stop' - Whether you want the event to stopped. (defaults true) + * + * @param string $type Type of event to bind to the current dom id + * @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()) { + + } +/** + * Create a domReady event. This is a special event in many libraries + * + * @param string $functionBody The code to run on domReady + * @return string completed domReady method + **/ + function domReady($functionBody) { + + } +/** + * Create an iteration over the current selection result. + * + * @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) { + + } +/** + * Trigger an Effect. + * + * @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. + * @see JsBaseEngineHelper::effect() + **/ + function effect($name, $options = array()) { + + } +/** + * Create an Ajax or Ajax.Updater call. + * + * @param mixed $url + * @param array $options + * @return string The completed ajax call. + **/ + function request($url, $options = array()) { + + } +/** + * Create a sortable element. + * + * Requires both Ui.Core and Ui.Sortables to be loaded. + * + * @param array $options Array of options for the sortable. + * @return string Completed sortable script. + * @see JsHelper::sortable() for options list. + **/ + function sortable($options = array()) { + + } +} +?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php new file mode 100644 index 000000000..c80a96013 --- /dev/null +++ b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php @@ -0,0 +1,122 @@ +<?php +/** + * PrototypeEngine TestCase + * + * + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework <http://www.cakephp.org/> + * Copyright 2006-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @package cake.tests + * @subpackage cake.tests.cases.views.helpers + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +App::import('Helper', array('Html', 'Js', 'PrototypeEngine')); + +class PrototypeEngineHelperTestCase extends CakeTestCase { +/** + * startTest + * + * @return void + **/ + function startTest() { + $this->Proto =& new PrototypeEngineHelper(); + } +/** + * end test + * + * @return void + **/ + function endTest() { + unset($this->Proto); + } +/** + * test selector method + * + * @return void + **/ + function testSelector() { + $result = $this->Proto->get('#content'); + $this->assertEqual($result, $this->Proto); + $this->assertEqual($this->Proto->selection, '$("content")'); + + $result = $this->Proto->get('a .remove'); + $this->assertEqual($result, $this->Proto); + $this->assertEqual($this->Proto->selection, '$$("a .remove")'); + + $result = $this->Proto->get('document'); + $this->assertEqual($result, $this->Proto); + $this->assertEqual($this->Proto->selection, "$(document)"); + + $result = $this->Proto->get('window'); + $this->assertEqual($result, $this->Proto); + $this->assertEqual($this->Proto->selection, "$(window)"); + + $result = $this->Proto->get('ul'); + $this->assertEqual($result, $this->Proto); + $this->assertEqual($this->Proto->selection, '$$("ul")'); + + $result = $this->Proto->get('#some_long-id.class'); + $this->assertEqual($result, $this->Proto); + $this->assertEqual($this->Proto->selection, '$$("#some_long-id.class")'); + } +/** + * test event binding + * + * @return void + **/ + function testEvent() { + + } +/** + * test dom ready event creation + * + * @return void + **/ + function testDomReady() { + + } +/** + * test Each method + * + * @return void + **/ + function testEach() { + + } +/** + * test Effect generation + * + * @return void + **/ + function testEffect() { + + } +/** + * Test Request Generation + * + * @return void + **/ + function testRequest() { + + } +/** + * test sortable list generation + * + * @return void + **/ + function testSortable() { + + } +} +?> \ No newline at end of file From 8cc5990e09c3b2cf46caab130e2a01dc4e5a5214 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 28 Mar 2009 12:08:34 -0400 Subject: [PATCH 0070/2083] Adding event() and tests to prototype library --- cake/libs/view/helpers/prototype_engine.php | 14 +++++++++++++- .../libs/view/helpers/prototype_engine.test.php | 10 ++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php index 5d595a4c4..755a69bd4 100644 --- a/cake/libs/view/helpers/prototype_engine.php +++ b/cake/libs/view/helpers/prototype_engine.php @@ -2,7 +2,8 @@ /** * Prototype Engine Helper for JsHelper * - * Provides Prototype specific Javascript for JsHelper. + * Provides Prototype specific Javascript for JsHelper. Requires at least + * Prototype 1.6 * * PHP versions 4 and 5 * @@ -67,7 +68,18 @@ function get($selector) { * @return string completed event handler **/ function event($type, $callback, $options = array()) { + $defaults = array('wrap' => true, 'stop' => true); + $options = array_merge($defaults, $options); + $function = 'function (event) {%s}'; + if ($options['wrap'] && $options['stop']) { + $callback = "event.stop();\n" . $callback; + } + if ($options['wrap']) { + $callback = sprintf($function, $callback); + } + $out = $this->selection . ".observe(\"{$type}\", $callback);"; + return $out; } /** * Create a domReady event. This is a special event in many libraries diff --git a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php index c80a96013..82f4c8130 100644 --- a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php @@ -76,7 +76,17 @@ function testSelector() { * @return void **/ function testEvent() { + $result = $this->Proto->get('#myLink')->event('click', 'doClick', array('wrap' => false)); + $expected = '$("myLink").observe("click", doClick);'; + $this->assertEqual($result, $expected); + $result = $this->Proto->get('#myLink')->event('click', 'Element.hide(this);', array('stop' => false)); + $expected = '$("myLink").observe("click", function (event) {Element.hide(this);});'; + $this->assertEqual($result, $expected); + + $result = $this->Proto->get('#myLink')->event('click', 'Element.hide(this);'); + $expected = "\$(\"myLink\").observe(\"click\", function (event) {event.stop();\nElement.hide(this);});"; + $this->assertEqual($result, $expected); } /** * test dom ready event creation From 55eafaf112b422419482ccd3210390f575183837 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 28 Mar 2009 18:06:20 -0400 Subject: [PATCH 0071/2083] Adding domReady to prototype --- cake/libs/view/helpers/prototype_engine.php | 3 ++- cake/tests/cases/libs/view/helpers/prototype_engine.test.php | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php index 755a69bd4..99faa1b87 100644 --- a/cake/libs/view/helpers/prototype_engine.php +++ b/cake/libs/view/helpers/prototype_engine.php @@ -88,7 +88,8 @@ function event($type, $callback, $options = array()) { * @return string completed domReady method **/ function domReady($functionBody) { - + $this->selection = 'document'; + return $this->event('dom:loaded', $functionBody, array('stop' => false)); } /** * Create an iteration over the current selection result. diff --git a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php index 82f4c8130..8312b7de2 100644 --- a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php @@ -94,7 +94,9 @@ function testEvent() { * @return void **/ function testDomReady() { - + $result = $this->Proto->domReady('foo.name = "bar";'); + $expected = 'document.observe("dom:loaded", function (event) {foo.name = "bar";});'; + $this->assertEqual($result, $expected); } /** * test Each method From 768941baebe32a137b2484e71a99a7e57bf1986f Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 28 Mar 2009 18:11:16 -0400 Subject: [PATCH 0072/2083] Adding each() to prototype engine --- cake/libs/view/helpers/prototype_engine.php | 2 +- cake/tests/cases/libs/view/helpers/prototype_engine.test.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php index 99faa1b87..f15231429 100644 --- a/cake/libs/view/helpers/prototype_engine.php +++ b/cake/libs/view/helpers/prototype_engine.php @@ -99,7 +99,7 @@ function domReady($functionBody) { * @return string completed iteration **/ function each($callback) { - + return $this->selection . '.each(function (item, index) {' . $callback . '});'; } /** * Trigger an Effect. diff --git a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php index 8312b7de2..c0dadba65 100644 --- a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php @@ -104,7 +104,9 @@ function testDomReady() { * @return void **/ function testEach() { - + $result = $this->Proto->get('#foo li')->each('item.hide();'); + $expected = '$$("#foo li").each(function (item, index) {item.hide();});'; + $this->assertEqual($result, $expected); } /** * test Effect generation From ba15d955e29b145609f45b78a02e439d51863237 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 28 Mar 2009 23:46:23 -0400 Subject: [PATCH 0073/2083] Updating effect in Mootools Updating effects and effect test in Prototype --- cake/libs/view/helpers/mootools_engine.php | 2 - cake/libs/view/helpers/prototype_engine.php | 33 ++++++++++++- .../view/helpers/prototype_engine.test.php | 46 +++++++++++++++++++ 3 files changed, 78 insertions(+), 3 deletions(-) diff --git a/cake/libs/view/helpers/mootools_engine.php b/cake/libs/view/helpers/mootools_engine.php index 3c8ed5629..ad78c5740 100644 --- a/cake/libs/view/helpers/mootools_engine.php +++ b/cake/libs/view/helpers/mootools_engine.php @@ -140,8 +140,6 @@ function effect($name, $options = array()) { $effect = 'setStyle("display", "")'; break; case 'fadeIn': - $effect = 'fade("in")'; - break; case 'fadeOut': case 'slideIn': case 'slideOut': diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php index f15231429..a7b5d5aa8 100644 --- a/cake/libs/view/helpers/prototype_engine.php +++ b/cake/libs/view/helpers/prototype_engine.php @@ -110,7 +110,38 @@ function each($callback) { * @see JsBaseEngineHelper::effect() **/ function effect($name, $options = array()) { - + $effect = ''; + $optionString = null; + if (isset($options['speed'])) { + if ($options['speed'] == 'fast') { + $options['duration'] = 0.5; + } elseif ($options['speed'] == 'slow') { + $options['duration'] = 2; + } else { + $options['duration'] = 1; + } + unset($options['speed']); + } + if (!empty($options)) { + $optionString = ', {' . $this->_parseOptions($options) . '}'; + } + switch ($name) { + case 'hide': + case 'show': + $effect = $this->selection . '.' . $name . '();'; + break; + case 'slideIn': + case 'slideOut': + $name = ($name == 'slideIn') ? 'slideDown' : 'slideUp'; + $effect = 'Effect.' . $name . '(' . $this->selection . $optionString . ');'; + break; + case 'fadeIn': + case 'fadeOut': + $name = ($name == 'fadeIn') ? 'appear' : 'fade'; + $effect = $this->selection . '.' . $name .'(' . substr($optionString, 2) . ');'; + break; + } + return $effect; } /** * Create an Ajax or Ajax.Updater call. diff --git a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php index c0dadba65..92d10a116 100644 --- a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php @@ -114,7 +114,53 @@ function testEach() { * @return void **/ function testEffect() { + $result = $this->Proto->get('#foo')->effect('show'); + $expected = '$("foo").show();'; + $this->assertEqual($result, $expected); + + $result = $this->Proto->effect('hide'); + $expected = '$("foo").hide();'; + $this->assertEqual($result, $expected); + + $result = $this->Proto->effect('fadeIn'); + $expected = '$("foo").appear();'; + $this->assertEqual($result, $expected); + + $result = $this->Proto->effect('fadeIn', array('speed' => 'fast')); + $expected = '$("foo").appear({duration:0.50000000000});'; + $this->assertEqual($result, $expected); + + $result = $this->Proto->effect('fadeIn', array('speed' => 'slow')); + $expected = '$("foo").appear({duration:2});'; + $this->assertEqual($result, $expected); + + $result = $this->Proto->effect('fadeOut'); + $expected = '$("foo").fade();'; + $this->assertEqual($result, $expected); + + $result = $this->Proto->effect('fadeOut', array('speed' => 'fast')); + $expected = '$("foo").fade({duration:0.50000000000});'; + $this->assertEqual($result, $expected); + + $result = $this->Proto->effect('fadeOut', array('speed' => 'slow')); + $expected = '$("foo").fade({duration:2});'; + $this->assertEqual($result, $expected); + + $result = $this->Proto->effect('slideIn'); + $expected = 'Effect.slideDown($("foo"));'; + $this->assertEqual($result, $expected); + $result = $this->Proto->effect('slideOut'); + $expected = 'Effect.slideUp($("foo"));'; + $this->assertEqual($result, $expected); + + $result = $this->Proto->effect('slideOut', array('speed' => 'fast')); + $expected = 'Effect.slideUp($("foo"), {duration:0.50000000000});'; + $this->assertEqual($result, $expected); + + $result = $this->Proto->effect('slideOut', array('speed' => 'slow')); + $expected = 'Effect.slideUp($("foo"), {duration:2});'; + $this->assertEqual($result, $expected); } /** * Test Request Generation From e2918c6f5ea42a1b43bd75c2f2f00a1f3db9bbe3 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 29 Mar 2009 00:28:15 -0400 Subject: [PATCH 0074/2083] Updating slide effects for jquery engine. --- cake/libs/view/helpers/jquery_engine.php | 7 ++++--- cake/libs/view/helpers/prototype_engine.php | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cake/libs/view/helpers/jquery_engine.php b/cake/libs/view/helpers/jquery_engine.php index eb1cddfa4..acf800671 100644 --- a/cake/libs/view/helpers/jquery_engine.php +++ b/cake/libs/view/helpers/jquery_engine.php @@ -116,12 +116,13 @@ function effect($name, $options = array()) { } $effect = ''; switch ($name) { + case 'slideIn': + case 'slideOut': + $name = ($name == 'slideIn') ? 'slideDown' : 'slideUp'; case 'hide': case 'show': - case 'fadeIn': + case 'fadeIn': case 'fadeOut': - case 'slideIn': - case 'slideOut': $effect = ".$name($speed);"; break; } diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php index a7b5d5aa8..48f543afb 100644 --- a/cake/libs/view/helpers/prototype_engine.php +++ b/cake/libs/view/helpers/prototype_engine.php @@ -104,6 +104,8 @@ function each($callback) { /** * Trigger an Effect. * + * #### Note: Effects require Scriptaculous to be loaded. + * * @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. @@ -156,7 +158,7 @@ function request($url, $options = array()) { /** * Create a sortable element. * - * Requires both Ui.Core and Ui.Sortables to be loaded. + * #### Note: Requires scriptaculous to be loaded. * * @param array $options Array of options for the sortable. * @return string Completed sortable script. From 8eeb00b66ece5e27165363dff649494a7d9a1105 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 29 Mar 2009 14:23:42 -0400 Subject: [PATCH 0075/2083] Refactoring writeScripts to buffer() methods to clarify API. --- cake/libs/view/helpers/js.php | 29 ++++++++++--------- .../tests/cases/libs/view/helpers/js.test.php | 16 +++++----- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 78acd57c1..1264ac9c7 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -33,11 +33,11 @@ **/ class JsHelper extends AppHelper { /** - * Whether or not you want scripts to be cached or output. + * Whether or not you want scripts to be buffered or output. * * @var boolean **/ - var $cacheScripts = true; + var $bufferScripts = true; /** * helpers * @@ -49,7 +49,7 @@ class JsHelper extends AppHelper { * * @var array **/ - var $__cachedScripts = array(); + var $__bufferedScripts = array(); /** * Current Javascript Engine that is being used * @@ -103,9 +103,12 @@ function __construct($settings = array()) { function call__($method, $params) { if (isset($this->{$this->__engineName}) && method_exists($this->{$this->__engineName}, $method)) { $out = $this->{$this->__engineName}->dispatchMethod($method, $params); - if ($this->cacheScripts) { - $this->writeCache($out); - return null; + if ($this->bufferScripts && is_string($out)) { + $this->buffer($out); + return $out; + } + if (is_object($out) && is_a($out, 'JsBaseEngineHelper')) { + return $this; } return $out; } @@ -130,10 +133,10 @@ function call__($method, $params) { * @param array $options options for the code block * @return string completed javascript tag. **/ - function writeScripts($options = array()) { + function writeBuffer($options = array()) { $defaults = array('onDomReady' => true, 'inline' => true, 'cache' => false, 'clear' => true, 'safe' => true); $options = array_merge($defaults, $options); - $script = implode("\n", $this->getCache($options['clear'])); + $script = implode("\n", $this->getBuffer($options['clear'])); if ($options['onDomReady']) { $script = $this->{$this->__engineName}->domReady($script); @@ -157,8 +160,8 @@ function writeScripts($options = array()) { * * @return void **/ - function writeCache($script) { - $this->__cachedScripts[] = $script; + function buffer($script) { + $this->__bufferedScripts[] = $script; } /** * Get all the cached scripts @@ -166,10 +169,10 @@ function writeCache($script) { * @param boolean $clear Whether or not to clear the script caches * @return array Array of scripts added to the request. **/ - function getCache($clear = true) { - $scripts = $this->__cachedScripts; + function getBuffer($clear = true) { + $scripts = $this->__bufferedScripts; if ($clear) { - $this->__cachedScripts = array(); + $this->__bufferedScripts = array(); } return $scripts; } diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index 923b95f26..20a80f1b0 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -140,9 +140,9 @@ function testMethodDispatching() { **/ function testWriteScriptsNoFile() { $this->Js->JsBaseEngine = new TestJsEngineHelper(); - $this->Js->writeCache('one = 1;'); - $this->Js->writeCache('two = 2;'); - $result = $this->Js->writeScripts(array('onDomReady' => false, 'cache' => false)); + $this->Js->buffer('one = 1;'); + $this->Js->buffer('two = 2;'); + $result = $this->Js->writeBuffer(array('onDomReady' => false, 'cache' => false)); $expected = array( 'script' => array('type' => 'text/javascript'), $this->cDataStart, @@ -153,11 +153,11 @@ function testWriteScriptsNoFile() { $this->assertTags($result, $expected, true); $this->Js->JsBaseEngine->expectAtLeastOnce('domReady'); - $result = $this->Js->writeScripts(array('onDomReady' => true, 'cache' => false)); + $result = $this->Js->writeBuffer(array('onDomReady' => true, 'cache' => false)); $view =& new JsHelperMockView(); $view->expectAt(0, 'addScript', array(new PatternExpectation('/one\s=\s1;\ntwo\=\2;/'))); - $result = $this->Js->writeScripts(array('onDomReady' => false, 'inline' => false, 'cache' => false)); + $result = $this->Js->writeBuffer(array('onDomReady' => false, 'inline' => false, 'cache' => false)); } /** * test that writeScripts makes files, and puts the events into them. @@ -169,9 +169,9 @@ function testWriteScriptsInFile() { return; } $this->Js->JsBaseEngine = new TestJsEngineHelper(); - $this->Js->writeCache('one = 1;'); - $this->Js->writeCache('two = 2;'); - $result = $this->Js->writeScripts(array('onDomReady' => false, 'cache' => true)); + $this->Js->buffer('one = 1;'); + $this->Js->buffer('two = 2;'); + $result = $this->Js->writeBuffer(array('onDomReady' => false, 'cache' => true)); $expected = array( 'script' => array('type' => 'text/javascript', 'src' => 'preg:/(.)*\.js/'), ); From 57ceba5c9c32ddedfeda27913fd97d16c40e68a8 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 29 Mar 2009 14:38:09 -0400 Subject: [PATCH 0076/2083] Adding docs to explain buffering control. --- cake/libs/view/helpers/js.php | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 1264ac9c7..4b706ae00 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -93,12 +93,24 @@ function __construct($settings = array()) { parent::__construct(); } /** - * call__ + * call__ Allows for dispatching of methods to the Engine Helper. + * methods in the Engines bufferedMethods list will be automatically buffered. + * You can control buffering with the buffer param as well. By setting the last parameter to + * any engine method to a boolean you can force or disable buffering. + * + * e.g. ```$js->get('#foo')->effect('fadeIn', array('speed' => 'slow'), true);``` + * + * Will force buffering for the effect method. If the method takes an options array you may also add + * a 'buffer' param to the options array and control buffering there as well. + * + * e.g. ```$js->get('#foo')->event('click', $functionContents, array('buffer' => true)); + * + * The buffer parameter will not be passed onto the EngineHelper. * * @param string $method Method to be called * @param array $params Parameters for the method being called. * @access public - * @return void + * @return mixed **/ function call__($method, $params) { if (isset($this->{$this->__engineName}) && method_exists($this->{$this->__engineName}, $method)) { @@ -246,8 +258,8 @@ function __object($name, $var) { } /** - * JsEngineBaseClass - * + * JsEngineBaseClass + * * Abstract Base Class for All JsEngines to extend. Provides generic methods. * * @package cake.view.helpers @@ -273,6 +285,13 @@ class JsBaseEngineHelper extends AppHelper { * @var array **/ var $_optionMap = array(); +/** + * An array of Methods in the Engine that are buffered unless otherwise disabled. This allows specific 'end point' + * methods to be automatically buffered by the JsHelper. + * + * @var string + **/ + var $bufferedMethods = array(); /** * Constructor. * From f2578315e749143cc6589f80b73a4ba4c0406d36 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 29 Mar 2009 16:10:04 -0400 Subject: [PATCH 0077/2083] Refactoring how buffering works. Adding buffer params to method calls. Adding tests for buffer calls. --- cake/libs/view/helpers/js.php | 25 +++++-- .../tests/cases/libs/view/helpers/js.test.php | 65 +++++++++++++++++-- 2 files changed, 78 insertions(+), 12 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 4b706ae00..a183d9813 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -114,10 +114,25 @@ function __construct($settings = array()) { **/ function call__($method, $params) { if (isset($this->{$this->__engineName}) && method_exists($this->{$this->__engineName}, $method)) { + $buffer = false; + if (in_array(strtolower($method), $this->{$this->__engineName}->bufferedMethods)) { + $buffer = true; + } + if (count($params) > 0) { + $lastParam = $params[count($params) - 1]; + $hasBufferParam = (is_bool($lastParam) || is_array($lastParam) && isset($lastParam['buffer'])); + if ($hasBufferParam && is_bool($lastParam)) { + $buffer = $lastParam; + unset($params[count($params) - 1]); + } elseif ($hasBufferParam && is_array($lastParam)) { + $buffer = $lastParam['buffer']; + unset($params['buffer']); + } + } $out = $this->{$this->__engineName}->dispatchMethod($method, $params); - if ($this->bufferScripts && is_string($out)) { + if ($this->bufferScripts && $buffer && is_string($out)) { $this->buffer($out); - return $out; + return null; } if (is_object($out) && is_a($out, 'JsBaseEngineHelper')) { return $this; @@ -286,10 +301,10 @@ class JsBaseEngineHelper extends AppHelper { **/ var $_optionMap = array(); /** - * An array of Methods in the Engine that are buffered unless otherwise disabled. This allows specific 'end point' - * methods to be automatically buffered by the JsHelper. + * An array of lowercase method names in the Engine that are buffered unless otherwise disabled. + * This allows specific 'end point' methods to be automatically buffered by the JsHelper. * - * @var string + * @var array **/ var $bufferedMethods = array(); /** diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index 20a80f1b0..ef8495b60 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -105,16 +105,16 @@ function endTest() { * @return void **/ function testConstruction() { - $js = new JsHelper(); + $js =& new JsHelper(); $this->assertEqual($js->helpers, array('Html', 'jqueryEngine')); - $js = new JsHelper(array('mootools')); + $js =& new JsHelper(array('mootools')); $this->assertEqual($js->helpers, array('Html', 'mootoolsEngine')); - $js = new JsHelper('prototype'); + $js =& new JsHelper('prototype'); $this->assertEqual($js->helpers, array('Html', 'prototypeEngine')); - $js = new JsHelper('MyPlugin.Dojo'); + $js =& new JsHelper('MyPlugin.Dojo'); $this->assertEqual($js->helpers, array('Html', 'MyPlugin.DojoEngine')); } /** @@ -123,16 +123,67 @@ function testConstruction() { * @return void **/ function testMethodDispatching() { - $js = new JsHelper(array('TestJs')); - $js->TestJsEngine = new TestJsEngineHelper(); + $js =& new JsHelper(array('TestJs')); + $js->TestJsEngine =& new TestJsEngineHelper(); $js->TestJsEngine->expectOnce('dispatchMethod', array('methodOne', array())); $js->methodOne(); - $js->TestEngine = new StdClass(); + $js->TestEngine =& new StdClass(); $this->expectError(); $js->someMethodThatSurelyDoesntExist(); } +/** + * Test that method dispatching respects buffer parameters and bufferedMethods Lists. + * + * @return void + **/ + function testMethodDispatchWithBuffering() { + $js =& new JsHelper(array('TestJs')); + $js->TestJsEngine = new TestJsEngineHelper(); + $js->TestJsEngine->bufferedMethods = array('event', 'sortables'); + $js->TestJsEngine->setReturnValue('dispatchMethod', 'This is an event call', array('event', '*')); + + $js->event('click', 'foo'); + $result = $js->getBuffer(); + $this->assertEqual(count($result), 1); + $this->assertEqual($result[0], 'This is an event call'); + + $result = $js->event('click', 'foo', array('buffer' => false)); + $buffer = $js->getBuffer(); + $this->assertTrue(empty($buffer)); + $this->assertEqual($result, 'This is an event call'); + + $result = $js->event('click', 'foo', false); + $buffer = $js->getBuffer(); + $this->assertTrue(empty($buffer)); + $this->assertEqual($result, 'This is an event call'); + + $js->TestJsEngine->setReturnValue('dispatchMethod', 'I am not buffered.', array('effect', '*')); + + $result = $js->effect('slideIn'); + $buffer = $js->getBuffer(); + $this->assertTrue(empty($buffer)); + $this->assertEqual($result, 'I am not buffered.'); + + $result = $js->effect('slideIn', true); + $buffer = $js->getBuffer(); + $this->assertNull($result); + $this->assertEqual(count($buffer), 1); + $this->assertEqual($buffer[0], 'I am not buffered.'); + + $result = $js->effect('slideIn', array('speed' => 'slow'), true); + $buffer = $js->getBuffer(); + $this->assertNull($result); + $this->assertEqual(count($buffer), 1); + $this->assertEqual($buffer[0], 'I am not buffered.'); + + $result = $js->effect('slideIn', array('speed' => 'slow', 'buffer' => true)); + $buffer = $js->getBuffer(); + $this->assertNull($result); + $this->assertEqual(count($buffer), 1); + $this->assertEqual($buffer[0], 'I am not buffered.'); + } /** * test that writeScripts generates scripts inline. * From 923883bdadfb5d0495305c3486e841a047210f2c Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 29 Mar 2009 16:14:56 -0400 Subject: [PATCH 0078/2083] Adding default list of buffered methods to the JsBaseEngine. --- cake/libs/view/helpers/js.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index a183d9813..f02f376b0 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -306,7 +306,7 @@ class JsBaseEngineHelper extends AppHelper { * * @var array **/ - var $bufferedMethods = array(); + var $bufferedMethods = array('event', 'sortable', 'drag', 'drop'); /** * Constructor. * From a899af66daa15e2f90347784b8f7dc4cb2e1ef72 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 29 Mar 2009 21:52:44 -0400 Subject: [PATCH 0079/2083] Fixing jQuery tests. --- cake/tests/cases/libs/view/helpers/jquery_engine.test.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php index 90e048c11..43c0890f0 100644 --- a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php @@ -127,11 +127,11 @@ function testEffect() { $this->assertEqual($result, $expected); $result = $this->Jquery->effect('slideIn'); - $expected = '$("#foo").slideIn();'; + $expected = '$("#foo").slideDown();'; $this->assertEqual($result, $expected); $result = $this->Jquery->effect('slideOut'); - $expected = '$("#foo").slideOut();'; + $expected = '$("#foo").slideUp();'; $this->assertEqual($result, $expected); } /** @@ -151,7 +151,7 @@ function testRequest() { 'type' => 'json', 'data' => array('name' => 'jim', 'height' => '185cm') )); - $expected = '$.ajax({method:"post", error:handleError, data:"name=jim&height=185cm", dataType:"json", success:doSuccess, url:"/people/edit/1"});'; + $expected = '$.ajax({data:"name=jim&height=185cm", dataType:"json", error:handleError, method:"post", success:doSuccess, url:"/people/edit/1"});'; $this->assertEqual($result, $expected); } /** @@ -167,7 +167,7 @@ function testSortable() { 'complete' => 'onStop', 'sort' => 'onSort', )); - $expected = '$("#myList").sortable({distance:5, containment:"parent", start:onStart, sort:onSort, stop:onStop});'; + $expected = '$("#myList").sortable({containment:"parent", distance:5, sort:onSort, start:onStart, stop:onStop});'; $this->assertEqual($result, $expected); } } From 23423f27911dc0062faf2a4cd355720b8fb9a983 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 29 Mar 2009 22:08:49 -0400 Subject: [PATCH 0080/2083] Updating request in Mootools --- cake/libs/view/helpers/js.php | 4 ++-- cake/libs/view/helpers/mootools_engine.php | 1 + .../libs/view/helpers/mootools_engine.test.php | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index f02f376b0..108057bb5 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -570,9 +570,9 @@ function effect($name, $options) { * - 'method' - The method to make the request with defaults to GET in more libraries * - 'async' - Whether or not you want an asynchronous request. * - 'data' - Additional data to send. - * - 'update' - Dom selector to update with the content of the request. + * - 'update' - Dom id to update with the content of the request. * - 'type' - Data type for response. 'json' and 'html' are supported. Default is html for most libraries. - * - 'evalScripts' - Whether or not <script> tags should be evaled. + * - 'evalScripts' - Whether or not <script> tags should be eval'ed. * * @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 diff --git a/cake/libs/view/helpers/mootools_engine.php b/cake/libs/view/helpers/mootools_engine.php index ad78c5740..f4efaef5a 100644 --- a/cake/libs/view/helpers/mootools_engine.php +++ b/cake/libs/view/helpers/mootools_engine.php @@ -176,6 +176,7 @@ function request($url, $options = array()) { unset($options['type']); } if (isset($options['update'])) { + $options['update'] = str_replace('#', '', $options['update']); $type = '.HTML'; if (!empty($options['data'])) { $data = $this->_toQuerystring($options['data']); diff --git a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php index 3f19e8a94..294d06e91 100644 --- a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php @@ -170,6 +170,22 @@ function testRequest() { )); $expected = 'var jsRequest = new Request.JSON({method:"post", onComplete:doSuccess, onFailure:handleError, url:"/people/edit/1"}).send({"name":"jim","height":"185cm"});'; $this->assertEqual($result, $expected); + + $result = $this->Moo->request('/people/edit/1', array( + 'method' => 'post', + 'complete' => 'doSuccess', + 'update' => '#update-zone' + )); + $expected = 'var jsRequest = new Request.HTML({method:"post", onComplete:doSuccess, update:"update-zone", url:"/people/edit/1"}).send();'; + $this->assertEqual($result, $expected); + + $result = $this->Moo->request('/people/edit/1', array( + 'method' => 'post', + 'complete' => 'doSuccess', + 'update' => 'update-zone' + )); + $expected = 'var jsRequest = new Request.HTML({method:"post", onComplete:doSuccess, update:"update-zone", url:"/people/edit/1"}).send();'; + $this->assertEqual($result, $expected); } /** * test sortable list generation From 87c5a5da6afd369ad44f692bf97e2ad547b093f0 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 29 Mar 2009 23:00:39 -0400 Subject: [PATCH 0081/2083] Fixing jquery::request() and update key. Adding drag and drop test skeleton to mootools/jquery --- cake/libs/view/helpers/jquery_engine.php | 6 +++++ .../libs/view/helpers/jquery_engine.test.php | 24 +++++++++++++++++++ .../view/helpers/mootools_engine.test.php | 16 +++++++++++++ 3 files changed, 46 insertions(+) diff --git a/cake/libs/view/helpers/jquery_engine.php b/cake/libs/view/helpers/jquery_engine.php index acf800671..70b6c41ab 100644 --- a/cake/libs/view/helpers/jquery_engine.php +++ b/cake/libs/view/helpers/jquery_engine.php @@ -131,6 +131,8 @@ function effect($name, $options = array()) { /** * Create an $.ajax() call. * + * If the 'update' key is set, success callback will be overridden. + * * @param mixed $url * @param array $options * @return string The completed ajax call. @@ -142,6 +144,10 @@ function request($url, $options = array()) { $options['data'] = $this->_toQuerystring($options['data']); } $options['url'] = $url; + if (isset($options['update'])) { + $options['success'] = 'function (msg, status) {$("' . $options['update'] . '").html(msg);}'; + unset($options['update']); + } $callbacks = array('success', 'error', 'beforeSend', 'complete'); $options = $this->_parseOptions($options, $callbacks); return '$.ajax({' . $options .'});'; diff --git a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php index 43c0890f0..81bfc964f 100644 --- a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php @@ -153,6 +153,14 @@ function testRequest() { )); $expected = '$.ajax({data:"name=jim&height=185cm", dataType:"json", error:handleError, method:"post", success:doSuccess, url:"/people/edit/1"});'; $this->assertEqual($result, $expected); + + $result = $this->Jquery->request('/people/edit/1', array( + 'update' => '#updated', + 'success' => 'doFoo', + 'method' => 'post' + )); + $expected = '$.ajax({method:"post", success:function (msg, status) {$("#updated").html(msg);}, url:"/people/edit/1"});'; + $this->assertEqual($result, $expected); } /** * test sortable list generation @@ -170,5 +178,21 @@ function testSortable() { $expected = '$("#myList").sortable({containment:"parent", distance:5, sort:onSort, start:onStart, stop:onStop});'; $this->assertEqual($result, $expected); } +/** + * test drag() method + * + * @return void + **/ + function testDrag() { + + } +/** + * test drop() method + * + * @return void + **/ + function testDrop() { + + } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php index 294d06e91..780ade21f 100644 --- a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php @@ -203,5 +203,21 @@ function testSortable() { $expected = 'var mooSortable = new Sortables($("myList"), {constrain:"parent", onComplete:onStop, onSort:onSort, onStart:onStart, snap:5});'; $this->assertEqual($result, $expected); } +/** + * test drag() method + * + * @return void + **/ + function testDrag() { + + } +/** + * test drop() method + * + * @return void + **/ + function testDrop() { + + } } ?> \ No newline at end of file From 5f7abae48c59475de7dbb19cd9315e51e74d3970 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 5 Apr 2009 23:49:09 -0400 Subject: [PATCH 0082/2083] Fixing request() callbacks. Starting test for prototype --- cake/libs/view/helpers/jquery_engine.php | 3 +- cake/libs/view/helpers/js.php | 3 +- cake/libs/view/helpers/mootools_engine.php | 5 +-- cake/libs/view/helpers/prototype_engine.php | 35 +++++++++++++++++-- .../libs/view/helpers/jquery_engine.test.php | 6 ++-- .../view/helpers/mootools_engine.test.php | 7 ++-- .../view/helpers/prototype_engine.test.php | 33 +++++++++++++++++ 7 files changed, 81 insertions(+), 11 deletions(-) diff --git a/cake/libs/view/helpers/jquery_engine.php b/cake/libs/view/helpers/jquery_engine.php index 70b6c41ab..14e82cb9a 100644 --- a/cake/libs/view/helpers/jquery_engine.php +++ b/cake/libs/view/helpers/jquery_engine.php @@ -35,8 +35,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper { var $_optionMap = array( 'request' => array( 'type' => 'dataType', - 'complete' => 'success', - 'request' => 'beforeSend', + 'before' => 'beforeSend', ), 'sortable' => array( 'complete' => 'stop', diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 108057bb5..b8c2e6d2d 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -562,7 +562,8 @@ function effect($name, $options) { * ### Event Options * * - 'complete' - Callback to fire on complete. - * - 'request' - Callback to fire on request initialization. + * - 'success' - Callback to fire on success. + * - 'before' - Callback to fire on request initialization. * - 'error' - Callback to fire on request failure. * * ### Options diff --git a/cake/libs/view/helpers/mootools_engine.php b/cake/libs/view/helpers/mootools_engine.php index f4efaef5a..45d3427fa 100644 --- a/cake/libs/view/helpers/mootools_engine.php +++ b/cake/libs/view/helpers/mootools_engine.php @@ -38,7 +38,8 @@ class MootoolsEngineHelper extends JsBaseEngineHelper { var $_optionMap = array( 'request' => array( 'complete' => 'onComplete', - 'request' => 'onRequest', + 'success' => 'onSuccess', + 'before' => 'onRequest', 'error' => 'onFailure' ), 'sortable' => array( @@ -185,7 +186,7 @@ function request($url, $options = array()) { unset($options['type']); } $options['url'] = $url; - $callbacks = array('onComplete', 'onFailure', 'onRequest'); + $callbacks = array('onComplete', 'onFailure', 'onRequest', 'onSuccess', 'onCancel', 'onException'); $options = $this->_parseOptions($options, $callbacks); return "var jsRequest = new Request$type({{$options}}).send($data);"; } diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php index 48f543afb..dd6112393 100644 --- a/cake/libs/view/helpers/prototype_engine.php +++ b/cake/libs/view/helpers/prototype_engine.php @@ -34,7 +34,13 @@ class PrototypeEngineHelper extends JsBaseEngineHelper { * @var array **/ var $_optionMap = array( - + 'request' => array( + 'async' => 'asyncrhronous', + 'data' => 'parameters', + 'before' => 'onCreate', + 'complete' => 'onSuccess', + 'error' => 'onFailure' + ) ); /** * Create javascript selector for a CSS rule @@ -153,7 +159,32 @@ function effect($name, $options = array()) { * @return string The completed ajax call. **/ function request($url, $options = array()) { - + $url = '"'. $this->url($url) . '"'; + $options = $this->_mapOptions('request', $options); + $type = $data = null; + /*if (isset($options['type']) && strtolower($options['type']) == 'json') { + $type = '.JSON'; + if (!empty($options['data'])) { + $data = $this->object($options['data']); + unset($options['data']); + } + unset($options['type']); + }*/ + if (isset($options['update'])) { + $options['update'] = str_replace('#', '', $options['update']); + $type = '.Updater'; + if (!empty($options['data'])) { + $data = $this->_toQuerystring($options['data']); + unset($options['data']); + } + unset($options['type']); + } + $callbacks = array('onComplete', 'onFailure', 'onRequest'); + $options = $this->_parseOptions($options, $callbacks); + if (!empty($options)) { + $options = ', {' . $options . '}'; + } + return "var jsRequest = new Ajax$type($url$options);"; } /** * Create a sortable element. diff --git a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php index 81bfc964f..b967fcc80 100644 --- a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php @@ -146,12 +146,14 @@ function testRequest() { $result = $this->Jquery->request('/people/edit/1', array( 'method' => 'post', - 'complete' => 'doSuccess', + 'before' => 'doBefore', + 'complete' => 'doComplete', + 'success' => 'doSuccess', 'error' => 'handleError', 'type' => 'json', 'data' => array('name' => 'jim', 'height' => '185cm') )); - $expected = '$.ajax({data:"name=jim&height=185cm", dataType:"json", error:handleError, method:"post", success:doSuccess, url:"/people/edit/1"});'; + $expected = '$.ajax({beforeSend:doBefore, complete:doComplete, data:"name=jim&height=185cm", dataType:"json", error:handleError, method:"post", success:doSuccess, url:"/people/edit/1"});'; $this->assertEqual($result, $expected); $result = $this->Jquery->request('/people/edit/1', array( diff --git a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php index 780ade21f..a5ffd3437 100644 --- a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php @@ -181,10 +181,13 @@ function testRequest() { $result = $this->Moo->request('/people/edit/1', array( 'method' => 'post', - 'complete' => 'doSuccess', + 'complete' => 'doComplete', + 'success' => 'doSuccess', + 'error' => 'doFailure', + 'before' => 'doBefore', 'update' => 'update-zone' )); - $expected = 'var jsRequest = new Request.HTML({method:"post", onComplete:doSuccess, update:"update-zone", url:"/people/edit/1"}).send();'; + $expected = 'var jsRequest = new Request.HTML({method:"post", onComplete:doComplete, onFailure:doFailure, onRequest:doBefore, onSuccess:doSuccess, update:"update-zone", url:"/people/edit/1"}).send();'; $this->assertEqual($result, $expected); } /** diff --git a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php index 92d10a116..b5ad20fcc 100644 --- a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php @@ -168,7 +168,40 @@ function testEffect() { * @return void **/ function testRequest() { + $result = $this->Proto->request(array('controller' => 'posts', 'action' => 'view', 1)); + $expected = 'var jsRequest = new Ajax("/posts/view/1");'; + $this->assertEqual($result, $expected); + + $result = $this->Proto->request('/posts/view/1', array('update' => 'content')); + $expected = 'var jsRequest = new Ajax.Updater("/posts/view/1", {update:"content"});'; + $this->assertEqual($result, $expected); +/* $result = $this->Proto->request('/people/edit/1', array( + 'method' => 'post', + 'complete' => 'doSuccess', + 'error' => 'handleError', + 'type' => 'json', + 'data' => array('name' => 'jim', 'height' => '185cm') + )); + $expected = 'var jsRequest = new Request.JSON({method:"post", onComplete:doSuccess, onFailure:handleError, url:"/people/edit/1"}).send({"name":"jim","height":"185cm"});'; + $this->assertEqual($result, $expected); + + $result = $this->Proto->request('/people/edit/1', array( + 'method' => 'post', + 'complete' => 'doSuccess', + 'update' => '#update-zone' + )); + $expected = 'var jsRequest = new Request.HTML({method:"post", onComplete:doSuccess, update:"update-zone", url:"/people/edit/1"}).send();'; + $this->assertEqual($result, $expected); + + $result = $this->Proto->request('/people/edit/1', array( + 'method' => 'post', + 'complete' => 'doSuccess', + 'update' => 'update-zone' + )); + $expected = 'var jsRequest = new Request.HTML({method:"post", onComplete:doSuccess, update:"update-zone", url:"/people/edit/1"}).send();'; + $this->assertEqual($result, $expected); + */ } /** * test sortable list generation From 00f3c6f25dc403061a986134d55c144916995163 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 6 Apr 2009 00:03:19 -0400 Subject: [PATCH 0083/2083] Updating prototype engine and test case for request() --- cake/libs/view/helpers/prototype_engine.php | 16 +++++------ .../view/helpers/prototype_engine.test.php | 28 ++++++++++++++++--- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php index dd6112393..ea5304641 100644 --- a/cake/libs/view/helpers/prototype_engine.php +++ b/cake/libs/view/helpers/prototype_engine.php @@ -38,7 +38,8 @@ class PrototypeEngineHelper extends JsBaseEngineHelper { 'async' => 'asyncrhronous', 'data' => 'parameters', 'before' => 'onCreate', - 'complete' => 'onSuccess', + 'success' => 'onSuccess', + 'complete' => 'onComplete', 'error' => 'onFailure' ) ); @@ -161,7 +162,8 @@ function effect($name, $options = array()) { function request($url, $options = array()) { $url = '"'. $this->url($url) . '"'; $options = $this->_mapOptions('request', $options); - $type = $data = null; + $type = '.Request'; + $data = null; /*if (isset($options['type']) && strtolower($options['type']) == 'json') { $type = '.JSON'; if (!empty($options['data'])) { @@ -171,15 +173,11 @@ function request($url, $options = array()) { unset($options['type']); }*/ if (isset($options['update'])) { - $options['update'] = str_replace('#', '', $options['update']); + $url = '"' . str_replace('#', '', $options['update']) . '", ' . $url; $type = '.Updater'; - if (!empty($options['data'])) { - $data = $this->_toQuerystring($options['data']); - unset($options['data']); - } - unset($options['type']); + unset($options['update'], $options['type']); } - $callbacks = array('onComplete', 'onFailure', 'onRequest'); + $callbacks = array('onCreate', 'onComplete', 'onFailure', 'onRequest', 'onSuccess'); $options = $this->_parseOptions($options, $callbacks); if (!empty($options)) { $options = ', {' . $options . '}'; diff --git a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php index b5ad20fcc..485e60be2 100644 --- a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php @@ -114,7 +114,8 @@ function testEach() { * @return void **/ function testEffect() { - $result = $this->Proto->get('#foo')->effect('show'); + $this->Proto->get('#foo'); + $result = $this->Proto->effect('show'); $expected = '$("foo").show();'; $this->assertEqual($result, $expected); @@ -169,11 +170,30 @@ function testEffect() { **/ function testRequest() { $result = $this->Proto->request(array('controller' => 'posts', 'action' => 'view', 1)); - $expected = 'var jsRequest = new Ajax("/posts/view/1");'; + $expected = 'var jsRequest = new Ajax.Request("/posts/view/1");'; $this->assertEqual($result, $expected); - + + $result = $this->Proto->request('/posts/view/1', array( + 'method' => 'post', + 'complete' => 'doComplete', + 'before' => 'doBefore', + 'success' => 'doSuccess', + 'error' => 'doError', + 'data' => array('name' => 'jim', 'height' => '185cm') + )); + $expected = 'var jsRequest = new Ajax.Request("/posts/view/1", {method:"post", onComplete:doComplete, onCreate:doBefore, onFailure:doError, onSuccess:doSuccess, parameters:{"name":"jim","height":"185cm"}});'; + $this->assertEqual($result, $expected); + $result = $this->Proto->request('/posts/view/1', array('update' => 'content')); - $expected = 'var jsRequest = new Ajax.Updater("/posts/view/1", {update:"content"});'; + $expected = 'var jsRequest = new Ajax.Updater("content", "/posts/view/1");'; + $this->assertEqual($result, $expected); + + $result = $this->Proto->request('/people/edit/1', array( + 'method' => 'post', + 'complete' => 'doSuccess', + 'update' => '#update-zone' + )); + $expected = 'var jsRequest = new Ajax.Updater("update-zone", "/people/edit/1", {method:"post", onComplete:doSuccess});'; $this->assertEqual($result, $expected); /* $result = $this->Proto->request('/people/edit/1', array( From f74408df0a54f50ef3a61e0bcb6ddb84f567e88f Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 6 Apr 2009 00:39:16 -0400 Subject: [PATCH 0084/2083] Updating request() in prototype. --- cake/libs/view/helpers/prototype_engine.php | 9 ++------- .../view/helpers/prototype_engine.test.php | 20 ++----------------- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php index ea5304641..1ec594bba 100644 --- a/cake/libs/view/helpers/prototype_engine.php +++ b/cake/libs/view/helpers/prototype_engine.php @@ -164,14 +164,9 @@ function request($url, $options = array()) { $options = $this->_mapOptions('request', $options); $type = '.Request'; $data = null; - /*if (isset($options['type']) && strtolower($options['type']) == 'json') { - $type = '.JSON'; - if (!empty($options['data'])) { - $data = $this->object($options['data']); - unset($options['data']); - } + if (isset($options['type']) && strtolower($options['type']) == 'json') { unset($options['type']); - }*/ + } if (isset($options['update'])) { $url = '"' . str_replace('#', '', $options['update']) . '", ' . $url; $type = '.Updater'; diff --git a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php index 485e60be2..df9a41856 100644 --- a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php @@ -196,32 +196,16 @@ function testRequest() { $expected = 'var jsRequest = new Ajax.Updater("update-zone", "/people/edit/1", {method:"post", onComplete:doSuccess});'; $this->assertEqual($result, $expected); -/* $result = $this->Proto->request('/people/edit/1', array( + $result = $this->Proto->request('/people/edit/1', array( 'method' => 'post', 'complete' => 'doSuccess', 'error' => 'handleError', 'type' => 'json', 'data' => array('name' => 'jim', 'height' => '185cm') )); - $expected = 'var jsRequest = new Request.JSON({method:"post", onComplete:doSuccess, onFailure:handleError, url:"/people/edit/1"}).send({"name":"jim","height":"185cm"});'; + $expected = 'var jsRequest = new Ajax.Request("/people/edit/1", {method:"post", onComplete:doSuccess, onFailure:handleError, parameters:{"name":"jim","height":"185cm"}});'; $this->assertEqual($result, $expected); - $result = $this->Proto->request('/people/edit/1', array( - 'method' => 'post', - 'complete' => 'doSuccess', - 'update' => '#update-zone' - )); - $expected = 'var jsRequest = new Request.HTML({method:"post", onComplete:doSuccess, update:"update-zone", url:"/people/edit/1"}).send();'; - $this->assertEqual($result, $expected); - - $result = $this->Proto->request('/people/edit/1', array( - 'method' => 'post', - 'complete' => 'doSuccess', - 'update' => 'update-zone' - )); - $expected = 'var jsRequest = new Request.HTML({method:"post", onComplete:doSuccess, update:"update-zone", url:"/people/edit/1"}).send();'; - $this->assertEqual($result, $expected); - */ } /** * test sortable list generation From ef024b86e4f039d38349e2f86db7b76e4fc561f3 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 6 Apr 2009 21:12:43 -0400 Subject: [PATCH 0085/2083] Adding group test for new Javascript engine. --- cake/tests/groups/javascript.group.php | 57 ++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 cake/tests/groups/javascript.group.php diff --git a/cake/tests/groups/javascript.group.php b/cake/tests/groups/javascript.group.php new file mode 100644 index 000000000..1b437a4d0 --- /dev/null +++ b/cake/tests/groups/javascript.group.php @@ -0,0 +1,57 @@ +<?php +/* SVN FILE: $Id$ */ +/** + * AllCoreJavascriptHelpersGroupTest file + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> + * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests + * @package cake + * @subpackage cake.tests.groups + * @since CakePHP(tm) v 1.2.0.4206 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ +/** + * AllCoreJavascriptHelpersGroupTest class + * + * This test group will run all test in the cases/libs/view/helpers directory. + * + * @package cake + * @subpackage cake.tests.groups + */ +class AllCoreJavascriptHelpersGroupTest extends GroupTest { +/** + * label property + * + * @var string 'All core helpers' + * @access public + */ + var $label = 'All Javascript Helpers'; +/** + * AllCoreHelpersGroupTest method + * + * @access public + * @return void + */ + function AllCoreJavascriptHelpersGroupTest() { + $helperTestPath = CORE_TEST_CASES . DS . 'libs' . DS . 'view' . DS . 'helpers' . DS; + TestManager::addTestFile($this, $helperTestPath . 'js.test.php'); + TestManager::addTestFile($this, $helperTestPath . 'jquery_engine.test.php'); + TestManager::addTestFile($this, $helperTestPath . 'mootools_engine.test.php'); + TestManager::addTestFile($this, $helperTestPath . 'prototype_engine.test.php'); + } +} +?> \ No newline at end of file From 34f67cc8972e25683ef6919e0871d3eab72ff2e7 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 6 Apr 2009 21:18:43 -0400 Subject: [PATCH 0086/2083] Updating names. --- cake/tests/groups/javascript.group.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cake/tests/groups/javascript.group.php b/cake/tests/groups/javascript.group.php index 1b437a4d0..b32bfaba8 100644 --- a/cake/tests/groups/javascript.group.php +++ b/cake/tests/groups/javascript.group.php @@ -27,7 +27,8 @@ /** * AllCoreJavascriptHelpersGroupTest class * - * This test group will run all test in the cases/libs/view/helpers directory. + * This test group will run all test in the cases/libs/view/helpers directory related + * to Js helper and its engines * * @package cake * @subpackage cake.tests.groups @@ -39,7 +40,7 @@ class AllCoreJavascriptHelpersGroupTest extends GroupTest { * @var string 'All core helpers' * @access public */ - var $label = 'All Javascript Helpers'; + var $label = 'Js Helper and all Engine Helpers'; /** * AllCoreHelpersGroupTest method * From c6c7630d8ff89f2e0f2eb028a4e8a3944d91c852 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 6 Apr 2009 21:24:14 -0400 Subject: [PATCH 0087/2083] Fixing tests for php4 compat. --- .../libs/view/helpers/jquery_engine.test.php | 16 ++++++++++------ .../libs/view/helpers/mootools_engine.test.php | 16 ++++++++++------ .../libs/view/helpers/prototype_engine.test.php | 10 ++++++---- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php index b967fcc80..9e4b82a81 100644 --- a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php @@ -68,15 +68,16 @@ function testSelector() { * @return void **/ function testEvent() { - $result = $this->Jquery->get('#myLink')->event('click', 'doClick', array('wrap' => false)); + $this->Jquery->get('#myLink'); + $result = $this->Jquery->event('click', 'doClick', array('wrap' => false)); $expected = '$("#myLink").bind("click", doClick);'; $this->assertEqual($result, $expected); - $result = $this->Jquery->get('#myLink')->event('click', '$(this).show();', array('stop' => false)); + $result = $this->Jquery->event('click', '$(this).show();', array('stop' => false)); $expected = '$("#myLink").bind("click", function (event) {$(this).show();});'; $this->assertEqual($result, $expected); - $result = $this->Jquery->get('#myLink')->event('click', '$(this).hide();'); + $result = $this->Jquery->event('click', '$(this).hide();'); $expected = '$("#myLink").bind("click", function (event) {$(this).hide();'."\n".'return false;});'; $this->assertEqual($result, $expected); } @@ -96,7 +97,8 @@ function testDomReady() { * @return void **/ function testEach() { - $result = $this->Jquery->get('#foo')->each('$(this).hide();'); + $this->Jquery->get('#foo'); + $result = $this->Jquery->each('$(this).hide();'); $expected = '$("#foo").each(function () {$(this).hide();});'; $this->assertEqual($result, $expected); } @@ -106,7 +108,8 @@ function testEach() { * @return void **/ function testEffect() { - $result = $this->Jquery->get('#foo')->effect('show'); + $this->Jquery->get('#foo'); + $result = $this->Jquery->effect('show'); $expected = '$("#foo").show();'; $this->assertEqual($result, $expected); @@ -170,7 +173,8 @@ function testRequest() { * @return void **/ function testSortable() { - $result = $this->Jquery->get('#myList')->sortable(array( + $this->Jquery->get('#myList'); + $result = $this->Jquery->sortable(array( 'distance' => 5, 'containment' => 'parent', 'start' => 'onStart', diff --git a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php index a5ffd3437..f32cdd818 100644 --- a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php @@ -76,15 +76,16 @@ function testSelector() { * @return void **/ function testEvent() { - $result = $this->Moo->get('#myLink')->event('click', 'doClick', array('wrap' => false)); + $this->Moo->get('#myLink'); + $result = $this->Moo->event('click', 'doClick', array('wrap' => false)); $expected = '$("myLink").addEvent("click", doClick);'; $this->assertEqual($result, $expected); - $result = $this->Moo->get('#myLink')->event('click', 'this.setStyle("display", "");', array('stop' => false)); + $result = $this->Moo->event('click', 'this.setStyle("display", "");', array('stop' => false)); $expected = '$("myLink").addEvent("click", function (event) {this.setStyle("display", "");});'; $this->assertEqual($result, $expected); - $result = $this->Moo->get('#myLink')->event('click', 'this.setStyle("display", "none");'); + $result = $this->Moo->event('click', 'this.setStyle("display", "none");'); $expected = "\$(\"myLink\").addEvent(\"click\", function (event) {event.stop();\nthis.setStyle(\"display\", \"none\");});"; $this->assertEqual($result, $expected); } @@ -104,7 +105,8 @@ function testDomReady() { * @return void **/ function testEach() { - $result = $this->Moo->get('#foo')->each('item.setStyle("display", "none");'); + $this->Moo->get('#foo'); + $result = $this->Moo->each('item.setStyle("display", "none");'); $expected = '$("foo").each(function (item, index) {item.setStyle("display", "none");});'; $this->assertEqual($result, $expected); } @@ -114,7 +116,8 @@ function testEach() { * @return void **/ function testEffect() { - $result = $this->Moo->get('#foo')->effect('show'); + $this->Moo->get('#foo'); + $result = $this->Moo->effect('show'); $expected = '$("foo").setStyle("display", "");'; $this->assertEqual($result, $expected); @@ -196,7 +199,8 @@ function testRequest() { * @return void **/ function testSortable() { - $result = $this->Moo->get('#myList')->sortable(array( + $this->Moo->get('#myList'); + $result = $this->Moo->sortable(array( 'distance' => 5, 'containment' => 'parent', 'start' => 'onStart', diff --git a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php index df9a41856..cf6f4f825 100644 --- a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php @@ -76,15 +76,16 @@ function testSelector() { * @return void **/ function testEvent() { - $result = $this->Proto->get('#myLink')->event('click', 'doClick', array('wrap' => false)); + $this->Proto->get('#myLink'); + $result = $this->Proto->event('click', 'doClick', array('wrap' => false)); $expected = '$("myLink").observe("click", doClick);'; $this->assertEqual($result, $expected); - $result = $this->Proto->get('#myLink')->event('click', 'Element.hide(this);', array('stop' => false)); + $result = $this->Proto->event('click', 'Element.hide(this);', array('stop' => false)); $expected = '$("myLink").observe("click", function (event) {Element.hide(this);});'; $this->assertEqual($result, $expected); - $result = $this->Proto->get('#myLink')->event('click', 'Element.hide(this);'); + $result = $this->Proto->event('click', 'Element.hide(this);'); $expected = "\$(\"myLink\").observe(\"click\", function (event) {event.stop();\nElement.hide(this);});"; $this->assertEqual($result, $expected); } @@ -104,7 +105,8 @@ function testDomReady() { * @return void **/ function testEach() { - $result = $this->Proto->get('#foo li')->each('item.hide();'); + $this->Proto->get('#foo li'); + $result = $this->Proto->each('item.hide();'); $expected = '$$("#foo li").each(function (item, index) {item.hide();});'; $this->assertEqual($result, $expected); } From 49f689a9ce9884e95d3dbefddc5027419b5d0db2 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 6 Apr 2009 21:56:20 -0400 Subject: [PATCH 0088/2083] Updating mootools and prototype sortable implementation. --- cake/libs/view/helpers/mootools_engine.php | 2 +- cake/libs/view/helpers/prototype_engine.php | 11 ++++++++++- .../cases/libs/view/helpers/mootools_engine.test.php | 2 +- .../cases/libs/view/helpers/prototype_engine.test.php | 10 +++++++++- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/cake/libs/view/helpers/mootools_engine.php b/cake/libs/view/helpers/mootools_engine.php index 45d3427fa..06e17bb0d 100644 --- a/cake/libs/view/helpers/mootools_engine.php +++ b/cake/libs/view/helpers/mootools_engine.php @@ -203,7 +203,7 @@ function sortable($options = array()) { $options = $this->_mapOptions('sortable', $options); $callbacks = array('onStart', 'onSort', 'onComplete'); $options = $this->_parseOptions($options, $callbacks); - return 'var mooSortable = new Sortables(' . $this->selection . ', {' . $options . '});'; + return 'var jsSortable = new Sortables(' . $this->selection . ', {' . $options . '});'; } } ?> \ No newline at end of file diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php index 1ec594bba..849e1b6ec 100644 --- a/cake/libs/view/helpers/prototype_engine.php +++ b/cake/libs/view/helpers/prototype_engine.php @@ -41,6 +41,12 @@ class PrototypeEngineHelper extends JsBaseEngineHelper { 'success' => 'onSuccess', 'complete' => 'onComplete', 'error' => 'onFailure' + ), + 'sortable' => array( + 'start' => 'onStart', + 'sort' => 'onDrag', + 'complete' => 'onDrop', + 'distance' => 'snap', ) ); /** @@ -189,7 +195,10 @@ function request($url, $options = array()) { * @see JsHelper::sortable() for options list. **/ function sortable($options = array()) { - + $options = $this->_mapOptions('sortable', $options); + $callbacks = array('onStart', 'change', 'onDrag', 'onDrop'); + $options = $this->_parseOptions($options, $callbacks); + return 'var jsSortable = Sortable.create(' . $this->selection . ', {' . $options . '});'; } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php index f32cdd818..18f0cabc1 100644 --- a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php @@ -207,7 +207,7 @@ function testSortable() { 'complete' => 'onStop', 'sort' => 'onSort', )); - $expected = 'var mooSortable = new Sortables($("myList"), {constrain:"parent", onComplete:onStop, onSort:onSort, onStart:onStart, snap:5});'; + $expected = 'var jsSortable = new Sortables($("myList"), {constrain:"parent", onComplete:onStop, onSort:onSort, onStart:onStart, snap:5});'; $this->assertEqual($result, $expected); } /** diff --git a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php index cf6f4f825..2156ad073 100644 --- a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php @@ -215,7 +215,15 @@ function testRequest() { * @return void **/ function testSortable() { - + $this->Proto->get('#myList'); + $result = $this->Proto->sortable(array( + 'distance' => 5, + 'start' => 'onStart', + 'complete' => 'onComplete', + 'sort' => 'onSort', + )); + $expected = 'var jsSortable = Sortable.create($("myList"), {onDrag:onSort, onDrop:onComplete, onStart:onStart, snap:5});'; + $this->assertEqual($result, $expected); } } ?> \ No newline at end of file From 0269994842561ba8497b7b07f368c4747671554c Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 8 Apr 2009 23:31:17 -0400 Subject: [PATCH 0089/2083] Adding Drag() to jquery --- cake/libs/view/helpers/jquery_engine.php | 19 +++++++++++++++++++ .../libs/view/helpers/jquery_engine.test.php | 10 +++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/jquery_engine.php b/cake/libs/view/helpers/jquery_engine.php index 14e82cb9a..e22443923 100644 --- a/cake/libs/view/helpers/jquery_engine.php +++ b/cake/libs/view/helpers/jquery_engine.php @@ -39,6 +39,10 @@ class JqueryEngineHelper extends JsBaseEngineHelper { ), 'sortable' => array( 'complete' => 'stop', + ), + 'drag' => array( + 'snapGrid' => 'grid', + 'container' => 'containment', ) ); /** @@ -167,5 +171,20 @@ function sortable($options = array()) { $options = $this->_parseOptions($options, $callbacks); return $this->selection . '.sortable({' . $options . '});'; } +/** + * Create a Draggable element + * + * Requires both Ui.Core and Ui.Draggable to be loaded. + * + * @param array $options Array of options for the draggable element. + * @return string Completed Draggabke script. + * @see JsHelper::drag() for options list. + **/ + function drag($options = array()) { + $options = $this->_mapOptions('drag', $options); + $callbacks = array('start', 'drag', 'stop'); + $options = $this->_parseOptions($options, $callbacks); + return $this->selection . '.draggable({' . $options . '});'; + } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php index 9e4b82a81..b227bf3d5 100644 --- a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php @@ -190,7 +190,15 @@ function testSortable() { * @return void **/ function testDrag() { - + $this->Jquery->get('#element'); + $result = $this->Jquery->drag(array( + 'container' => '#content', + 'start' => 'onStart', + 'drag' => 'onDrag', + 'stop' => 'onStop', + 'snapGrid' => array(10, 10), + )); + $expected = '$("#element").draggable({containment:"#content", drag:onDrag, grid:[10, 10], start:onStart, stop:onStop});'; } /** * test drop() method From 646cfd7a830ec9e5dee317ce35ff6c59c820ea62 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 8 Apr 2009 23:57:32 -0400 Subject: [PATCH 0090/2083] Adding drop() to jquery. Adding testcases. Fixing doc blocks. --- cake/libs/view/helpers/jquery_engine.php | 23 +++++++++++++++++-- cake/libs/view/helpers/js.php | 6 ++++- .../libs/view/helpers/jquery_engine.test.php | 13 +++++++++-- 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/cake/libs/view/helpers/jquery_engine.php b/cake/libs/view/helpers/jquery_engine.php index e22443923..46911677d 100644 --- a/cake/libs/view/helpers/jquery_engine.php +++ b/cake/libs/view/helpers/jquery_engine.php @@ -43,6 +43,10 @@ class JqueryEngineHelper extends JsBaseEngineHelper { 'drag' => array( 'snapGrid' => 'grid', 'container' => 'containment', + ), + 'drop' => array( + 'leave' => 'out', + 'hover' => 'over' ) ); /** @@ -177,14 +181,29 @@ function sortable($options = array()) { * Requires both Ui.Core and Ui.Draggable to be loaded. * * @param array $options Array of options for the draggable element. - * @return string Completed Draggabke script. + * @return string Completed Draggable script. * @see JsHelper::drag() for options list. **/ function drag($options = array()) { $options = $this->_mapOptions('drag', $options); $callbacks = array('start', 'drag', 'stop'); $options = $this->_parseOptions($options, $callbacks); - return $this->selection . '.draggable({' . $options . '});'; + return $this->selection . '.draggable({' . $options . '});'; + } +/** + * Create a Droppable element + * + * Requires both Ui.Core and Ui.Droppable to be loaded. + * + * @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()) { + $options = $this->_mapOptions('drop', $options); + $callbacks = array('activate', 'deactivate', 'over', 'out', 'drop'); + $options = $this->_parseOptions($options, $callbacks); + return $this->selection . '.droppable({' . $options . '});'; } } ?> \ No newline at end of file diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index b8c2e6d2d..b4bb4cb42 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -608,9 +608,13 @@ function drag($options = array()) { * Create a droppable element. Allows for draggable elements to be dropped on it. * Additional options may be supported by your library. * + * ### Options + * + * - accept - Selector for elements this droppable will accept. + * - hoverclass - Class to add to droppable when a draggable is over. + * * ### Event Options * - * - drag - Elements that can be dragged into this droppable * - drop - Event fired when an element is dropped into the drop zone. * - hover - Event fired when a drag enters a drop zone. * - leave - Event fired when a drag is removed from a drop zone without being dropped. diff --git a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php index b227bf3d5..6e50ad356 100644 --- a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php @@ -198,7 +198,8 @@ function testDrag() { 'stop' => 'onStop', 'snapGrid' => array(10, 10), )); - $expected = '$("#element").draggable({containment:"#content", drag:onDrag, grid:[10, 10], start:onStart, stop:onStop});'; + $expected = '$("#element").draggable({containment:"#content", drag:onDrag, grid:[10,10], start:onStart, stop:onStop});'; + $this->assertEqual($result, $expected); } /** * test drop() method @@ -206,7 +207,15 @@ function testDrag() { * @return void **/ function testDrop() { - + $this->Jquery->get('#element'); + $result = $this->Jquery->drop(array( + 'accept' => '.items', + 'hover' => 'onHover', + 'leave' => 'onExit', + 'drop' => 'onDrop' + )); + $expected = '$("#element").droppable({accept:".items", drop:onDrop, out:onExit, over:onHover});'; + $this->assertEqual($result, $expected); } } ?> \ No newline at end of file From dd55afe57fb2e36b9586f70171b2aed3aaeec57e Mon Sep 17 00:00:00 2001 From: jperras <joel.perras@gmail.com> Date: Fri, 10 Apr 2009 10:34:36 -0400 Subject: [PATCH 0091/2083] Removing unsused variable. --- cake/libs/inflector.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index aaaa7b3b1..fd835f128 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -188,14 +188,6 @@ class Inflector extends Object { * @access private **/ var $pluralized = array(); -/** - * List of pluralization rules in the form of pattern => replacement. - * - * @var array - * @access public - * @link http://book.cakephp.org/view/47/Custom-Inflections - **/ - var $rules = array(); /** * Cached array identity map of singularized words. * From f466929aca28b42b459056b8d3b7ded927d8f898 Mon Sep 17 00:00:00 2001 From: jperras <joel.perras@gmail.com> Date: Fri, 10 Apr 2009 13:03:38 -0400 Subject: [PATCH 0092/2083] Refactoring singularize/pluralize to use an in-memory array map for better performance. --- cake/libs/inflector.php | 48 +++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index fd835f128..f76cc6733 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -227,13 +227,14 @@ function &getInstance() { function rules($type, $rules = array()) { $_this =& Inflector::getInstance(); - foreach ($rules as $rule => $pattern) { - if (is_array($pattern)) { - $_this->{$type}[$rule] = array_merge($pattern, $_this->{$type}[$rule]); - unset($rules[$rule], $_this->{$type}['cache' . ucfirst($rule)]); + foreach ($rules as $rule => $pattern) { + if (is_array($pattern)) { + $_this->{$type}[$rule] = array_merge($pattern, $_this->{$type}[$rule]); + unset($rules[$rule], $_this->{$type}['cache' . ucfirst($rule)], $_this->{$type}['merged'][$rule]); + } } - } - $_this->{$type}['rules'] = array_merge($rules, $_this->{$type}['rules']); + $_this->{$type}['rules'] = array_merge($rules, $_this->{$type}['rules']); + } /** * Return $word in plural form. @@ -251,16 +252,21 @@ function pluralize($word) { return $_this->pluralized[$word]; } - extract($_this->plural); - $uninflected = array_merge($uninflected, $_this->uninflected); + if (!isset($_this->plural['merged']['irregular'])) { + $_this->plural['merged']['irregular'] = $_this->plural['irregular']; + } + + if (!isset($_this->plural['merged']['uninflected'])) { + $_this->plural['merged']['uninflected'] = array_merge($_this->plural['uninflected'], $_this->uninflected); + } if (!isset($_this->plural['cacheUninflected']) || !isset($_this->plural['cacheIrregular'])) { - $_this->plural['cacheUninflected'] = '(?:' . join( '|', $uninflected) . ')'; - $_this->plural['cacheIrregular'] = '(?:' . join( '|', array_keys($irregular)) . ')'; + $_this->plural['cacheUninflected'] = '(?:' . join( '|', $_this->plural['merged']['uninflected']) . ')'; + $_this->plural['cacheIrregular'] = '(?:' . join( '|', array_keys($_this->plural['merged']['irregular'])) . ')'; } if (preg_match('/(.*)\\b(' . $_this->plural['cacheIrregular'] . ')$/i', $word, $regs)) { - $_this->pluralized[$word] = $regs[1] . substr($word, 0, 1) . substr($irregular[strtolower($regs[2])], 1); + $_this->pluralized[$word] = $regs[1] . substr($word, 0, 1) . substr($_this->plural['merged']['irregular'][strtolower($regs[2])], 1); return $_this->pluralized[$word]; } @@ -269,7 +275,7 @@ function pluralize($word) { return $word; } - foreach ($rules as $rule => $replacement) { + foreach ($_this->plural['rules'] as $rule => $replacement) { if (preg_match($rule, $word)) { $_this->pluralized[$word] = preg_replace($rule, $replacement, $word); return $_this->pluralized[$word]; @@ -293,17 +299,21 @@ function singularize($word) { return $_this->singularized[$word]; } - extract($_this->singular); - $uninflected = array_merge($uninflected, $_this->uninflected); - $irregular = array_merge($irregular, array_flip($_this->plural['irregular'])); + if (!isset($_this->singular['merged']['uninflected'])) { + $_this->singular['merged']['uninflected'] = array_merge($_this->singular['uninflected'], $_this->uninflected); + } + + if (!isset($_this->singular['merged']['irregular'])) { + $_this->singular['merged']['irregular'] = array_merge($_this->singular['irregular'], array_flip($_this->plural['irregular'])); + } if (!isset($_this->singular['cacheUninflected']) || !isset($_this->singular['cacheIrregular'])) { - $_this->singular['cacheUninflected'] = '(?:' . join( '|', $uninflected) . ')'; - $_this->singular['cacheIrregular'] = '(?:' . join( '|', array_keys($irregular)) . ')'; + $_this->singular['cacheUninflected'] = '(?:' . join( '|', $_this->singular['merged']['uninflected']) . ')'; + $_this->singular['cacheIrregular'] = '(?:' . join( '|', array_keys($_this->singular['merged']['irregular'])) . ')'; } if (preg_match('/(.*)\\b(' . $_this->singular['cacheIrregular'] . ')$/i', $word, $regs)) { - $_this->singularized[$word] = $regs[1] . substr($word, 0, 1) . substr($irregular[strtolower($regs[2])], 1); + $_this->singularized[$word] = $regs[1] . substr($word, 0, 1) . substr($_this->singular['merged']['irregular'][strtolower($regs[2])], 1); return $_this->singularized[$word]; } @@ -312,7 +322,7 @@ function singularize($word) { return $word; } - foreach ($rules as $rule => $replacement) { + foreach ($_this->singular['rules'] as $rule => $replacement) { if (preg_match($rule, $word)) { $_this->singularized[$word] = preg_replace($rule, $replacement, $word); return $_this->singularized[$word]; From 8d1198dfd6305f690a3f23ef320e7c81a0ba03e1 Mon Sep 17 00:00:00 2001 From: jperras <joel.perras@gmail.com> Date: Fri, 10 Apr 2009 13:41:32 -0400 Subject: [PATCH 0093/2083] Refactoring Inflector class attributes from public to protected scope. --- cake/libs/inflector.php | 89 +++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 44 deletions(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index f76cc6733..ec6626abe 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -50,9 +50,9 @@ class Inflector extends Object { * Plural inflector rules * * @var array - * @access public + * @access protected **/ - var $plural = array( + var $_plural = array( 'rules' => array( '/(s)tatus$/i' => '\1\2tatuses', '/(quiz)$/i' => '\1zes', @@ -116,9 +116,9 @@ class Inflector extends Object { * Singular inflector rules * * @var array - * @access public + * @access protected **/ - var $singular = array( + var $_singular = array( 'rules' => array( '/(s)tatuses$/i' => '\1\2tatus', '/^(.*)(menu)s$/i' => '\1\2', @@ -163,9 +163,9 @@ class Inflector extends Object { * Words that should not be inflected * * @var array - * @access public + * @access protected **/ - var $uninflected = array( + var $_uninflected = array( 'Amoyese', 'bison', 'Borghese', 'bream', 'breeches', 'britches', 'buffalo', 'cantus', 'carp', 'chassis', 'clippers', 'cod', 'coitus', 'Congoese', 'contretemps', 'corps', 'debris', 'diabetes', 'djinn', 'eland', 'elk', 'equipment', 'Faroese', 'flounder', @@ -185,16 +185,16 @@ class Inflector extends Object { * Cached array identity map of pluralized words. * * @var array - * @access private + * @access protected **/ - var $pluralized = array(); + var $_pluralized = array(); /** * Cached array identity map of singularized words. * * @var array - * @access private + * @access protected **/ - var $singularized = array(); + var $_singularized = array(); /** * Gets a reference to the Inflector object instance * @@ -226,6 +226,7 @@ function &getInstance() { */ function rules($type, $rules = array()) { $_this =& Inflector::getInstance(); + $type = '_'.$type; foreach ($rules as $rule => $pattern) { if (is_array($pattern)) { @@ -248,37 +249,37 @@ function rules($type, $rules = array()) { function pluralize($word) { $_this =& Inflector::getInstance(); - if (isset($_this->pluralized[$word])) { - return $_this->pluralized[$word]; + if (isset($_this->_pluralized[$word])) { + return $_this->_pluralized[$word]; } - if (!isset($_this->plural['merged']['irregular'])) { - $_this->plural['merged']['irregular'] = $_this->plural['irregular']; + if (!isset($_this->_plural['merged']['irregular'])) { + $_this->_plural['merged']['irregular'] = $_this->_plural['irregular']; } if (!isset($_this->plural['merged']['uninflected'])) { - $_this->plural['merged']['uninflected'] = array_merge($_this->plural['uninflected'], $_this->uninflected); + $_this->_plural['merged']['uninflected'] = array_merge($_this->_plural['uninflected'], $_this->_uninflected); } - if (!isset($_this->plural['cacheUninflected']) || !isset($_this->plural['cacheIrregular'])) { - $_this->plural['cacheUninflected'] = '(?:' . join( '|', $_this->plural['merged']['uninflected']) . ')'; - $_this->plural['cacheIrregular'] = '(?:' . join( '|', array_keys($_this->plural['merged']['irregular'])) . ')'; + if (!isset($_this->_plural['cacheUninflected']) || !isset($_this->_plural['cacheIrregular'])) { + $_this->_plural['cacheUninflected'] = '(?:' . join( '|', $_this->_plural['merged']['uninflected']) . ')'; + $_this->_plural['cacheIrregular'] = '(?:' . join( '|', array_keys($_this->_plural['merged']['irregular'])) . ')'; } - if (preg_match('/(.*)\\b(' . $_this->plural['cacheIrregular'] . ')$/i', $word, $regs)) { - $_this->pluralized[$word] = $regs[1] . substr($word, 0, 1) . substr($_this->plural['merged']['irregular'][strtolower($regs[2])], 1); - return $_this->pluralized[$word]; + if (preg_match('/(.*)\\b(' . $_this->_plural['cacheIrregular'] . ')$/i', $word, $regs)) { + $_this->_pluralized[$word] = $regs[1] . substr($word, 0, 1) . substr($_this->_plural['merged']['irregular'][strtolower($regs[2])], 1); + return $_this->_pluralized[$word]; } - if (preg_match('/^(' . $_this->plural['cacheUninflected'] . ')$/i', $word, $regs)) { - $_this->pluralized[$word] = $word; + if (preg_match('/^(' . $_this->_plural['cacheUninflected'] . ')$/i', $word, $regs)) { + $_this->_pluralized[$word] = $word; return $word; } - foreach ($_this->plural['rules'] as $rule => $replacement) { + foreach ($_this->_plural['rules'] as $rule => $replacement) { if (preg_match($rule, $word)) { - $_this->pluralized[$word] = preg_replace($rule, $replacement, $word); - return $_this->pluralized[$word]; + $_this->_pluralized[$word] = preg_replace($rule, $replacement, $word); + return $_this->_pluralized[$word]; } } } @@ -295,40 +296,40 @@ function pluralize($word) { function singularize($word) { $_this =& Inflector::getInstance(); - if (isset($_this->singularized[$word])) { - return $_this->singularized[$word]; + if (isset($_this->_singularized[$word])) { + return $_this->_singularized[$word]; } - if (!isset($_this->singular['merged']['uninflected'])) { - $_this->singular['merged']['uninflected'] = array_merge($_this->singular['uninflected'], $_this->uninflected); + if (!isset($_this->_singular['merged']['uninflected'])) { + $_this->_singular['merged']['uninflected'] = array_merge($_this->_singular['uninflected'], $_this->_uninflected); } - if (!isset($_this->singular['merged']['irregular'])) { - $_this->singular['merged']['irregular'] = array_merge($_this->singular['irregular'], array_flip($_this->plural['irregular'])); + if (!isset($_this->_singular['merged']['irregular'])) { + $_this->_singular['merged']['irregular'] = array_merge($_this->_singular['irregular'], array_flip($_this->_plural['irregular'])); } - if (!isset($_this->singular['cacheUninflected']) || !isset($_this->singular['cacheIrregular'])) { - $_this->singular['cacheUninflected'] = '(?:' . join( '|', $_this->singular['merged']['uninflected']) . ')'; - $_this->singular['cacheIrregular'] = '(?:' . join( '|', array_keys($_this->singular['merged']['irregular'])) . ')'; + if (!isset($_this->_singular['cacheUninflected']) || !isset($_this->_singular['cacheIrregular'])) { + $_this->_singular['cacheUninflected'] = '(?:' . join( '|', $_this->_singular['merged']['uninflected']) . ')'; + $_this->_singular['cacheIrregular'] = '(?:' . join( '|', array_keys($_this->_singular['merged']['irregular'])) . ')'; } - if (preg_match('/(.*)\\b(' . $_this->singular['cacheIrregular'] . ')$/i', $word, $regs)) { - $_this->singularized[$word] = $regs[1] . substr($word, 0, 1) . substr($_this->singular['merged']['irregular'][strtolower($regs[2])], 1); - return $_this->singularized[$word]; + if (preg_match('/(.*)\\b(' . $_this->_singular['cacheIrregular'] . ')$/i', $word, $regs)) { + $_this->_singularized[$word] = $regs[1] . substr($word, 0, 1) . substr($_this->_singular['merged']['irregular'][strtolower($regs[2])], 1); + return $_this->_singularized[$word]; } - if (preg_match('/^(' . $_this->singular['cacheUninflected'] . ')$/i', $word, $regs)) { - $_this->singularized[$word] = $word; + if (preg_match('/^(' . $_this->_singular['cacheUninflected'] . ')$/i', $word, $regs)) { + $_this->_singularized[$word] = $word; return $word; } - foreach ($_this->singular['rules'] as $rule => $replacement) { + foreach ($_this->_singular['rules'] as $rule => $replacement) { if (preg_match($rule, $word)) { - $_this->singularized[$word] = preg_replace($rule, $replacement, $word); - return $_this->singularized[$word]; + $_this->_singularized[$word] = preg_replace($rule, $replacement, $word); + return $_this->_singularized[$word]; } } - $_this->singularized[$word] = $word; + $_this->_singularized[$word] = $word; return $word; } /** From 67fffaab862c00494c0bdc83fc9b376a77045fb5 Mon Sep 17 00:00:00 2001 From: jperras <joel.perras@gmail.com> Date: Fri, 10 Apr 2009 14:01:40 -0400 Subject: [PATCH 0094/2083] Removing unused Set class import. --- cake/libs/inflector.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index ec6626abe..501d19382 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -31,9 +31,6 @@ if (!class_exists('Object')) { uses('object'); } -if (!class_exists('Set')) { - require LIBS . 'set.php'; -} /** * Pluralize and singularize English words. * From d72dad581a0ac105501b07f18d7354ad41dc72c4 Mon Sep 17 00:00:00 2001 From: jperras <joel.perras@gmail.com> Date: Fri, 10 Apr 2009 14:06:04 -0400 Subject: [PATCH 0095/2083] Cleaning up formatting. --- cake/libs/inflector.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index 501d19382..aaa5aa50d 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -43,6 +43,7 @@ * @link http://book.cakephp.org/view/491/Inflector */ class Inflector extends Object { + /** * Plural inflector rules * @@ -109,6 +110,7 @@ class Inflector extends Object { 'turf' => 'turfs' ) ); + /** * Singular inflector rules * @@ -156,6 +158,7 @@ class Inflector extends Object { ), 'irregular' => array() ); + /** * Words that should not be inflected * @@ -177,7 +180,6 @@ class Inflector extends Object { 'Yengeese' ); - /** * Cached array identity map of pluralized words. * @@ -185,6 +187,7 @@ class Inflector extends Object { * @access protected **/ var $_pluralized = array(); + /** * Cached array identity map of singularized words. * @@ -192,6 +195,7 @@ class Inflector extends Object { * @access protected **/ var $_singularized = array(); + /** * Gets a reference to the Inflector object instance * @@ -206,6 +210,7 @@ function &getInstance() { } return $instance[0]; } + /** * Adds custom inflection $rules, of either 'plural' or 'singular' $type. * @@ -234,6 +239,7 @@ function rules($type, $rules = array()) { $_this->{$type}['rules'] = array_merge($rules, $_this->{$type}['rules']); } + /** * Return $word in plural form. * @@ -329,6 +335,7 @@ function singularize($word) { $_this->_singularized[$word] = $word; return $word; } + /** * Returns the given lower_case_and_underscored_word as a CamelCased word. * @@ -341,6 +348,7 @@ function singularize($word) { function camelize($lowerCaseAndUnderscoredWord) { return str_replace(" ", "", ucwords(str_replace("_", " ", $lowerCaseAndUnderscoredWord))); } + /** * Returns the given camelCasedWord as an underscored_word. * @@ -353,6 +361,7 @@ function camelize($lowerCaseAndUnderscoredWord) { function underscore($camelCasedWord) { return strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $camelCasedWord)); } + /** * Returns the given underscored_word_group as a Human Readable Word Group. * (Underscores are replaced by spaces and capitalized following words.) @@ -366,6 +375,7 @@ function underscore($camelCasedWord) { function humanize($lowerCaseAndUnderscoredWord) { return ucwords(str_replace("_", " ", $lowerCaseAndUnderscoredWord)); } + /** * Returns corresponding table name for given model $className. ("people" for the model class "Person"). * @@ -378,6 +388,7 @@ function humanize($lowerCaseAndUnderscoredWord) { function tableize($className) { return Inflector::pluralize(Inflector::underscore($className)); } + /** * Returns Cake model class name ("Person" for the database table "people".) for given database table. * @@ -390,6 +401,7 @@ function tableize($className) { function classify($tableName) { return Inflector::camelize(Inflector::singularize($tableName)); } + /** * Returns camelBacked version of an underscored string. * @@ -404,6 +416,7 @@ function variable($string) { $replace = strtolower(substr($string, 0, 1)); return preg_replace('/\\w/', $replace, $string, 1); } + /** * Returns a string with all spaces converted to underscores (by default), accented * characters converted to non-accented characters, and non word characters removed. From 7902f6838b86466d6e634df3d5dc18047f136b52 Mon Sep 17 00:00:00 2001 From: jperras <joel.perras@gmail.com> Date: Fri, 10 Apr 2009 14:15:27 -0400 Subject: [PATCH 0096/2083] Remvoving dependence on String class in Inflector::slug. --- cake/libs/inflector.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index aaa5aa50d..03727ca20 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -429,9 +429,8 @@ function variable($string) { * @link http://book.cakephp.org/view/572/Class-methods */ function slug($string, $replacement = '_') { - if (!class_exists('String')) { - require LIBS . 'string.php'; - } + $quotedReplacement = preg_quote($replacement, '/'); + $map = array( '/à|á|Ã¥|â/' => 'a', '/è|é|ê|ẽ|ë/' => 'e', @@ -449,7 +448,7 @@ function slug($string, $replacement = '_') { '/ß/' => 'ss', '/[^\w\s]/' => ' ', '/\\s+/' => $replacement, - String::insert('/^[:replacement]+|[:replacement]+$/', array('replacement' => preg_quote($replacement, '/'))) => '', + sprintf('/^[%s]+|[%s]+$/', $quotedReplacement, $quotedReplacement) => '', ); return preg_replace(array_keys($map), array_values($map), $string); } From 199d446ba71609fed641bb4bec74d92afe40b24d Mon Sep 17 00:00:00 2001 From: jperras <joel.perras@gmail.com> Date: Fri, 10 Apr 2009 14:47:17 -0400 Subject: [PATCH 0097/2083] Addding additional English irregular singularization/pluralization rule 'niche' => 'niches'. --- cake/libs/inflector.php | 1 + cake/tests/cases/libs/inflector.test.php | 1 + 2 files changed, 2 insertions(+) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index 03727ca20..eef562cdc 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -96,6 +96,7 @@ class Inflector extends Object { 'mongoose' => 'mongooses', 'move' => 'moves', 'mythos' => 'mythoi', + 'niche' => 'niches', 'numen' => 'numina', 'occiput' => 'occiputs', 'octopus' => 'octopuses', diff --git a/cake/tests/cases/libs/inflector.test.php b/cake/tests/cases/libs/inflector.test.php index 90efaabea..c5e3a95a0 100644 --- a/cake/tests/cases/libs/inflector.test.php +++ b/cake/tests/cases/libs/inflector.test.php @@ -105,6 +105,7 @@ function testInflectingSingulars() { $this->assertEqual(Inflector::singularize('taxes'), 'tax'); $this->assertEqual(Inflector::singularize('faxes'), 'fax'); $this->assertEqual(Inflector::singularize('waxes'), 'wax'); + $this->assertEqual(Inflector::singularize('niches'), 'niche'); $this->assertEqual(Inflector::singularize(''), ''); } /** From 66959d5849364865c7765d3bea9111763b4561e0 Mon Sep 17 00:00:00 2001 From: jperras <joel.perras@gmail.com> Date: Fri, 10 Apr 2009 15:28:34 -0400 Subject: [PATCH 0098/2083] Fixing indentation & trailing EOF newline. --- cake/libs/inflector.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index eef562cdc..3899c80e3 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -155,7 +155,7 @@ class Inflector extends Object { '/s$/i' => '' ), 'uninflected' => array( - '.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', '.*ss' + '.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', '.*ss' ), 'irregular' => array() ); @@ -167,18 +167,18 @@ class Inflector extends Object { * @access protected **/ var $_uninflected = array( - 'Amoyese', 'bison', 'Borghese', 'bream', 'breeches', 'britches', 'buffalo', 'cantus', - 'carp', 'chassis', 'clippers', 'cod', 'coitus', 'Congoese', 'contretemps', 'corps', - 'debris', 'diabetes', 'djinn', 'eland', 'elk', 'equipment', 'Faroese', 'flounder', - 'Foochowese', 'gallows', 'Genevese', 'Genoese', 'Gilbertese', 'graffiti', - 'headquarters', 'herpes', 'hijinks', 'Hottentotese', 'information', 'innings', - 'jackanapes', 'Kiplingese', 'Kongoese', 'Lucchese', 'mackerel', 'Maltese', 'media', - 'mews', 'moose', 'mumps', 'Nankingese', 'news', 'nexus', 'Niasese', - 'Pekingese', 'Piedmontese', 'pincers', 'Pistoiese', 'pliers', 'Portuguese', - 'proceedings', 'rabies', 'rice', 'rhinoceros', 'salmon', 'Sarawakese', 'scissors', - 'sea[- ]bass', 'series', 'Shavese', 'shears', 'siemens', 'species', 'swine', 'testes', - 'trousers', 'trout','tuna', 'Vermontese', 'Wenchowese', 'whiting', 'wildebeest', - 'Yengeese' + 'Amoyese', 'bison', 'Borghese', 'bream', 'breeches', 'britches', 'buffalo', 'cantus', + 'carp', 'chassis', 'clippers', 'cod', 'coitus', 'Congoese', 'contretemps', 'corps', + 'debris', 'diabetes', 'djinn', 'eland', 'elk', 'equipment', 'Faroese', 'flounder', + 'Foochowese', 'gallows', 'Genevese', 'Genoese', 'Gilbertese', 'graffiti', + 'headquarters', 'herpes', 'hijinks', 'Hottentotese', 'information', 'innings', + 'jackanapes', 'Kiplingese', 'Kongoese', 'Lucchese', 'mackerel', 'Maltese', 'media', + 'mews', 'moose', 'mumps', 'Nankingese', 'news', 'nexus', 'Niasese', + 'Pekingese', 'Piedmontese', 'pincers', 'Pistoiese', 'pliers', 'Portuguese', + 'proceedings', 'rabies', 'rice', 'rhinoceros', 'salmon', 'Sarawakese', 'scissors', + 'sea[- ]bass', 'series', 'Shavese', 'shears', 'siemens', 'species', 'swine', 'testes', + 'trousers', 'trout','tuna', 'Vermontese', 'Wenchowese', 'whiting', 'wildebeest', + 'Yengeese' ); /** @@ -454,4 +454,4 @@ function slug($string, $replacement = '_') { return preg_replace(array_keys($map), array_values($map), $string); } } -?> +?> \ No newline at end of file From 02bb4e71f3c08dd82d9df8a8b5dbc048a9c5b8f0 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 11 Apr 2009 00:01:40 -0400 Subject: [PATCH 0099/2083] Adding drag and drop() methods to prototype. Adding test for option pass through on _mapOptions(). Ensures that correctly named options do not get munged. --- cake/libs/view/helpers/js.php | 4 +- cake/libs/view/helpers/prototype_engine.php | 53 ++++++++++++++++++- .../tests/cases/libs/view/helpers/js.test.php | 3 ++ .../view/helpers/prototype_engine.test.php | 31 +++++++++++ 4 files changed, 89 insertions(+), 2 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index b4bb4cb42..61453e39d 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -295,7 +295,9 @@ class JsBaseEngineHelper extends AppHelper { **/ var $selection; /** - * Collection of option maps. + * Collection of option maps. Option maps allow other helpers to use generic names for engine + * callbacks and options. Allowing uniform code access for all engine types. Their use is optional + * for end user use though. * * @var array **/ diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php index 849e1b6ec..5e415d9db 100644 --- a/cake/libs/view/helpers/prototype_engine.php +++ b/cake/libs/view/helpers/prototype_engine.php @@ -47,6 +47,18 @@ class PrototypeEngineHelper extends JsBaseEngineHelper { 'sort' => 'onDrag', 'complete' => 'onDrop', 'distance' => 'snap', + ), + 'drag' => array( + 'snapGrid' => 'snap', + 'container' => 'constraint', + 'stop' => 'onEnd', + 'start' => 'onStart', + 'drag' => 'onDrag', + ), + 'drop' => array( + 'hover' => 'onHover', + 'drop' => 'onDrop', + 'hoverClass' => 'hoverclass', ) ); /** @@ -198,7 +210,46 @@ function sortable($options = array()) { $options = $this->_mapOptions('sortable', $options); $callbacks = array('onStart', 'change', 'onDrag', 'onDrop'); $options = $this->_parseOptions($options, $callbacks); - return 'var jsSortable = Sortable.create(' . $this->selection . ', {' . $options . '});'; + if (!empty($options)) { + $options = ', {' . $options . '}'; + } + return 'var jsSortable = Sortable.create(' . $this->selection . $options . ');'; + } +/** + * Create a Draggable element. + * + * #### Note: Requires scriptaculous to be loaded. + * + * @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->_mapOptions('drag', $options); + $callbacks = array('onStart', 'change', 'onDrag', 'onEnd'); + $options = $this->_parseOptions($options, $callbacks); + if (!empty($options)) { + $options = ', {' . $options . '}'; + } + return 'var jsDrag = new Draggable(' . $this->selection . $options . ');'; + } +/** + * Create a Droppable element. + * + * #### Note: Requires scriptaculous to be loaded. + * + * @param array $options Array of options for the droppable. + * @return string Completed draggable script. + * @see JsHelper::droppable() for options list. + **/ + function drop($options = array()) { + $options = $this->_mapOptions('drop', $options); + $callbacks = array('onHover', 'onDrop'); + $options = $this->_parseOptions($options, $callbacks); + if (!empty($options)) { + $options = ', {' . $options . '}'; + } + return 'Droppables.add(' . $this->selection . $options . ');'; } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index ef8495b60..43764cb34 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -402,6 +402,9 @@ function testOptionMapping() { $result = $JsEngine->testMap(array('complete' => 'myFunc', 'type' => 'json', 'update' => '#element')); $this->assertEqual($result, array('success' => 'myFunc', 'dataType' => 'json', 'update' => '#element')); + + $result = $JsEngine->testMap(array('success' => 'myFunc', 'dataType' => 'json', 'update' => '#element')); + $this->assertEqual($result, array('success' => 'myFunc', 'dataType' => 'json', 'update' => '#element')); } /** * test that option parsing escapes strings and saves what is supposed to be saved. diff --git a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php index 2156ad073..ab5ed6746 100644 --- a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php @@ -225,5 +225,36 @@ function testSortable() { $expected = 'var jsSortable = Sortable.create($("myList"), {onDrag:onSort, onDrop:onComplete, onStart:onStart, snap:5});'; $this->assertEqual($result, $expected); } +/** + * test drag() method + * + * @return void + **/ + function testDrag() { + $this->Proto->get('#element'); + $result = $this->Proto->drag(array( + 'start' => 'onStart', + 'drag' => 'onDrag', + 'stop' => 'onStop', + 'snapGrid' => array(10, 10), + )); + $expected = 'var jsDrag = new Draggable($("element"), {onDrag:onDrag, onEnd:onStop, onStart:onStart, snap:[10,10]});'; + $this->assertEqual($result, $expected); + } +/** + * test drop() method + * + * @return void + **/ + function testDrop() { + $this->Proto->get('#element'); + $result = $this->Proto->drop(array( + 'hover' => 'onHover', + 'drop' => 'onDrop', + 'accept' => '.drag-me' + )); + $expected = 'Droppables.add($("element"), {accept:".drag-me", onDrop:onDrop, onHover:onHover});'; + $this->assertEqual($result, $expected); + } } ?> \ No newline at end of file From 1d5e3150a22e5eb5912844b3d3416a8bf9091113 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 11 Apr 2009 23:09:58 -0400 Subject: [PATCH 0100/2083] Adding drag() to mootools. --- cake/libs/view/helpers/mootools_engine.php | 24 ++++++++++++++++++- .../view/helpers/mootools_engine.test.php | 10 +++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/cake/libs/view/helpers/mootools_engine.php b/cake/libs/view/helpers/mootools_engine.php index 06e17bb0d..a4a7eb1b9 100644 --- a/cake/libs/view/helpers/mootools_engine.php +++ b/cake/libs/view/helpers/mootools_engine.php @@ -48,6 +48,12 @@ class MootoolsEngineHelper extends JsBaseEngineHelper { 'sort' => 'onSort', 'complete' => 'onComplete', 'start' => 'onStart', + ), + 'drag' => array( + 'snapGrid' => 'snap', + 'start' => 'onStart', + 'drag' => 'onDrag', + 'stop' => 'onComplete', ) ); /** @@ -193,7 +199,7 @@ function request($url, $options = array()) { /** * Create a sortable element. * - * Requires both the ```Sortables``` plugin from MootoolsMore + * Requires the ```Sortables``` plugin from MootoolsMore * * @param array $options Array of options for the sortable. * @return string Completed sortable script. @@ -205,5 +211,21 @@ function sortable($options = array()) { $options = $this->_parseOptions($options, $callbacks); return 'var jsSortable = new Sortables(' . $this->selection . ', {' . $options . '});'; } +/** + * Create a Draggable element. + * + * Requires the ```Drag``` plugin from MootoolsMore + * + * @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->_mapOptions('drag', $options); + $callbacks = array('onBeforeStart', 'onStart', 'onSnap', 'onDrag', 'onComplete'); + $options = $this->_parseOptions($options, $callbacks); + return 'var jsDrag = new Drag(' . $this->selection . ', {' . $options . '});'; + } + } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php index 18f0cabc1..a6e78c335 100644 --- a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php @@ -216,7 +216,15 @@ function testSortable() { * @return void **/ function testDrag() { - + $this->Moo->get('#drag-me'); + $result = $this->Moo->drag(array( + 'start' => 'onStart', + 'drag' => 'onDrag', + 'stop' => 'onStop', + 'snapGrid' => array(10,10) + )); + $expected = 'var jsDrag = new Drag($("drag-me"), {onComplete:onStop, onDrag:onDrag, onStart:onStart, snap:[10,10]});'; + $this->assertEqual($result, $expected); } /** * test drop() method From 3a3e003982871b394191659e0ea50cc577da9137 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 11 Apr 2009 23:37:24 -0400 Subject: [PATCH 0101/2083] Adding drop() to mootools. --- cake/libs/view/helpers/mootools_engine.php | 44 +++++++++++++++++++ .../view/helpers/mootools_engine.test.php | 18 +++++++- 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/mootools_engine.php b/cake/libs/view/helpers/mootools_engine.php index a4a7eb1b9..d271c7508 100644 --- a/cake/libs/view/helpers/mootools_engine.php +++ b/cake/libs/view/helpers/mootools_engine.php @@ -54,6 +54,11 @@ class MootoolsEngineHelper extends JsBaseEngineHelper { 'start' => 'onStart', 'drag' => 'onDrag', 'stop' => 'onComplete', + ), + 'drop' => array( + 'drop' => 'onDrop', + 'hover' => 'onEnter', + 'leave' => 'onLeave', ) ); /** @@ -226,6 +231,45 @@ function drag($options = array()) { $options = $this->_parseOptions($options, $callbacks); return 'var jsDrag = new Drag(' . $this->selection . ', {' . $options . '});'; } +/** + * Create a Droppable element. + * + * Requires the ```Drag``` and ```Drag.Move``` plugins from MootoolsMore + * + * Droppables in Mootools function differently from other libraries. Droppables + * are implemented as an extension of Drag. So in addtion to making a get() selection for + * the droppable element. You must also provide a selector rule to the draggable element. Furthermore, + * Mootools droppables inherit all options from Drag. + * + * @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( + __('MootoolsEngine::drop() requires a "drag" option to properly function', true), E_USER_WARNING + ); + return false; + } + $options['droppables'] = $this->selection; + + $this->get($options['drag']); + unset($options['drag']); + + $options = $this->_mapOptions('drop', $options); + $options = $this->_mapOptions('drag', $options); + $callbacks = array('onBeforeStart', 'onStart', 'onSnap', 'onDrag', 'onComplete', 'onDrop', + 'onLeave', 'onEnter', 'droppables'); + + $optionString = $this->_parseOptions($options, $callbacks); + if (!empty($optionString)) { + $optionString = ', {' . $optionString . '}'; + } + $out = 'var jsDrop = new Drag.Move(' . $this->selection . $optionString . ');'; + $this->selection = $options['droppables']; + return $out; + } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php index a6e78c335..8c24d8736 100644 --- a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php @@ -232,7 +232,23 @@ function testDrag() { * @return void **/ function testDrop() { - + $this->expectError(); + $this->Moo->get('#drop-me'); + $this->Moo->drop(array( + 'drop' => 'onDrop', + 'leave' => 'onLeave', + 'hover' => 'onHover', + )); + + $result = $this->Moo->drop(array( + 'drop' => 'onDrop', + 'leave' => 'onLeave', + 'hover' => 'onHover', + 'drag' => '#my-drag' + )); + $expected = 'var jsDrop = new Drag.Move($("my-drag"), {droppables:$("drop-me"), onDrop:onDrop, onEnter:onHover, onLeave:onLeave});'; + $this->assertEqual($result, $expected); + $this->assertEqual($this->Moo->selection, '$("drop-me")'); } } ?> \ No newline at end of file From 4b2504d33421bbc478e2eff85cc86269de9e9d9a Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 11 Apr 2009 23:47:43 -0400 Subject: [PATCH 0102/2083] Refactor repetitive logic in jquery engine. --- cake/libs/view/helpers/jquery_engine.php | 31 +++++++++++++++++------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/cake/libs/view/helpers/jquery_engine.php b/cake/libs/view/helpers/jquery_engine.php index 46911677d..6271736a6 100644 --- a/cake/libs/view/helpers/jquery_engine.php +++ b/cake/libs/view/helpers/jquery_engine.php @@ -49,6 +49,22 @@ class JqueryEngineHelper extends JsBaseEngineHelper { 'hover' => 'over' ) ); +/** + * Helper function to wrap repetitive simple method templating. + * + * @param string $method The method name being generated. + * @param string $template The method template + * @param string $selection the selection to apply + * @param string $options Array of options for method + * @param string $callbacks Array of callback / special options. + * @access public + * @return string + **/ + function _methodTemplate($method, $template, $options, $callbacks) { + $options = $this->_mapOptions($method, $options); + $options = $this->_parseOptions($options, $callbacks); + return sprintf($template, $this->selection, $options); + } /** * Create javascript selector for a CSS rule * @@ -169,11 +185,10 @@ function request($url, $options = array()) { * @see JsHelper::sortable() for options list. **/ function sortable($options = array()) { - $options = $this->_mapOptions('sortable', $options); $callbacks = array('start', 'sort', 'change', 'beforeStop', 'stop', 'update', 'receive', 'remove', 'over', 'out', 'activate', 'deactivate'); - $options = $this->_parseOptions($options, $callbacks); - return $this->selection . '.sortable({' . $options . '});'; + $template = '%s.sortable({%s});'; + return $this->_methodTemplate('sortable', $template, $options, $callbacks); } /** * Create a Draggable element @@ -185,10 +200,9 @@ function sortable($options = array()) { * @see JsHelper::drag() for options list. **/ function drag($options = array()) { - $options = $this->_mapOptions('drag', $options); $callbacks = array('start', 'drag', 'stop'); - $options = $this->_parseOptions($options, $callbacks); - return $this->selection . '.draggable({' . $options . '});'; + $template = '%s.draggable({%s});'; + return $this->_methodTemplate('drag', $template, $options, $callbacks); } /** * Create a Droppable element @@ -200,10 +214,9 @@ function drag($options = array()) { * @see JsHelper::drop() for options list. **/ function drop($options = array()) { - $options = $this->_mapOptions('drop', $options); $callbacks = array('activate', 'deactivate', 'over', 'out', 'drop'); - $options = $this->_parseOptions($options, $callbacks); - return $this->selection . '.droppable({' . $options . '});'; + $template = '%s.droppable({%s});'; + return $this->_methodTemplate('drop', $template, $options, $callbacks); } } ?> \ No newline at end of file From 740c712fb59374469e0aa603d3f99b0b9b1e5cd9 Mon Sep 17 00:00:00 2001 From: jperras <joel.perras@gmail.com> Date: Mon, 13 Apr 2009 15:47:40 -0400 Subject: [PATCH 0103/2083] Refactoring core session library to use a proper Session model instead of hard-coded SQL. --- cake/libs/session.php | 131 ++++++++++++------------- cake/tests/cases/libs/session.test.php | 21 +++- 2 files changed, 81 insertions(+), 71 deletions(-) diff --git a/cake/libs/session.php b/cake/libs/session.php index 88b90da52..4d6a29f16 100644 --- a/cake/libs/session.php +++ b/cake/libs/session.php @@ -27,16 +27,7 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ -/** - * Database name for cake sessions. - * - */ -if (!class_exists('Set')) { - require LIBS . 'set.php'; -} -if (!class_exists('Security')) { - require LIBS . 'security.php'; -} + /** * Session class for Cake. * @@ -125,32 +116,49 @@ class CakeSession extends Object { * @access public */ function __construct($base = null, $start = true) { - if (Configure::read('Session.save') === 'database' && !class_exists('ConnectionManager')) { - App::import('Core', 'ConnectionManager'); - } + App::import('Core', 'Security'); + $this->time = time(); if (Configure::read('Session.checkAgent') === true || Configure::read('Session.checkAgent') === null) { if (env('HTTP_USER_AGENT') != null) { $this->_userAgent = md5(env('HTTP_USER_AGENT') . Configure::read('Security.salt')); } } - $this->time = time(); - if ($start === true) { - $this->host = env('HTTP_HOST'); + if (Configure::read('Session.save') === 'database') { + $modelName = Configure::read('Session.model'); + $database = Configure::read('Session.database'); + $table = Configure::read('Session.table'); - if (empty($base) || strpos($base, '?') === 0 || strpos($base, 'index.php') === 0) { - $this->path = '/'; + if (empty($database)) { + $database = 'default'; + } + + if (empty($modelName)) { + ClassRegistry::init(array( + 'class' => Inflector::classify($table), + 'alias' => 'Session' + )); } else { - $this->path = $base; + ClassRegistry::init(array( + 'class' => $modelName, + 'alias' => 'Session' + )); } + } + + + if ($start === true) { + $this->host = env('HTTP_HOST'); if (strpos($this->host, ':') !== false) { $this->host = substr($this->host, 0, strpos($this->host, ':')); } - if (!class_exists('Security')) { - App::import('Core', 'Security'); + if (empty($base) || strpos($base, '?') === 0 || strpos($base, 'index.php') === 0) { + $this->path = '/'; + } else { + $this->path = $base; } $this->sessionTime = $this->time + (Security::inactiveMins() * Configure::read('Session.timeout')); @@ -685,81 +693,60 @@ function __close() { /** * Method used to read from a database session. * - * @param mixed $key The key of the value to read + * @param mixed $id The key of the value to read * @return mixed The value of the key or false if it does not exist * @access private */ - function __read($key) { - $db =& ConnectionManager::getDataSource(Configure::read('Session.database')); - $table = $db->fullTableName(Configure::read('Session.table'), false); - $row = $db->query("SELECT " . $db->name($table.'.data') . " FROM " . $db->name($table) . " WHERE " . $db->name($table.'.id') . " = " . $db->value($key), false); + function __read($id) { + $model = ClassRegistry::getObject('Session'); - if ($row && !isset($row[0][$table]) && isset($row[0][0])) { - $table = 0; - } + $row = $model->find('first', array( + 'conditions' => array($model->primaryKey => $id) + )); - if ($row && $row[0][$table]['data']) { - return $row[0][$table]['data']; - } else { + if (empty($row[$model->alias]['data'])) { return false; } + + return $row[$model->alias]['data']; } /** * Helper function called on write for database sessions. * - * @param mixed $key The name of the var - * @param mixed $value The value of the var - * @return boolean Success + * @param integer $id ID that uniquely identifies session in database + * @param mixed $data The value of the the data to be saved. + * @return boolean True for successful write, false otherwise. * @access private */ - function __write($key, $value) { - $db =& ConnectionManager::getDataSource(Configure::read('Session.database')); - $table = $db->fullTableName(Configure::read('Session.table')); - + function __write($id, $data) { switch (Configure::read('Security.level')) { - case 'high': - $factor = 10; - break; case 'medium': $factor = 100; break; case 'low': $factor = 300; break; + case 'high': default: $factor = 10; break; } - $expires = time() + Configure::read('Session.timeout') * $factor; - $row = $db->query("SELECT COUNT(id) AS count FROM " . $db->name($table) . " WHERE " - . $db->name('id') . " = " - . $db->value($key), false); - if ($row[0][0]['count'] > 0) { - $db->execute("UPDATE " . $db->name($table) . " SET " . $db->name('data') . " = " - . $db->value($value) . ", " . $db->name('expires') . " = " - . $db->value($expires) . " WHERE " . $db->name('id') . " = " - . $db->value($key)); - } else { - $db->execute("INSERT INTO " . $db->name($table) . " (" . $db->name('data') . "," - . $db->name('expires') . "," . $db->name('id') - . ") VALUES (" . $db->value($value) . ", " . $db->value($expires) . ", " - . $db->value($key) . ")"); - } - return true; + $expires = time() + Configure::read('Session.timeout') * $factor; + $return = ClassRegistry::getObject('Session')->save(compact('id', 'data', 'expires')); + + return $return; } /** * Method called on the destruction of a database session. * - * @param integer $key Key that uniquely identifies session in database - * @return boolean Success + * @param integer $id ID that uniquely identifies session in database + * @return boolean True for successful delete, false otherwise. * @access private */ - function __destroy($key) { - $db =& ConnectionManager::getDataSource(Configure::read('Session.database')); - $table = $db->fullTableName(Configure::read('Session.table')); - $db->execute("DELETE FROM " . $db->name($table) . " WHERE " . $db->name($table.'.id') . " = " . $db->value($key)); - return true; + function __destroy($id) { + $return = ClassRegistry::getObject('Session')->delete($id); + return $return; } /** * Helper function called on gc for database sessions. @@ -769,10 +756,14 @@ function __destroy($key) { * @access private */ function __gc($expires = null) { - $db =& ConnectionManager::getDataSource(Configure::read('Session.database')); - $table = $db->fullTableName(Configure::read('Session.table')); - $db->execute("DELETE FROM " . $db->name($table) . " WHERE " . $db->name($table.'.expires') . " < ". $db->value(time())); - return true; + $model = ClassRegistry::getObject('Session'); + + if (!$expires) { + $expires = time(); + } + + $return = $model->deleteAll(array("$alias.expires <" => $expires), false, false); + return $return; } } -?> \ No newline at end of file +?> diff --git a/cake/tests/cases/libs/session.test.php b/cake/tests/cases/libs/session.test.php index eacea5651..c50147163 100644 --- a/cake/tests/cases/libs/session.test.php +++ b/cake/tests/cases/libs/session.test.php @@ -34,6 +34,12 @@ * @subpackage cake.tests.cases.libs */ class SessionTest extends CakeTestCase { +/** + * Fixtures used in the SessionTest + * + * @var array + * @access public + */ var $fixtures = array('core.session'); /** * setUp method @@ -46,6 +52,16 @@ function setUp() { $this->Session->start(); $this->Session->_checkValid(); } +/** + * tearDown method + * + * @access public + * @return void + */ + function tearDown() { + unset($_SESSION); + session_destroy(); + } /** * testCheck method * @@ -366,6 +382,9 @@ function testReadAndWriteWithDatabaseStorage() { $this->Session->write('SessionTestCase', 'This is a Test'); $this->assertEqual($this->Session->read('SessionTestCase'), 'This is a Test'); + $this->Session->write('SessionTestCase', 'Some additional data'); + $this->assertEqual($this->Session->read('SessionTestCase'), 'Some additional data'); + $this->Session->destroy(); $this->assertFalse($this->Session->read('SessionTestCase')); session_write_close(); @@ -376,4 +395,4 @@ function testReadAndWriteWithDatabaseStorage() { $this->setUp(); } } -?> \ No newline at end of file +?> From cadc64c7b6fdff546586eae6baa89bb6195382e8 Mon Sep 17 00:00:00 2001 From: jperras <joel.perras@gmail.com> Date: Mon, 13 Apr 2009 23:53:10 -0400 Subject: [PATCH 0104/2083] Removing EOF newlines. --- cake/libs/session.php | 2 +- cake/tests/cases/libs/session.test.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/libs/session.php b/cake/libs/session.php index 4d6a29f16..012a57634 100644 --- a/cake/libs/session.php +++ b/cake/libs/session.php @@ -766,4 +766,4 @@ function __gc($expires = null) { return $return; } } -?> +?> \ No newline at end of file diff --git a/cake/tests/cases/libs/session.test.php b/cake/tests/cases/libs/session.test.php index c50147163..7405a315a 100644 --- a/cake/tests/cases/libs/session.test.php +++ b/cake/tests/cases/libs/session.test.php @@ -395,4 +395,4 @@ function testReadAndWriteWithDatabaseStorage() { $this->setUp(); } } -?> +?> \ No newline at end of file From 75f303f7b8598e5230b97258889906103be220cb Mon Sep 17 00:00:00 2001 From: jperras <joel.perras@gmail.com> Date: Tue, 14 Apr 2009 00:36:13 -0400 Subject: [PATCH 0105/2083] Removing method chaining from core session library & adding assign by references for php4 compatibility. --- cake/libs/session.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/cake/libs/session.php b/cake/libs/session.php index 012a57634..f2b6de4b2 100644 --- a/cake/libs/session.php +++ b/cake/libs/session.php @@ -698,7 +698,7 @@ function __close() { * @access private */ function __read($id) { - $model = ClassRegistry::getObject('Session'); + $model =& ClassRegistry::getObject('Session'); $row = $model->find('first', array( 'conditions' => array($model->primaryKey => $id) @@ -733,7 +733,9 @@ function __write($id, $data) { } $expires = time() + Configure::read('Session.timeout') * $factor; - $return = ClassRegistry::getObject('Session')->save(compact('id', 'data', 'expires')); + + $model =& ClassRegistry::getObject('Session'); + $return = $model->save(compact('id', 'data', 'expires')); return $return; } @@ -745,7 +747,9 @@ function __write($id, $data) { * @access private */ function __destroy($id) { - $return = ClassRegistry::getObject('Session')->delete($id); + $model =& ClassRegistry::getObject('Session'); + $return = $model->delete($id); + return $return; } /** @@ -756,13 +760,13 @@ function __destroy($id) { * @access private */ function __gc($expires = null) { - $model = ClassRegistry::getObject('Session'); + $model =& ClassRegistry::getObject('Session'); if (!$expires) { $expires = time(); } - $return = $model->deleteAll(array("$alias.expires <" => $expires), false, false); + $return = $model->deleteAll(array("$alias.expires <" => $expires), false, false); return $return; } } From 5d183cbe9af3e6f12a238118dd063b9ecb1dc96c Mon Sep 17 00:00:00 2001 From: jperras <joel.perras@gmail.com> Date: Tue, 14 Apr 2009 20:12:44 -0400 Subject: [PATCH 0106/2083] Updating core.php with new Session.model configuration directive. --- app/config/core.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/config/core.php b/app/config/core.php index dfcba1ea5..01b8d563d 100644 --- a/app/config/core.php +++ b/app/config/core.php @@ -96,16 +96,30 @@ * To define a custom session handler, save it at /app/config/<name>.php. * Set the value of 'Session.save' to <name> to utilize it in CakePHP. * - * To use database sessions, execute the SQL file found at /app/config/sql/sessions.sql. + * To use database sessions, run the app/config/schema/sessions.php schema using + * the cake shell command: cake schema run create Sessions * */ Configure::write('Session.save', 'php'); +/** + * The model name to be used for the session model. + * + * 'Session.save' must be set to 'database' in order to utilize this constant. + * + * The model name set here should *not* be used elsewhere in your application. + */ + //Configure::write('Session.model', 'Session'); /** * The name of the table used to store CakePHP database sessions. * * 'Session.save' must be set to 'database' in order to utilize this constant. * * The table name set here should *not* include any table prefix defined elsewhere. + * + * Please note that if you set a value for Session.model (above), any value set for + * Session.table will be ignored. + * + * [Note: Session.table is deprecated as of CakePHP 1.3] */ //Configure::write('Session.table', 'cake_sessions'); /** From 518dd41ca83f92222338c5ebae53ec3e31967fcb Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 15 Apr 2009 23:48:04 -0400 Subject: [PATCH 0107/2083] Updating doc blocks. Removing old methods from JsHelper. --- cake/libs/view/helpers/js.php | 71 +--------------------- cake/libs/view/helpers/mootools_engine.php | 8 +-- 2 files changed, 6 insertions(+), 73 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 61453e39d..253e963bf 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -98,12 +98,12 @@ function __construct($settings = array()) { * You can control buffering with the buffer param as well. By setting the last parameter to * any engine method to a boolean you can force or disable buffering. * - * e.g. ```$js->get('#foo')->effect('fadeIn', array('speed' => 'slow'), true);``` + * e.g. `$js->get('#foo')->effect('fadeIn', array('speed' => 'slow'), true);` * * Will force buffering for the effect method. If the method takes an options array you may also add * a 'buffer' param to the options array and control buffering there as well. * - * e.g. ```$js->get('#foo')->event('click', $functionContents, array('buffer' => true)); + * e.g. `$js->get('#foo')->event('click', $functionContents, array('buffer' => true));` * * The buffer parameter will not be passed onto the EngineHelper. * @@ -203,73 +203,6 @@ function getBuffer($clear = true) { } return $scripts; } -/** - * Loads a remote URL - * - * @param string $url - * @param array $options - * @return string - **/ -/* function load_($url = null, $options = array()) { - if (isset($options['update'])) { - if (!is_array($options['update'])) { - $func = "new Ajax.Updater('{$options['update']}',"; - } else { - $func = "new Ajax.Updater(document.createElement('div'),"; - } - if (!isset($options['requestHeaders'])) { - $options['requestHeaders'] = array(); - } - if (is_array($options['update'])) { - $options['update'] = join(' ', $options['update']); - } - $options['requestHeaders']['X-Update'] = $options['update']; - } else { - $func = "new Ajax.Request("; - } - - $func .= "'" . Router::url($url) . "'"; - $ajax =& new AjaxHelper(); - $func .= ", " . $ajax->__optionsForAjax($options) . ")"; - - if (isset($options['before'])) { - $func = "{$options['before']}; $func"; - } - if (isset($options['after'])) { - $func = "$func; {$options['after']};"; - } - if (isset($options['condition'])) { - $func = "if ({$options['condition']}) { $func; }"; - } - if (isset($options['confirm'])) { - $func = "if (confirm('" . $this->Javascript->escapeString($options['confirm']) - . "')) { $func; } else { return false; }"; - } - return $func; - } - - -/* - function get__($name) { - return $this->__object($name, 'id'); - } - - function select($pattern) { - return $this->__object($pattern, 'pattern'); - } - - function real($var) { - return $this->__object($var, 'real'); - } - - function __object($name, $var) { - if (!isset($this->__objects[$name])) { - $this->__objects[$name] = new JsHelperObject($this); - $this->__objects[$name]->{$var} = $name; - } - return $this->__objects[$name]; - } -*/ } /** diff --git a/cake/libs/view/helpers/mootools_engine.php b/cake/libs/view/helpers/mootools_engine.php index d271c7508..b8068213e 100644 --- a/cake/libs/view/helpers/mootools_engine.php +++ b/cake/libs/view/helpers/mootools_engine.php @@ -168,7 +168,7 @@ function effect($name, $options = array()) { /** * Create an new Request. * - * Requires ```Request```. If you wish to use 'update' key you must have ```Request.HTML``` + * Requires `Request`. If you wish to use 'update' key you must have ```Request.HTML``` * if you wish to do Json requests you will need ```JSON``` and ```Request.JSON```. * * @param mixed $url @@ -204,7 +204,7 @@ function request($url, $options = array()) { /** * Create a sortable element. * - * Requires the ```Sortables``` plugin from MootoolsMore + * Requires the `Sortables` plugin from MootoolsMore * * @param array $options Array of options for the sortable. * @return string Completed sortable script. @@ -219,7 +219,7 @@ function sortable($options = array()) { /** * Create a Draggable element. * - * Requires the ```Drag``` plugin from MootoolsMore + * Requires the `Drag` plugin from MootoolsMore * * @param array $options Array of options for the draggable. * @return string Completed draggable script. @@ -234,7 +234,7 @@ function drag($options = array()) { /** * Create a Droppable element. * - * Requires the ```Drag``` and ```Drag.Move``` plugins from MootoolsMore + * Requires the `Drag` and `Drag.Move` plugins from MootoolsMore * * Droppables in Mootools function differently from other libraries. Droppables * are implemented as an extension of Drag. So in addtion to making a get() selection for From 4507d2b8955d8eb56a1a9aa2029630ca9743b2f0 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 15 Apr 2009 23:59:13 -0400 Subject: [PATCH 0108/2083] Adding slider() skel to libraries. --- cake/libs/view/helpers/jquery_engine.php | 12 ++++++++++++ cake/libs/view/helpers/js.php | 14 ++++++++++++++ cake/libs/view/helpers/mootools_engine.php | 13 ++++++++++++- cake/libs/view/helpers/prototype_engine.php | 12 ++++++++++++ 4 files changed, 50 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/jquery_engine.php b/cake/libs/view/helpers/jquery_engine.php index 6271736a6..57eb588f0 100644 --- a/cake/libs/view/helpers/jquery_engine.php +++ b/cake/libs/view/helpers/jquery_engine.php @@ -218,5 +218,17 @@ function drop($options = array()) { $template = '%s.droppable({%s});'; return $this->_methodTemplate('drop', $template, $options, $callbacks); } +/** + * Slider + * + * Requires the Ui.Core and Ui.Slider to be loaded. + * + * @param array $options Array of options for the slider. + * @return string Completed slider script. + * @see JsHelper::slider() for options list. + **/ + function slider($options = array()) { + + } } ?> \ No newline at end of file diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 253e963bf..58202dc83 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -583,6 +583,20 @@ function drop($options = array()) { function sortable() { trigger_error(sprintf(__('%s does not have sortable() implemented', true), get_class($this)), E_USER_WARNING); } +/** + * Create a slider UI widget. Comprised of a track and knob + * + * ### Options + * + * ### Event Options + * + * + * @param array $options Array of options for the slider. See above. + * @return string Completed slider script. + **/ + function slider() { + trigger_error(sprintf(__('%s does not have slider() implemented', true), get_class($this)), E_USER_WARNING); + } /** * Parse an options assoc array into an Javascript object literal. * Similar to object() but treats any non-integer value as a string, diff --git a/cake/libs/view/helpers/mootools_engine.php b/cake/libs/view/helpers/mootools_engine.php index b8068213e..86a5aef2b 100644 --- a/cake/libs/view/helpers/mootools_engine.php +++ b/cake/libs/view/helpers/mootools_engine.php @@ -270,6 +270,17 @@ function drop($options = array()) { $this->selection = $options['droppables']; return $out; } - +/** + * Slider + * + * Requires the `Slider` plugin from MootoolsMore + * + * @param array $options Array of options for the slider. + * @return string Completed slider script. + * @see JsHelper::slider() for options list. + **/ + function slider($options = array()) { + + } } ?> \ No newline at end of file diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php index 5e415d9db..e6531a55c 100644 --- a/cake/libs/view/helpers/prototype_engine.php +++ b/cake/libs/view/helpers/prototype_engine.php @@ -251,5 +251,17 @@ function drop($options = array()) { } return 'Droppables.add(' . $this->selection . $options . ');'; } +/** + * Slider + * + * Requires the Scriptaculous to be loaded. + * + * @param array $options Array of options for the slider. + * @return string Completed slider script. + * @see JsHelper::slider() for options list. + **/ + function slider($options = array()) { + + } } ?> \ No newline at end of file From 73cbdf011bc69776144c69b9a077efbcbe23127e Mon Sep 17 00:00:00 2001 From: davidpersson <davidpersson@gmx.de> Date: Thu, 16 Apr 2009 10:30:36 +0200 Subject: [PATCH 0109/2083] Removing prepending of "Error: " in ShellDispatcher::stderr --- cake/console/cake.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/console/cake.php b/cake/console/cake.php index 823e6fc00..0866d53b6 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -436,7 +436,7 @@ function stdout($string, $newline = true) { * @access public */ function stderr($string) { - fwrite($this->stderr, 'Error: '. $string); + fwrite($this->stderr, $string); } /** * Parses command line options From 4faa9d3b21de78c4d637673014894423d64e67f0 Mon Sep 17 00:00:00 2001 From: davidpersson <davidpersson@gmx.de> Date: Thu, 16 Apr 2009 10:53:12 +0200 Subject: [PATCH 0110/2083] Adding newline param to Shell::err The signature of ::err is now identical to ::out Adding tests for ::err --- cake/console/libs/shell.php | 5 +++-- cake/tests/cases/console/libs/shell.test.php | 13 +++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php index bac6c347b..b298fcaaa 100644 --- a/cake/console/libs/shell.php +++ b/cake/console/libs/shell.php @@ -358,9 +358,10 @@ function out($string, $newline = true) { * Outputs to the stderr filehandle. * * @param string $string Error text to output. + * @param boolean $newline If true, the outputs gets an added newline. * @access public */ - function err($string) { + function err($string, $newline = true) { if (is_array($string)) { $str = ''; foreach ($string as $message) { @@ -368,7 +369,7 @@ function err($string) { } $string = $str; } - return $this->Dispatch->stderr($string."\n"); + return $this->Dispatch->stderr($string . ($newline ? "\n" : '')); } /** * Outputs a series of minus characters to the standard output, acts as a visual separator. diff --git a/cake/tests/cases/console/libs/shell.test.php b/cake/tests/cases/console/libs/shell.test.php index bfd15a95b..8d03541fc 100644 --- a/cake/tests/cases/console/libs/shell.test.php +++ b/cake/tests/cases/console/libs/shell.test.php @@ -160,6 +160,19 @@ function testOut() { $this->Shell->Dispatch->expectAt(1, 'stdout', array("Just\na\ntest\n", true)); $this->Shell->out(array('Just', 'a', 'test')); } +/** + * testErr method + * + * @return void + * @access public + */ + function testErr() { + $this->Shell->Dispatch->expectAt(0, 'stderr', array("Just a test\n")); + $this->Shell->err('Just a test'); + + $this->Shell->Dispatch->expectAt(1, 'stderr', array("Just\na\ntest\n\n")); + $this->Shell->err(array('Just', 'a', 'test')); + } /** * testIn method * From 82641e535f581260c7b614aa3ac56d0349de2c49 Mon Sep 17 00:00:00 2001 From: davidpersson <davidpersson@gmx.de> Date: Thu, 16 Apr 2009 11:00:47 +0200 Subject: [PATCH 0111/2083] Updating formatting of output in Shell:error Renaming $msg param to $message The $message param is now optional The method now exits the app with status code 1 --- cake/console/libs/shell.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php index b298fcaaa..01855bceb 100644 --- a/cake/console/libs/shell.php +++ b/cake/console/libs/shell.php @@ -387,18 +387,20 @@ function hr($newline = false) { } } /** - * Displays a formatted error message and exits the application + * Displays a formatted error message + * and exits the application with status code 1 * - * @param string $title Title of the error message - * @param string $msg Error message + * @param string $title Title of the error + * @param string $message An optional error message * @access public */ - function error($title, $msg) { - $out = "$title\n"; - $out .= "$msg\n"; - $out .= "\n"; - $this->err($out); - $this->_stop(); + function error($title, $message = null) { + $this->err(sprintf(__('Error: %s', true), $title)); + + if (!empty($message)) { + $this->err($message); + } + $this->_stop(1); } /** * Will check the number args matches otherwise throw an error From 5bc6bcfce17ddcb8000056b67db7f91ca6f77004 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 18 Apr 2009 22:00:58 -0400 Subject: [PATCH 0112/2083] Adding slider to base engine and jquery engine. Tests added. --- cake/libs/view/helpers/jquery_engine.php | 18 +++++++++++++++ cake/libs/view/helpers/js.php | 22 +++++++++++++++++++ .../libs/view/helpers/jquery_engine.test.php | 18 +++++++++++++++ 3 files changed, 58 insertions(+) diff --git a/cake/libs/view/helpers/jquery_engine.php b/cake/libs/view/helpers/jquery_engine.php index 6271736a6..c3e0ee9da 100644 --- a/cake/libs/view/helpers/jquery_engine.php +++ b/cake/libs/view/helpers/jquery_engine.php @@ -47,6 +47,10 @@ class JqueryEngineHelper extends JsBaseEngineHelper { 'drop' => array( 'leave' => 'out', 'hover' => 'over' + ), + 'slider' => array( + 'complete' => 'stop', + 'direction' => 'orientation' ) ); /** @@ -218,5 +222,19 @@ function drop($options = array()) { $template = '%s.droppable({%s});'; return $this->_methodTemplate('drop', $template, $options, $callbacks); } +/** + * Create a Slider element + * + * Requires both Ui.Core and Ui.Slider to be loaded. + * + * @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});'; + return $this->_methodTemplate('slider', $template, $options, $callbacks); + } } ?> \ No newline at end of file diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 61453e39d..e8bbe7faf 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -650,6 +650,28 @@ function drop($options = array()) { function sortable() { trigger_error(sprintf(__('%s does not have sortable() implemented', true), get_class($this)), E_USER_WARNING); } +/** + * Create a slider control element. + * + * ### Options + * + * - handle - The handle used in sliding + * - direction - The direction of the slider either 'vertical' or 'horizontal' + * - min - The min value for the slider. + * - max - The max value for the slider. + * - step - The number of steps or ticks the slider will have. + * - value - The initial offset of the slider + * + * ### Events + * + * - change - Fired when the slider's value is updated + * - 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); + } /** * Parse an options assoc array into an Javascript object literal. * Similar to object() but treats any non-integer value as a string, diff --git a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php index 6e50ad356..e12a6a4ef 100644 --- a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php @@ -217,5 +217,23 @@ function testDrop() { $expected = '$("#element").droppable({accept:".items", drop:onDrop, out:onExit, over:onHover});'; $this->assertEqual($result, $expected); } +/** + * test slider generation + * + * @return void + **/ + function testSlider() { + $this->Jquery->get('#element'); + $result = $this->Jquery->slider(array( + 'complete' => 'onComplete', + 'change' => 'onChange', + 'min' => 0, + 'max' => 10, + 'value' => 2, + 'direction' => 'vertical' + )); + $expected = '$("#element").slider({change:onChange, max:10, min:0, orientation:"vertical", stop:onComplete, value:2});'; + $this->assertEqual($result, $expected); + } } ?> \ No newline at end of file From b7845657a88f5a3d14444905da2fedfaba18db9e Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 18 Apr 2009 22:44:47 -0400 Subject: [PATCH 0113/2083] Adding slider to Mootools. Test cases added. --- cake/libs/view/helpers/js.php | 4 +-- cake/libs/view/helpers/mootools_engine.php | 33 +++++++++++++++++++ .../view/helpers/mootools_engine.test.php | 29 ++++++++++++++++ 3 files changed, 64 insertions(+), 2 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index e8bbe7faf..602985bae 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -655,12 +655,12 @@ function sortable() { * * ### Options * - * - handle - The handle used in sliding + * - handle - The id of the element used in sliding. * - direction - The direction of the slider either 'vertical' or 'horizontal' * - min - The min value for the slider. * - max - The max value for the slider. * - step - The number of steps or ticks the slider will have. - * - value - The initial offset of the slider + * - value - The initial offset of the slider. * * ### Events * diff --git a/cake/libs/view/helpers/mootools_engine.php b/cake/libs/view/helpers/mootools_engine.php index d271c7508..7b7059c81 100644 --- a/cake/libs/view/helpers/mootools_engine.php +++ b/cake/libs/view/helpers/mootools_engine.php @@ -59,6 +59,12 @@ class MootoolsEngineHelper extends JsBaseEngineHelper { 'drop' => 'onDrop', 'hover' => 'onEnter', 'leave' => 'onLeave', + ), + 'slider' => array( + 'complete' => 'onComplete', + 'change' => 'onChange', + 'direction' => 'mode', + 'step' => 'steps' ) ); /** @@ -270,6 +276,33 @@ function drop($options = array()) { $this->selection = $options['droppables']; return $out; } +/** + * Create a slider control + * + * Requires `Slider` from MootoolsMore + * + * @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']); + unset($options['handle']); + $callbacks = array('onStart', 'onTick', 'onChange', 'onComplete'); + $options = $this->_mapOptions('slider', $options); + if (isset($options['min']) && isset($options['max'])) { + $options['range'] = array($options['min'], $options['max']); + unset($options['min'], $options['max']); + } + $optionString = $this->_parseOptions($options, $callbacks); + if (!empty($optionString)) { + $optionString = ', {' . $optionString . '}'; + } + $out = 'var jsSlider = new Slider(' . $slider . ', ' . $this->selection . $optionString . ');'; + $this->selection = $slider; + return $out; + } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php index 8c24d8736..44b27af7a 100644 --- a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php @@ -250,5 +250,34 @@ function testDrop() { $this->assertEqual($result, $expected); $this->assertEqual($this->Moo->selection, '$("drop-me")'); } +/** + * test slider generation + * + * @return void + **/ + function testSlider() { + $this->Moo->get('#slider'); + $result = $this->Moo->slider(array( + 'handle' => '#my-handle', + 'complete' => 'onComplete', + 'change' => 'onChange', + 'direction' => 'horizontal', + )); + $expected = 'var jsSlider = new Slider($("slider"), $("my-handle"), {mode:"horizontal", onChange:onChange, onComplete:onComplete});'; + $this->assertEqual($result, $expected); + $this->assertEqual($this->Moo->selection, '$("slider")'); + + $this->Moo->get('#slider'); + $result = $this->Moo->slider(array( + 'handle' => '#my-handle', + 'complete' => 'onComplete', + 'change' => 'onChange', + 'direction' => 'horizontal', + 'min' => 10, + 'max' => 40 + )); + $expected = 'var jsSlider = new Slider($("slider"), $("my-handle"), {mode:"horizontal", onChange:onChange, onComplete:onComplete, range:[10,40]});'; + $this->assertEqual($result, $expected); + } } ?> \ No newline at end of file From dd01dda0b4809aec642e0b6871f251ed34ee75e3 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 21 Apr 2009 09:18:45 -0700 Subject: [PATCH 0114/2083] Adding slider to prototype --- cake/libs/view/helpers/prototype_engine.php | 36 ++++++++++++++++++- .../view/helpers/prototype_engine.test.php | 18 ++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php index 5e415d9db..eb6799928 100644 --- a/cake/libs/view/helpers/prototype_engine.php +++ b/cake/libs/view/helpers/prototype_engine.php @@ -59,6 +59,12 @@ class PrototypeEngineHelper extends JsBaseEngineHelper { 'hover' => 'onHover', 'drop' => 'onDrop', 'hoverClass' => 'hoverclass', + ), + 'slider' => array( + 'direction' => 'axis', + 'change' => 'onSlide', + 'complete' => 'onChange', + 'value' => 'sliderValue', ) ); /** @@ -239,7 +245,7 @@ function drag($options = array()) { * #### Note: Requires scriptaculous to be loaded. * * @param array $options Array of options for the droppable. - * @return string Completed draggable script. + * @return string Completed droppable script. * @see JsHelper::droppable() for options list. **/ function drop($options = array()) { @@ -251,5 +257,33 @@ function drop($options = array()) { } return 'Droppables.add(' . $this->selection . $options . ');'; } +/** + * Creates a slider control widget. + * + * ### Note: Requires scriptaculous to be loaded. + * + * @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']); + unset($options['handle']); + + $callbacks = array('onSlide', 'onChange'); + $options = $this->_mapOptions('slider', $options); + if (isset($options['min']) && isset($options['max'])) { + $options['range'] = array($options['min'], $options['max']); + unset($options['min'], $options['max']); + } + $optionString = $this->_parseOptions($options, $callbacks); + if (!empty($optionString)) { + $optionString = ', {' . $optionString . '}'; + } + $out = 'var jsSlider = new Control.Slider(' . $this->selection . ', ' . $slider . $optionString . ');'; + $this->selection = $slider; + return $out; + } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php index ab5ed6746..0ed044e03 100644 --- a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php @@ -256,5 +256,23 @@ function testDrop() { $expected = 'Droppables.add($("element"), {accept:".drag-me", onDrop:onDrop, onHover:onHover});'; $this->assertEqual($result, $expected); } +/** + * ensure that slider() method behaves properly + * + * @return void + **/ + function testSlider() { + $this->Proto->get('#element'); + $result = $this->Proto->slider(array( + 'handle' => '#handle', + 'direction' => 'horizontal', + 'change' => 'onChange', + 'complete' => 'onComplete', + 'value' => 4, + )); + $expected = 'var jsSlider = new Control.Slider($("handle"), $("element"), {axis:"horizontal", onChange:onComplete, onSlide:onChange, sliderValue:4});'; + $this->assertEqual($result, $expected); + + } } ?> \ No newline at end of file From 91edcacec2d3d582cb5536adf8a76491aa428ce0 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 21 Apr 2009 09:31:52 -0700 Subject: [PATCH 0115/2083] Adding newlines between methods. --- cake/libs/view/helpers/jquery_engine.php | 11 +++++++++++ cake/libs/view/helpers/mootools_engine.php | 10 ++++++++++ cake/libs/view/helpers/prototype_engine.php | 12 +++++++++++- .../libs/view/helpers/prototype_engine.test.php | 1 - 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/cake/libs/view/helpers/jquery_engine.php b/cake/libs/view/helpers/jquery_engine.php index c3e0ee9da..071947463 100644 --- a/cake/libs/view/helpers/jquery_engine.php +++ b/cake/libs/view/helpers/jquery_engine.php @@ -53,6 +53,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper { 'direction' => 'orientation' ) ); + /** * Helper function to wrap repetitive simple method templating. * @@ -69,6 +70,7 @@ function _methodTemplate($method, $template, $options, $callbacks) { $options = $this->_parseOptions($options, $callbacks); return sprintf($template, $this->selection, $options); } + /** * Create javascript selector for a CSS rule * @@ -83,6 +85,7 @@ function get($selector) { } return $this; } + /** * Add an event to the script cache. Operates on the currently selected elements. * @@ -109,6 +112,7 @@ function event($type, $callback, $options = array()) { } return sprintf('%s.bind("%s", %s);', $this->selection, $type, $callback); } + /** * Create a domReady event. This is a special event in many libraries * @@ -118,6 +122,7 @@ function event($type, $callback, $options = array()) { function domReady($functionBody) { return $this->get('document')->event('ready', $functionBody, array('stop' => false)); } + /** * Create an iteration over the current selection result. * @@ -128,6 +133,7 @@ function domReady($functionBody) { function each($callback) { return $this->selection . '.each(function () {' . $callback . '});'; } + /** * Trigger an Effect. * @@ -155,6 +161,7 @@ function effect($name, $options = array()) { } return $this->selection . $effect; } + /** * Create an $.ajax() call. * @@ -179,6 +186,7 @@ function request($url, $options = array()) { $options = $this->_parseOptions($options, $callbacks); return '$.ajax({' . $options .'});'; } + /** * Create a sortable element. * @@ -194,6 +202,7 @@ function sortable($options = array()) { $template = '%s.sortable({%s});'; return $this->_methodTemplate('sortable', $template, $options, $callbacks); } + /** * Create a Draggable element * @@ -208,6 +217,7 @@ function drag($options = array()) { $template = '%s.draggable({%s});'; return $this->_methodTemplate('drag', $template, $options, $callbacks); } + /** * Create a Droppable element * @@ -222,6 +232,7 @@ function drop($options = array()) { $template = '%s.droppable({%s});'; return $this->_methodTemplate('drop', $template, $options, $callbacks); } + /** * Create a Slider element * diff --git a/cake/libs/view/helpers/mootools_engine.php b/cake/libs/view/helpers/mootools_engine.php index 7b7059c81..51784f8f0 100644 --- a/cake/libs/view/helpers/mootools_engine.php +++ b/cake/libs/view/helpers/mootools_engine.php @@ -67,6 +67,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper { 'step' => 'steps' ) ); + /** * Create javascript selector for a CSS rule * @@ -85,6 +86,7 @@ function get($selector) { $this->selection = '$$("' . $selector . '")'; return $this; } + /** * Add an event to the script cache. Operates on the currently selected elements. * @@ -112,6 +114,7 @@ function event($type, $callback, $options = array()) { $out = $this->selection . ".addEvent(\"{$type}\", $callback);"; return $out; } + /** * Create a domReady event. This is a special event in many libraries * @@ -122,6 +125,7 @@ function domReady($functionBody) { $this->selection = 'window'; return $this->event('domready', $functionBody, array('stop' => false)); } + /** * Create an iteration over the current selection result. * @@ -132,6 +136,7 @@ function domReady($functionBody) { function each($callback) { return $this->selection . '.each(function (item, index) {' . $callback . '});'; } + /** * Trigger an Effect. * @@ -171,6 +176,7 @@ function effect($name, $options = array()) { } return $this->selection . '.' . $effect . ';'; } + /** * Create an new Request. * @@ -207,6 +213,7 @@ function request($url, $options = array()) { $options = $this->_parseOptions($options, $callbacks); return "var jsRequest = new Request$type({{$options}}).send($data);"; } + /** * Create a sortable element. * @@ -222,6 +229,7 @@ function sortable($options = array()) { $options = $this->_parseOptions($options, $callbacks); return 'var jsSortable = new Sortables(' . $this->selection . ', {' . $options . '});'; } + /** * Create a Draggable element. * @@ -237,6 +245,7 @@ function drag($options = array()) { $options = $this->_parseOptions($options, $callbacks); return 'var jsDrag = new Drag(' . $this->selection . ', {' . $options . '});'; } + /** * Create a Droppable element. * @@ -276,6 +285,7 @@ function drop($options = array()) { $this->selection = $options['droppables']; return $out; } + /** * Create a slider control * diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php index eb6799928..49c335c85 100644 --- a/cake/libs/view/helpers/prototype_engine.php +++ b/cake/libs/view/helpers/prototype_engine.php @@ -67,6 +67,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper { 'value' => 'sliderValue', ) ); + /** * Create javascript selector for a CSS rule * @@ -85,6 +86,7 @@ function get($selector) { $this->selection = '$$("' . $selector . '")'; return $this; } + /** * Add an event to the script cache. Operates on the currently selected elements. * @@ -112,6 +114,7 @@ function event($type, $callback, $options = array()) { $out = $this->selection . ".observe(\"{$type}\", $callback);"; return $out; } + /** * Create a domReady event. This is a special event in many libraries * @@ -122,6 +125,7 @@ function domReady($functionBody) { $this->selection = 'document'; return $this->event('dom:loaded', $functionBody, array('stop' => false)); } + /** * Create an iteration over the current selection result. * @@ -132,6 +136,7 @@ function domReady($functionBody) { function each($callback) { return $this->selection . '.each(function (item, index) {' . $callback . '});'; } + /** * Trigger an Effect. * @@ -176,6 +181,7 @@ function effect($name, $options = array()) { } return $effect; } + /** * Create an Ajax or Ajax.Updater call. * @@ -203,6 +209,7 @@ function request($url, $options = array()) { } return "var jsRequest = new Ajax$type($url$options);"; } + /** * Create a sortable element. * @@ -221,6 +228,7 @@ function sortable($options = array()) { } return 'var jsSortable = Sortable.create(' . $this->selection . $options . ');'; } + /** * Create a Draggable element. * @@ -239,6 +247,7 @@ function drag($options = array()) { } return 'var jsDrag = new Draggable(' . $this->selection . $options . ');'; } + /** * Create a Droppable element. * @@ -257,6 +266,7 @@ function drop($options = array()) { } return 'Droppables.add(' . $this->selection . $options . ');'; } + /** * Creates a slider control widget. * @@ -283,7 +293,7 @@ function slider($options = array()) { } $out = 'var jsSlider = new Control.Slider(' . $this->selection . ', ' . $slider . $optionString . ');'; $this->selection = $slider; - return $out; + return $out; } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php index 0ed044e03..b8c838d65 100644 --- a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php @@ -272,7 +272,6 @@ function testSlider() { )); $expected = 'var jsSlider = new Control.Slider($("handle"), $("element"), {axis:"horizontal", onChange:onComplete, onSlide:onChange, sliderValue:4});'; $this->assertEqual($result, $expected); - } } ?> \ No newline at end of file From 005cc1b338f3f2e6fe4016c4701bd8a552214791 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 23 Apr 2009 22:58:42 -0700 Subject: [PATCH 0116/2083] Removing old JsHelperObject --- cake/libs/view/helpers/js.php | 179 ---------------------------------- 1 file changed, 179 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 602985bae..fbd2849ea 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -734,183 +734,4 @@ function _toQuerystring($parameters) { return $out; } } - - -class JsHelperObject { - var $__parent = null; - - var $id = null; - - var $pattern = null; - - var $real = null; - - function __construct(&$parent) { - if (is_object($parent)) { - $this->setParent($parent); - } - } - - function toString() { - return $this->__toString(); - } - - function __toString() { - return $this->literal; - } - - function ref($ref = null) { - if ($ref == null) { - foreach (array('id', 'pattern', 'real') as $ref) { - if ($this->{$ref} !== null) { - return $this->{$ref}; - } - } - } else { - return ($this->{$ref} !== null); - } - return null; - } - - function literal($append = null) { - if (!empty($this->id)) { - $data = '$("' . $this->id . '")'; - } - if (!empty($this->pattern)) { - $data = '$$("' . $this->pattern . '")'; - } - if (!empty($this->real)) { - $data = $this->real; - } - if (!empty($append)) { - $data .= '.' . $append; - } - return $data; - } - - function __call($name, $args) { - $data = ''; - - if (isset($this->__parent->effectMap[strtolower($name)])) { - array_unshift($args, $this->__parent->effectMap[strtolower($name)]); - $name = 'effect'; - } - - switch ($name) { - case 'effect': - case 'visualEffect': - - if (strpos($args[0], '_') || $args[0]{0} != strtoupper($args[0]{0})) { - $args[0] = Inflector::camelize($args[0]); - } - - if (strtolower($args[0]) == 'highlight') { - $data .= 'new '; - } - if ($this->pattern == null) { - $data .= 'Effect.' . $args[0] . '(' . $this->literal(); - } else { - $data .= 'Effect.' . $args[0] . '(item'; - } - - if (isset($args[1]) && is_array($args[1])) { - $data .= ', {' . $this->__options($args[1]) . '}'; - } - $data .= ');'; - - if ($this->pattern !== null) { - $data = $this->each($data); - } - break; - case 'remove': - case 'toggle': - case 'show': - case 'hide': - if (empty($args)) { - $obj = 'Element'; - $params = ''; - } else { - $obj = 'Effect'; - $params = ', "' . $args[0] . '"'; - } - - if ($this->pattern != null) { - $data = $this->each($obj . ".{$name}(item);"); - } else { - $data = $obj . ".{$name}(" . $this->literal() . ');'; - } - break; - case 'visible': - $data = $this->literal() . '.visible();'; - break; - case 'update': - $data = $this->literal() . ".update({$args[0]});"; - break; - case 'load': - $data = 'new Ajax.Updater("' . $this->id . '", "' . $args[0] . '"'; - if (isset($args[1]) && is_array($args[1])) { - $data .= ', {' . $this->__options($args[1]) . '}'; - } - $data .= ');'; - break; - case 'each': - case 'all': - case 'any': - case 'detect': - case 'findAll': - if ($this->pattern != null) { - $data = $this->__iterate($name, $args[0]); - } - break; - case 'addClass': - case 'removeClass': - case 'hasClass': - case 'toggleClass': - $data = $this->literal() . ".{$name}Name(\"{$args[0]}\");"; - break; - case 'clone': - case 'inspect': - case 'keys': - case 'values': - $data = "Object.{$name}(" . $this->literal() . ");"; - break; - case 'extend': - $data = "Object.extend(" . $this->literal() . ", {$args[0]});"; - break; - case '...': - // Handle other methods here - // including interfaces to load other files on-the-fly - // that add support for additional methods/replacing existing methods - break; - default: - $data = $this->literal() . '.' . $name . '();'; - break; - } - - if ($this->__parent->output) { - echo $data; - } else { - return $data; - } - } - - function __iterate($method, $data) { - return '$$("' . $this->pattern . '").' . $method . '(function(item) {' . $data . '});'; - } - - function setParent(&$parent) { - $this->__parent =& $parent; - } - - function __options($opts) { - $options = array(); - foreach ($opts as $key => $val) { - if (!is_int($val)) { - $val = '"' . $val . '"'; - } - $options[] = $key . ':' . $val; - } - return join(', ', $options); - } -} ?> \ No newline at end of file From 9754926d02b6699026d061a5d9157ddb601a0ebb Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Fri, 24 Apr 2009 13:44:52 -0400 Subject: [PATCH 0117/2083] Merging with self. --- cake/libs/view/helpers/jquery_engine.php | 24 ++- cake/libs/view/helpers/js.php | 197 ++---------------- cake/libs/view/helpers/mootools_engine.php | 40 +++- cake/libs/view/helpers/prototype_engine.php | 40 +++- .../libs/view/helpers/jquery_engine.test.php | 18 ++ .../view/helpers/mootools_engine.test.php | 29 +++ .../view/helpers/prototype_engine.test.php | 17 ++ 7 files changed, 169 insertions(+), 196 deletions(-) diff --git a/cake/libs/view/helpers/jquery_engine.php b/cake/libs/view/helpers/jquery_engine.php index 57eb588f0..a157e90c9 100644 --- a/cake/libs/view/helpers/jquery_engine.php +++ b/cake/libs/view/helpers/jquery_engine.php @@ -47,8 +47,13 @@ class JqueryEngineHelper extends JsBaseEngineHelper { 'drop' => array( 'leave' => 'out', 'hover' => 'over' + ), + 'slider' => array( + 'complete' => 'stop', + 'direction' => 'orientation' ) ); + /** * Helper function to wrap repetitive simple method templating. * @@ -65,6 +70,7 @@ function _methodTemplate($method, $template, $options, $callbacks) { $options = $this->_parseOptions($options, $callbacks); return sprintf($template, $this->selection, $options); } + /** * Create javascript selector for a CSS rule * @@ -79,6 +85,7 @@ function get($selector) { } return $this; } + /** * Add an event to the script cache. Operates on the currently selected elements. * @@ -105,6 +112,7 @@ function event($type, $callback, $options = array()) { } return sprintf('%s.bind("%s", %s);', $this->selection, $type, $callback); } + /** * Create a domReady event. This is a special event in many libraries * @@ -114,6 +122,7 @@ function event($type, $callback, $options = array()) { function domReady($functionBody) { return $this->get('document')->event('ready', $functionBody, array('stop' => false)); } + /** * Create an iteration over the current selection result. * @@ -124,6 +133,7 @@ function domReady($functionBody) { function each($callback) { return $this->selection . '.each(function () {' . $callback . '});'; } + /** * Trigger an Effect. * @@ -151,6 +161,7 @@ function effect($name, $options = array()) { } return $this->selection . $effect; } + /** * Create an $.ajax() call. * @@ -175,6 +186,7 @@ function request($url, $options = array()) { $options = $this->_parseOptions($options, $callbacks); return '$.ajax({' . $options .'});'; } + /** * Create a sortable element. * @@ -190,6 +202,7 @@ function sortable($options = array()) { $template = '%s.sortable({%s});'; return $this->_methodTemplate('sortable', $template, $options, $callbacks); } + /** * Create a Draggable element * @@ -204,6 +217,7 @@ function drag($options = array()) { $template = '%s.draggable({%s});'; return $this->_methodTemplate('drag', $template, $options, $callbacks); } + /** * Create a Droppable element * @@ -223,12 +237,14 @@ function drop($options = array()) { * * Requires the Ui.Core and Ui.Slider to be loaded. * - * @param array $options Array of options for the slider. - * @return string Completed slider script. + * @param array $options Array of options for the slider 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});'; + return $this->_methodTemplate('slider', $template, $options, $callbacks); } } -?> \ No newline at end of file +?> diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 58202dc83..39505d54f 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -588,14 +588,22 @@ function sortable() { * * ### Options * - * ### Event Options + * - handle - The id of the element used in sliding. + * - direction - The direction of the slider either 'vertical' or 'horizontal' + * - min - The min value for the slider. + * - max - The max value for the slider. + * - step - The number of steps or ticks the slider will have. + * - value - The initial offset of the slider. + * + * ### Events * + * - change - Fired when the slider's value is updated + * - complete - Fired when the user stops sliding the handle * - * @param array $options Array of options for the slider. See above. - * @return string Completed slider script. + * @return string Completed slider script **/ function slider() { - trigger_error(sprintf(__('%s does not have slider() implemented', true), get_class($this)), E_USER_WARNING); + trigger_error(sprintf(__('%s does not have slider() implemented', true), get_class($this)), E_USER_WARNING); } /** * Parse an options assoc array into an Javascript object literal. @@ -659,183 +667,4 @@ function _toQuerystring($parameters) { return $out; } } - - -class JsHelperObject { - var $__parent = null; - - var $id = null; - - var $pattern = null; - - var $real = null; - - function __construct(&$parent) { - if (is_object($parent)) { - $this->setParent($parent); - } - } - - function toString() { - return $this->__toString(); - } - - function __toString() { - return $this->literal; - } - - function ref($ref = null) { - if ($ref == null) { - foreach (array('id', 'pattern', 'real') as $ref) { - if ($this->{$ref} !== null) { - return $this->{$ref}; - } - } - } else { - return ($this->{$ref} !== null); - } - return null; - } - - function literal($append = null) { - if (!empty($this->id)) { - $data = '$("' . $this->id . '")'; - } - if (!empty($this->pattern)) { - $data = '$$("' . $this->pattern . '")'; - } - if (!empty($this->real)) { - $data = $this->real; - } - if (!empty($append)) { - $data .= '.' . $append; - } - return $data; - } - - function __call($name, $args) { - $data = ''; - - if (isset($this->__parent->effectMap[strtolower($name)])) { - array_unshift($args, $this->__parent->effectMap[strtolower($name)]); - $name = 'effect'; - } - - switch ($name) { - case 'effect': - case 'visualEffect': - - if (strpos($args[0], '_') || $args[0]{0} != strtoupper($args[0]{0})) { - $args[0] = Inflector::camelize($args[0]); - } - - if (strtolower($args[0]) == 'highlight') { - $data .= 'new '; - } - if ($this->pattern == null) { - $data .= 'Effect.' . $args[0] . '(' . $this->literal(); - } else { - $data .= 'Effect.' . $args[0] . '(item'; - } - - if (isset($args[1]) && is_array($args[1])) { - $data .= ', {' . $this->__options($args[1]) . '}'; - } - $data .= ');'; - - if ($this->pattern !== null) { - $data = $this->each($data); - } - break; - case 'remove': - case 'toggle': - case 'show': - case 'hide': - if (empty($args)) { - $obj = 'Element'; - $params = ''; - } else { - $obj = 'Effect'; - $params = ', "' . $args[0] . '"'; - } - - if ($this->pattern != null) { - $data = $this->each($obj . ".{$name}(item);"); - } else { - $data = $obj . ".{$name}(" . $this->literal() . ');'; - } - break; - case 'visible': - $data = $this->literal() . '.visible();'; - break; - case 'update': - $data = $this->literal() . ".update({$args[0]});"; - break; - case 'load': - $data = 'new Ajax.Updater("' . $this->id . '", "' . $args[0] . '"'; - if (isset($args[1]) && is_array($args[1])) { - $data .= ', {' . $this->__options($args[1]) . '}'; - } - $data .= ');'; - break; - case 'each': - case 'all': - case 'any': - case 'detect': - case 'findAll': - if ($this->pattern != null) { - $data = $this->__iterate($name, $args[0]); - } - break; - case 'addClass': - case 'removeClass': - case 'hasClass': - case 'toggleClass': - $data = $this->literal() . ".{$name}Name(\"{$args[0]}\");"; - break; - case 'clone': - case 'inspect': - case 'keys': - case 'values': - $data = "Object.{$name}(" . $this->literal() . ");"; - break; - case 'extend': - $data = "Object.extend(" . $this->literal() . ", {$args[0]});"; - break; - case '...': - // Handle other methods here - // including interfaces to load other files on-the-fly - // that add support for additional methods/replacing existing methods - break; - default: - $data = $this->literal() . '.' . $name . '();'; - break; - } - - if ($this->__parent->output) { - echo $data; - } else { - return $data; - } - } - - function __iterate($method, $data) { - return '$$("' . $this->pattern . '").' . $method . '(function(item) {' . $data . '});'; - } - - function setParent(&$parent) { - $this->__parent =& $parent; - } - - function __options($opts) { - $options = array(); - foreach ($opts as $key => $val) { - if (!is_int($val)) { - $val = '"' . $val . '"'; - } - $options[] = $key . ':' . $val; - } - return join(', ', $options); - } -} -?> \ No newline at end of file +?> diff --git a/cake/libs/view/helpers/mootools_engine.php b/cake/libs/view/helpers/mootools_engine.php index 86a5aef2b..10b118a6b 100644 --- a/cake/libs/view/helpers/mootools_engine.php +++ b/cake/libs/view/helpers/mootools_engine.php @@ -59,8 +59,15 @@ class MootoolsEngineHelper extends JsBaseEngineHelper { 'drop' => 'onDrop', 'hover' => 'onEnter', 'leave' => 'onLeave', + ), + 'slider' => array( + 'complete' => 'onComplete', + 'change' => 'onChange', + 'direction' => 'mode', + 'step' => 'steps' ) ); + /** * Create javascript selector for a CSS rule * @@ -79,6 +86,7 @@ function get($selector) { $this->selection = '$$("' . $selector . '")'; return $this; } + /** * Add an event to the script cache. Operates on the currently selected elements. * @@ -106,6 +114,7 @@ function event($type, $callback, $options = array()) { $out = $this->selection . ".addEvent(\"{$type}\", $callback);"; return $out; } + /** * Create a domReady event. This is a special event in many libraries * @@ -116,6 +125,7 @@ function domReady($functionBody) { $this->selection = 'window'; return $this->event('domready', $functionBody, array('stop' => false)); } + /** * Create an iteration over the current selection result. * @@ -126,6 +136,7 @@ function domReady($functionBody) { function each($callback) { return $this->selection . '.each(function (item, index) {' . $callback . '});'; } + /** * Trigger an Effect. * @@ -165,6 +176,7 @@ function effect($name, $options = array()) { } return $this->selection . '.' . $effect . ';'; } + /** * Create an new Request. * @@ -201,6 +213,7 @@ function request($url, $options = array()) { $options = $this->_parseOptions($options, $callbacks); return "var jsRequest = new Request$type({{$options}}).send($data);"; } + /** * Create a sortable element. * @@ -216,6 +229,7 @@ function sortable($options = array()) { $options = $this->_parseOptions($options, $callbacks); return 'var jsSortable = new Sortables(' . $this->selection . ', {' . $options . '});'; } + /** * Create a Draggable element. * @@ -231,6 +245,7 @@ function drag($options = array()) { $options = $this->_parseOptions($options, $callbacks); return 'var jsDrag = new Drag(' . $this->selection . ', {' . $options . '});'; } + /** * Create a Droppable element. * @@ -270,17 +285,34 @@ function drop($options = array()) { $this->selection = $options['droppables']; return $out; } + /** - * Slider + * Create a slider control * - * Requires the `Slider` plugin from MootoolsMore + * Requires `Slider` from MootoolsMore * * @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']); + unset($options['handle']); + + $callbacks = array('onStart', 'onTick', 'onChange', 'onComplete'); + $options = $this->_mapOptions('slider', $options); + if (isset($options['min']) && isset($options['max'])) { + $options['range'] = array($options['min'], $options['max']); + unset($options['min'], $options['max']); + } + $optionString = $this->_parseOptions($options, $callbacks); + if (!empty($optionString)) { + $optionString = ', {' . $optionString . '}'; + } + $out = 'var jsSlider = new Slider(' . $slider . ', ' . $this->selection . $optionString . ');'; + $this->selection = $slider; + return $out; } } -?> \ No newline at end of file +?> diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php index e6531a55c..245c63adf 100644 --- a/cake/libs/view/helpers/prototype_engine.php +++ b/cake/libs/view/helpers/prototype_engine.php @@ -59,8 +59,15 @@ class PrototypeEngineHelper extends JsBaseEngineHelper { 'hover' => 'onHover', 'drop' => 'onDrop', 'hoverClass' => 'hoverclass', + ), + 'slider' => array( + 'direction' => 'axis', + 'change' => 'onSlide', + 'complete' => 'onChange', + 'value' => 'sliderValue', ) ); + /** * Create javascript selector for a CSS rule * @@ -79,6 +86,7 @@ function get($selector) { $this->selection = '$$("' . $selector . '")'; return $this; } + /** * Add an event to the script cache. Operates on the currently selected elements. * @@ -106,6 +114,7 @@ function event($type, $callback, $options = array()) { $out = $this->selection . ".observe(\"{$type}\", $callback);"; return $out; } + /** * Create a domReady event. This is a special event in many libraries * @@ -116,6 +125,7 @@ function domReady($functionBody) { $this->selection = 'document'; return $this->event('dom:loaded', $functionBody, array('stop' => false)); } + /** * Create an iteration over the current selection result. * @@ -126,6 +136,7 @@ function domReady($functionBody) { function each($callback) { return $this->selection . '.each(function (item, index) {' . $callback . '});'; } + /** * Trigger an Effect. * @@ -170,6 +181,7 @@ function effect($name, $options = array()) { } return $effect; } + /** * Create an Ajax or Ajax.Updater call. * @@ -197,6 +209,7 @@ function request($url, $options = array()) { } return "var jsRequest = new Ajax$type($url$options);"; } + /** * Create a sortable element. * @@ -215,6 +228,7 @@ function sortable($options = array()) { } return 'var jsSortable = Sortable.create(' . $this->selection . $options . ');'; } + /** * Create a Draggable element. * @@ -233,13 +247,14 @@ function drag($options = array()) { } return 'var jsDrag = new Draggable(' . $this->selection . $options . ');'; } + /** * Create a Droppable element. * * #### Note: Requires scriptaculous to be loaded. * * @param array $options Array of options for the droppable. - * @return string Completed draggable script. + * @return string Completed droppable script. * @see JsHelper::droppable() for options list. **/ function drop($options = array()) { @@ -251,17 +266,34 @@ function drop($options = array()) { } return 'Droppables.add(' . $this->selection . $options . ');'; } + /** - * Slider + * Creates a slider control widget. * - * Requires the Scriptaculous to be loaded. + * ### Note: Requires scriptaculous to be loaded. * * @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']); + unset($options['handle']); + $callbacks = array('onSlide', 'onChange'); + $options = $this->_mapOptions('slider', $options); + if (isset($options['min']) && isset($options['max'])) { + $options['range'] = array($options['min'], $options['max']); + unset($options['min'], $options['max']); + } + $optionString = $this->_parseOptions($options, $callbacks); + if (!empty($optionString)) { + $optionString = ', {' . $optionString . '}'; + } + $out = 'var jsSlider = new Control.Slider(' . $this->selection . ', ' . $slider . $optionString . ');'; + $this->selection = $slider; + return $out; } } -?> \ No newline at end of file +?> diff --git a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php index 6e50ad356..e12a6a4ef 100644 --- a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php @@ -217,5 +217,23 @@ function testDrop() { $expected = '$("#element").droppable({accept:".items", drop:onDrop, out:onExit, over:onHover});'; $this->assertEqual($result, $expected); } +/** + * test slider generation + * + * @return void + **/ + function testSlider() { + $this->Jquery->get('#element'); + $result = $this->Jquery->slider(array( + 'complete' => 'onComplete', + 'change' => 'onChange', + 'min' => 0, + 'max' => 10, + 'value' => 2, + 'direction' => 'vertical' + )); + $expected = '$("#element").slider({change:onChange, max:10, min:0, orientation:"vertical", stop:onComplete, value:2});'; + $this->assertEqual($result, $expected); + } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php index 8c24d8736..44b27af7a 100644 --- a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php @@ -250,5 +250,34 @@ function testDrop() { $this->assertEqual($result, $expected); $this->assertEqual($this->Moo->selection, '$("drop-me")'); } +/** + * test slider generation + * + * @return void + **/ + function testSlider() { + $this->Moo->get('#slider'); + $result = $this->Moo->slider(array( + 'handle' => '#my-handle', + 'complete' => 'onComplete', + 'change' => 'onChange', + 'direction' => 'horizontal', + )); + $expected = 'var jsSlider = new Slider($("slider"), $("my-handle"), {mode:"horizontal", onChange:onChange, onComplete:onComplete});'; + $this->assertEqual($result, $expected); + $this->assertEqual($this->Moo->selection, '$("slider")'); + + $this->Moo->get('#slider'); + $result = $this->Moo->slider(array( + 'handle' => '#my-handle', + 'complete' => 'onComplete', + 'change' => 'onChange', + 'direction' => 'horizontal', + 'min' => 10, + 'max' => 40 + )); + $expected = 'var jsSlider = new Slider($("slider"), $("my-handle"), {mode:"horizontal", onChange:onChange, onComplete:onComplete, range:[10,40]});'; + $this->assertEqual($result, $expected); + } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php index ab5ed6746..b8c838d65 100644 --- a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php @@ -256,5 +256,22 @@ function testDrop() { $expected = 'Droppables.add($("element"), {accept:".drag-me", onDrop:onDrop, onHover:onHover});'; $this->assertEqual($result, $expected); } +/** + * ensure that slider() method behaves properly + * + * @return void + **/ + function testSlider() { + $this->Proto->get('#element'); + $result = $this->Proto->slider(array( + 'handle' => '#handle', + 'direction' => 'horizontal', + 'change' => 'onChange', + 'complete' => 'onComplete', + 'value' => 4, + )); + $expected = 'var jsSlider = new Control.Slider($("handle"), $("element"), {axis:"horizontal", onChange:onComplete, onSlide:onChange, sliderValue:4});'; + $this->assertEqual($result, $expected); + } } ?> \ No newline at end of file From 0ee8889e6d9fb26873a0d8a87832f8c201757d9d Mon Sep 17 00:00:00 2001 From: davidpersson <davidpersson@gmx.de> Date: Fri, 24 Apr 2009 21:04:07 +0200 Subject: [PATCH 0118/2083] Adding Shell::nl method Updating out to not use newline feature of SD::stdout Updating out, err and hr methods to utilize the new method Rewording parameters of out, err and hr Changing handling of multiple messages Adding tests for nl, hr and error Updating tests for out and err Updating docblocks --- cake/console/libs/shell.php | 66 +++++----- cake/tests/cases/console/libs/shell.test.php | 131 +++++++++++++++---- 2 files changed, 141 insertions(+), 56 deletions(-) diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php index 01855bceb..a0a194d70 100644 --- a/cake/console/libs/shell.php +++ b/cake/console/libs/shell.php @@ -338,53 +338,59 @@ function in($prompt, $options = null, $default = null) { } } /** - * Outputs to the stdout filehandle. + * Outputs a single or multiple messages to stdout. * - * @param string $string String to output. - * @param boolean $newline If true, the outputs gets an added newline. + * @param mixed $message A string or a an array of strings to output + * @param mixed $after Appended to message, if true a newline is used * @access public */ - function out($string, $newline = true) { - if (is_array($string)) { - $str = ''; - foreach ($string as $message) { - $str .= $message ."\n"; - } - $string = $str; + function out($message, $after = true) { + if (is_array($message)) { + $message = implode($this->nl(), $message); } - return $this->Dispatch->stdout($string, $newline); + $this->Dispatch->stdout($message . $this->nl($after), false); } /** - * Outputs to the stderr filehandle. + * Outputs a single or multiple error messages to stderr. * - * @param string $string Error text to output. - * @param boolean $newline If true, the outputs gets an added newline. + * @param mixed $message A string or a an array of strings to output + * @param mixed $after Appended to message, if true a newline is used * @access public */ - function err($string, $newline = true) { - if (is_array($string)) { - $str = ''; - foreach ($string as $message) { - $str .= $message ."\n"; - } - $string = $str; + function err($message, $after = true) { + if (is_array($message)) { + $message = implode($this->nl(), $message); } - return $this->Dispatch->stderr($string . ($newline ? "\n" : '')); + $this->Dispatch->stderr($message . $this->nl($after)); } /** - * Outputs a series of minus characters to the standard output, acts as a visual separator. + * Returns a single or multiple linefeeds sequences. * - * @param boolean $newline If true, the outputs gets an added newline. + * @param mixed $format If true returns a linefeed sequence, if false null, + * if a string is given that is returned, + * if an integer is given it is used as a multiplier to return multiple linefeed sequences * @access public + * @return string */ - function hr($newline = false) { - if ($newline) { - $this->out("\n"); + function nl($format = true) { + if (is_string($format)) { + return $format; } - $this->out('---------------------------------------------------------------'); - if ($newline) { - $this->out("\n"); + if (is_integer($format)) { + return str_repeat("\n", $format); } + return $format ? "\n" : null; + } +/** + * Outputs a series of minus characters to the standard output, acts as a visual separator. + * + * @param mixed $surround If true, the outputs gets surrounded by newlines. + * @access public + */ + function hr($surround = false) { + $this->out(null, $surround); + $this->out('---------------------------------------------------------------'); + $this->out(null, $surround); } /** * Displays a formatted error message diff --git a/cake/tests/cases/console/libs/shell.test.php b/cake/tests/cases/console/libs/shell.test.php index 8d03541fc..6144842a4 100644 --- a/cake/tests/cases/console/libs/shell.test.php +++ b/cake/tests/cases/console/libs/shell.test.php @@ -48,6 +48,23 @@ * @subpackage cake.tests.cases.console.libs */ class TestShell extends Shell { +/** + * stopped property + * + * @var integer + * @access public + */ + var $stopped; +/** + * stop method + * + * @param integer $status + * @access protected + * @return void + */ + function _stop($status = 0) { + $this->stopped = $status; + } } /** * TestAppleTask class @@ -147,32 +164,6 @@ function testInitialize() { Configure::write('pluginPaths', $_back['pluginPaths']); Configure::write('modelPaths', $_back['modelPaths']); } -/** - * testOut method - * - * @return void - * @access public - */ - function testOut() { - $this->Shell->Dispatch->expectAt(0, 'stdout', array('Just a test', true)); - $this->Shell->out('Just a test'); - - $this->Shell->Dispatch->expectAt(1, 'stdout', array("Just\na\ntest\n", true)); - $this->Shell->out(array('Just', 'a', 'test')); - } -/** - * testErr method - * - * @return void - * @access public - */ - function testErr() { - $this->Shell->Dispatch->expectAt(0, 'stderr', array("Just a test\n")); - $this->Shell->err('Just a test'); - - $this->Shell->Dispatch->expectAt(1, 'stderr', array("Just\na\ntest\n\n")); - $this->Shell->err(array('Just', 'a', 'test')); - } /** * testIn method * @@ -210,6 +201,94 @@ function testIn() { $result = $this->Shell->in('Just a test?', 'y/n', 'n'); $this->assertEqual($result, 'n'); } +/** + * testOut method + * + * @return void + * @access public + */ + function testOut() { + $this->Shell->Dispatch->expectAt(0, 'stdout', array("Just a test\n", false)); + $this->Shell->out('Just a test'); + + $this->Shell->Dispatch->expectAt(1, 'stdout', array("Just\na\ntest\n", false)); + $this->Shell->out(array('Just', 'a', 'test')); + + $this->Shell->Dispatch->expectAt(2, 'stdout', array("Just\na\ntest\n\n", false)); + $this->Shell->out(array('Just', 'a', 'test'), 2); + } +/** + * testErr method + * + * @return void + * @access public + */ + function testErr() { + $this->Shell->Dispatch->expectAt(0, 'stderr', array("Just a test\n")); + $this->Shell->err('Just a test'); + + $this->Shell->Dispatch->expectAt(1, 'stderr', array("Just\na\ntest\n")); + $this->Shell->err(array('Just', 'a', 'test')); + + $this->Shell->Dispatch->expectAt(2, 'stderr', array("Just\na\ntest\n\n")); + $this->Shell->err(array('Just', 'a', 'test'), 2); + } +/** + * testNl + * + * @access public + * @return void + */ + function testNl() { + $this->assertEqual($this->Shell->nl(), "\n"); + $this->assertEqual($this->Shell->nl(true), "\n"); + $this->assertEqual($this->Shell->nl(false), ""); + $this->assertEqual($this->Shell->nl(2), "\n\n"); + $this->assertEqual($this->Shell->nl(1), "\n"); + $this->assertEqual($this->Shell->nl("custom\n"), "custom\n"); + } +/** + * testHr + * + * @access public + * @return void + */ + function testHr() { + $bar = '---------------------------------------------------------------'; + + $this->Shell->Dispatch->expectAt(0, 'stdout', array('', false)); + $this->Shell->Dispatch->expectAt(1, 'stdout', array($bar . "\n", false)); + $this->Shell->Dispatch->expectAt(2, 'stdout', array('', false)); + $this->Shell->hr(); + + $this->Shell->Dispatch->expectAt(3, 'stdout', array("\n", false)); + $this->Shell->Dispatch->expectAt(4, 'stdout', array($bar . "\n", false)); + $this->Shell->Dispatch->expectAt(5, 'stdout', array("\n", false)); + $this->Shell->hr(true); + + $this->Shell->Dispatch->expectAt(3, 'stdout', array("\n\n", false)); + $this->Shell->Dispatch->expectAt(4, 'stdout', array($bar . "\n", false)); + $this->Shell->Dispatch->expectAt(5, 'stdout', array("\n\n", false)); + $this->Shell->hr(2); + } +/** + * testError + * + * @access public + * @return void + */ + function testError() { + $this->Shell->Dispatch->expectAt(0, 'stderr', array("Error: Foo Not Found\n")); + $this->Shell->error('Foo Not Found'); + $this->assertIdentical($this->Shell->stopped, 1); + + $this->Shell->stopped = null; + + $this->Shell->Dispatch->expectAt(1, 'stderr', array("Error: Foo Not Found\n")); + $this->Shell->Dispatch->expectAt(2, 'stderr', array("Searched all...\n")); + $this->Shell->error('Foo Not Found', 'Searched all...'); + $this->assertIdentical($this->Shell->stopped, 1); + } /** * testLoadTasks method * From e990c5ba3752188a74988c88a28073e70eff4522 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 26 Apr 2009 22:53:26 -0400 Subject: [PATCH 0119/2083] Adding optional param to remove colon on methods. Allows use inside object literals. --- cake/libs/view/helpers/js.php | 36 +++++++++++++------ .../tests/cases/libs/view/helpers/js.test.php | 18 ++++++++-- 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 39505d54f..25f28fb5d 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -77,7 +77,7 @@ class JsHelper extends AppHelper { * @return void **/ function __construct($settings = array()) { - $className = 'jquery'; + $className = 'Jquery'; if (is_array($settings) && isset($settings[0])) { $className = $settings[0]; } elseif (is_string($settings)) { @@ -241,7 +241,7 @@ class JsBaseEngineHelper extends AppHelper { * * @var array **/ - var $bufferedMethods = array('event', 'sortable', 'drag', 'drop'); + var $bufferedMethods = array('event', 'sortable', 'drag', 'drop', 'slider'); /** * Constructor. * @@ -254,11 +254,16 @@ function __construct() { * Create an alert message in Javascript * * @param string $message Message you want to alter. + * @param boolean $colon Whether you want a colon or not. * @access public - * @return void + * @return string Completed alert() call. **/ - function alert($message) { - return 'alert("' . $this->escape($message) . '");'; + function alert($message, $colon = true) { + $out = 'alert("' . $this->escape($message) . '")'; + if ($colon) { + $out .= ';'; + } + return $out; } /** * Redirects to a URL @@ -274,11 +279,16 @@ function redirect($url = null) { * Create a confirm() message * * @param string $message Message you want confirmed. + * @param boolean $colon Whether you want a colon or not. * @access public - * @return void + * @return string Completed confirm() call **/ - function confirm($message) { - return 'confirm("' . $this->escape($message) . '");'; + function confirm($message, $colon = true) { + $out = 'confirm("' . $this->escape($message) . '")'; + if ($colon) { + $out .= ';'; + } + return $out; } /** * Create a prompt() Javascript function @@ -286,10 +296,14 @@ function confirm($message) { * @param string $message Message you want to prompt. * @param string $default Default message * @access public - * @return void + * @return string completed prompt() call **/ - function prompt($message, $default = '') { - return 'prompt("' . $this->escape($message) . '", "' . $this->escape($default) . '");'; + function prompt($message, $default = '', $colon = true) { + $out = 'prompt("' . $this->escape($message) . '", "' . $this->escape($default) . '")'; + if ($colon) { + $out .= ';'; + } + return $out; } /** * Generates a JavaScript object in JavaScript Object Notation (JSON) diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index 43764cb34..cc003e35b 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -106,7 +106,7 @@ function endTest() { **/ function testConstruction() { $js =& new JsHelper(); - $this->assertEqual($js->helpers, array('Html', 'jqueryEngine')); + $this->assertEqual($js->helpers, array('Html', 'JqueryEngine')); $js =& new JsHelper(array('mootools')); $this->assertEqual($js->helpers, array('Html', 'mootoolsEngine')); @@ -302,6 +302,10 @@ function testPrompt() { $expected = 'prompt("Hey, hey you", "hi!");'; $this->assertEqual($result, $expected); + $result = $this->JsEngine->prompt('Hey, hey you', 'hi!', false); + $expected = 'prompt("Hey, hey you", "hi!")'; + $this->assertEqual($result, $expected); + $result = $this->JsEngine->prompt('"Hey"', '"hi"'); $expected = 'prompt("\"Hey\"", "\"hi\"");'; $this->assertEqual($result, $expected); @@ -318,7 +322,11 @@ function testAlert() { $result = $this->JsEngine->alert('"Hey"'); $expected = 'alert("\"Hey\"");'; - $this->assertEqual($result, $expected); + $this->assertEqual($result, $expected); + + $result = $this->JsEngine->alert('Hey there', false); + $expected = 'alert("Hey there")'; + $this->assertEqual($result, $expected); } /** * test confirm generation @@ -332,7 +340,11 @@ function testConfirm() { $result = $this->JsEngine->confirm('"Are you sure?"'); $expected = 'confirm("\"Are you sure?\"");'; - $this->assertEqual($result, $expected); + $this->assertEqual($result, $expected); + + $result = $this->JsEngine->confirm('"Are you sure?"', false); + $expected = 'confirm("\"Are you sure?\"")'; + $this->assertEqual($result, $expected); } /** * test Redirect From 912f6589d556f391daaa768dcd11ab34682ee0c0 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 26 Apr 2009 23:24:39 -0400 Subject: [PATCH 0120/2083] Partial Revert "Adding optional param to remove colon on methods. Allows use inside" This reverts commit b29e130606176e4ad4d834fdf42746b3c4085686. --- cake/libs/view/helpers/js.php | 34 ++++++------------- .../tests/cases/libs/view/helpers/js.test.php | 16 ++------- 2 files changed, 12 insertions(+), 38 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 25f28fb5d..1bcb37932 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -254,23 +254,18 @@ function __construct() { * Create an alert message in Javascript * * @param string $message Message you want to alter. - * @param boolean $colon Whether you want a colon or not. * @access public - * @return string Completed alert() call. + * @return string completed alert() **/ - function alert($message, $colon = true) { - $out = 'alert("' . $this->escape($message) . '")'; - if ($colon) { - $out .= ';'; - } - return $out; + function alert($message) { + return 'alert("' . $this->escape($message) . '");'; } /** * Redirects to a URL * * @param mixed $url * @param array $options - * @return string + * @return string completed redirect in javascript **/ function redirect($url = null) { return 'window.location = "' . Router::url($url) . '";'; @@ -279,16 +274,11 @@ function redirect($url = null) { * Create a confirm() message * * @param string $message Message you want confirmed. - * @param boolean $colon Whether you want a colon or not. * @access public - * @return string Completed confirm() call + * @return string completed confirm() **/ - function confirm($message, $colon = true) { - $out = 'confirm("' . $this->escape($message) . '")'; - if ($colon) { - $out .= ';'; - } - return $out; + function confirm($message) { + return 'confirm("' . $this->escape($message) . '");'; } /** * Create a prompt() Javascript function @@ -296,14 +286,10 @@ function confirm($message, $colon = true) { * @param string $message Message you want to prompt. * @param string $default Default message * @access public - * @return string completed prompt() call + * @return string completed prompt() **/ - function prompt($message, $default = '', $colon = true) { - $out = 'prompt("' . $this->escape($message) . '", "' . $this->escape($default) . '")'; - if ($colon) { - $out .= ';'; - } - return $out; + function prompt($message, $default = '') { + return 'prompt("' . $this->escape($message) . '", "' . $this->escape($default) . '");'; } /** * Generates a JavaScript object in JavaScript Object Notation (JSON) diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index cc003e35b..26834c1b1 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -302,10 +302,6 @@ function testPrompt() { $expected = 'prompt("Hey, hey you", "hi!");'; $this->assertEqual($result, $expected); - $result = $this->JsEngine->prompt('Hey, hey you', 'hi!', false); - $expected = 'prompt("Hey, hey you", "hi!")'; - $this->assertEqual($result, $expected); - $result = $this->JsEngine->prompt('"Hey"', '"hi"'); $expected = 'prompt("\"Hey\"", "\"hi\"");'; $this->assertEqual($result, $expected); @@ -322,11 +318,7 @@ function testAlert() { $result = $this->JsEngine->alert('"Hey"'); $expected = 'alert("\"Hey\"");'; - $this->assertEqual($result, $expected); - - $result = $this->JsEngine->alert('Hey there', false); - $expected = 'alert("Hey there")'; - $this->assertEqual($result, $expected); + $this->assertEqual($result, $expected); } /** * test confirm generation @@ -340,11 +332,7 @@ function testConfirm() { $result = $this->JsEngine->confirm('"Are you sure?"'); $expected = 'confirm("\"Are you sure?\"");'; - $this->assertEqual($result, $expected); - - $result = $this->JsEngine->confirm('"Are you sure?"', false); - $expected = 'confirm("\"Are you sure?\"")'; - $this->assertEqual($result, $expected); + $this->assertEqual($result, $expected); } /** * test Redirect From 798a9d5e43ae81e0b12d8ac6002b172a20ede47b Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 27 Apr 2009 23:15:28 -0400 Subject: [PATCH 0121/2083] Adding `cake bake model all`. --- cake/console/libs/tasks/model.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 464d5bae5..558250d48 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -64,6 +64,9 @@ function execute() { } if (!empty($this->args[0])) { + if (strtolower($this->args[0]) == 'all') { + return $this->all(); + } $model = Inflector::camelize($this->args[0]); if ($this->bake($model)) { if ($this->_checkUnitTest()) { @@ -72,6 +75,31 @@ function execute() { } } } +/** + * Bake all models at once. + * + * @return void + **/ + function all() { + $ds = 'default'; + if (isset($this->params['connection'])) { + $ds = $this->params['connection']; + } + $this->listAll($ds, false); + foreach ($this->__tables as $table) { + $modelClass = Inflector::classify($table); + $this->out(sprintf(__('Baking %s', true), $modelClass)); + + if (App::import('Model', $modelClass)) { + $object = new $modelClass(); + $modelExists = true; + } else { + App::import('Model'); + $object = new Model(array('name' => $modelClass, 'ds' => $ds)); + } + $this->bake($object, false); + } + } /** * Handles interactive baking * From f0543987e1608b5df334101ea9c42d536705a112 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 27 Apr 2009 23:36:57 -0400 Subject: [PATCH 0122/2083] Adding `cake bake controller all` --- cake/console/libs/tasks/controller.php | 46 +++++++++++++++++++++----- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index aefe126ea..491fb64e6 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -70,6 +70,9 @@ function execute() { } if (isset($this->args[0])) { + if (strtolower($this->args[0]) == 'all') { + return $this->all(); + } $controller = Inflector::camelize($this->args[0]); $actions = null; if (isset($this->args[1]) && $this->args[1] == 'scaffold') { @@ -95,6 +98,28 @@ function execute() { } } } +/** + * Bake All the controllers at once. Will only bake controllers for models that exist. + * + * @access public + * @return void + **/ + function all() { + $ds = 'default'; + $ds = 'default'; + if (isset($this->params['connection'])) { + $ds = $this->params['connection']; + } + $controllers = $this->listAll($ds, false); + foreach ($this->__tables as $table) { + $model = $this->_modelName($table); + $controller = $this->_controllerName($model); + if (App::import('Model', $model)) { + $actions = $this->bakeActions($controller); + $this->bake($controller, $actions); + } + } + } /** * Interactive * @@ -488,10 +513,11 @@ function bakeTest($className) { * Outputs and gets the list of possible models or controllers from database * * @param string $useDbConfig Database configuration name + * @param boolean $interactive Whether you are using listAll interactively and want options output. * @return array Set of controllers * @access public */ - function listAll($useDbConfig = 'default') { + function listAll($useDbConfig = 'default', $interactive = true) { $db =& ConnectionManager::getDataSource($useDbConfig); $usePrefix = empty($db->config['prefix']) ? '' : $db->config['prefix']; if ($usePrefix) { @@ -511,14 +537,16 @@ function listAll($useDbConfig = 'default') { } $this->__tables = $tables; - $this->out('Possible Controllers based on your current database:'); - $this->_controllerNames = array(); - $count = count($tables); - for ($i = 0; $i < $count; $i++) { - $this->_controllerNames[] = $this->_controllerName($this->_modelName($tables[$i])); - $this->out($i + 1 . ". " . $this->_controllerNames[$i]); - } - return $this->_controllerNames; + if ($interactive == true) { + $this->out('Possible Controllers based on your current database:'); + $this->_controllerNames = array(); + $count = count($tables); + for ($i = 0; $i < $count; $i++) { + $this->_controllerNames[] = $this->_controllerName($this->_modelName($tables[$i])); + $this->out($i + 1 . ". " . $this->_controllerNames[$i]); + } + return $this->_controllerNames; + } } /** From 73b9cbfeadc47223bf8151982bdbbc396710e0b6 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 27 Apr 2009 23:43:06 -0400 Subject: [PATCH 0123/2083] Adding help text entries for controller all and model all. --- cake/console/libs/tasks/controller.php | 1 + cake/console/libs/tasks/model.php | 1 + 2 files changed, 2 insertions(+) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 491fb64e6..ff1921fa2 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -597,6 +597,7 @@ function help() { $this->out("\n\tcontroller <name> scaffold\n\t\tbakes controller with scaffold actions.\n\t\t(index, view, add, edit, delete)"); $this->out("\n\tcontroller <name> scaffold admin\n\t\tbakes a controller with scaffold actions for both public and Configure::read('Routing.admin')"); $this->out("\n\tcontroller <name> admin\n\t\tbakes a controller with scaffold actions only for Configure::read('Routing.admin')"); + $this->out("\n\tcontroller all\n\t\tbakes all controllers with CRUD methods."); $this->out(""); $this->_stop(); } diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 558250d48..4a334529b 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -847,6 +847,7 @@ function help() { $this->out('Commands:'); $this->out("\n\tmodel\n\t\tbakes model in interactive mode."); $this->out("\n\tmodel <name>\n\t\tbakes model file with no associations or validation"); + $this->out("\n\tmodel all\n\t\tbakes all model files with associations and validation"); $this->out(""); $this->_stop(); } From 1291d4f02527e82fdaa3eac19cf88aa79fb06214 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 27 Apr 2009 23:55:34 -0400 Subject: [PATCH 0124/2083] Adding `cake bake view all` --- cake/console/libs/tasks/view.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 4dfdc5089..83050228c 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -114,6 +114,10 @@ function execute() { if (!$action) { $action = $this->template; } + + if (strtolower($this->args[0]) == 'all') { + return $this->all(); + } if (in_array($action, $this->scaffoldActions)) { $this->bake($action, true); @@ -146,6 +150,30 @@ function execute() { } } } +/** + * Bake All views for All controllers. + * + * @return void + **/ + function all() { + $ds = 'default'; + $actions = $this->scaffoldActions; + $tables = $this->Controller->listAll($ds, false); + foreach ($tables as $table) { + $model = $this->_modelName($table); + $this->controllerName = $this->_controllerName($model); + $this->controllerPath = Inflector::underscore($this->controllerName); + if (App::import('Model', $model)) { + $vars = $this->__loadController(); + if ($vars) { + foreach ($actions as $action) { + $content = $this->getContent($action, $vars); + $this->bake($action, $content); + } + } + } + } + } /** * Handles interactive baking * From f7a7b077408926e0c46fafa63e5b14c2a7e4cdc8 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 27 Apr 2009 23:58:36 -0400 Subject: [PATCH 0125/2083] Turning off interactive for bake all commands. --- cake/console/libs/tasks/controller.php | 5 +++-- cake/console/libs/tasks/model.php | 2 ++ cake/console/libs/tasks/view.php | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index ff1921fa2..ca05b0b28 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -105,11 +105,11 @@ function execute() { * @return void **/ function all() { - $ds = 'default'; $ds = 'default'; if (isset($this->params['connection'])) { $ds = $this->params['connection']; } + $this->interactive = false; $controllers = $this->listAll($ds, false); foreach ($this->__tables as $table) { $model = $this->_modelName($table); @@ -547,6 +547,7 @@ function listAll($useDbConfig = 'default', $interactive = true) { } return $this->_controllerNames; } + return $this->__tables; } /** @@ -557,7 +558,7 @@ function listAll($useDbConfig = 'default', $interactive = true) { */ function getName() { $useDbConfig = 'default'; - $controllers = $this->listAll($useDbConfig, 'Controllers'); + $controllers = $this->listAll($useDbConfig); $enteredController = ''; while ($enteredController == '') { diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 4a334529b..baffcd724 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -86,6 +86,8 @@ function all() { $ds = $this->params['connection']; } $this->listAll($ds, false); + $this->interactive = false; + foreach ($this->__tables as $table) { $modelClass = Inflector::classify($table); $this->out(sprintf(__('Baking %s', true), $modelClass)); diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 83050228c..b85dac809 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -159,6 +159,7 @@ function all() { $ds = 'default'; $actions = $this->scaffoldActions; $tables = $this->Controller->listAll($ds, false); + $this->interactive = false; foreach ($tables as $table) { $model = $this->_modelName($table); $this->controllerName = $this->_controllerName($model); From b5cc69c37c454e4152c5b93fb4ee40448bea5a8c Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 28 Apr 2009 20:32:15 -0400 Subject: [PATCH 0126/2083] Adding Fixture task to bake. --- cake/console/libs/bake.php | 8 +- cake/console/libs/tasks/fixture.php | 139 ++++++++++++++++++++++++++++ 2 files changed, 145 insertions(+), 2 deletions(-) create mode 100644 cake/console/libs/tasks/fixture.php diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index f891ca2a4..1a21780e8 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -40,7 +40,7 @@ class BakeShell extends Shell { * @var array * @access public */ - var $tasks = array('Project', 'DbConfig', 'Model', 'Controller', 'View', 'Plugin', 'Test'); + var $tasks = array('Project', 'DbConfig', 'Model', 'Controller', 'View', 'Plugin', 'Fixture', 'Test'); /** * Override loadTasks() to handle paths * @@ -49,7 +49,7 @@ class BakeShell extends Shell { function loadTasks() { parent::loadTasks(); $task = Inflector::classify($this->command); - if (isset($this->{$task}) && !in_array($task, array('Project', 'DbConfig'))) { + if (isset($this->{$task}) && !in_array($task, array('Project', 'DbConfig', 'Fixture'))) { $path = Inflector::underscore(Inflector::pluralize($this->command)); $this->{$task}->path = $this->params['working'] . DS . $path . DS; if (!is_dir($this->{$task}->path)) { @@ -82,6 +82,7 @@ function main() { $this->out('[V]iew'); $this->out('[C]ontroller'); $this->out('[P]roject'); + $this->out('[F]ixture'); $this->out('[Q]uit'); $classToBake = strtoupper($this->in(__('What would you like to Bake?', true), array('D', 'M', 'V', 'C', 'P', 'Q'))); @@ -101,6 +102,9 @@ function main() { case 'P': $this->Project->execute(); break; + case 'F': + $this->Fixture->execute(); + break; case 'Q': exit(0); break; diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php new file mode 100644 index 000000000..051234385 --- /dev/null +++ b/cake/console/libs/tasks/fixture.php @@ -0,0 +1,139 @@ +<?php +/* SVN FILE: $Id$ */ +/** + * The FixtureTest handles creating and updating fixture files. + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2008, Cake Software Foundation, Inc. + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console.libs.tasks + * @since CakePHP(tm) v 1.3 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Task class for creating and updating fixtures files. + * + * @package cake + * @subpackage cake.cake.console.libs.tasks + */ +class FixtureTask extends Shell { +/** + * Name of plugin + * + * @var string + * @access public + */ + var $plugin = null; +/** + * Tasks to be loaded by this Task + * + * @var array + * @access public + */ + var $tasks = array('Model'); +/** + * path to fixtures directory + * + * @var string + * @access public + */ + var $path = null; +/** + * Override initialize + * + * @access public + */ + function initialize() { + $this->path = $this->params['working'] . DS . 'tests' . DS . 'fixtures' . DS; + } +/** + * Execution method always used for tasks + * + * @access public + */ + function execute() { + if (empty($this->args)) { + $this->__interactive(); + } + + if (isset($this->args[0])) { + if (strtolower($this->args[0]) == 'all') { + return $this->all(); + } + $controller = Inflector::camelize($this->args[0]); + $actions = null; + if (isset($this->args[1]) && $this->args[1] == 'scaffold') { + $this->out('Baking scaffold for ' . $controller); + $actions = $this->bakeActions($controller); + } else { + $actions = 'scaffold'; + } + if ($this->bake($controller, $actions)) { + if ($this->_checkUnitTest()) { + $this->bakeTest($controller); + } + } + } + } + +/** + * Bake All the Fixtures at once. Will only bake fixtures for models that exist. + * + * @access public + * @return void + **/ + function all() { + $ds = 'default'; + if (isset($this->params['connection'])) { + $ds = $this->params['connection']; + } + } + +/** + * Interactive baking function + * + * @access private + */ + function __interactive($modelName = false) { + + } + +/** + * Assembles and writes a Fixture file + * + * @return string Baked fixture + * @access private + */ + function bake() { + + } + +/** + * Displays help contents + * + * @access public + */ + function help() { + $this->hr(); + $this->out("Usage: cake bake fixture <arg1> <arg2>..."); + $this->hr(); + $this->out('Commands:'); + $this->out("\n\fixture <name>\n\t\tbakes fixture with specified name."); + $this->out("\n\fixture all\n\t\tbakes all fixtures."); + $this->out(""); + $this->_stop(); + } +} +?> From 802ed73c0a7a03c6dc5c53cd127f6f9f1f2f208b Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 28 Apr 2009 20:44:23 -0400 Subject: [PATCH 0127/2083] Adding getConfig() so other tasks can pick connections more easily. --- cake/console/libs/tasks/db_config.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cake/console/libs/tasks/db_config.php b/cake/console/libs/tasks/db_config.php index 8fa5f8c23..856b1226c 100644 --- a/cake/console/libs/tasks/db_config.php +++ b/cake/console/libs/tasks/db_config.php @@ -349,5 +349,25 @@ function bake($configs) { $filename = $this->path.'database.php'; return $this->createFile($filename, $out); } + +/** + * Get a user specified Connection name + * + * @return void + **/ + function getConfig() { + $useDbConfig = 'default'; + $configs = get_class_vars('DATABASE_CONFIG'); + + if (!is_array($configs)) { + return $this->execute(); + } + + $connections = array_keys($configs); + if (count($connections) > 1) { + $useDbConfig = $this->in(__('Use Database Config', true) .':', $connections, 'default'); + } + return $useDbConfig; + } } ?> \ No newline at end of file From 0b40e5c709ea16ae865574f32763a3a859bb9f94 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 28 Apr 2009 20:45:07 -0400 Subject: [PATCH 0128/2083] Refactoring out to use DbConfig::getConfig Continuing fixture bake --- cake/console/libs/tasks/fixture.php | 9 +++++++-- cake/console/libs/tasks/model.php | 14 ++------------ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 051234385..8ae1534f3 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -42,7 +42,7 @@ class FixtureTask extends Shell { * @var array * @access public */ - var $tasks = array('Model'); + var $tasks = array('DbConfig', 'Model'); /** * path to fixtures directory * @@ -107,7 +107,12 @@ function all() { * @access private */ function __interactive($modelName = false) { - + $this->interactive = true; + $this->hr(); + $this->out(sprintf("Bake Fixture\nPath: %s", $this->path)); + $this->hr(); + + $useDbConfig = $this->DbConfig->getConfig(); } /** diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index baffcd724..b8bfcb7d2 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -117,18 +117,8 @@ function __interactive() { $primaryKey = 'id'; $validate = array(); $associations = array('belongsTo'=> array(), 'hasOne'=> array(), 'hasMany' => array(), 'hasAndBelongsToMany'=> array()); - - $useDbConfig = 'default'; - $configs = get_class_vars('DATABASE_CONFIG'); - - if (!is_array($configs)) { - return $this->DbConfig->execute(); - } - - $connections = array_keys($configs); - if (count($connections) > 1) { - $useDbConfig = $this->in(__('Use Database Config', true) .':', $connections, 'default'); - } + + $useDbConfig = $this->DbConfig->getConfig(); $currentModelName = $this->getName($useDbConfig); $db =& ConnectionManager::getDataSource($useDbConfig); From d705e8943ab28839781483fa22974cadc3480806 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 28 Apr 2009 21:20:34 -0400 Subject: [PATCH 0129/2083] Refactoring table naming interaction into getTable() --- cake/console/libs/tasks/model.php | 52 +++++++++++++++---------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index b8bfcb7d2..d4e19f96d 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -119,33 +119,10 @@ function __interactive() { $associations = array('belongsTo'=> array(), 'hasOne'=> array(), 'hasMany' => array(), 'hasAndBelongsToMany'=> array()); $useDbConfig = $this->DbConfig->getConfig(); - $currentModelName = $this->getName($useDbConfig); + $useTable = $this->getTable($currentModelName, $useDbConfig); $db =& ConnectionManager::getDataSource($useDbConfig); - $useTable = Inflector::tableize($currentModelName); - $fullTableName = $db->fullTableName($useTable, false); - $tableIsGood = false; - - if (array_search($useTable, $this->__tables) === false) { - $this->out(''); - $this->out(sprintf(__("Given your model named '%s', Cake would expect a database table named %s", true), $currentModelName, $fullTableName)); - $tableIsGood = $this->in(__('Do you want to use this table?', true), array('y','n'), 'y'); - } - - if (low($tableIsGood) == 'n' || low($tableIsGood) == 'no') { - $useTable = $this->in(__('What is the name of the table (enter "null" to use NO table)?', true)); - } - - while ($tableIsGood == false && low($useTable) != 'null') { - if (is_array($this->__tables) && !in_array($useTable, $this->__tables)) { - $fullTableName = $db->fullTableName($useTable, false); - $this->out($fullTableName . ' does not exist.'); - $useTable = $this->in(__('What is the name of the table (enter "null" to use NO table)?', true)); - $tableIsGood = false; - } else { - $tableIsGood = true; - } - } + $fullTableName = $db->fullTableName($useTable); $wannaDoValidation = $this->in(__('Would you like to supply validation criteria for the fields in your model?', true), array('y','n'), 'y'); @@ -794,6 +771,29 @@ function listAll($useDbConfig = 'default', $interactive = true) { } } } +/** + * Interact with the user to determine the table name of a particular model + * + * @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) { + $db =& ConnectionManager::getDataSource($useDbConfig); + $useTable = Inflector::tableize($modelName); + $fullTableName = $db->fullTableName($useTable, false); + $tableIsGood = false; + + if (array_search($useTable, $this->__tables) === false) { + $this->out(''); + $this->out(sprintf(__("Given your model named '%s', Cake would expect a database table named '%s'", true), $modelName, $fullTableName)); + $tableIsGood = $this->in(__('Do you want to use this table?', true), array('y','n'), 'y'); + } + if (low($tableIsGood) == 'n' || low($tableIsGood) == 'no') { + $useTable = $this->in(__('What is the name of the table (enter "null" to use NO table)?', true)); + } + return $useTable; + } /** * Forces the user to specify the model he wants to bake, and returns the selected model name. * @@ -818,13 +818,11 @@ function getName($useDbConfig) { $enteredModel = ''; } } - if (intval($enteredModel) > 0 && intval($enteredModel) <= count($this->_modelNames)) { $currentModelName = $this->_modelNames[intval($enteredModel) - 1]; } else { $currentModelName = $enteredModel; } - return $currentModelName; } /** From 0b2232d05a1daf2630e8d30c2022c278053fa8b9 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 29 Apr 2009 20:52:12 -0400 Subject: [PATCH 0130/2083] Updating fixture task. Refactored methods. Multiple rows can now be generated. --- cake/console/libs/tasks/fixture.php | 189 +++++++++++++++++++++++++--- 1 file changed, 174 insertions(+), 15 deletions(-) diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 8ae1534f3..f28193b82 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -57,6 +57,9 @@ class FixtureTask extends Shell { */ function initialize() { $this->path = $this->params['working'] . DS . 'tests' . DS . 'fixtures' . DS; + if (!class_exists('CakeSchema')) { + App::import('Model', 'Schema'); + } } /** * Execution method always used for tasks @@ -72,19 +75,7 @@ function execute() { if (strtolower($this->args[0]) == 'all') { return $this->all(); } - $controller = Inflector::camelize($this->args[0]); - $actions = null; - if (isset($this->args[1]) && $this->args[1] == 'scaffold') { - $this->out('Baking scaffold for ' . $controller); - $actions = $this->bakeActions($controller); - } else { - $actions = 'scaffold'; - } - if ($this->bake($controller, $actions)) { - if ($this->_checkUnitTest()) { - $this->bakeTest($controller); - } - } + $model = Inflector::camelize($this->args[0]); } } @@ -113,16 +104,184 @@ function __interactive($modelName = false) { $this->hr(); $useDbConfig = $this->DbConfig->getConfig(); + $modelName = $this->Model->getName($useDbConfig); + $useTable = $this->Model->getTable($modelName, $useDbConfig); + $importOptions = $this->importOptions($modelName); + $this->bake($modelName, $useTable, $importOptions); + } +/** + * Interacts with the User to setup an array of import options. For a fixture. + * + * @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?', array('y', 'n'), 'n'); + if ($doSchema == 'y') { + $options['schema'] = $modelName; + } + $doRecords = $this->in('Would you like to import records for this fixture?', array('y', 'n'), 'n'); + if ($doRecords == 'y') { + $options['records'] = true; + } + return $options; } /** * Assembles and writes a Fixture file * + * @param string $model Name of model to bake. + * @param string $useTable Name of table to use. + * @param array $importOptions Options for var $import * @return string Baked fixture * @access private */ - function bake() { - + function bake($model, $useTable = false, $importOptions = array()) { + $out = "\nclass {$model}Fixture extends CakeTestFixture {\n"; + $out .= "\tvar \$name = '$model';\n"; + + if (!$useTable) { + $useTable = Inflector::tableize($model); + } elseif ($useTable != Inflector::tableize($model)) { + $out .= "\tvar \$table = '$useTable';\n"; + } + + $modelImport = $recordImport = null; + if (!empty($importOptions)) { + if (isset($importOptions['schema'])) { + $modelImport = "'model' => '{$importOptions['schema']}'"; + } + if (isset($importOptions['records'])) { + $recordImport = ", 'records' => true"; + } + $out .= sprintf("\tvar \$import = array(%s%s);\n", $modelImport, $recordImport); + } + + $this->_Schema = new CakeSchema(); + $data = $this->_Schema->read(array('models' => false)); + + if (!isset($data['tables'][$useTable])) { + $this->err('Could not find your selected table ' . $useTable); + return false; + } + + $tableInfo = $data['tables'][$useTable]; + if (is_null($modelImport)) { + $out .= $this->_generateSchema($tableInfo); + } + + if (is_null($recordImport)) { + $recordCount = 1; + if (isset($this->params['count'])) { + $recordCount = $this->params['count']; + } + $out .= $this->_generateRecords($tableInfo, $recordCount); + } + $out .= "}\n"; + + $path = TESTS . DS . 'fixtures' . DS; + if (isset($this->plugin)) { + $pluginPath = 'plugins' . DS . Inflector::underscore($this->plugin) . DS; + $path = APP . $pluginPath . 'tests' . DS . 'fixtures' . DS; + } + $filename = Inflector::underscore($model).'_fixture.php'; + $header = '$Id'; + $content = "<?php \n/* SVN FILE: $header$ */\n/* ". $model ." Fixture generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n{$out}?>"; + $this->out("\nBaking test fixture for $model..."); + $this->createFile($path . $filename, $content); + } + +/** + * Generates a string representation of a schema. + * + * @param array $table Table schema array + * @return string fields definitions + **/ + function _generateSchema($tableInfo) { + $cols = array(); + $out = "\n\tvar \$fields = array(\n"; + foreach ($tableInfo as $field => $fieldInfo) { + if (is_array($fieldInfo)) { + if ($field != 'indexes') { + $col = "\t\t'{$field}' => array('type'=>'" . $fieldInfo['type'] . "', "; + $col .= join(', ', $this->_Schema->__values($fieldInfo)); + } else { + $col = "\t\t'indexes' => array("; + $props = array(); + foreach ((array)$fieldInfo as $key => $index) { + $props[] = "'{$key}' => array(".join(', ', $this->_Schema->__values($index)).")"; + } + $col .= join(', ', $props); + } + $col .= ")"; + $cols[] = $col; + } + } + $out .= join(",\n", $cols); + $out .= "\n\t);\n"; + return $out; + } + +/** + * Generate String representation of Records + * + * @param array $table Table schema array + * @return string + **/ + function _generateRecords($tableInfo, $recordCount = 1) { + $out = "\t\$records = array(\n"; + + for ($i = 0; $i < $recordCount; $i++) { + $records = array(); + foreach ($tableInfo as $field => $fieldInfo) { + if (empty($fieldInfo['type'])) { + continue; + } + switch ($fieldInfo['type']) { + case 'integer': + $insert = $i + 1; + break; + case 'string'; + $insert = "Lorem ipsum dolor sit amet"; + if (!empty($fieldInfo['length'])) { + $insert = substr($insert, 0, (int)$value['length'] - 2); + } + $insert = "'$insert'"; + break; + case 'datetime': + $ts = date('Y-m-d H:i:s'); + $insert = "'$ts'"; + break; + case 'date': + $ts = date('Y-m-d'); + $insert = "'$ts'"; + break; + case 'time': + $ts = date('H:i:s'); + $insert = "'$ts'"; + break; + case 'boolean': + $insert = 1; + break; + case 'text': + $insert = "'Lorem ipsum dolor sit amet, aliquet feugiat."; + $insert .= " Convallis morbi fringilla gravida,"; + $insert .= " phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin"; + $insert .= " venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla"; + $insert .= " vestibulum massa neque ut et, id hendrerit sit,"; + $insert .= " feugiat in taciti enim proin nibh, tempor dignissim, rhoncus"; + $insert .= " duis vestibulum nunc mattis convallis.'"; + break; + } + $records[] = "\t\t\t'$field' => $insert"; + } + $out .= "\t\tarray(\n"; + $out .= implode(",\n", $records); + $out .= "\n\t\t),\n"; + } + $out .= "\t);\n"; + return $out; } /** From f992406501e78df94487152d46bded282ee9b644 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 29 Apr 2009 21:18:08 -0400 Subject: [PATCH 0131/2083] Removing fixture generation from ModelTask --- cake/console/libs/tasks/model.php | 220 ++++++++---------------------- 1 file changed, 55 insertions(+), 165 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index d4e19f96d..ff9910b0b 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -52,7 +52,7 @@ class ModelTask extends Shell { * @var array * @access public */ - var $tasks = array('DbConfig'); + var $tasks = array('DbConfig', 'Fixture'); /** * Execution method always used for tasks * @@ -673,67 +673,61 @@ function bake($name, $associations = array(), $validate = array(), $primaryKey * @access private */ function bakeTest($className, $useTable = null, $associations = array()) { - $results = $this->fixture($className, $useTable); + $this->fixture($className, $useTable); - if ($results) { - $fixtureInc = 'app'; - if ($this->plugin) { - $fixtureInc = 'plugin.'.Inflector::underscore($this->plugin); - } + $fixtureInc = 'app'; + if ($this->plugin) { + $fixtureInc = 'plugin.'.Inflector::underscore($this->plugin); + } - $fixture[] = "'{$fixtureInc}." . Inflector::underscore($className) ."'"; + $fixture[] = "'{$fixtureInc}." . Inflector::underscore($className) ."'"; - if (!empty($associations)) { - $assoc[] = Set::extract($associations, 'belongsTo.{n}.className'); - $assoc[] = Set::extract($associations, 'hasOne.{n}.className'); - $assoc[] = Set::extract($associations, 'hasMany.{n}.className'); - foreach ($assoc as $key => $value) { - if (is_array($value)) { - foreach ($value as $class) { - $fixture[] = "'{$fixtureInc}." . Inflector::underscore($class) ."'"; - } + if (!empty($associations)) { + $assoc[] = Set::extract($associations, 'belongsTo.{n}.className'); + $assoc[] = Set::extract($associations, 'hasOne.{n}.className'); + $assoc[] = Set::extract($associations, 'hasMany.{n}.className'); + foreach ($assoc as $key => $value) { + if (is_array($value)) { + foreach ($value as $class) { + $fixture[] = "'{$fixtureInc}." . Inflector::underscore($class) ."'"; } } } - $fixture = join(", ", $fixture); - - $import = $className; - if (isset($this->plugin)) { - $import = $this->plugin . '.' . $className; - } - - $out = "App::import('Model', '$import');\n\n"; - $out .= "class {$className}TestCase extends CakeTestCase {\n"; - $out .= "\tvar \${$className} = null;\n"; - $out .= "\tvar \$fixtures = array($fixture);\n\n"; - $out .= "\tfunction startTest() {\n"; - $out .= "\t\t\$this->{$className} =& ClassRegistry::init('{$className}');\n"; - $out .= "\t}\n\n"; - $out .= "\tfunction test{$className}Instance() {\n"; - $out .= "\t\t\$this->assertTrue(is_a(\$this->{$className}, '{$className}'));\n"; - $out .= "\t}\n\n"; - $out .= "\tfunction test{$className}Find() {\n"; - $out .= "\t\t\$this->{$className}->recursive = -1;\n"; - $out .= "\t\t\$results = \$this->{$className}->find('first');\n\t\t\$this->assertTrue(!empty(\$results));\n\n"; - $out .= "\t\t\$expected = array('$className' => array(\n$results\n\t\t));\n"; - $out .= "\t\t\$this->assertEqual(\$results, \$expected);\n"; - $out .= "\t}\n"; - $out .= "}\n"; - - $path = MODEL_TESTS; - if (isset($this->plugin)) { - $pluginPath = 'plugins' . DS . Inflector::underscore($this->plugin) . DS; - $path = APP . $pluginPath . 'tests' . DS . 'cases' . DS . 'models' . DS; - } - - $filename = Inflector::underscore($className).'.test.php'; - $this->out("\nBaking unit test for $className..."); - - $header = '$Id'; - $content = "<?php \n/* SVN FILE: $header$ */\n/* ". $className ." Test cases generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n{$out}?>"; - return $this->createFile($path . $filename, $content); - } - return false; + } + $fixture = join(", ", $fixture); + + $import = $className; + if (isset($this->plugin)) { + $import = $this->plugin . '.' . $className; + } + + $out = "App::import('Model', '$import');\n\n"; + $out .= "class {$className}TestCase extends CakeTestCase {\n"; + $out .= "\tvar \${$className} = null;\n"; + $out .= "\tvar \$fixtures = array($fixture);\n\n"; + $out .= "\tfunction startTest() {\n"; + $out .= "\t\t\$this->{$className} =& ClassRegistry::init('{$className}');\n"; + $out .= "\t}\n\n"; + $out .= "\tfunction endTest() {\n"; + $out .= "\t\tunset(\$this->{$className});\n"; + $out .= "\t}\n\n"; + $out .= "\tfunction test{$className}Instance() {\n"; + $out .= "\t\t\$this->assertTrue(is_a(\$this->{$className}, '{$className}'));\n"; + $out .= "\t}\n\n"; + $out .= "}\n"; + + $path = MODEL_TESTS; + if (isset($this->plugin)) { + $pluginPath = 'plugins' . DS . Inflector::underscore($this->plugin) . DS; + $path = APP . $pluginPath . 'tests' . DS . 'cases' . DS . 'models' . DS; + } + + $filename = Inflector::underscore($className).'.test.php'; + $this->out("\nBaking unit test for $className..."); + + $header = '$Id'; + $content = "<?php \n/* SVN FILE: $header$ */\n/* ". $className ." Test cases generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n{$out}?>"; + return $this->createFile($path . $filename, $content); } /** * outputs the a list of possible models or controllers from database @@ -842,116 +836,12 @@ function help() { $this->_stop(); } /** - * Builds the tests fixtures for the model and create the file + * Interact with FixtureTask to automatically bake fixtures when baking models. * - * @param string $model the name of the model - * @param string $useTable table name - * @return array $records, used in ModelTask::bakeTest() to create $expected - * @todo move this to a task - */ - function fixture($model, $useTable = null) { - if (!class_exists('CakeSchema')) { - App::import('Model', 'Schema'); - } - $out = "\nclass {$model}Fixture extends CakeTestFixture {\n"; - $out .= "\tvar \$name = '$model';\n"; - - if (!$useTable) { - $useTable = Inflector::tableize($model); - } else { - $out .= "\tvar \$table = '$useTable';\n"; - } - $schema = new CakeSchema(); - $data = $schema->read(array('models' => false)); - - if (!isset($data['tables'][$useTable])) { - return false; - } - $tables[$model] = $data['tables'][$useTable]; - - foreach ($tables as $table => $fields) { - if (!is_numeric($table) && $table !== 'missing') { - $out .= "\tvar \$fields = array(\n"; - $records = array(); - if (is_array($fields)) { - $cols = array(); - foreach ($fields as $field => $value) { - if ($field != 'indexes') { - if (is_string($value)) { - $type = $value; - $value = array('type'=> $type); - } - $col = "\t\t'{$field}' => array('type'=>'" . $value['type'] . "', "; - - switch ($value['type']) { - case 'integer': - $insert = 1; - break; - case 'string'; - $insert = "Lorem ipsum dolor sit amet"; - if (!empty($value['length'])) { - $insert = substr($insert, 0, (int)$value['length'] - 2); - } - $insert = "'$insert'"; - break; - case 'datetime': - $ts = date('Y-m-d H:i:s'); - $insert = "'$ts'"; - break; - case 'date': - $ts = date('Y-m-d'); - $insert = "'$ts'"; - break; - case 'time': - $ts = date('H:i:s'); - $insert = "'$ts'"; - break; - case 'boolean': - $insert = 1; - break; - case 'text': - $insert = - "'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida,"; - $insert .= "phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam,"; - $insert .= "vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit,"; - $insert .= "feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.'"; - break; - } - $records[] = "\t\t'$field' => $insert"; - unset($value['type']); - $col .= join(', ', $schema->__values($value)); - } else { - $col = "\t\t'indexes' => array("; - $props = array(); - foreach ((array)$value as $key => $index) { - $props[] = "'{$key}' => array(".join(', ', $schema->__values($index)).")"; - } - $col .= join(', ', $props); - } - $col .= ")"; - $cols[] = $col; - } - $out .= join(",\n", $cols); - } - $out .= "\n\t);\n"; - } - } - $records = join(",\n", $records); - $out .= "\tvar \$records = array(array(\n$records\n\t));\n"; - $out .= "}\n"; - $path = TESTS . DS . 'fixtures' . DS; - if (isset($this->plugin)) { - $pluginPath = 'plugins' . DS . Inflector::underscore($this->plugin) . DS; - $path = APP . $pluginPath . 'tests' . DS . 'fixtures' . DS; - } - $filename = Inflector::underscore($model).'_fixture.php'; - $header = '$Id'; - $content = "<?php \n/* SVN FILE: $header$ */\n/* ". $model ." Fixture generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n{$out}?>"; - $this->out("\nBaking test fixture for $model..."); - if ($this->createFile($path . $filename, $content)) { - return str_replace("\t\t", "\t\t\t", $records); - } - return false; + * @return null. + **/ + function fixture($className, $useTable = null) { + $this->Fixture->bake($className, $useTable); } } ?> \ No newline at end of file From aad2bd702dca4b538c2f6defdf63cad4ec19377a Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 29 Apr 2009 22:17:08 -0400 Subject: [PATCH 0132/2083] Adding test case for Model Task --- .../cases/console/libs/tasks/model.test.php | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 cake/tests/cases/console/libs/tasks/model.test.php diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php new file mode 100644 index 000000000..b9557d809 --- /dev/null +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -0,0 +1,123 @@ +<?php +/* SVN FILE: $Id$ */ +/** + * TestTaskTest file + * + * Test Case for test generation shell task + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2006-2008, Cake Software Foundation, Inc. + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @package cake + * @subpackage cake.tests.cases.console.libs.tasks + * @since CakePHP v 1.2.0.7726 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +App::import('Core', 'Shell'); + +if (!defined('DISABLE_AUTO_DISPATCH')) { + define('DISABLE_AUTO_DISPATCH', true); +} + +if (!class_exists('ShellDispatcher')) { + ob_start(); + $argv = false; + require CAKE . 'console' . DS . 'cake.php'; + ob_end_clean(); +} + +if (!class_exists('ModelTask')) { + require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'model.php'; +} + +Mock::generatePartial( + 'ShellDispatcher', 'TestModelTaskMockShellDispatcher', + array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment') +); + +Mock::generatePartial( + 'ModelTask', 'MockModelTask', + array('in', 'out', 'err', 'createFile', '_stop') +); +/** + * ModelTaskTest class + * + * @package cake + * @subpackage cake.tests.cases.console.libs.tasks + */ +class ModelTaskTest extends CakeTestCase { + + var $fixtures = array('core.article', 'core.comment'); +/** + * setUp method + * + * @return void + * @access public + */ + function startTest() { + $this->Dispatcher =& new TestModelTaskMockShellDispatcher(); + $this->Task =& new MockModelTask($this->Dispatcher); + $this->Task->Dispatch = new $this->Dispatcher; + } +/** + * tearDown method + * + * @return void + * @access public + */ + function endTest() { + unset($this->Task, $this->Dispatcher); + ClassRegistry::flush(); + } +/** + * Test that listAll scans the database connection and lists all the tables in it.s + * + * @return void + **/ + function testListAll() { + $this->Task->expectCallCount('out', 3); + $this->Task->expectAt(1, 'out', array('1. Article')); + $this->Task->expectAt(2, 'out', array('2. Comment')); + $this->Task->listAll('test_suite'); + } + +/** + * Test that listAll scans the database connection and lists all the tables in it.s + * + * @return void + **/ + function testGetName() { + $this->Task->setReturnValue('in', 1); + + //test quit. + $this->Task->setReturnValueAt(0, 'in', 'q'); + $this->Task->expectOnce('_stop'); + $this->Task->getName('test_suite'); + + $this->Task->setReturnValueAt(1, 'in', 1); + $result = $this->Task->getName('test_suite'); + $expected = 'Article'; + $this->assertEqual($result, $expected); + + $this->Task->setReturnValueAt(2, 'in', 2); + $result = $this->Task->getName('test_suite'); + $expected = 'Comment'; + $this->assertEqual($result, $expected); + + $this->Task->setReturnValueAt(3, 'in', 10); + $result = $this->Task->getName('test_suite'); + $this->Task->expectOnce('err'); + } +} +?> \ No newline at end of file From 80287223f18b7963bbd2cec9d321222cc483c16c Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 29 Apr 2009 22:25:42 -0400 Subject: [PATCH 0133/2083] Additional Test for ModelTask --- cake/console/libs/tasks/model.php | 6 +++++ .../cases/console/libs/tasks/model.test.php | 23 ++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index ff9910b0b..df5021749 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -53,6 +53,12 @@ class ModelTask extends Shell { * @access public */ var $tasks = array('DbConfig', 'Fixture'); +/** + * Holds tables found on connection. + * + * @var array + **/ + var $__tables = array(); /** * Execution method always used for tasks * diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index b9557d809..c3fe80066 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -100,7 +100,6 @@ function testListAll() { function testGetName() { $this->Task->setReturnValue('in', 1); - //test quit. $this->Task->setReturnValueAt(0, 'in', 'q'); $this->Task->expectOnce('_stop'); $this->Task->getName('test_suite'); @@ -109,15 +108,33 @@ function testGetName() { $result = $this->Task->getName('test_suite'); $expected = 'Article'; $this->assertEqual($result, $expected); - + $this->Task->setReturnValueAt(2, 'in', 2); $result = $this->Task->getName('test_suite'); $expected = 'Comment'; $this->assertEqual($result, $expected); - + $this->Task->setReturnValueAt(3, 'in', 10); $result = $this->Task->getName('test_suite'); $this->Task->expectOnce('err'); } + +/** + * Test table name interactions + * + * @return void + **/ + function testGetTableName() { + $this->Task->setReturnValueAt(0, 'in', 'y'); + $result = $this->Task->getTable('Article', 'test_suite'); + $expected = 'articles'; + $this->assertEqual($result, $expected); + + $this->Task->setReturnValueAt(1, 'in', 'n'); + $this->Task->setReturnValueAt(2, 'in', 'my_table'); + $result = $this->Task->getTable('Article', 'test_suite'); + $expected = 'my_table'; + $this->assertEqual($result, $expected); + } } ?> \ No newline at end of file From 2b87be1d7c0d322ea4cce4f2b324d94668221e5a Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 29 Apr 2009 22:40:49 -0400 Subject: [PATCH 0134/2083] Updating FixtureTask help Adding test case for FixtureTask --- cake/console/libs/tasks/fixture.php | 7 +- .../cases/console/libs/tasks/fixture.test.php | 121 ++++++++++++++++++ .../cases/console/libs/tasks/model.test.php | 6 +- 3 files changed, 130 insertions(+), 4 deletions(-) create mode 100644 cake/tests/cases/console/libs/tasks/fixture.test.php diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index f28193b82..cd9b8b33b 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -291,11 +291,12 @@ function _generateRecords($tableInfo, $recordCount = 1) { */ function help() { $this->hr(); - $this->out("Usage: cake bake fixture <arg1> <arg2>..."); + $this->out("Usage: cake bake fixture <arg1> <params>"); $this->hr(); $this->out('Commands:'); - $this->out("\n\fixture <name>\n\t\tbakes fixture with specified name."); - $this->out("\n\fixture all\n\t\tbakes all fixtures."); + $this->out("\nfixture <name>\n\tbakes fixture with specified name."); + $this->out("\nfixture -count <n>\n\tbakes fixture with <n> records."); + $this->out("\nfixture all\n\tbakes all fixtures."); $this->out(""); $this->_stop(); } diff --git a/cake/tests/cases/console/libs/tasks/fixture.test.php b/cake/tests/cases/console/libs/tasks/fixture.test.php new file mode 100644 index 000000000..60abb371e --- /dev/null +++ b/cake/tests/cases/console/libs/tasks/fixture.test.php @@ -0,0 +1,121 @@ +<?php +/* SVN FILE: $Id$ */ +/** + * TestTaskTest file + * + * Test Case for test generation shell task + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2006-2008, Cake Software Foundation, Inc. + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @package cake + * @subpackage cake.tests.cases.console.libs.tasks + * @since CakePHP v 1.2.0.7726 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +App::import('Core', 'Shell'); + +if (!defined('DISABLE_AUTO_DISPATCH')) { + define('DISABLE_AUTO_DISPATCH', true); +} + +if (!class_exists('ShellDispatcher')) { + ob_start(); + $argv = false; + require CAKE . 'console' . DS . 'cake.php'; + ob_end_clean(); +} + +if (!class_exists('FixtureTask')) { + require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'fixture.php'; +} + +Mock::generatePartial( + 'ShellDispatcher', 'TestFixtureTaskMockShellDispatcher', + array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment') +); + +Mock::generatePartial( + 'FixtureTask', 'MockFixtureTask', + array('in', 'out', 'err', 'createFile', '_stop') +); +/** + * FixtureTaskTest class + * + * @package cake + * @subpackage cake.tests.cases.console.libs.tasks + */ +class FixtureTaskTest extends CakeTestCase { +/** + * fixtures + * + * @var array + **/ + var $fixtures = array('core.article', 'core.comment'); +/** + * setUp method + * + * @return void + * @access public + */ + function startTest() { + $this->Dispatcher =& new TestFixtureTaskMockShellDispatcher(); + $this->Task =& new MockFixtureTask($this->Dispatcher); + $this->Task->Dispatch = new $this->Dispatcher; + } +/** + * tearDown method + * + * @return void + * @access public + */ + function endTest() { + unset($this->Task, $this->Dispatcher); + ClassRegistry::flush(); + } +/** + * test that initialize sets the path + * + * @return void + **/ + function testInitialize() { + $this->Task->params['working'] = '/my/path'; + $this->Task->initialize(); + + $expected = '/my/path/tests/fixtures/'; + $this->assertEqual($this->Task->path, $expected); + } +/** + * test import option array generation + * + * @return void + **/ + function testImportOptions() { + $this->Task->setReturnValueAt(0, 'in', 'y'); + $this->Task->setReturnValueAt(1, 'in', 'y'); + + $result = $this->Task->importOptions('Article'); + $expected = array('schema' => 'Article', 'records' => true); + $this->assertEqual($result, $expected); + + $this->Task->setReturnValueAt(2, 'in', 'n'); + $this->Task->setReturnValueAt(3, 'in', 'n'); + + $result = $this->Task->importOptions('Article'); + $expected = array(); + $this->assertEqual($result, $expected); + } + +} +?> \ No newline at end of file diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index c3fe80066..5f6a35e01 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -57,7 +57,11 @@ * @subpackage cake.tests.cases.console.libs.tasks */ class ModelTaskTest extends CakeTestCase { - +/** + * fixtures + * + * @var array + **/ var $fixtures = array('core.article', 'core.comment'); /** * setUp method From d3fe3d59593f63e97624baee5873e1b44695fdf5 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 29 Apr 2009 22:42:11 -0400 Subject: [PATCH 0135/2083] Adding fixture <name> baking --- cake/console/libs/tasks/fixture.php | 1 + 1 file changed, 1 insertion(+) diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index cd9b8b33b..fa307a7f7 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -76,6 +76,7 @@ function execute() { return $this->all(); } $model = Inflector::camelize($this->args[0]); + return $this->bake($model); } } From 40ebdf8aac62eab983c22f3d001c547d24e8bbee Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 29 Apr 2009 22:50:43 -0400 Subject: [PATCH 0136/2083] Adding fixture all command. Fixing errors with maxlength and timestamp fields Adding return for ModelTask::listAll() --- cake/console/libs/tasks/fixture.php | 12 +++++++++++- cake/console/libs/tasks/model.php | 1 + cake/tests/cases/console/libs/tasks/model.test.php | 6 +++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index fa307a7f7..a9f5b8054 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -91,6 +91,12 @@ function all() { if (isset($this->params['connection'])) { $ds = $this->params['connection']; } + $this->interactive = false; + $tables = $this->Model->listAll($ds, false); + foreach ($tables as $table) { + $model = $this->_modelName($table); + $this->bake($model); + } } /** @@ -246,10 +252,14 @@ function _generateRecords($tableInfo, $recordCount = 1) { case 'string'; $insert = "Lorem ipsum dolor sit amet"; if (!empty($fieldInfo['length'])) { - $insert = substr($insert, 0, (int)$value['length'] - 2); + $insert = substr($insert, 0, (int)$fieldInfo['length'] - 2); } $insert = "'$insert'"; break; + case 'timestamp': + $ts = time(); + $insert = "'$ts'"; + break; case 'datetime': $ts = date('Y-m-d H:i:s'); $insert = "'$ts'"; diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index df5021749..bcb38a01a 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -770,6 +770,7 @@ function listAll($useDbConfig = 'default', $interactive = true) { $this->out($i + 1 . ". " . $this->_modelNames[$i]); } } + return $this->__tables; } /** * Interact with the user to determine the table name of a particular model diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index 5f6a35e01..954c5f2ad 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -74,6 +74,7 @@ function startTest() { $this->Task =& new MockModelTask($this->Dispatcher); $this->Task->Dispatch = new $this->Dispatcher; } + /** * tearDown method * @@ -84,6 +85,7 @@ function endTest() { unset($this->Task, $this->Dispatcher); ClassRegistry::flush(); } + /** * Test that listAll scans the database connection and lists all the tables in it.s * @@ -93,7 +95,9 @@ function testListAll() { $this->Task->expectCallCount('out', 3); $this->Task->expectAt(1, 'out', array('1. Article')); $this->Task->expectAt(2, 'out', array('2. Comment')); - $this->Task->listAll('test_suite'); + $result = $this->Task->listAll('test_suite'); + $expected = array('articles', 'comments'); + $this->assertEqual($result, $expected); } /** From 1cc3a6ecfb9e882a53384fe3f16776c5050b08fc Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 29 Apr 2009 22:50:57 -0400 Subject: [PATCH 0137/2083] Removing unused variable. --- cake/console/libs/tasks/controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index ca05b0b28..ec69bb21f 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -110,7 +110,7 @@ function all() { $ds = $this->params['connection']; } $this->interactive = false; - $controllers = $this->listAll($ds, false); + $this->listAll($ds, false); foreach ($this->__tables as $table) { $model = $this->_modelName($table); $controller = $this->_controllerName($model); From 4b89dd2209a7a5ee9c5833ce15f0c31351a12497 Mon Sep 17 00:00:00 2001 From: davidpersson <davidpersson@gmx.de> Date: Thu, 30 Apr 2009 19:25:58 +0200 Subject: [PATCH 0138/2083] Refactoring ShellDispatcher::dispatch Updating dispatch method to use is_a fixes #5318 Adding _getShell method to ease testing Updating status code handling in the constructor Adding and updating tests --- cake/console/cake.php | 229 +++++++++------- cake/tests/cases/console/cake.test.php | 350 ++++++++++++++++++++++++- 2 files changed, 471 insertions(+), 108 deletions(-) diff --git a/cake/console/cake.php b/cake/console/cake.php index 0866d53b6..22683ad8b 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -120,15 +120,21 @@ function ShellDispatcher($args = array()) { /** * Constructor * - * @param array $args the argv. + * The execution of the script is stopped after dispatching the request with + * a status code of either 0 or 1 according to the result of the dispatch. + * + * @param array $args the argv + * @return void + * @access public */ function __construct($args = array()) { set_time_limit(0); + $this->__initConstants(); $this->parseParams($args); $this->_initEnvironment(); $this->__buildPaths(); - $this->_stop($this->dispatch()); + $this->_stop($this->dispatch() === false ? 1 : 0); } /** * Defines core configuration. @@ -269,118 +275,145 @@ function __bootstrap() { /** * Dispatches a CLI request * + * @return boolean * @access public */ function dispatch() { - if (isset($this->args[0])) { + if (!$arg = array_shift($this->args)) { + $this->help(); + return false; + } + if ($arg == 'help') { + $this->help(); + return true; + } + + if (strpos($arg, '.') !== false) { + list($plugin, $shell) = explode('.', $arg); + } else { $plugin = null; - $shell = $this->args[0]; - if (strpos($shell, '.') !== false) { - list($plugin, $shell) = explode('.', $this->args[0]); + $shell = $arg; + } + $this->shell = $shell; + $this->shellName = Inflector::camelize($shell); + $this->shellClass = $this->shellName . 'Shell'; + + if ($arg = array_shift($this->args)) { + $this->shellCommand = Inflector::variable($arg); + } + + $Shell = $this->_getShell($plugin); + + if (!$Shell) { + $message = sprintf(__('Class `%s` could not be loaded', true), $this->shellClass); + $this->stderr($message . "\n"); + return false; + } + + if (is_a($Shell, 'Shell')) { + $Shell->initialize(); + $Shell->loadTasks(); + + foreach ($Shell->taskNames as $task) { + if (is_a($Shell->{$task}, 'Shell')) { + $Shell->{$task}->initialize(); + $Shell->{$task}->loadTasks(); + } } - $this->shell = $shell; - $this->shiftArgs(); - $this->shellName = Inflector::camelize($this->shell); - $this->shellClass = $this->shellName . 'Shell'; + $task = Inflector::camelize($this->shellCommand); - if ($this->shell === 'help') { - $this->help(); - } else { - $loaded = false; - foreach ($this->shellPaths as $path) { - $this->shellPath = $path . $this->shell . '.php'; - - $isPlugin = ($plugin && strpos($path, DS . $plugin . DS . 'vendors' . DS . 'shells' . DS) !== false); - if (($isPlugin && file_exists($this->shellPath)) || (!$plugin && file_exists($this->shellPath))) { - $loaded = true; - break; + if (in_array($task, $Shell->taskNames)) { + $this->shiftArgs(); + $Shell->{$task}->startup(); + + if (isset($this->args[0]) && $this->args[0] == 'help') { + if (method_exists($Shell->{$task}, 'help')) { + $Shell->{$task}->help(); + } else { + $this->help(); } + return true; } + return $Shell->{$task}->execute(); + } - if ($loaded) { - if (!class_exists('Shell')) { - require CONSOLE_LIBS . 'shell.php'; - } - require $this->shellPath; - if (class_exists($this->shellClass)) { - $command = null; - if (isset($this->args[0])) { - $command = $this->args[0]; - } - $this->shellCommand = Inflector::variable($command); - $shell = new $this->shellClass($this); - - if (strtolower(get_parent_class($shell)) == 'shell') { - $shell->initialize(); - $shell->loadTasks(); - - foreach ($shell->taskNames as $task) { - if (strtolower(get_parent_class($shell)) == 'shell') { - $shell->{$task}->initialize(); - $shell->{$task}->loadTasks(); - } - } - - $task = Inflector::camelize($command); - if (in_array($task, $shell->taskNames)) { - $this->shiftArgs(); - $shell->{$task}->startup(); - if (isset($this->args[0]) && $this->args[0] == 'help') { - if (method_exists($shell->{$task}, 'help')) { - $shell->{$task}->help(); - $this->_stop(); - } else { - $this->help(); - } - } - return $shell->{$task}->execute(); - } - } + } - $classMethods = get_class_methods($shell); + $classMethods = get_class_methods($Shell); - $privateMethod = $missingCommand = false; - if ((in_array($command, $classMethods) || in_array(strtolower($command), $classMethods)) && strpos($command, '_', 0) === 0) { - $privateMethod = true; - } + $privateMethod = $missingCommand = false; + if ((in_array($arg, $classMethods) || in_array(strtolower($arg), $classMethods)) + && $arg[0] == '_') { + $privateMethod = true; + } - if (!in_array($command, $classMethods) && !in_array(strtolower($command), $classMethods)) { - $missingCommand = true; - } + if (!in_array($arg, $classMethods) && !in_array(strtolower($arg), $classMethods)) { + $missingCommand = true; + } - $protectedCommands = array( - 'initialize','in','out','err','hr', - 'createfile', 'isdir','copydir','object','tostring', - 'requestaction','log','cakeerror', 'shelldispatcher', - '__initconstants','__initenvironment','__construct', - 'dispatch','__bootstrap','getinput','stdout','stderr','parseparams','shiftargs' - ); + $protectedCommands = array( + 'initialize','in','out','err','hr', + 'createfile', 'isdir','copydir','object','tostring', + 'requestaction','log','cakeerror', 'shelldispatcher', + '__initconstants','__initenvironment','__construct', + 'dispatch','__bootstrap','getinput','stdout','stderr','parseparams','shiftargs' + ); - if (in_array(strtolower($command), $protectedCommands)) { - $missingCommand = true; - } + if (in_array(strtolower($arg), $protectedCommands)) { + $missingCommand = true; + } - if ($missingCommand && method_exists($shell, 'main')) { - $shell->startup(); - return $shell->main(); - } elseif (!$privateMethod && method_exists($shell, $command)) { - $this->shiftArgs(); - $shell->startup(); - return $shell->{$command}(); - } else { - $this->stderr("Unknown {$this->shellName} command '$command'.\nFor usage, try 'cake {$this->shell} help'.\n\n"); - } - } else { - $this->stderr('Class '.$this->shellClass.' could not be loaded'); - } - } else { - $this->help(); - } + if ($missingCommand && method_exists($Shell, 'main')) { + $Shell->startup(); + return $Shell->main(); + } elseif (!$privateMethod && method_exists($Shell, $arg)) { + $this->shiftArgs(); + $Shell->startup(); + return $Shell->{$arg}(); + } + + $message = sprintf(__('Unknown %1$s command `%2$s`. For usage try `cake %3$s help`.', true), + $this->shellName, $this->shellCommand, $this->shell); + $this->stderr($message . "\n"); + return false; + } +/** + * Get shell to use, either plugin shell or application shell + * + * All paths in the shellPaths property are searched. + * shell, shellPath and shellClass properties are taken into account. + * + * @param string $plugin Optionally the name of a plugin + * @return mixed False if no shell could be found or an object on success + * @access protected + */ + function _getShell($plugin = null) { + foreach ($this->shellPaths as $path) { + $this->shellPath = $path . $this->shell . '.php'; + $pluginShellPath = DS . $plugin . DS . 'vendors' . DS . 'shells' . DS; + + if ((strpos($path, $pluginShellPath) !== false || !$plugin) && file_exists($this->shellPath)) { + $loaded = true; + break; } - } else { - $this->help(); } + if (!isset($loaded)) { + return false; + } + + if (!class_exists('Shell')) { + require CONSOLE_LIBS . 'shell.php'; + } + + if (!class_exists($this->shellClass)) { + require $this->shellPath; + } + if (!class_exists($this->shellClass)) { + return false; + } + $Shell = new $this->shellClass($this); + return $Shell; } /** * Prompts the user for input, and returns it. @@ -480,7 +513,7 @@ function parseParams($params) { $this->params = array_merge($this->params, $params); } /** - * Helper for recursively paraing params + * Helper for recursively parsing params * * @return array params * @access private @@ -559,6 +592,7 @@ function help() { } else { sort($shells); foreach ($shells as $shell) { + if ($shell !== 'shell.php') { $this->stdout("\t " . str_replace('.php', '', $shell)); } @@ -568,7 +602,6 @@ function help() { } $this->stdout("\nTo run a command, type 'cake shell_name [args]'"); $this->stdout("To get help on a specific command, type 'cake shell_name help'"); - $this->_stop(); } /** * Stop execution of the current script diff --git a/cake/tests/cases/console/cake.test.php b/cake/tests/cases/console/cake.test.php index 9ec2e57dd..2c87d6628 100644 --- a/cake/tests/cases/console/cake.test.php +++ b/cake/tests/cases/console/cake.test.php @@ -34,6 +34,8 @@ require CAKE . 'console' . DS . 'cake.php'; ob_end_clean(); } + +require_once CONSOLE_LIBS . 'shell.php'; /** * TestShellDispatcher class * @@ -69,6 +71,13 @@ class TestShellDispatcher extends ShellDispatcher { * @access public */ var $stopped = null; +/** + * TestShell + * + * @var mixed + * @access public + */ + var $TestShell; /** * _initEnvironment method * @@ -107,6 +116,30 @@ function stdout($string, $newline = true) { */ function _stop($status = 0) { $this->stopped = 'Stopped with status: ' . $status; + return $status; + } +/** + * getShell + * + * @param mixed $plugin + * @access public + * @return mixed + */ + function getShell($plugin = null) { + return $this->_getShell($plugin); + } +/** + * _getShell + * + * @param mixed $plugin + * @access protected + * @return mixed + */ + function _getShell($plugin = null) { + if (isset($this->TestShell)) { + return $this->TestShell; + } + return parent::_getShell($plugin); } } /** @@ -115,7 +148,7 @@ function _stop($status = 0) { * @package cake * @subpackage cake.tests.cases.libs */ -class ShellDispatcherTest extends UnitTestCase { +class ShellDispatcherTest extends CakeTestCase { /** * setUp method * @@ -419,20 +452,317 @@ function testBuildPaths() { $this->assertIdentical(array_diff($expected, $result), array()); } /** - * testDispatch method + * Verify loading of (plugin-) shells * * @access public * @return void */ - function testDispatch() { - $Dispatcher =& new TestShellDispatcher(array('sample')); - $this->assertPattern('/This is the main method called from SampleShell/', $Dispatcher->stdout); + function testGetShell() { + $this->skipIf(class_exists('SampleShell'), '%s SampleShell Class already loaded'); + $this->skipIf(class_exists('ExampleShell'), '%s ExampleShell Class already loaded'); + + $Dispatcher =& new TestShellDispatcher(); + + $Dispatcher->shell = 'sample'; + $Dispatcher->shellName = 'Sample'; + $Dispatcher->shellClass = 'SampleShell'; - $Dispatcher =& new TestShellDispatcher(array('test_plugin_two.example')); - $this->assertPattern('/This is the main method called from TestPluginTwo.ExampleShell/', $Dispatcher->stdout); + $result = $Dispatcher->getShell(); + $this->assertIsA($result, 'SampleShell'); - $Dispatcher =& new TestShellDispatcher(array('test_plugin_two.welcome', 'say_hello')); - $this->assertPattern('/This is the say_hello method called from TestPluginTwo.WelcomeShell/', $Dispatcher->stdout); + $Dispatcher =& new TestShellDispatcher(); + + $Dispatcher->shell = 'example'; + $Dispatcher->shellName = 'Example'; + $Dispatcher->shellClass = 'ExampleShell'; + + $result = $Dispatcher->getShell('test_plugin'); + $this->assertIsA($result, 'ExampleShell'); + } +/** + * Verify correct dispatch of Shell subclasses with a main method + * + * @access public + * @return void + */ + function testDispatchShellWithMain() { + Mock::generate('Shell', 'MockWithMainShell', array('main', '_secret')); + + $Dispatcher =& new TestShellDispatcher(); + + $Shell = new MockWithMainShell(); + $Shell->setReturnValue('main', true); + $Shell->expectOnce('initialize'); + $Shell->expectOnce('loadTasks'); + $Shell->expectOnce('startup'); + $Shell->expectOnce('main'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_with_main')); + $result = $Dispatcher->dispatch(); + $this->assertTrue($result); + + $Shell = new MockWithMainShell(); + $Shell->setReturnValue('main', true); + $Shell->expectOnce('startup'); + $Shell->expectOnce('main'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_with_main', 'initdb')); + $result = $Dispatcher->dispatch(); + $this->assertTrue($result); + + $Shell = new MockWithMainShell(); + $Shell->setReturnValue('main', true); + $Shell->expectNever('hr'); + $Shell->expectOnce('startup'); + $Shell->expectOnce('main'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_with_main', 'hr')); + $result = $Dispatcher->dispatch(); + $this->assertTrue($result); + + $Shell = new MockWithMainShell(); + $Shell->setReturnValue('main', true); + $Shell->expectOnce('startup'); + $Shell->expectOnce('main'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_with_main', 'dispatch')); + $result = $Dispatcher->dispatch(); + $this->assertTrue($result); + + $Shell = new MockWithMainShell(); + $Shell->setReturnValue('main', true); + $Shell->expectOnce('startup'); + $Shell->expectOnce('main'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_with_main', 'idontexist')); + $result = $Dispatcher->dispatch(); + $this->assertTrue($result); + + $Shell = new MockWithMainShell(); + $Shell->expectNever('startup'); + $Shell->expectNever('main'); + $Shell->expectNever('_secret'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_with_main', '_secret')); + $result = $Dispatcher->dispatch(); + $this->assertFalse($result); + } +/** + * Verify correct dispatch of Shell subclasses without a main method + * + * @access public + * @return void + */ + function testDispatchShellWithoutMain() { + Mock::generate('Shell', 'MockWithoutMainShell', array('initDb', '_secret')); + + $Dispatcher =& new TestShellDispatcher(); + + $Shell = new MockWithoutMainShell(); + $Shell->setReturnValue('initDb', true); + $Shell->expectOnce('initialize'); + $Shell->expectOnce('loadTasks'); + $Shell->expectNever('startup'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_without_main')); + $result = $Dispatcher->dispatch(); + $this->assertFalse($result); + + $Shell = new MockWithoutMainShell(); + $Shell->setReturnValue('initDb', true); + $Shell->expectOnce('startup'); + $Shell->expectOnce('initDb'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_without_main', 'initdb')); + $result = $Dispatcher->dispatch(); + $this->assertTrue($result); + + /* Currently fails when it should not */ + /* $Shell = new MockWithoutMainShell(); + $Shell->setReturnValue('initDb', true); + $Shell->expectNever('startup'); + $Shell->expectNever('hr'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_without_main', 'hr')); + $result = $Dispatcher->dispatch(); + $this->assertFalse($result); */ + + $Shell = new MockWithoutMainShell(); + $Shell->setReturnValue('initDb', true); + $Shell->expectNever('startup'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_without_main', 'dispatch')); + $result = $Dispatcher->dispatch(); + $this->assertFalse($result); + + $Shell = new MockWithoutMainShell(); + $Shell->expectNever('startup'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_without_main', 'idontexist')); + $result = $Dispatcher->dispatch(); + $this->assertFalse($result); + + $Shell = new MockWithoutMainShell(); + $Shell->expectNever('startup'); + $Shell->expectNever('_secret'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_without_main', '_secret')); + $result = $Dispatcher->dispatch(); + $this->assertFalse($result); + } +/** + * Verify correct dispatch of custom classes with a main method + * + * @access public + * @return void + */ + function testDispatchNotAShellWithMain() { + Mock::generate('Object', 'MockWithMainNotAShell', + array('main', 'initialize', 'loadTasks', 'startup', '_secret')); + + $Dispatcher =& new TestShellDispatcher(); + + $Shell = new MockWithMainNotAShell(); + $Shell->setReturnValue('main', true); + $Shell->expectNever('initialize'); + $Shell->expectNever('loadTasks'); + $Shell->expectOnce('startup'); + $Shell->expectOnce('main'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_with_main_not_a')); + $result = $Dispatcher->dispatch(); + $this->assertTrue($result); + + $Shell = new MockWithMainNotAShell(); + $Shell->setReturnValue('main', true); + $Shell->expectOnce('startup'); + $Shell->expectOnce('main'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_with_main_not_a', 'initdb')); + $result = $Dispatcher->dispatch(); + $this->assertTrue($result); + + $Shell = new MockWithMainNotAShell(); + $Shell->setReturnValue('main', true); + $Shell->expectOnce('startup'); + $Shell->expectOnce('main'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_with_main_not_a', 'hr')); + $result = $Dispatcher->dispatch(); + $this->assertTrue($result); + + $Shell = new MockWithMainNotAShell(); + $Shell->setReturnValue('main', true); + $Shell->expectOnce('startup'); + $Shell->expectOnce('main'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_with_main_not_a', 'dispatch')); + $result = $Dispatcher->dispatch(); + $this->assertTrue($result); + + $Shell = new MockWithMainNotAShell(); + $Shell->setReturnValue('main', true); + $Shell->expectOnce('startup'); + $Shell->expectOnce('main'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_with_main_not_a', 'idontexist')); + $result = $Dispatcher->dispatch(); + $this->assertTrue($result); + + $Shell = new MockWithMainNotAShell(); + $Shell->expectNever('startup'); + $Shell->expectNever('main'); + $Shell->expectNever('_secret'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_with_main_not_a', '_secret')); + $result = $Dispatcher->dispatch(); + $this->assertFalse($result); + } +/** + * Verify correct dispatch of custom classes without a main method + * + * @access public + * @return void + */ + function testDispatchNotAShellWithoutMain() { + Mock::generate('Object', 'MockWithoutMainNotAShell', + array('initDb', 'initialize', 'loadTasks', 'startup', '_secret')); + + $Dispatcher =& new TestShellDispatcher(); + + $Shell = new MockWithoutMainNotAShell(); + $Shell->setReturnValue('initDb', true); + $Shell->expectNever('initialize'); + $Shell->expectNever('loadTasks'); + $Shell->expectNever('startup'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_without_main_not_a')); + $result = $Dispatcher->dispatch(); + $this->assertFalse($result); + + $Shell = new MockWithoutMainNotAShell(); + $Shell->setReturnValue('initDb', true); + $Shell->expectOnce('startup'); + $Shell->expectOnce('initDb'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_without_main_not_a', 'initdb')); + $result = $Dispatcher->dispatch(); + $this->assertTrue($result); + + $Shell = new MockWithoutMainNotAShell(); + $Shell->setReturnValue('initDb', true); + $Shell->expectNever('startup'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_without_main_not_a', 'hr')); + $result = $Dispatcher->dispatch(); + $this->assertFalse($result); + + $Shell = new MockWithoutMainNotAShell(); + $Shell->setReturnValue('initDb', true); + $Shell->expectNever('startup'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_without_main_not_a', 'dispatch')); + $result = $Dispatcher->dispatch(); + $this->assertFalse($result); + + $Shell = new MockWithoutMainNotAShell(); + $Shell->expectNever('startup'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_without_main_not_a', 'idontexist')); + $result = $Dispatcher->dispatch(); + $this->assertFalse($result); + + $Shell = new MockWithoutMainNotAShell(); + $Shell->expectNever('startup'); + $Shell->expectNever('_secret'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->parseParams(array('mock_without_main_not_a', '_secret')); + $result = $Dispatcher->dispatch(); + $this->assertFalse($result); } /** * testHelpCommand method @@ -476,7 +806,7 @@ function testHelpCommand() { $expected = "/ CORE(\\\|\/)tests(\\\|\/)test_app(\\\|\/)vendors(\\\|\/)shells:"; $expected .= "\n\t sample"; $expected .= "\n/"; - $this->assertPattern($expected, $Dispatcher->stdout); + $this->assertPattern($expected, $Dispatcher->stdout); } } ?> \ No newline at end of file From ebe1cd258a09adf06e54aec2b3b0ae3dd22836ff Mon Sep 17 00:00:00 2001 From: davidpersson <davidpersson@gmx.de> Date: Fri, 1 May 2009 03:47:33 +0200 Subject: [PATCH 0139/2083] Updating shiftArgs to return shifted arg If no args were available the method was returning false and now returns null. If args were available the method was returning true it now returns the shifted argument instead. --- cake/console/cake.php | 13 ++++-------- cake/tests/cases/console/cake.test.php | 29 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/cake/console/cake.php b/cake/console/cake.php index 22683ad8b..1129b9a25 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -279,7 +279,7 @@ function __bootstrap() { * @access public */ function dispatch() { - if (!$arg = array_shift($this->args)) { + if (!$arg = $this->shiftArgs()) { $this->help(); return false; } @@ -298,7 +298,7 @@ function dispatch() { $this->shellName = Inflector::camelize($shell); $this->shellClass = $this->shellName . 'Shell'; - if ($arg = array_shift($this->args)) { + if ($arg = $this->shiftArgs()) { $this->shellCommand = Inflector::variable($arg); } @@ -546,16 +546,11 @@ function __parseParams($params) { /** * Removes first argument and shifts other arguments up * - * @return boolean False if there are no arguments + * @return mixed Null if there are no arguments otherwise the shifted argument * @access public */ function shiftArgs() { - if (empty($this->args)) { - return false; - } - unset($this->args[0]); - $this->args = array_values($this->args); - return true; + return array_shift($this->args); } /** * Shows console help diff --git a/cake/tests/cases/console/cake.test.php b/cake/tests/cases/console/cake.test.php index 2c87d6628..45b160a8b 100644 --- a/cake/tests/cases/console/cake.test.php +++ b/cake/tests/cases/console/cake.test.php @@ -764,6 +764,35 @@ function testDispatchNotAShellWithoutMain() { $result = $Dispatcher->dispatch(); $this->assertFalse($result); } +/** + * Verify shifting of arguments + * + * @access public + * @return void + */ + function testShiftArgs() { + $Dispatcher =& new TestShellDispatcher(); + + $Dispatcher->args = array('a', 'b', 'c'); + $this->assertEqual($Dispatcher->shiftArgs(), 'a'); + $this->assertIdentical($Dispatcher->args, array('b', 'c')); + + $Dispatcher->args = array('a' => 'b', 'c', 'd'); + $this->assertEqual($Dispatcher->shiftArgs(), 'b'); + $this->assertIdentical($Dispatcher->args, array('c', 'd')); + + $Dispatcher->args = array('a', 'b' => 'c', 'd'); + $this->assertEqual($Dispatcher->shiftArgs(), 'a'); + $this->assertIdentical($Dispatcher->args, array('b' => 'c', 'd')); + + $Dispatcher->args = array(0 => 'a', 2 => 'b', 30 => 'c'); + $this->assertEqual($Dispatcher->shiftArgs(), 'a'); + $this->assertIdentical($Dispatcher->args, array(0 => 'b', 1 => 'c')); + + $Dispatcher->args = array(); + $this->assertNull($Dispatcher->shiftArgs()); + $this->assertIdentical($Dispatcher->args, array()); + } /** * testHelpCommand method * From 1d8f57d37a5bdd7b4d6f077e78e7ac4d88b9257b Mon Sep 17 00:00:00 2001 From: davidpersson <davidpersson@gmx.de> Date: Fri, 1 May 2009 12:08:56 +0200 Subject: [PATCH 0140/2083] Second pass at dispatch refactor Updating command dispatching Fixing incorrect arg handling Moving assignments out of conditionals Updating tests to reset args Adding dispatch task test --- cake/console/cake.php | 69 +++++++---------- cake/tests/cases/console/cake.test.php | 102 ++++++++++++++++++------- 2 files changed, 104 insertions(+), 67 deletions(-) diff --git a/cake/console/cake.php b/cake/console/cake.php index 1129b9a25..72236b84a 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -279,7 +279,9 @@ function __bootstrap() { * @access public */ function dispatch() { - if (!$arg = $this->shiftArgs()) { + $arg = $this->shiftArgs(); + + if (!$arg) { $this->help(); return false; } @@ -298,18 +300,23 @@ function dispatch() { $this->shellName = Inflector::camelize($shell); $this->shellClass = $this->shellName . 'Shell'; - if ($arg = $this->shiftArgs()) { + $arg = null; + + if (isset($this->args[0])) { + $arg = $this->args[0]; $this->shellCommand = Inflector::variable($arg); } $Shell = $this->_getShell($plugin); if (!$Shell) { - $message = sprintf(__('Class `%s` could not be loaded', true), $this->shellClass); - $this->stderr($message . "\n"); + $title = sprintf(__('Error: Class %s could not be loaded.', true), $this->shellClass); + $this->stderr($title . "\n"); return false; } + $methods = array(); + if (is_a($Shell, 'Shell')) { $Shell->initialize(); $Shell->loadTasks(); @@ -321,7 +328,7 @@ function dispatch() { } } - $task = Inflector::camelize($this->shellCommand); + $task = Inflector::camelize($arg); if (in_array($task, $Shell->taskNames)) { $this->shiftArgs(); @@ -337,45 +344,27 @@ function dispatch() { } return $Shell->{$task}->execute(); } - - } - - $classMethods = get_class_methods($Shell); - - $privateMethod = $missingCommand = false; - if ((in_array($arg, $classMethods) || in_array(strtolower($arg), $classMethods)) - && $arg[0] == '_') { - $privateMethod = true; - } - - if (!in_array($arg, $classMethods) && !in_array(strtolower($arg), $classMethods)) { - $missingCommand = true; - } - - $protectedCommands = array( - 'initialize','in','out','err','hr', - 'createfile', 'isdir','copydir','object','tostring', - 'requestaction','log','cakeerror', 'shelldispatcher', - '__initconstants','__initenvironment','__construct', - 'dispatch','__bootstrap','getinput','stdout','stderr','parseparams','shiftargs' - ); - - if (in_array(strtolower($arg), $protectedCommands)) { - $missingCommand = true; + $methods = get_class_methods('Shell'); } + $methods = array_diff(get_class_methods($Shell), $methods); + $added = in_array(strtolower($arg), array_map('strtolower', $methods)); + $private = $arg[0] == '_' && method_exists($Shell, $arg); - if ($missingCommand && method_exists($Shell, 'main')) { - $Shell->startup(); - return $Shell->main(); - } elseif (!$privateMethod && method_exists($Shell, $arg)) { - $this->shiftArgs(); - $Shell->startup(); - return $Shell->{$arg}(); + if (!$private) { + if ($added) { + $this->shiftArgs(); + $Shell->startup(); + return $Shell->{$arg}(); + } + if (method_exists($Shell, 'main')) { + $Shell->startup(); + return $Shell->main(); + } } - $message = sprintf(__('Unknown %1$s command `%2$s`. For usage try `cake %3$s help`.', true), - $this->shellName, $this->shellCommand, $this->shell); - $this->stderr($message . "\n"); + $title = sprintf(__('Error: Unknown %1$s command %2$s.', true), $this->shellName, $arg); + $message = sprintf(__('For usage try `cake %s help`', true), $this->shell); + $this->stderr($title . "\n" . $message . "\n"); return false; } /** diff --git a/cake/tests/cases/console/cake.test.php b/cake/tests/cases/console/cake.test.php index 45b160a8b..914890223 100644 --- a/cake/tests/cases/console/cake.test.php +++ b/cake/tests/cases/console/cake.test.php @@ -498,9 +498,10 @@ function testDispatchShellWithMain() { $Shell->expectOnce('main'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_with_main')); + $Dispatcher->args = array('mock_with_main'); $result = $Dispatcher->dispatch(); $this->assertTrue($result); + $this->assertEqual($Dispatcher->args, array()); $Shell = new MockWithMainShell(); $Shell->setReturnValue('main', true); @@ -508,9 +509,10 @@ function testDispatchShellWithMain() { $Shell->expectOnce('main'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_with_main', 'initdb')); + $Dispatcher->args = array('mock_with_main', 'initdb'); $result = $Dispatcher->dispatch(); $this->assertTrue($result); + $this->assertEqual($Dispatcher->args, array('initdb')); $Shell = new MockWithMainShell(); $Shell->setReturnValue('main', true); @@ -519,9 +521,10 @@ function testDispatchShellWithMain() { $Shell->expectOnce('main'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_with_main', 'hr')); + $Dispatcher->args = array('mock_with_main', 'hr'); $result = $Dispatcher->dispatch(); $this->assertTrue($result); + $this->assertEqual($Dispatcher->args, array('hr')); $Shell = new MockWithMainShell(); $Shell->setReturnValue('main', true); @@ -529,9 +532,10 @@ function testDispatchShellWithMain() { $Shell->expectOnce('main'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_with_main', 'dispatch')); + $Dispatcher->args = array('mock_with_main', 'dispatch'); $result = $Dispatcher->dispatch(); $this->assertTrue($result); + $this->assertEqual($Dispatcher->args, array('dispatch')); $Shell = new MockWithMainShell(); $Shell->setReturnValue('main', true); @@ -539,9 +543,10 @@ function testDispatchShellWithMain() { $Shell->expectOnce('main'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_with_main', 'idontexist')); + $Dispatcher->args = array('mock_with_main', 'idontexist'); $result = $Dispatcher->dispatch(); $this->assertTrue($result); + $this->assertEqual($Dispatcher->args, array('idontexist')); $Shell = new MockWithMainShell(); $Shell->expectNever('startup'); @@ -549,7 +554,7 @@ function testDispatchShellWithMain() { $Shell->expectNever('_secret'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_with_main', '_secret')); + $Dispatcher->args = array('mock_with_main', '_secret'); $result = $Dispatcher->dispatch(); $this->assertFalse($result); } @@ -571,9 +576,10 @@ function testDispatchShellWithoutMain() { $Shell->expectNever('startup'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_without_main')); + $Dispatcher->args = array('mock_without_main'); $result = $Dispatcher->dispatch(); $this->assertFalse($result); + $this->assertEqual($Dispatcher->args, array()); $Shell = new MockWithoutMainShell(); $Shell->setReturnValue('initDb', true); @@ -581,27 +587,28 @@ function testDispatchShellWithoutMain() { $Shell->expectOnce('initDb'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_without_main', 'initdb')); + $Dispatcher->args = array('mock_without_main', 'initdb'); $result = $Dispatcher->dispatch(); $this->assertTrue($result); + $this->assertEqual($Dispatcher->args, array()); - /* Currently fails when it should not */ - /* $Shell = new MockWithoutMainShell(); + $Shell = new MockWithoutMainShell(); $Shell->setReturnValue('initDb', true); $Shell->expectNever('startup'); $Shell->expectNever('hr'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_without_main', 'hr')); + $Dispatcher->args = array('mock_without_main', 'hr'); $result = $Dispatcher->dispatch(); - $this->assertFalse($result); */ + $this->assertFalse($result); + $this->assertEqual($Dispatcher->args, array('hr')); $Shell = new MockWithoutMainShell(); $Shell->setReturnValue('initDb', true); $Shell->expectNever('startup'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_without_main', 'dispatch')); + $Dispatcher->args = array('mock_without_main', 'dispatch'); $result = $Dispatcher->dispatch(); $this->assertFalse($result); @@ -609,7 +616,7 @@ function testDispatchShellWithoutMain() { $Shell->expectNever('startup'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_without_main', 'idontexist')); + $Dispatcher->args = array('mock_without_main', 'idontexist'); $result = $Dispatcher->dispatch(); $this->assertFalse($result); @@ -618,7 +625,7 @@ function testDispatchShellWithoutMain() { $Shell->expectNever('_secret'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_without_main', '_secret')); + $Dispatcher->args = array('mock_without_main', '_secret'); $result = $Dispatcher->dispatch(); $this->assertFalse($result); } @@ -642,9 +649,10 @@ function testDispatchNotAShellWithMain() { $Shell->expectOnce('main'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_with_main_not_a')); + $Dispatcher->args = array('mock_with_main_not_a'); $result = $Dispatcher->dispatch(); $this->assertTrue($result); + $this->assertEqual($Dispatcher->args, array()); $Shell = new MockWithMainNotAShell(); $Shell->setReturnValue('main', true); @@ -652,9 +660,10 @@ function testDispatchNotAShellWithMain() { $Shell->expectOnce('main'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_with_main_not_a', 'initdb')); + $Dispatcher->args = array('mock_with_main_not_a', 'initdb'); $result = $Dispatcher->dispatch(); $this->assertTrue($result); + $this->assertEqual($Dispatcher->args, array('initdb')); $Shell = new MockWithMainNotAShell(); $Shell->setReturnValue('main', true); @@ -662,9 +671,10 @@ function testDispatchNotAShellWithMain() { $Shell->expectOnce('main'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_with_main_not_a', 'hr')); + $Dispatcher->args = array('mock_with_main_not_a', 'hr'); $result = $Dispatcher->dispatch(); $this->assertTrue($result); + $this->assertEqual($Dispatcher->args, array('hr')); $Shell = new MockWithMainNotAShell(); $Shell->setReturnValue('main', true); @@ -672,9 +682,10 @@ function testDispatchNotAShellWithMain() { $Shell->expectOnce('main'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_with_main_not_a', 'dispatch')); + $Dispatcher->args = array('mock_with_main_not_a', 'dispatch'); $result = $Dispatcher->dispatch(); $this->assertTrue($result); + $this->assertEqual($Dispatcher->args, array('dispatch')); $Shell = new MockWithMainNotAShell(); $Shell->setReturnValue('main', true); @@ -682,9 +693,10 @@ function testDispatchNotAShellWithMain() { $Shell->expectOnce('main'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_with_main_not_a', 'idontexist')); + $Dispatcher->args = array('mock_with_main_not_a', 'idontexist'); $result = $Dispatcher->dispatch(); $this->assertTrue($result); + $this->assertEqual($Dispatcher->args, array('idontexist')); $Shell = new MockWithMainNotAShell(); $Shell->expectNever('startup'); @@ -692,7 +704,7 @@ function testDispatchNotAShellWithMain() { $Shell->expectNever('_secret'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_with_main_not_a', '_secret')); + $Dispatcher->args = array('mock_with_main_not_a', '_secret'); $result = $Dispatcher->dispatch(); $this->assertFalse($result); } @@ -715,7 +727,7 @@ function testDispatchNotAShellWithoutMain() { $Shell->expectNever('startup'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_without_main_not_a')); + $Dispatcher->args = array('mock_without_main_not_a'); $result = $Dispatcher->dispatch(); $this->assertFalse($result); @@ -725,16 +737,17 @@ function testDispatchNotAShellWithoutMain() { $Shell->expectOnce('initDb'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_without_main_not_a', 'initdb')); + $Dispatcher->args = array('mock_without_main_not_a', 'initdb'); $result = $Dispatcher->dispatch(); $this->assertTrue($result); + $this->assertEqual($Dispatcher->args, array()); $Shell = new MockWithoutMainNotAShell(); $Shell->setReturnValue('initDb', true); $Shell->expectNever('startup'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_without_main_not_a', 'hr')); + $Dispatcher->args = array('mock_without_main_not_a', 'hr'); $result = $Dispatcher->dispatch(); $this->assertFalse($result); @@ -743,7 +756,7 @@ function testDispatchNotAShellWithoutMain() { $Shell->expectNever('startup'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_without_main_not_a', 'dispatch')); + $Dispatcher->args = array('mock_without_main_not_a', 'dispatch'); $result = $Dispatcher->dispatch(); $this->assertFalse($result); @@ -751,7 +764,7 @@ function testDispatchNotAShellWithoutMain() { $Shell->expectNever('startup'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_without_main_not_a', 'idontexist')); + $Dispatcher->args = array('mock_without_main_not_a', 'idontexist'); $result = $Dispatcher->dispatch(); $this->assertFalse($result); @@ -760,10 +773,45 @@ function testDispatchNotAShellWithoutMain() { $Shell->expectNever('_secret'); $Dispatcher->TestShell =& $Shell; - $Dispatcher->parseParams(array('mock_without_main_not_a', '_secret')); + $Dispatcher->args = array('mock_without_main_not_a', '_secret'); $result = $Dispatcher->dispatch(); $this->assertFalse($result); } +/** + * Verify that a task is called instead of the shell if the first arg equals + * the name of the task + * + * @access public + * @return void + */ + function testDispatchTask() { + Mock::generate('Shell', 'MockWeekShell', array('main')); + Mock::generate('Shell', 'MockOnSundayTask', array('execute')); + + $Dispatcher =& new TestShellDispatcher(); + + $Shell = new MockWeekShell(); + $Shell->expectOnce('initialize'); + $Shell->expectOnce('loadTasks'); + $Shell->expectNever('startup'); + $Shell->expectNever('main'); + + $Task = new MockOnSundayTask(); + $Task->setReturnValue('execute', true); + $Task->expectOnce('initialize'); + $Task->expectOnce('loadTasks'); + $Task->expectOnce('startup'); + $Task->expectOnce('execute'); + + $Shell->MockOnSunday =& $Task; + $Shell->taskNames = array('MockOnSunday'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->args = array('mock_week', 'mock_on_sunday'); + $result = $Dispatcher->dispatch(); + $this->assertTrue($result); + $this->assertEqual($Dispatcher->args, array()); + } /** * Verify shifting of arguments * From 67d45cb28bfa69bda845428bd401cbb28cb1d9b8 Mon Sep 17 00:00:00 2001 From: gwoo <gwoo@cakephp.org> Date: Fri, 1 May 2009 10:03:30 -0700 Subject: [PATCH 0141/2083] updating headers on inflector and adding map param to slug(). added more comments to app/config/bootstrap.php --- app/config/bootstrap.php | 46 ++++++++++++------------ cake/libs/inflector.php | 27 +++++++------- cake/tests/cases/libs/inflector.test.php | 29 ++++++++------- 3 files changed, 48 insertions(+), 54 deletions(-) diff --git a/app/config/bootstrap.php b/app/config/bootstrap.php index da6f91493..924147237 100644 --- a/app/config/bootstrap.php +++ b/app/config/bootstrap.php @@ -1,48 +1,46 @@ <?php -/* SVN FILE: $Id$ */ /** - * Short description for file. + * This file is loaded automatically by the app/webroot/index.php file after the core bootstrap.php * - * Long description for file + * This is an application wide file to load any function that is not used within a class + * define. You can also use this to include or require any files in your application. * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2008, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.config * @since CakePHP(tm) v 0.10.8.2117 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** + * The settings below can be used to set additional paths to models, views and controllers. + * This is related to Ticket #470 (https://trac.cakephp.org/ticket/470) * - * This file is loaded automatically by the app/webroot/index.php file after the core bootstrap.php is loaded - * This is an application wide file to load any function that is not used within a class define. - * You can also use this to include or require any files in your application. + * $modelPaths = array('/full/path/to/models/', '/next/full/path/to/models/'); + * $viewPaths = array('/full/path/to/views/', '/next/full/path/to/views/'); + * $controllerPaths = array(/full/path/to/controllers/', '/next/full/path/to/controllers/'); + * $pluginPaths = array('/full/path/to/plugins/', '/next/full/path/to/plugins/'); + * $behaviorPaths = array('/full/path/to/behaviors/', '/next/full/path/to/behaviors/'); + * $componentPaths = array('/full/path/to/components/', '/next/full/path/to/components/'); + * $helperPaths = array('/full/path/to/helpers/', '/next/full/path/to/helpers/'); + * $vendorPaths = array('/full/path/to/vendors/', '/next/full/path/to/vendors/'); + * $shellPaths = array('/full/path/to/shells/', '/next/full/path/to/shells/'); + * $localePaths = array('/full/path/to/locale/', '/next/full/path/to/locale/'; * */ /** - * The settings below can be used to set additional paths to models, views and controllers. - * This is related to Ticket #470 (https://trac.cakephp.org/ticket/470) + * As of 1.3, additional rules for the inflector are added below * - * $modelPaths = array('full path to models', 'second full path to models', 'etc...'); - * $viewPaths = array('this path to views', 'second full path to views', 'etc...'); - * $controllerPaths = array('this path to controllers', 'second full path to controllers', 'etc...'); + * Inflector::rule('singular', array('rules' => array(), irregular' => array(), 'uninflected' => array())); + * Inflector::rule('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); * */ -//EOF - -// Inflector::rule('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array())); -// Inflector::rule('singular', array('rules' => array(), irregular' => array(), 'uninflected' => array())); - ?> diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index 3899c80e3..f5d7a6d9b 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -1,5 +1,4 @@ <?php -/* SVN FILE: $Id$ */ /** * Pluralize and singularize English words. * @@ -7,29 +6,25 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ /** * Included libraries. * */ if (!class_exists('Object')) { - uses('object'); + require_once(LIBS . 'object.php'); } /** * Pluralize and singularize English words. @@ -422,17 +417,18 @@ function variable($string) { * Returns a string with all spaces converted to underscores (by default), accented * characters converted to non-accented characters, and non word characters removed. * - * @param string $string - * @param string $replacement + * @param string $string the string you want to slug + * @param string $replacement will replace keys in map + * @param array $map extra elements to map to the replacement * @return string * @access public * @static * @link http://book.cakephp.org/view/572/Class-methods */ - function slug($string, $replacement = '_') { + function slug($string, $replacement = '_', $map = array()) { $quotedReplacement = preg_quote($replacement, '/'); - $map = array( + $default = array( '/à|á|Ã¥|â/' => 'a', '/è|é|ê|ẽ|ë/' => 'e', '/ì|í|î/' => 'i', @@ -451,6 +447,7 @@ function slug($string, $replacement = '_') { '/\\s+/' => $replacement, sprintf('/^[%s]+|[%s]+$/', $quotedReplacement, $quotedReplacement) => '', ); + $map = array_merge($default, $map); return preg_replace(array_keys($map), array_values($map), $string); } } diff --git a/cake/tests/cases/libs/inflector.test.php b/cake/tests/cases/libs/inflector.test.php index c5e3a95a0..9c7445ad2 100644 --- a/cake/tests/cases/libs/inflector.test.php +++ b/cake/tests/cases/libs/inflector.test.php @@ -1,28 +1,27 @@ <?php -/* SVN FILE: $Id$ */ /** - * Short description for file. + * InflectorTest * - * Long description for file + * InflectorTest is used to test cases on the Inflector class * * PHP versions 4 and 5 * - * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * - * Licensed under The Open Group Test Suite License - * Redistributions of files must retain the above copyright notice. + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://book.cakephp.org/view/160/Testing * @package cake.tests * @subpackage cake.tests.cases.libs * @since CakePHP(tm) v 1.2.0.4206 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + * @license Open Group Test Suite License (http://www.opensource.org/licenses/opengroup.php) + */ +/** + * Included libraries. + * */ App::import('Core', 'Inflector'); /** @@ -305,4 +304,4 @@ function tearDown() { unset($this->Inflector); } } -?> +?> \ No newline at end of file From 54a3118d3444f4adf5898314316eb3583627dc5b Mon Sep 17 00:00:00 2001 From: gwoo <gwoo@cakephp.org> Date: Fri, 1 May 2009 10:34:19 -0700 Subject: [PATCH 0142/2083] adding tests for map param on Inflector::slug. cleaning up. --- cake/libs/inflector.php | 98 ++++++++++++------------ cake/tests/cases/libs/inflector.test.php | 15 ++++ 2 files changed, 66 insertions(+), 47 deletions(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index f5d7a6d9b..47fdc3979 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -31,7 +31,6 @@ * * Inflector pluralizes and singularizes English nouns. * Used by Cake's naming conventions throughout the framework. - * Test with $i = new Inflector(); $i->test(); * * @package cake * @subpackage cake.cake.libs @@ -91,7 +90,7 @@ class Inflector extends Object { 'mongoose' => 'mongooses', 'move' => 'moves', 'mythos' => 'mythoi', - 'niche' => 'niches', + 'niche' => 'niches', 'numen' => 'numina', 'occiput' => 'occiputs', 'octopus' => 'octopuses', @@ -150,8 +149,8 @@ class Inflector extends Object { '/s$/i' => '' ), 'uninflected' => array( - '.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', '.*ss' - ), + '.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', '.*ss' + ), 'irregular' => array() ); @@ -161,19 +160,19 @@ class Inflector extends Object { * @var array * @access protected **/ - var $_uninflected = array( - 'Amoyese', 'bison', 'Borghese', 'bream', 'breeches', 'britches', 'buffalo', 'cantus', - 'carp', 'chassis', 'clippers', 'cod', 'coitus', 'Congoese', 'contretemps', 'corps', - 'debris', 'diabetes', 'djinn', 'eland', 'elk', 'equipment', 'Faroese', 'flounder', - 'Foochowese', 'gallows', 'Genevese', 'Genoese', 'Gilbertese', 'graffiti', - 'headquarters', 'herpes', 'hijinks', 'Hottentotese', 'information', 'innings', - 'jackanapes', 'Kiplingese', 'Kongoese', 'Lucchese', 'mackerel', 'Maltese', 'media', - 'mews', 'moose', 'mumps', 'Nankingese', 'news', 'nexus', 'Niasese', - 'Pekingese', 'Piedmontese', 'pincers', 'Pistoiese', 'pliers', 'Portuguese', - 'proceedings', 'rabies', 'rice', 'rhinoceros', 'salmon', 'Sarawakese', 'scissors', - 'sea[- ]bass', 'series', 'Shavese', 'shears', 'siemens', 'species', 'swine', 'testes', - 'trousers', 'trout','tuna', 'Vermontese', 'Wenchowese', 'whiting', 'wildebeest', - 'Yengeese' + var $_uninflected = array( + 'Amoyese', 'bison', 'Borghese', 'bream', 'breeches', 'britches', 'buffalo', 'cantus', + 'carp', 'chassis', 'clippers', 'cod', 'coitus', 'Congoese', 'contretemps', 'corps', + 'debris', 'diabetes', 'djinn', 'eland', 'elk', 'equipment', 'Faroese', 'flounder', + 'Foochowese', 'gallows', 'Genevese', 'Genoese', 'Gilbertese', 'graffiti', + 'headquarters', 'herpes', 'hijinks', 'Hottentotese', 'information', 'innings', + 'jackanapes', 'Kiplingese', 'Kongoese', 'Lucchese', 'mackerel', 'Maltese', 'media', + 'mews', 'moose', 'mumps', 'Nankingese', 'news', 'nexus', 'Niasese', + 'Pekingese', 'Piedmontese', 'pincers', 'Pistoiese', 'pliers', 'Portuguese', + 'proceedings', 'rabies', 'rice', 'rhinoceros', 'salmon', 'Sarawakese', 'scissors', + 'sea[- ]bass', 'series', 'Shavese', 'shears', 'siemens', 'species', 'swine', 'testes', + 'trousers', 'trout','tuna', 'Vermontese', 'Wenchowese', 'whiting', 'wildebeest', + 'Yengeese' ); /** @@ -212,27 +211,27 @@ function &getInstance() { * * @param string $type The type of inflection, either 'singular' or 'plural' * @param array $rules Array of rules to be added. Example usage: - * Inflector::rules('plural', array('/^(inflect)or$/i' => '\1ables')); - * Inflector::rules('plural', array( - * 'rules' => array('/^(inflect)ors$/i' => '\1ables'), - * 'uninflected' => array('dontinflectme'), - * 'irregular' => array('red' => 'redlings') - * )); + * Inflector::rules('plural', array('/^(inflect)or$/i' => '\1ables')); + * Inflector::rules('plural', array( + * 'rules' => array('/^(inflect)ors$/i' => '\1ables'), + * 'uninflected' => array('dontinflectme'), + * 'irregular' => array('red' => 'redlings') + * )); * @access public * @return void * @static */ function rules($type, $rules = array()) { $_this =& Inflector::getInstance(); - $type = '_'.$type; + $type = '_'.$type; - foreach ($rules as $rule => $pattern) { - if (is_array($pattern)) { - $_this->{$type}[$rule] = array_merge($pattern, $_this->{$type}[$rule]); - unset($rules[$rule], $_this->{$type}['cache' . ucfirst($rule)], $_this->{$type}['merged'][$rule]); - } - } - $_this->{$type}['rules'] = array_merge($rules, $_this->{$type}['rules']); + foreach ($rules as $rule => $pattern) { + if (is_array($pattern)) { + $_this->{$type}[$rule] = array_merge($pattern, $_this->{$type}[$rule]); + unset($rules[$rule], $_this->{$type}['cache' . ucfirst($rule)], $_this->{$type}['merged'][$rule]); + } + } + $_this->{$type}['rules'] = array_merge($rules, $_this->{$type}['rules']); } @@ -252,15 +251,15 @@ function pluralize($word) { return $_this->_pluralized[$word]; } - if (!isset($_this->_plural['merged']['irregular'])) { - $_this->_plural['merged']['irregular'] = $_this->_plural['irregular']; - } + if (!isset($_this->_plural['merged']['irregular'])) { + $_this->_plural['merged']['irregular'] = $_this->_plural['irregular']; + } - if (!isset($_this->plural['merged']['uninflected'])) { - $_this->_plural['merged']['uninflected'] = array_merge($_this->_plural['uninflected'], $_this->_uninflected); - } + if (!isset($_this->plural['merged']['uninflected'])) { + $_this->_plural['merged']['uninflected'] = array_merge($_this->_plural['uninflected'], $_this->_uninflected); + } - if (!isset($_this->_plural['cacheUninflected']) || !isset($_this->_plural['cacheIrregular'])) { + if (!isset($_this->_plural['cacheUninflected']) || !isset($_this->_plural['cacheIrregular'])) { $_this->_plural['cacheUninflected'] = '(?:' . join( '|', $_this->_plural['merged']['uninflected']) . ')'; $_this->_plural['cacheIrregular'] = '(?:' . join( '|', array_keys($_this->_plural['merged']['irregular'])) . ')'; } @@ -299,17 +298,17 @@ function singularize($word) { return $_this->_singularized[$word]; } - if (!isset($_this->_singular['merged']['uninflected'])) { - $_this->_singular['merged']['uninflected'] = array_merge($_this->_singular['uninflected'], $_this->_uninflected); - } + if (!isset($_this->_singular['merged']['uninflected'])) { + $_this->_singular['merged']['uninflected'] = array_merge($_this->_singular['uninflected'], $_this->_uninflected); + } - if (!isset($_this->_singular['merged']['irregular'])) { - $_this->_singular['merged']['irregular'] = array_merge($_this->_singular['irregular'], array_flip($_this->_plural['irregular'])); - } + if (!isset($_this->_singular['merged']['irregular'])) { + $_this->_singular['merged']['irregular'] = array_merge($_this->_singular['irregular'], array_flip($_this->_plural['irregular'])); + } if (!isset($_this->_singular['cacheUninflected']) || !isset($_this->_singular['cacheIrregular'])) { $_this->_singular['cacheUninflected'] = '(?:' . join( '|', $_this->_singular['merged']['uninflected']) . ')'; - $_this->_singular['cacheIrregular'] = '(?:' . join( '|', array_keys($_this->_singular['merged']['irregular'])) . ')'; + $_this->_singular['cacheIrregular'] = '(?:' . join( '|', array_keys($_this->_singular['merged']['irregular'])) . ')'; } if (preg_match('/(.*)\\b(' . $_this->_singular['cacheIrregular'] . ')$/i', $word, $regs)) { @@ -426,7 +425,12 @@ function variable($string) { * @link http://book.cakephp.org/view/572/Class-methods */ function slug($string, $replacement = '_', $map = array()) { - $quotedReplacement = preg_quote($replacement, '/'); + if (is_array($replacement)) { + $map = $replacement; + $replacement = '_'; + } + + $quotedReplacement = preg_quote($replacement, '/'); $default = array( '/à|á|Ã¥|â/' => 'a', @@ -445,7 +449,7 @@ function slug($string, $replacement = '_', $map = array()) { '/ß/' => 'ss', '/[^\w\s]/' => ' ', '/\\s+/' => $replacement, - sprintf('/^[%s]+|[%s]+$/', $quotedReplacement, $quotedReplacement) => '', + sprintf('/^[%s]+|[%s]+$/', $quotedReplacement, $quotedReplacement) => '', ); $map = array_merge($default, $map); return preg_replace(array_keys($map), array_values($map), $string); diff --git a/cake/tests/cases/libs/inflector.test.php b/cake/tests/cases/libs/inflector.test.php index 9c7445ad2..0cfc171c9 100644 --- a/cake/tests/cases/libs/inflector.test.php +++ b/cake/tests/cases/libs/inflector.test.php @@ -201,6 +201,21 @@ function testInflectorSlug() { $expected = 'this-melts-your-face1-2-3'; $this->assertEqual($result, $expected); } +/** + * testInflectorSlugWithMap method + * + * @access public + * @return void + */ + function testInflectorSlugWithMap() { + $result = Inflector::slug('replace every r', array('/r/' => '_')); + $expected = '_eplace_eve_y__'; + $this->assertEqual($result, $expected); + + $result = Inflector::slug('replace every r', '_', array('/r/' => '_')); + $expected = '_eplace_eve_y__'; + $this->assertEqual($result, $expected); + } /** * testVariableNaming method * From 1f7eb18107fa9c1956b5415951f0e5b6a0d69778 Mon Sep 17 00:00:00 2001 From: gwoo <gwoo@cakephp.org> Date: Fri, 1 May 2009 11:17:53 -0700 Subject: [PATCH 0143/2083] fixing up versions numbers in 1.3 --- cake/VERSION.txt | 28 ++++++++++++++++++++-------- cake/config/config.php | 19 ++++++++----------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/cake/VERSION.txt b/cake/VERSION.txt index 328fa2e81..3974acb41 100644 --- a/cake/VERSION.txt +++ b/cake/VERSION.txt @@ -1,9 +1,21 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////////////// -// +---------------------------------------------------------------------------------------------------+ // -// + $Id$ -// + Last Modified: $Date$ -// + Modified By: $LastChangedBy$ -// +---------------------------------------------------------------------------------------------------+ // -/////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////// +// +--------------------------------------------------------------------------------------------+ // // CakePHP Version +// +// Holds a static string representing the current version of CakePHP +// +// CakePHP(tm) : Rapid Development Framework (http://cakephp.org) +// Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) +// +// Licensed under The MIT License +// Redistributions of files must retain the above copyright notice. +// +// @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) +// @link http://cakephp.org +// @package cake +// @subpackage cake.cake.libs +// @since CakePHP(tm) v 0.2.9 +// @license MIT License (http://www.opensource.org/licenses/mit-license.php) +// +--------------------------------------------------------------------------------------------+ // +//////////////////////////////////////////////////////////////////////////////////////////////////// -1.2.2.8120 \ No newline at end of file +1.3.0.0 \ No newline at end of file diff --git a/cake/config/config.php b/cake/config/config.php index 61c56e8ee..0ea8edad5 100644 --- a/cake/config/config.php +++ b/cake/config/config.php @@ -1,26 +1,23 @@ <?php -/* SVN FILE: $Id$ */ /** * Core Configurations. * + * Holds configurations used by CakePHP + * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org * @package cake * @subpackage cake.app.config * @since CakePHP(tm) v 1.1.11.4062 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -return $config['Cake.version'] = '1.3.0'; +return $config['Cake.version'] = '1.3.0.0'; ?> \ No newline at end of file From 15518b8c9ac6e022eda29cd907b8f1fe3537a188 Mon Sep 17 00:00:00 2001 From: gwoo <gwoo@cakephp.org> Date: Fri, 1 May 2009 14:05:46 -0700 Subject: [PATCH 0144/2083] merging 1.3-misc into master --- .gitignore | 1 + app/config/database.php.default | 15 +- app/webroot/index.php | 19 +- cake/bootstrap.php | 45 +-- cake/console/libs/tasks/controller.php | 2 +- cake/libs/controller/controller.php | 96 +++-- cake/libs/controller/scaffold.php | 176 ++++++--- cake/libs/debugger.php | 368 ++++++++++++------ cake/libs/model/model.php | 137 ++++--- cake/libs/string.php | 61 +-- cake/libs/view/helpers/paginator.php | 39 +- .../cases/libs/controller/controller.test.php | 29 +- cake/tests/cases/libs/debugger.test.php | 90 ++++- cake/tests/cases/libs/model/behavior.test.php | 24 +- cake/tests/cases/libs/model/model.test.php | 29 +- cake/tests/cases/libs/string.test.php | 57 ++- index.php | 42 +- 17 files changed, 777 insertions(+), 453 deletions(-) diff --git a/.gitignore b/.gitignore index cfc5c7a4b..49926b62b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +app/config app/tmp vendors \ No newline at end of file diff --git a/app/config/database.php.default b/app/config/database.php.default index 5c20804d4..dda59ad15 100644 --- a/app/config/database.php.default +++ b/app/config/database.php.default @@ -1,5 +1,4 @@ <?php -/* SVN FILE: $Id$ */ /** * This is core configuration file. * @@ -7,22 +6,18 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org * @package cake * @subpackage cake.app.config * @since CakePHP(tm) v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ /** * In this file you set up your database connection details. diff --git a/app/webroot/index.php b/app/webroot/index.php index 34837799b..526cecba3 100644 --- a/app/webroot/index.php +++ b/app/webroot/index.php @@ -1,27 +1,22 @@ <?php -/* SVN FILE: $Id$ */ /** - * Short description for file. + * Index * - * Long description for file + * The Front Controller for handling every request * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org * @package cake * @subpackage cake.app.webroot * @since CakePHP(tm) v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** @@ -85,7 +80,7 @@ return; } else { $Dispatcher = new Dispatcher(); - $Dispatcher->dispatch($url); + $Dispatcher->dispatch(); } if (Configure::read() > 0) { echo "<!-- " . round(getMicrotime() - $TIME_START, 4) . "s -->"; diff --git a/cake/bootstrap.php b/cake/bootstrap.php index 403ebdaf2..c50974478 100644 --- a/cake/bootstrap.php +++ b/cake/bootstrap.php @@ -1,48 +1,35 @@ <?php -/* SVN FILE: $Id$ */ /** * Basic Cake functionality. * - * Core functions for including other source files, loading models and so forth. + * Handles loading of core files needed on every request * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org * @package cake * @subpackage cake.cake * @since CakePHP(tm) v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ if (!defined('PHP5')) { define('PHP5', (PHP_VERSION >= 5)); } -/** - * Configuration, directory layout and standard libraries - */ - if (!isset($bootstrap)) { - require CORE_PATH . 'cake' . DS . 'basics.php'; - $TIME_START = getMicrotime(); - require CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php'; - require LIBS . 'object.php'; - require LIBS . 'inflector.php'; - require LIBS . 'configure.php'; - } - require LIBS . 'cache.php'; - - Configure::getInstance(); - - $url = null; - - App::import('Core', array('Dispatcher')); +require CORE_PATH . 'cake' . DS . 'basics.php'; +$TIME_START = getMicrotime(); +require CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php'; +require LIBS . 'object.php'; +require LIBS . 'inflector.php'; +require LIBS . 'configure.php'; +require LIBS . 'set.php'; +require LIBS . 'cache.php'; +Configure::getInstance(); +require CAKE . 'dispatcher.php'; ?> \ No newline at end of file diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index aefe126ea..1fce18a71 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -375,7 +375,7 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) { $actions .= "\t\t\t\$this->flash(__('Invalid {$singularHumanName}', true), array('action'=>'index'));\n"; } $actions .= "\t\t}\n"; - $actions .= "\t\tif (\$this->{$currentModelName}->del(\$id)) {\n"; + $actions .= "\t\tif (\$this->{$currentModelName}->delete(\$id)) {\n"; if ($wannaUseSession) { $actions .= "\t\t\t\$this->Session->setFlash(__('{$singularHumanName} deleted', true));\n"; $actions .= "\t\t\t\$this->redirect(array('action'=>'index'));\n"; diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index aa7c26b62..e16835240 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -1,26 +1,21 @@ <?php -/* SVN FILE: $Id$ */ /** * Base controller class. * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org * @package cake * @subpackage cake.cake.libs.controller * @since CakePHP(tm) v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ /** * Include files @@ -55,7 +50,7 @@ class Controller extends Object { */ var $here = null; /** - * The webroot of the application. Helpful if your application is placed in a folder under the current domain name. + * The webroot of the application. * * @var string * @access public @@ -292,7 +287,7 @@ class Controller extends Object { */ var $methods = array(); /** - * This controller's primary model class name, the Inflector::classify()'ed version of + * This controller's primary model class name, the Inflector::classify()'ed version of * the controller's $name property. * * Example: For a controller named 'Comments', the modelClass would be 'Comment' @@ -325,7 +320,8 @@ function __construct() { if ($this->name === null) { $r = null; if (!preg_match('/(.*)Controller/i', get_class($this), $r)) { - die (__("Controller::__construct() : Can not get or parse my own class name, exiting.")); + __("Controller::__construct() : Can not get or parse my own class name, exiting."); + $this->_stop(); } $this->name = $r[1]; } @@ -395,7 +391,9 @@ function __mergeVars() { $app = Set::normalize($appVars[$var]); $this->{$var} = Set::merge($app, $normal); } else { - $this->{$var} = Set::merge($this->{$var}, array_diff($appVars[$var], $this->{$var})); + $this->{$var} = Set::merge( + $this->{$var}, array_diff($appVars[$var], $this->{$var}) + ); } } } @@ -417,7 +415,9 @@ function __mergeVars() { $app = Set::normalize($appVars[$var]); $this->{$var} = Set::merge($normal, array_diff_assoc($app, $normal)); } else { - $this->{$var} = Set::merge($this->{$var}, array_diff($appVars[$var], $this->{$var})); + $this->{$var} = Set::merge( + $this->{$var}, array_diff($appVars[$var], $this->{$var}) + ); } } } @@ -462,7 +462,7 @@ function constructClasses() { } /** * Loads and instantiates models required by this controller. - * If Controller::persistModel; is true, controller will create cached model instances on first request, + * If Controller::persistModel; is true, controller will cache model instances on first request, * additional request will used cached models. * If the model is non existent, it will throw a missing database table error, as Cake generates * dynamic models for the time being. @@ -498,13 +498,19 @@ function loadModel($modelClass = null, $id = null) { $this->modelNames[] = $modelClass; if (!PHP5) { - $this->{$modelClass} =& ClassRegistry::init(array('class' => $plugin . $modelClass, 'alias' => $modelClass, 'id' => $id)); + $this->{$modelClass} =& ClassRegistry::init(array( + 'class' => $plugin . $modelClass, 'alias' => $modelClass, 'id' => $id + )); } else { - $this->{$modelClass} = ClassRegistry::init(array('class' => $plugin . $modelClass, 'alias' => $modelClass, 'id' => $id)); + $this->{$modelClass} = ClassRegistry::init(array( + 'class' => $plugin . $modelClass, 'alias' => $modelClass, 'id' => $id + )); } if (!$this->{$modelClass}) { - return $this->cakeError('missingModel', array(array('className' => $modelClass, 'webroot' => '', 'base' => $this->base))); + return $this->cakeError('missingModel', array(array( + 'className' => $modelClass, 'webroot' => '', 'base' => $this->base + ))); } if ($this->persistModel === true) { @@ -522,7 +528,8 @@ function loadModel($modelClass = null, $id = null) { * Redirects to given $url, after turning off $this->autoRender. * Script execution is halted after the redirect. * - * @param mixed $url A string or array-based URL pointing to another location within the app, or an absolute URL + * @param mixed $url A string or array-based URL pointing to another location within the app, + * or an absolute URL * @param integer $status Optional HTTP status code (eg: 404) * @param boolean $exit If true, exit() will be called after the redirect * @return mixed void if $exit = false. Terminates script if $exit = true @@ -689,14 +696,17 @@ function setAction($action) { return call_user_func_array(array(&$this, $action), $args); } /** - * Controller callback to tie into Auth component. Only called when AuthComponent::authorize is set to 'controller'. + * Controller callback to tie into Auth component. + * Only called when AuthComponent::authorize is set to 'controller'. * * @return bool true if authorized, false otherwise * @access public * @link http://book.cakephp.org/view/396/authorize */ function isAuthorized() { - trigger_error(sprintf(__('%s::isAuthorized() is not defined.', true), $this->name), E_USER_WARNING); + trigger_error(sprintf( + __('%s::isAuthorized() is not defined.', true), $this->name + ), E_USER_WARNING); return false; } /** @@ -776,8 +786,13 @@ function render($action = null, $layout = null, $file = null) { if (isset($this->$currentModel) && is_a($this->$currentModel, 'Model')) { $models[] = Inflector::underscore($currentModel); } - if (isset($this->$currentModel) && is_a($this->$currentModel, 'Model') && !empty($this->$currentModel->validationErrors)) { - $View->validationErrors[Inflector::camelize($currentModel)] =& $this->$currentModel->validationErrors; + $isValidModel = ( + isset($this->$currentModel) && is_a($this->$currentModel, 'Model') && + !empty($this->$currentModel->validationErrors) + ); + if ($isValidModel) { + $View->validationErrors[Inflector::camelize($currentModel)] =& + $this->$currentModel->validationErrors; } } $models = array_diff(ClassRegistry::keys(), $models); @@ -785,7 +800,8 @@ function render($action = null, $layout = null, $file = null) { if (ClassRegistry::isKeySet($currentModel)) { $currentObject =& ClassRegistry::getObject($currentModel); if (is_a($currentObject, 'Model') && !empty($currentObject->validationErrors)) { - $View->validationErrors[Inflector::camelize($currentModel)] =& $currentObject->validationErrors; + $View->validationErrors[Inflector::camelize($currentModel)] =& + $currentObject->validationErrors; } } } @@ -821,7 +837,8 @@ function referer($default = null, $local = false) { } if ($default != null) { - return $default; + $url = Router::url($default, true); + return $url; } return '/'; } @@ -863,9 +880,11 @@ function flash($message, $url, $pause = 1) { * Converts POST'ed form data to a model conditions array, suitable for use in a Model::find() call. * * @param array $data POST'ed data organized by model and field - * @param mixed $op A string containing an SQL comparison operator, or an array matching operators to fields + * @param mixed $op A string containing an SQL comparison operator, or an array matching operators + * to fields * @param string $bool SQL boolean operator: AND, OR, XOR, etc. - * @param boolean $exclusive If true, and $op is an array, fields not included in $op will not be included in the returned conditions + * @param boolean $exclusive If true, and $op is an array, fields not included in $op will not be + * included in the returned conditions * @return array An array of model conditions * @access public * @link http://book.cakephp.org/view/432/postConditions @@ -940,11 +959,16 @@ function paginate($object = null, $scope = array(), $whitelist = array()) { if ($assoc && isset($this->{$object}->{$assoc})) { $object = $this->{$object}->{$assoc}; - } elseif ($assoc && isset($this->{$this->modelClass}) && isset($this->{$this->modelClass}->{$assoc})) { + } elseif ( + $assoc && isset($this->{$this->modelClass}) && + isset($this->{$this->modelClass}->{$assoc} + )) { $object = $this->{$this->modelClass}->{$assoc}; } elseif (isset($this->{$object})) { $object = $this->{$object}; - } elseif (isset($this->{$this->modelClass}) && isset($this->{$this->modelClass}->{$object})) { + } elseif ( + isset($this->{$this->modelClass}) && isset($this->{$this->modelClass}->{$object} + )) { $object = $this->{$this->modelClass}->{$object}; } } elseif (empty($object) || $object === null) { @@ -965,7 +989,11 @@ function paginate($object = null, $scope = array(), $whitelist = array()) { } if (!is_object($object)) { - trigger_error(sprintf(__('Controller::paginate() - can\'t find model %1$s in controller %2$sController', true), $object, $this->name), E_USER_WARNING); + trigger_error(sprintf( + __('Controller::paginate() - can\'t find model %1$s in controller %2$sController', + true + ), $object, $this->name + ), E_USER_WARNING); return array(); } $options = array_merge($this->params, $this->params['url'], $this->passedArgs); @@ -1071,7 +1099,9 @@ function paginate($object = null, $scope = array(), $whitelist = array()) { $page = $options['page'] = (integer)$page; if (method_exists($object, 'paginate')) { - $results = $object->paginate($conditions, $fields, $order, $limit, $page, $recursive, $extra); + $results = $object->paginate( + $conditions, $fields, $order, $limit, $page, $recursive, $extra + ); } else { $parameters = compact('conditions', 'fields', 'order', 'limit', 'page'); if ($recursive != $object->recursive) { @@ -1167,4 +1197,4 @@ function _scaffoldError($method) { return false; } } -?> +?> \ No newline at end of file diff --git a/cake/libs/controller/scaffold.php b/cake/libs/controller/scaffold.php index 1c326cffe..2f9d34e8c 100644 --- a/cake/libs/controller/scaffold.php +++ b/cake/libs/controller/scaffold.php @@ -1,5 +1,4 @@ <?php -/* SVN FILE: $Id$ */ /** * Scaffold. * @@ -7,25 +6,21 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org * @package cake * @subpackage cake.cake.libs.controller * @since Cake v 0.10.0.1076 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ /** - * Scaffolding is a set of automatic views, forms and controllers for starting web development work faster. + * Scaffolding is a set of automatic actions for starting web development work faster. * * Scaffold inspects your database tables, and making educated guesses, sets up a * number of pages for each of your Models. These pages have data forms that work, @@ -113,13 +108,23 @@ class Scaffold extends Object { * @access public */ var $plugin = null; +/** + * valid session. + * + * @var boolean + * @access public + */ + var $_validSession = null; /** * List of variables to collect from the associated controller * * @var array * @access private */ - var $__passedVars = array('action', 'base', 'webroot', 'layout', 'name', 'viewPath', 'ext', 'params', 'data', 'plugin', 'cacheAction'); + var $__passedVars = array( + 'action', 'base', 'webroot', 'layout', 'name', + 'viewPath', 'ext', 'params', 'data', 'plugin', 'cacheAction' + ); /** * Title HTML element for current scaffolded view * @@ -148,14 +153,16 @@ function __construct(&$controller, $params) { $this->modelKey = $controller->modelKey; if (!is_object($this->controller->{$this->modelClass})) { - return $this->cakeError('missingModel', array(array('className' => $this->modelClass, 'webroot' => '', 'base' => $controller->base))); + return $this->cakeError('missingModel', array(array( + 'className' => $this->modelClass, 'webroot' => '', 'base' => $controller->base + ))); } $this->ScaffoldModel =& $this->controller->{$this->modelClass}; $this->scaffoldTitle = Inflector::humanize($this->viewPath); $this->scaffoldActions = $controller->scaffold; - $this->controller->pageTitle = __('Scaffold :: ', true) . Inflector::humanize($this->action) . ' :: ' . $this->scaffoldTitle; - + $this->controller->pageTitle = __('Scaffold :: ', true) + . Inflector::humanize($this->action) . ' :: ' . $this->scaffoldTitle; $modelClass = $this->controller->modelClass; $primaryKey = $this->ScaffoldModel->primaryKey; $displayField = $this->ScaffoldModel->displayField; @@ -166,13 +173,18 @@ function __construct(&$controller, $params) { $scaffoldFields = array_keys($this->ScaffoldModel->schema()); $associations = $this->__associations(); - $this->controller->set(compact('modelClass', 'primaryKey', 'displayField', 'singularVar', 'pluralVar', - 'singularHumanName', 'pluralHumanName', 'scaffoldFields', 'associations')); + $this->controller->set(compact( + 'modelClass', 'primaryKey', 'displayField', 'singularVar', 'pluralVar', + 'singularHumanName', 'pluralHumanName', 'scaffoldFields', 'associations' + )); if ($this->controller->view && $this->controller->view !== 'Theme') { $this->controller->view = 'scaffold'; } $this->__scaffold($params); + $this->_validSession = ( + isset($this->controller->Session) && $this->controller->Session->valid() != false + ); } /** * Outputs the content of a scaffold method passing it through the Controller::afterFilter() @@ -196,16 +208,23 @@ function __scaffoldView($params) { if (isset($params['pass'][0])) { $this->ScaffoldModel->id = $params['pass'][0]; - } elseif (isset($this->controller->Session) && $this->controller->Session->valid() != false) { - $this->controller->Session->setFlash(sprintf(__("No id set for %s::view()", true), Inflector::humanize($this->modelKey))); + } elseif ($this->_validSession) { + $this->controller->Session->setFlash(sprintf( + __("No id set for %s::view()", true), + Inflector::humanize($this->modelKey + ))); $this->controller->redirect($this->redirect); } else { - return $this->controller->flash(sprintf(__("No id set for %s::view()", true), Inflector::humanize($this->modelKey)), - '/' . Inflector::underscore($this->controller->viewPath)); + return $this->controller->flash(sprintf( + __("No id set for %s::view()", true), Inflector::humanize($this->modelKey)), + '/' . Inflector::underscore($this->controller->viewPath + )); } $this->ScaffoldModel->recursive = 1; $this->controller->data = $this->ScaffoldModel->read(); - $this->controller->set(Inflector::variable($this->controller->modelClass), $this->controller->data); + $this->controller->set( + Inflector::variable($this->controller->modelClass), $this->controller->data + ); $this->controller->render($this->action, $this->layout); $this->_output(); } elseif ($this->controller->_scaffoldError('view') === false) { @@ -222,7 +241,9 @@ function __scaffoldView($params) { function __scaffoldIndex($params) { if ($this->controller->_beforeScaffold('index')) { $this->ScaffoldModel->recursive = 0; - $this->controller->set(Inflector::variable($this->controller->name), $this->controller->paginate()); + $this->controller->set( + Inflector::variable($this->controller->name), $this->controller->paginate() + ); $this->controller->render($this->action, $this->layout); $this->_output(); } elseif ($this->controller->_scaffoldError('index') === false) { @@ -263,11 +284,17 @@ function __scaffoldSave($params = array(), $action = 'edit') { } if (!$this->ScaffoldModel->exists()) { - if (isset($this->controller->Session) && $this->controller->Session->valid() != false) { - $this->controller->Session->setFlash(sprintf(__("Invalid id for %s::edit()", true), Inflector::humanize($this->modelKey))); + if ($this->_validSession) { + $this->controller->Session->setFlash(sprintf( + __("Invalid id for %s::edit()", true), + Inflector::humanize($this->modelKey) + )); $this->controller->redirect($this->redirect); } else { - return $this->controller->flash(sprintf(__("Invalid id for %s::edit()", true), Inflector::humanize($this->modelKey)), $this->redirect); + return $this->controller->flash(sprintf( + __("Invalid id for %s::edit()", true), + Inflector::humanize($this->modelKey) + ), $this->redirect); } } } @@ -279,18 +306,26 @@ function __scaffoldSave($params = array(), $action = 'edit') { if ($this->ScaffoldModel->save($this->controller->data)) { if ($this->controller->_afterScaffoldSave($action)) { - if (isset($this->controller->Session) && $this->controller->Session->valid() != false) { - $this->controller->Session->setFlash(sprintf(__('The %1$s has been %2$s', true), Inflector::humanize($this->modelClass), $success)); + if ($this->_validSession) { + $this->controller->Session->setFlash(sprintf( + __('The %1$s has been %2$s', true), + Inflector::humanize($this->modelClass), $success + )); $this->controller->redirect($this->redirect); } else { - return $this->controller->flash(sprintf(__('The %1$s has been %2$s', true), Inflector::humanize($this->modelClass), $success), $this->redirect); + return $this->controller->flash(sprintf( + __('The %1$s has been %2$s', true), + Inflector::humanize($this->modelClass), $success + ), $this->redirect); } } else { return $this->controller->_afterScaffoldSaveError($action); } } else { - if (isset($this->controller->Session) && $this->controller->Session->valid() != false) { - $this->controller->Session->setFlash(__('Please correct errors below.', true)); + if ($this->_validSession) { + $this->controller->Session->setFlash( + __('Please correct errors below.', true + )); } } } @@ -304,7 +339,9 @@ function __scaffoldSave($params = array(), $action = 'edit') { } foreach ($this->ScaffoldModel->belongsTo as $assocName => $assocData) { - $varName = Inflector::variable(Inflector::pluralize(preg_replace('/(?:_id)$/', '', $assocData['foreignKey']))); + $varName = Inflector::variable(Inflector::pluralize( + preg_replace('/(?:_id)$/', '', $assocData['foreignKey']) + )); $this->controller->set($varName, $this->ScaffoldModel->{$assocName}->find('list')); } foreach ($this->ScaffoldModel->hasAndBelongsToMany as $assocName => $assocData) { @@ -328,27 +365,42 @@ function __scaffoldDelete($params = array()) { if ($this->controller->_beforeScaffold('delete')) { if (isset($params['pass'][0])) { $id = $params['pass'][0]; - } elseif (isset($this->controller->Session) && $this->controller->Session->valid() != false) { - $this->controller->Session->setFlash(sprintf(__("No id set for %s::delete()", true), Inflector::humanize($this->modelKey))); + } elseif ($this->_validSession) { + $this->controller->Session->setFlash(sprintf( + __("No id set for %s::delete()", true), Inflector::humanize($this->modelKey) + )); $this->controller->redirect($this->redirect); } else { - return $this->controller->flash(sprintf(__("No id set for %s::delete()", true), Inflector::humanize($this->modelKey)), - '/' . Inflector::underscore($this->controller->viewPath)); + return $this->controller->flash(sprintf( + __("No id set for %s::delete()", true), Inflector::humanize($this->modelKey) + ), '/' . Inflector::underscore($this->controller->viewPath)); } - if ($this->ScaffoldModel->del($id)) { - if (isset($this->controller->Session) && $this->controller->Session->valid() != false) { - $this->controller->Session->setFlash(sprintf(__('The %1$s with id: %2$d has been deleted.', true), Inflector::humanize($this->modelClass), $id)); + if ($this->ScaffoldModel->delete($id)) { + if ($this->_validSession) { + $this->controller->Session->setFlash(sprintf( + __('The %1$s with id: %2$d has been deleted.', true), + Inflector::humanize($this->modelClass), $id + )); $this->controller->redirect($this->redirect); } else { - return $this->controller->flash(sprintf(__('The %1$s with id: %2$d has been deleted.', true), Inflector::humanize($this->modelClass), $id), '/' . $this->viewPath); + return $this->controller->flash(sprintf( + __('The %1$s with id: %2$d has been deleted.', true), + Inflector::humanize($this->modelClass), $id + ), '/' . $this->viewPath); } } else { - if (isset($this->controller->Session) && $this->controller->Session->valid() != false) { - $this->controller->Session->setFlash(sprintf(__('There was an error deleting the %1$s with id: %2$d', true), Inflector::humanize($this->modelClass), $id)); + if ($this->_validSession) { + $this->controller->Session->setFlash(sprintf( + __('There was an error deleting the %1$s with id: %2$d', true), + Inflector::humanize($this->modelClass), $id + )); $this->controller->redirect($this->redirect); } else { - return $this->controller->flash(sprintf(__('There was an error deleting the %1$s with id: %2$d', true), Inflector::humanize($this->modelClass), $id), '/' . $this->viewPath); + return $this->controller->flash(sprintf( + __('There was an error deleting the %1$s with id: %2$d', true), + Inflector::humanize($this->modelClass), $id + ), '/' . $this->viewPath); } } } elseif ($this->controller->_scaffoldError('delete') === false) { @@ -383,9 +435,14 @@ function __scaffold($params) { if (isset($db)) { if (empty($this->scaffoldActions)) { - $this->scaffoldActions = array('index', 'list', 'view', 'add', 'create', 'edit', 'update', 'delete'); + $this->scaffoldActions = array( + 'index', 'list', 'view', 'add', 'create', 'edit', 'update', 'delete' + ); } elseif (!empty($admin) && $this->scaffoldActions === $admin) { - $this->scaffoldActions = array($admin .'_index', $admin .'_list', $admin .'_view', $admin .'_add', $admin .'_create', $admin .'_edit', $admin .'_update', $admin .'_delete'); + $this->scaffoldActions = array( + $admin .'_index', $admin .'_list', $admin .'_view', $admin .'_add', + $admin .'_create', $admin .'_edit', $admin .'_update', $admin .'_delete' + ); } if (in_array($params['action'], $this->scaffoldActions)) { @@ -419,13 +476,17 @@ function __scaffold($params) { break; } } else { - return $this->cakeError('missingAction', array(array('className' => $this->controller->name . "Controller", - 'base' => $this->controller->base, - 'action' => $this->action, - 'webroot' => $this->controller->webroot))); + return $this->cakeError('missingAction', array(array( + 'className' => $this->controller->name . "Controller", + 'base' => $this->controller->base, + 'action' => $this->action, + 'webroot' => $this->controller->webroot + ))); } } else { - return $this->cakeError('missingDatabase', array(array('webroot' => $this->controller->webroot))); + return $this->cakeError('missingDatabase', array(array( + 'webroot' => $this->controller->webroot + ))); } } /** @@ -440,10 +501,17 @@ function __associations() { foreach ($keys as $key => $type) { foreach ($this->ScaffoldModel->{$type} as $assocKey => $assocData) { - $associations[$type][$assocKey]['primaryKey'] = $this->ScaffoldModel->{$assocKey}->primaryKey; - $associations[$type][$assocKey]['displayField'] = $this->ScaffoldModel->{$assocKey}->displayField; - $associations[$type][$assocKey]['foreignKey'] = $assocData['foreignKey']; - $associations[$type][$assocKey]['controller'] = Inflector::pluralize(Inflector::underscore($assocData['className'])); + $associations[$type][$assocKey]['primaryKey'] = + $this->ScaffoldModel->{$assocKey}->primaryKey; + + $associations[$type][$assocKey]['displayField'] = + $this->ScaffoldModel->{$assocKey}->displayField; + + $associations[$type][$assocKey]['foreignKey'] = + $assocData['foreignKey']; + + $associations[$type][$assocKey]['controller'] = + Inflector::pluralize(Inflector::underscore($assocData['className'])); } } return $associations; diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index c070d9098..bab67ae80 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -1,5 +1,4 @@ <?php -/* SVN FILE: $Id$ */ /** * Framework debugging and PHP error-handling class * @@ -7,33 +6,34 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.4560 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ + /** * Included libraries. * */ - if (!class_exists('Object')) { - uses('object'); - } - if (!class_exists('CakeLog')) { - uses('cake_log'); - } +if (!class_exists('Object')) { + require_once LIBS . 'object.php'; +} +if (!class_exists('CakeLog')) { + require_once LIBS . 'cake_log.php'; +} +if (!class_exists('String')) { + require_once LIBS . 'string.php'; +} + /** * Provide custom logging and error handling. * @@ -44,6 +44,7 @@ * @link http://book.cakephp.org/view/460/Using-the-Debugger-Class */ class Debugger extends Object { + /** * A list of errors generated by the application. * @@ -51,6 +52,7 @@ class Debugger extends Object { * @access public */ var $errors = array(); + /** * Contains the base URL for error code documentation. * @@ -58,6 +60,7 @@ class Debugger extends Object { * @access public */ var $helpPath = null; + /** * The current output format. * @@ -65,26 +68,110 @@ class Debugger extends Object { * @access protected */ var $_outputFormat = 'js'; + +/** + * Templates used when generating trace or error strings. Can be global or indexed by the format + * value used in $_outputFormat. + * + * @var string + * @access protected + */ + var $_templates = array( + 'log' => array( + 'trace' => '{:reference} - {:path}, line {:line}', + 'error' => "{:error} ({:code}): {:description} in [{:file}, line {:line}]" + ), + 'js' => array( + 'error' => '', + 'info' => '', + 'trace' => '<pre class="stack-trace">{:trace}</pre>', + 'code' => '', + 'context' => '', + 'links' => array() + ), + 'html' => array( + 'trace' => '<pre class="cake-debug trace"><b>Trace</b> <p>{:trace}</p></pre>', + 'context' => '<pre class="cake-debug context"><b>Context</b> <p>{:context}</p></pre>' + ), + 'txt' => array( + 'error' => "{:error}: {:code} :: {:description} on line {:line} of {:path}\n{:info}", + 'context' => "Context:\n{:context}\n", + 'trace' => "Trace:\n{:trace}\n", + 'code' => '', + 'info' => '' + ), + 'base' => array( + 'traceLine' => '{:reference} - {:path}, line {:line}' + ) + ); + /** * Holds current output data when outputFormat is false. * * @var string * @access private */ - var $__data = array(); + var $_data = array(); + /** * Constructor. * */ function __construct() { $docRef = ini_get('docref_root'); + if (empty($docRef)) { ini_set('docref_root', 'http://php.net/'); } if (!defined('E_RECOVERABLE_ERROR')) { define('E_RECOVERABLE_ERROR', 4096); } + if (!defined('E_DEPRECATED')) { + define('E_DEPRECATED', 8192); + } + + $e = '<a href="javascript:void(0);" onclick="document.getElementById(\'{:id}-trace\')'; + $e .= '.style.display = (document.getElementById(\'{:id}-trace\').style.display == '; + $e .= '\'none\' ? \'\' : \'none\');"><b>{:error}</b> ({:code})</a>: {:description} '; + $e .= '[<b>{:path}</b>, line <b>{:line}</b>]'; + + $e .= '<div id="{:id}-trace" class="cake-stack-trace" style="display: none;">'; + $e .= '{:links}{:info}</div>'; + $this->_templates['js']['error'] = $e; + + $t = '<div id="{:id}-trace" class="cake-stack-trace" style="display: none;">'; + $t .= '{:context}{:code}{:trace}</div>'; + $this->_templates['js']['info'] = $t; + + $links = array(); + $link = '<a href="javascript:void(0);" onclick="document.getElementById(\'{:id}-code\')'; + $link .= '.style.display = (document.getElementById(\'{:id}-code\').style.display == '; + $link .= '\'none\' ? \'\' : \'none\')">Code</a>'; + $links['code'] = $link; + + $link = '<a href="javascript:void(0);" onclick="document.getElementById(\'{:id}-context\')'; + $link .= '.style.display = (document.getElementById(\'{:id}-context\').style.display == '; + $link .= '\'none\' ? \'\' : \'none\')">Context</a>'; + $links['context'] = $link; + + $links['help'] = '<a href="{:helpPath}{:code}" target="_blank">Help</a>'; + $this->_templates['js']['links'] = $links; + + $this->_templates['js']['context'] = '<pre id="{:id}-context" class="cake-context" '; + $this->_templates['js']['context'] .= 'style="display: none;">{:context}</pre>'; + + $this->_templates['js']['code'] = '<div id="{:id}-code" class="cake-code-dump" '; + $this->_templates['js']['code'] .= 'style="display: none;"><pre>{:code}</pre></div>'; + + + $e = '<pre class="cake-debug"><b>{:error}</b> ({:code}) : {:description} '; + $e .= '[<b>{:path}</b>, line <b>{:line}]</b></pre>'; + $this->_templates['html']['error'] = $e; + + $this->_templates['html']['context'] = '<pre class="cake-debug context"><b>Context</b> '; + $this->_templates['html']['context'] .= '<p>{:context}</p></pre>'; } + /** * Returns a reference to the Debugger singleton object instance. * @@ -113,6 +200,7 @@ function &getInstance($class = null) { } return $instance[0]; } + /** * Formats and outputs the contents of the supplied variable. * @@ -127,6 +215,7 @@ function dump($var) { $_this = Debugger::getInstance(); pr($_this->exportVar($var)); } + /** * Creates a detailed stack trace log at the time of invocation, much like dump() * but to debug.log. @@ -175,7 +264,7 @@ function handleError($code, $description, $file = null, $line = null, $context = if (empty($line)) { $line = '??'; } - $file = $_this->trimPath($file); + $path = $_this->trimPath($file); $info = compact('code', 'description', 'file', 'line'); if (!in_array($info, $_this->errors)) { @@ -214,15 +303,20 @@ function handleError($code, $description, $file = null, $line = null, $context = $helpCode = null; if (!empty($_this->helpPath) && preg_match('/.*\[([0-9]+)\]$/', $description, $codes)) { if (isset($codes[1])) { - $helpCode = $codes[1]; + $helpID = $codes[1]; $description = trim(preg_replace('/\[[0-9]+\]$/', '', $description)); } } - echo $_this->_output($level, $error, $code, $helpCode, $description, $file, $line, $context); + $data = compact( + 'level', 'error', 'code', 'helpID', 'description', 'file', 'path', 'line', 'context' + ); + echo $_this->_output($data); if (Configure::read('log')) { - CakeLog::write($level, "{$error} ({$code}): {$description} in [{$file}, line {$line}]"); + $tpl = $_this->_templates['log']['error']; + $options = array('before' => '{:', 'after' => '}'); + CakeLog::write($level, String::insert($tpl, $data, $options)); } if ($error == 'Fatal Error') { @@ -230,6 +324,7 @@ function handleError($code, $description, $file = null, $line = null, $context = } return true; } + /** * Outputs a stack trace based on the supplied options. * @@ -240,65 +335,66 @@ function handleError($code, $description, $file = null, $line = null, $context = * @link http://book.cakephp.org/view/460/Using-the-Debugger-Class */ function trace($options = array()) { - $options = array_merge(array( - 'depth' => 999, - 'format' => '', - 'args' => false, - 'start' => 0, - 'scope' => null, - 'exclude' => null - ), - $options + $_this = Debugger::getInstance(); + $defaults = array( + 'depth' => 999, + 'format' => $_this->_outputFormat, + 'args' => false, + 'start' => 0, + 'scope' => null, + 'exclude' => null ); + $options += $defaults; $backtrace = debug_backtrace(); - $back = array(); $count = count($backtrace); + $back = array(); + + $_trace = array( + 'line' => '??', + 'file' => '[internal]', + 'class' => null, + 'function' => '[main]' + ); for ($i = $options['start']; $i < $count && $i < $options['depth']; $i++) { - $trace = array_merge( - array( - 'file' => '[internal]', - 'line' => '??' - ), - $backtrace[$i] - ); + $trace = array_merge(array('file' => '[internal]', 'line' => '??'), $backtrace[$i]); if (isset($backtrace[$i + 1])) { - $next = array_merge( - array( - 'line' => '??', - 'file' => '[internal]', - 'class' => null, - 'function' => '[main]' - ), - $backtrace[$i + 1] - ); - $function = $next['function']; + $next = array_merge($_trace, $backtrace[$i + 1]); + $reference = $next['function']; if (!empty($next['class'])) { - $function = $next['class'] . '::' . $function . '('; + $reference = $next['class'] . '::' . $reference . '('; if ($options['args'] && isset($next['args'])) { $args = array(); foreach ($next['args'] as $arg) { $args[] = Debugger::exportVar($arg); } - $function .= join(', ', $args); + $reference .= join(', ', $args); } - $function .= ')'; + $reference .= ')'; } } else { - $function = '[main]'; + $reference = '[main]'; } - if (in_array($function, array('call_user_func_array', 'trigger_error'))) { + if (in_array($reference, array('call_user_func_array', 'trigger_error'))) { continue; } if ($options['format'] == 'points' && $trace['file'] != '[internal]') { $back[] = array('file' => $trace['file'], 'line' => $trace['line']); - } elseif (empty($options['format'])) { - $back[] = $function . ' - ' . Debugger::trimPath($trace['file']) . ', line ' . $trace['line']; - } else { + } elseif ($options['format'] == 'array') { $back[] = $trace; + } else { + if (isset($_this->_templates[$options['format']]['traceLine'])) { + $tpl = $_this->_templates[$options['format']]['traceLine']; + } else { + $tpl = $_this->_templates['base']['traceLine']; + } + $trace['path'] = Debugger::trimPath($trace['file']); + $trace['reference'] = $reference; + unset($trace['object'], $trace['args']); + $back[] = String::insert($tpl, $trace, array('before' => '{:', 'after' => '}')); } } @@ -307,6 +403,7 @@ function trace($options = array()) { } return join("\n", $back); } + /** * Shortens file paths by replacing the application base path with 'APP', and the CakePHP core * path with 'CORE'. @@ -336,6 +433,7 @@ function trimPath($path) { } return $path; } + /** * Grabs an excerpt from a file and highlights a given line of code * @@ -370,6 +468,7 @@ function excerpt($file, $line, $context = 2) { } return $lines; } + /** * Converts a variable to a string for debug output. * @@ -424,6 +523,7 @@ function exportVar($var, $recursion = 0) { break; } } + /** * Handles object to string conversion. * @@ -454,98 +554,122 @@ function __object($var) { } return join("\n", $out); } + /** - * Handles object conversion to debug string. + * Switches output format, updates format strings * - * @param string $var Object to convert + * @param string $format Format to use, including 'js' for JavaScript-enhanced HTML, 'html' for + * straight HTML output, or 'text' for unformatted text. * @access protected */ - function output($format = 'js') { + function output($format = null, $strings = array()) { $_this = Debugger::getInstance(); $data = null; - if ($format === true && !empty($_this->__data)) { - $data = $_this->__data; - $_this->__data = array(); + if (is_null($format)) { + return $_this->_outputFormat; + } + + if (!empty($strings)) { + if (isset($_this->_templates[$format])) { + if (isset($strings['links'])) { + $_this->_templates[$format]['links'] = array_merge( + $_this->_templates[$format]['links'], + $strings['links'] + ); + unset($strings['links']); + } + $_this->_templates[$format] = array_merge($_this->_templates[$format], $strings); + } else { + $_this->_templates[$format] = $strings; + } + return $_this->_templates[$format]; + } + + if ($format === true && !empty($_this->_data)) { + $data = $_this->_data; + $_this->_data = array(); $format = false; } $_this->_outputFormat = $format; return $data; } + /** - * Handles object conversion to debug string. + * Renders error messages * - * @param string $var Object to convert + * @param array $data Data about the current error * @access private */ - function _output($level, $error, $code, $helpCode, $description, $file, $line, $kontext) { + function _output($data = array()) { + $defaults = array( + 'level' => 0, + 'error' => 0, + 'code' => 0, + 'helpID' => null, + 'description' => '', + 'file' => '', + 'line' => 0, + 'context' => array() + ); + $data += $defaults; + $files = $this->trace(array('start' => 2, 'format' => 'points')); - $listing = $this->excerpt($files[0]['file'], $files[0]['line'] - 1, 1); + $code = $this->excerpt($files[0]['file'], $files[0]['line'] - 1, 1); $trace = $this->trace(array('start' => 2, 'depth' => '20')); + $insertOpts = array('before' => '{:', 'after' => '}'); $context = array(); + $links = array(); + $info = ''; - foreach ((array)$kontext as $var => $value) { + foreach ((array)$data['context'] as $var => $value) { $context[] = "\${$var}\t=\t" . $this->exportVar($value, 1); } switch ($this->_outputFormat) { - default: - case 'js': - $link = "document.getElementById(\"CakeStackTrace" . count($this->errors) . "\").style.display = (document.getElementById(\"CakeStackTrace" . count($this->errors) . "\").style.display == \"none\" ? \"\" : \"none\")"; - $out = "<a href='javascript:void(0);' onclick='{$link}'><b>{$error}</b> ({$code})</a>: {$description} [<b>{$file}</b>, line <b>{$line}</b>]"; - if (Configure::read() > 0) { - debug($out, false, false); - echo '<div id="CakeStackTrace' . count($this->errors) . '" class="cake-stack-trace" style="display: none;">'; - $link = "document.getElementById(\"CakeErrorCode" . count($this->errors) . "\").style.display = (document.getElementById(\"CakeErrorCode" . count($this->errors) . "\").style.display == \"none\" ? \"\" : \"none\")"; - echo "<a href='javascript:void(0);' onclick='{$link}'>Code</a>"; - - if (!empty($context)) { - $link = "document.getElementById(\"CakeErrorContext" . count($this->errors) . "\").style.display = (document.getElementById(\"CakeErrorContext" . count($this->errors) . "\").style.display == \"none\" ? \"\" : \"none\")"; - echo " | <a href='javascript:void(0);' onclick='{$link}'>Context</a>"; - - if (!empty($helpCode)) { - echo " | <a href='{$this->helpPath}{$helpCode}' target='_blank'>Help</a>"; - } - - echo "<pre id=\"CakeErrorContext" . count($this->errors) . "\" class=\"cake-context\" style=\"display: none;\">"; - echo implode("\n", $context); - echo "</pre>"; - } + case false: + $this->_data[] = compact('context', 'trace') + $data; + return; + case 'log': + $this->log(compact('context', 'trace') + $data); + return; + } - if (!empty($listing)) { - echo "<div id=\"CakeErrorCode" . count($this->errors) . "\" class=\"cake-code-dump\" style=\"display: none;\">"; - pr(implode("\n", $listing) . "\n", false); - echo '</div>'; - } - pr($trace, false); - echo '</div>'; - } - break; - case 'html': - echo "<pre class=\"cake-debug\"><b>{$error}</b> ({$code}) : {$description} [<b>{$file}</b>, line <b>{$line}]</b></pre>"; - if (!empty($context)) { - echo "Context:\n" .implode("\n", $context) . "\n"; - } - echo "<pre class=\"cake-debug context\"><b>Context</b> <p>" . implode("\n", $context) . "</p></pre>"; - echo "<pre class=\"cake-debug trace\"><b>Trace</b> <p>" . $trace. "</p></pre>"; - break; - case 'text': - case 'txt': - echo "{$error}: {$code} :: {$description} on line {$line} of {$file}\n"; - if (!empty($context)) { - echo "Context:\n" .implode("\n", $context) . "\n"; + if (empty($this->_outputFormat) || !isset($this->_templates[$this->_outputFormat])) { + $this->_outputFormat = 'js'; + } + + $data['id'] = 'cakeErr' . count($this->errors); + $tpl = array_merge($this->_templates['base'], $this->_templates[$this->_outputFormat]); + $insert = array('context' => join("\n", $context), 'helpPath' => $this->helpPath) + $data; + + $detect = array('help' => 'helpID', 'context' => 'context'); + + if (isset($tpl['links'])) { + foreach ($tpl['links'] as $key => $val) { + if (isset($detect[$key]) && empty($insert[$detect[$key]])) { + continue; } - echo "Trace:\n" . $trace; - break; - case 'log': - $this->log(compact('error', 'code', 'description', 'line', 'file', 'context', 'trace')); - break; - case false: - $this->__data[] = compact('error', 'code', 'description', 'line', 'file', 'context', 'trace'); - break; + $links[$key] = String::insert($val, $insert, $insertOpts); + } } + + foreach (array('code', 'context', 'trace') as $key) { + if (empty($$key) || !isset($tpl[$key])) { + continue; + } + if (is_array($$key)) { + $$key = join("\n", $$key); + } + $info .= String::insert($tpl[$key], compact($key) + $insert, $insertOpts); + } + $links = join(' | ', $links); + unset($data['context']); + + echo String::insert($tpl['error'], compact('links', 'info') + $data, $insertOpts); } + /** * Verifies that the application's salt value has been changed from the default value. * @@ -557,9 +681,10 @@ function checkSessionKey() { trigger_error(__('Please change the value of \'Security.salt\' in app/config/core.php to a salt value specific to your application', true), E_USER_NOTICE); } } + /** - * Invokes the given debugger object as the current error handler, taking over control from the previous handler - * in a stack-like hierarchy. + * Invokes the given debugger object as the current error handler, taking over control from the + * previous handler in a stack-like hierarchy. * * @param object $debugger A reference to the Debugger object * @access public @@ -574,4 +699,5 @@ function invoke(&$debugger) { if (!defined('DISABLE_DEFAULT_ERROR_HANDLING')) { Debugger::invoke(Debugger::getInstance()); } + ?> \ No newline at end of file diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 1becede48..817ecf592 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1,5 +1,4 @@ <?php -/* SVN FILE: $Id$ */ /** * Object-relational mapper. * @@ -7,27 +6,25 @@ * * PHP versions 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org * @package cake * @subpackage cake.cake.libs.model * @since CakePHP(tm) v 0.10.0.0 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ /** * Included libs */ -App::import('Core', array('ClassRegistry', 'Overloadable', 'Validation', 'Behavior', 'ConnectionManager', 'Set', 'String')); +App::import('Core', array( + 'ClassRegistry', 'Overloadable', 'Validation', 'Behavior', 'ConnectionManager', 'Set', 'String' +)); /** * Object-relational mapper. * @@ -1377,7 +1374,7 @@ function updateCounterCache($keys = array(), $created = false) { if ($keys['old'][$foreignKey] != $keys[$foreignKey]) { $conditions[$fkQuoted] = $keys['old'][$foreignKey]; $count = intval($this->find('count', compact('conditions', 'recursive'))); - + $this->{$parent}->updateAll( array($assoc['counterCache'] => $count), array($this->{$parent}->escapeField() => $keys['old'][$foreignKey]) @@ -1645,17 +1642,11 @@ function updateAll($fields, $conditions = true) { return $db->update($this, $fields, null, $conditions); } /** - * Alias for del(). - * - * @param mixed $id ID of record to delete - * @param boolean $cascade Set to true to delete records that depend on this record - * @return boolean True on success - * @access public - * @see Model::del() + * @deprecated * @link http://book.cakephp.org/view/691/remove */ function remove($id = null, $cascade = true) { - return $this->del($id, $cascade); + return $this->delete($id, $cascade); } /** * Removes record for given ID. If no ID is given, the current ID is used. Returns true on success. @@ -1666,7 +1657,7 @@ function remove($id = null, $cascade = true) { * @access public * @link http://book.cakephp.org/view/690/del */ - function del($id = null, $cascade = true) { + function delete($id = null, $cascade = true) { if (!empty($id)) { $this->id = $id; } @@ -1674,7 +1665,10 @@ function del($id = null, $cascade = true) { if ($this->exists() && $this->beforeDelete($cascade)) { $db =& ConnectionManager::getDataSource($this->useDbConfig); - if (!$this->Behaviors->trigger($this, 'beforeDelete', array($cascade), array('break' => true, 'breakOn' => false))) { + $filters = $this->Behaviors->trigger($this, 'beforeDelete', array($cascade), array( + 'break' => true, 'breakOn' => false + )); + if (!$filters) { return false; } $this->_deleteDependent($id, $cascade); @@ -1700,16 +1694,10 @@ function del($id = null, $cascade = true) { return false; } /** - * Alias for del(). - * - * @param mixed $id ID of record to delete - * @param boolean $cascade Set to true to delete records that depend on this record - * @return boolean True on success - * @access public - * @see Model::del() + * @deprecated */ - function delete($id = null, $cascade = true) { - return $this->del($id, $cascade); + function del($id = null, $cascade = true) { + return $this->delete($id, $cascade); } /** * Cascades model deletes through associated hasMany and hasOne child records. @@ -1737,7 +1725,9 @@ function _deleteDependent($id, $cascade) { if (isset($data['exclusive']) && $data['exclusive']) { $model->deleteAll($conditions); } else { - $records = $model->find('all', array('conditions' => $conditions, 'fields' => $model->primaryKey)); + $records = $model->find('all', array( + 'conditions' => $conditions, 'fields' => $model->primaryKey + )); if (!empty($records)) { foreach ($records as $record) { @@ -1762,14 +1752,18 @@ function _deleteLinks($id) { $db =& ConnectionManager::getDataSource($this->useDbConfig); foreach ($this->hasAndBelongsToMany as $assoc => $data) { + $with = $data['with']; $records = $this->{$data['with']}->find('all', array( - 'conditions' => array_merge(array($this->{$data['with']}->escapeField($data['foreignKey']) => $id)), - 'fields' => $this->{$data['with']}->primaryKey, + 'conditions' => array_merge(array( + $this->{$with}->escapeField($data['foreignKey']) => $id + )), + 'fields' => $this->{$with}->primaryKey, 'recursive' => -1 )); if (!empty($records)) { foreach ($records as $record) { - $this->{$data['with']}->delete($record[$this->{$data['with']}->alias][$this->{$data['with']}->primaryKey]); + $id = $record[$this->{$with}->alias][$this->{$with}->primaryKey]; + $this->{$with}->delete($id); } } } @@ -1794,7 +1788,10 @@ function deleteAll($conditions, $cascade = true, $callbacks = false) { return $db->delete($this, $conditions); } else { $ids = Set::extract( - $this->find('all', array_merge(array('fields' => "{$this->alias}.{$this->primaryKey}", 'recursive' => 0), compact('conditions'))), + $this->find('all', array_merge(array( + 'fields' => "{$this->alias}.{$this->primaryKey}", + 'recursive' => 0), compact('conditions')) + ), "{n}.{$this->alias}.{$this->primaryKey}" ); @@ -1821,6 +1818,7 @@ function deleteAll($conditions, $cascade = true, $callbacks = false) { } } } + /** * Collects foreign keys from associations. * @@ -1837,6 +1835,7 @@ function __collectForeignKeys($type = 'belongsTo') { } return $result; } + /** * Returns true if a record with the currently set ID exists. * @@ -1863,6 +1862,7 @@ function exists($reset = false) { } return $this->__exists = ($this->find('count', $query) > 0); } + /** * Returns true if a record that meets given conditions exists. * @@ -1873,6 +1873,7 @@ function exists($reset = false) { function hasAny($conditions = null) { return ($this->find('count', array('conditions' => $conditions, 'recursive' => -1)) != false); } + /** * Returns a result set array. * @@ -1894,8 +1895,10 @@ function hasAny($conditions = null) { * - If three fields are specified, they are used (in order) for key, value and group. * - Otherwise, first and second fields are used for key and value. * - * @param array $conditions SQL conditions array, or type of find operation (all / first / count / neighbors / list / threaded) - * @param mixed $fields Either a single string of a field name, or an array of field names, or options for matching + * @param array $conditions SQL conditions array, or type of find operation (all / first / count / + * neighbors / list / threaded) + * @param mixed $fields Either a single string of a field name, or an array of field names, or + * options for matching * @param string $order SQL ORDER BY conditions (e.g. "price DESC" or "name ASC") * @param integer $recursive The number of levels deep to fetch associated records * @return array Array of records @@ -1973,6 +1976,7 @@ function find($conditions = null, $fields = array(), $order = null, $recursive = } } } + /** * Handles the before/after filter logic for find('first') operations. Only called by Model::find(). * @@ -1997,6 +2001,7 @@ function _findFirst($state, $query, $results = array()) { return $results[0]; } } + /** * Handles the before/after filter logic for find('count') operations. Only called by Model::find(). * @@ -2028,6 +2033,7 @@ function _findCount($state, $query, $results = array()) { return false; } } + /** * Handles the before/after filter logic for find('list') operations. Only called by Model::find(). * @@ -2086,6 +2092,7 @@ function _findList($state, $query, $results = array()) { return Set::combine($results, $lst['keyPath'], $lst['valuePath'], $lst['groupPath']); } } + /** * Detects the previous field's value, then uses logic to find the 'wrapping' * rows and return them. @@ -2144,6 +2151,7 @@ function _findNeighbors($state, $query, $results = array()) { return $return; } } + /** * In the event of ambiguous results returned (multiple top level results, with different parent_ids) * top level results with different parent_ids to the first result will be dropped @@ -2190,6 +2198,7 @@ function _findThreaded($state, $query, $results = array()) { return $return; } } + /** * Passes query results through model and behavior afterFilter() methods. * @@ -2205,6 +2214,7 @@ function __filterResults($results, $primary = true) { } return $this->afterFind($results, $primary); } + /** * Called only when bindTo<ModelName>() is used. * This resets the association arrays for the model back @@ -2233,6 +2243,7 @@ function resetAssociations() { $this->__backAssociation = array(); return true; } + /** * Returns false if any fields passed match any (by default, all if $or = false) of their matching values. * @@ -2275,6 +2286,7 @@ function isUnique($fields, $or = true) { } return ($this->find('count', array('conditions' => $fields, 'recursive' => -1)) == 0); } + /** * Returns a resultset for a given SQL statement. Custom SQL queries should be performed with this method. * @@ -2288,6 +2300,7 @@ function query() { $db =& ConnectionManager::getDataSource($this->useDbConfig); return call_user_func_array(array(&$db, 'query'), $params); } + /** * Returns true if all fields pass validation. * @@ -2303,6 +2316,7 @@ function validates($options = array()) { } return $errors; } + /** * Returns an array of fields that have failed validation. * @@ -2453,6 +2467,7 @@ function invalidFields($options = array()) { $this->validate = $_validate; return $this->validationErrors; } + /** * Marks a field as invalid, optionally setting the name of validation * rule (in case of multiple validation for field) that was broken. @@ -2468,6 +2483,7 @@ function invalidate($field, $value = true) { } $this->validationErrors[$field] = $value; } + /** * Returns true if given field name is a foreign key in this model. * @@ -2484,6 +2500,7 @@ function isForeignKey($field) { } return in_array($field, $foreignKeys); } + /** * Returns the display field for this model. * @@ -2494,6 +2511,7 @@ function isForeignKey($field) { function getDisplayField() { return $this->displayField; } + /** * Escapes the field name and prepends the model name. Escaping is done according to the current database driver's rules. * @@ -2515,6 +2533,7 @@ function escapeField($field = null, $alias = null) { } return $db->name($alias . '.' . $field); } + /** * Returns the current record's ID * @@ -2547,6 +2566,7 @@ function getID($list = 0) { return false; } + /** * Returns the ID of the last record this model inserted. * @@ -2556,6 +2576,7 @@ function getID($list = 0) { function getLastInsertID() { return $this->getInsertID(); } + /** * Returns the ID of the last record this model inserted. * @@ -2565,6 +2586,7 @@ function getLastInsertID() { function getInsertID() { return $this->__insertID; } + /** * Sets the ID of the last record this model inserted * @@ -2658,7 +2680,12 @@ function getAssociated($type = null) { } return array_keys($this->{$type}); } else { - $assoc = array_merge($this->hasOne, $this->hasMany, $this->belongsTo, $this->hasAndBelongsToMany); + $assoc = array_merge( + $this->hasOne, + $this->hasMany, + $this->belongsTo, + $this->hasAndBelongsToMany + ); if (array_key_exists($type, $assoc)) { foreach ($this->__associations as $a) { if (isset($this->{$a}[$type])) { @@ -2672,7 +2699,8 @@ function getAssociated($type = null) { } } /** - * Gets the name and fields to be used by a join model. This allows specifying join fields in the association definition. + * Gets the name and fields to be used by a join model. This allows specifying join fields + * in the association definition. * * @param object $model The model to be joined * @param mixed $with The 'with' key of the model association @@ -2686,16 +2714,19 @@ function joinModel($assoc, $keys = array()) { } elseif (is_array($assoc)) { $with = key($assoc); return array($with, array_unique(array_merge($assoc[$with], $keys))); - } else { - trigger_error(sprintf(__('Invalid join model settings in %s', true), $model->alias), E_USER_WARNING); } + trigger_error( + sprintf(__('Invalid join model settings in %s', true), $model->alias), + E_USER_WARNING + ); } /** * Called before each find operation. Return false if you want to halt the find * call, otherwise return the (modified) query data. * * @param array $queryData Data used to execute this query, i.e. conditions, order, etc. - * @return mixed true if the operation should continue, false if it should abort; or, modified $queryData to continue with new $queryData + * @return mixed true if the operation should continue, false if it should abort; or, modified + * $queryData to continue with new $queryData * @access public * @link http://book.cakephp.org/view/680/beforeFind */ @@ -2827,7 +2858,10 @@ function __wakeup() { * @see Model::find('all') */ function findAll($conditions = null, $fields = null, $order = null, $limit = null, $page = 1, $recursive = null) { - //trigger_error(__('(Model::findAll) Deprecated, use Model::find("all")', true), E_USER_WARNING); + trigger_error( + __('(Model::findAll) Deprecated, use Model::find("all")', true), + E_USER_WARNING + ); return $this->find('all', compact('conditions', 'fields', 'order', 'limit', 'page', 'recursive')); } /** @@ -2835,7 +2869,10 @@ function findAll($conditions = null, $fields = null, $order = null, $limit = nul * @see Model::find('count') */ function findCount($conditions = null, $recursive = 0) { - //trigger_error(__('(Model::findCount) Deprecated, use Model::find("count")', true), E_USER_WARNING); + trigger_error( + __('(Model::findCount) Deprecated, use Model::find("count")', true), + E_USER_WARNING + ); return $this->find('count', compact('conditions', 'recursive')); } /** @@ -2843,7 +2880,10 @@ function findCount($conditions = null, $recursive = 0) { * @see Model::find('threaded') */ function findAllThreaded($conditions = null, $fields = null, $order = null) { - //trigger_error(__('(Model::findAllThreaded) Deprecated, use Model::find("threaded")', true), E_USER_WARNING); + trigger_error( + __('(Model::findAllThreaded) Deprecated, use Model::find("threaded")', true), + E_USER_WARNING + ); return $this->find('threaded', compact('conditions', 'fields', 'order')); } /** @@ -2851,7 +2891,10 @@ function findAllThreaded($conditions = null, $fields = null, $order = null) { * @see Model::find('neighbors') */ function findNeighbours($conditions = null, $field, $value) { - //trigger_error(__('(Model::findNeighbours) Deprecated, use Model::find("neighbors")', true), E_USER_WARNING); + trigger_error( + __('(Model::findNeighbours) Deprecated, use Model::find("neighbors")', true), + E_USER_WARNING + ); $query = compact('conditions', 'field', 'value'); $query['fields'] = $field; if (is_array($field)) { diff --git a/cake/libs/string.php b/cake/libs/string.php index 286017bdb..6ea6bfd55 100644 --- a/cake/libs/string.php +++ b/cake/libs/string.php @@ -1,27 +1,22 @@ <?php -/* SVN FILE: $Id$ */ /** * String handling methods. * * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.0.5551 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ /** * String handling methods. @@ -59,7 +54,9 @@ function uuid() { if (strpos($node, ':') !== false) { if (substr_count($node, '::')) { - $node = str_replace('::', str_repeat(':0000', 8 - substr_count($node, ':')) . ':', $node); + $node = str_replace( + '::', str_repeat(':0000', 8 - substr_count($node, ':')) . ':', $node + ); } $node = explode(':', $node) ; $ipv6 = '' ; @@ -111,14 +108,16 @@ function uuid() { } list($timeMid, $timeLow) = explode(' ', microtime()); - $uuid = sprintf("%08x-%04x-%04x-%02x%02x-%04x%08x", (int)$timeLow, (int)substr($timeMid, 2) & 0xffff, - mt_rand(0, 0xfff) | 0x4000, mt_rand(0, 0x3f) | 0x80, mt_rand(0, 0xff), $pid, $node); + $uuid = sprintf( + "%08x-%04x-%04x-%02x%02x-%04x%08x", (int)$timeLow, (int)substr($timeMid, 2) & 0xffff, + mt_rand(0, 0xfff) | 0x4000, mt_rand(0, 0x3f) | 0x80, mt_rand(0, 0xff), $pid, $node + ); return $uuid; } /** - * Tokenizes a string using $separator, ignoring any instance of $separator that appears between $leftBound - * and $rightBound + * Tokenizes a string using $separator, ignoring any instance of $separator that appears between + * $leftBound and $rightBound * * @param string $data The data to tokenize * @param string $separator The token to split the data on @@ -140,7 +139,11 @@ function tokenize($data, $separator = ',', $leftBound = '(', $rightBound = ')') while ($offset <= $length) { $tmpOffset = -1; - $offsets = array(strpos($data, $separator, $offset), strpos($data, $leftBound, $offset), strpos($data, $rightBound, $offset)); + $offsets = array( + strpos($data, $separator, $offset), + strpos($data, $leftBound, $offset), + strpos($data, $rightBound, $offset) + ); for ($i = 0; $i < 3; $i++) { if ($offsets[$i] !== false && ($offsets[$i] < $tmpOffset || $tmpOffset == -1)) { $tmpOffset = $offsets[$i]; @@ -190,21 +193,22 @@ function tokenize($data, $separator = ',', $leftBound = '(', $rightBound = ')') return $data; } /** - * Replaces variable placeholders inside a $str with any given $data. Each key in the $data array corresponds to a variable - * placeholder name in $str. Example: - * - * Sample: String::insert('My name is :name and I am :age years old.', array('name' => 'Bob', '65')); - * Returns: My name is Bob and I am 65 years old. + * Replaces variable placeholders inside a $str with any given $data. Each key in the $data array + * corresponds to a variable placeholder name in $str. + * Example: String::insert(':name is :age years old.', array('name' => 'Bob', '65')); + * Returns: Bob is 65 years old. * * Available $options are: * before: The character or string in front of the name of the variable placeholder (Defaults to ':') * after: The character or string after the name of the variable placeholder (Defaults to null) * escape: The character or string used to escape the before character / string (Defaults to '\') - * format: A regex to use for matching variable placeholders. Default is: '/(?<!\\)\:%s/' (Overwrites before, after, breaks escape / clean) + * format: A regex to use for matching variable placeholders. Default is: '/(?<!\\)\:%s/' + * (Overwrites before, after, breaks escape / clean) * clean: A boolean or array with instructions for String::cleanInsert * * @param string $str A string containing variable placeholders - * @param string $data A key => val array where each key stands for a placeholder variable name to be replaced with val + * @param string $data A key => val array where each key stands for a placeholder variable name + * to be replaced with val * @param string $options An array of options, see description above * @return string * @access public @@ -247,6 +251,9 @@ function insert($str, $data, $options = array()) { } $dataReplacements = array_combine($hashKeys, array_values($data)); foreach ($dataReplacements as $tmpHash => $data) { + if (is_array($data)) { + $data = ''; + } $str = str_replace($tmpHash, $data, $str); } } @@ -260,15 +267,17 @@ function insert($str, $data, $options = array()) { return String::cleanInsert($str, $options); } /** - * Cleans up a Set::insert formated string with given $options depending on the 'clean' key in $options. The default method used is - * text but html is also available. The goal of this function is to replace all whitespace and uneeded markup around placeholders - * that did not get replaced by Set::insert. + * Cleans up a Set::insert formated string with given $options depending on the 'clean' key in + * $options. The default method used is text but html is also available. The goal of this function + * is to replace all whitespace and uneeded markup around placeholders that did not get replaced + * by Set::insert. * * @param string $str * @param string $options * @return string * @access public * @static + * @see Set::insert() */ function cleanInsert($str, $options) { $clean = $options['clean']; diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index a88410d2b..5a6da4a63 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -1,26 +1,21 @@ <?php -/* SVN FILE: $Id$ */ /** * Pagination Helper class file. * * Generates pagination links * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org * @package cake * @subpackage cake.cake.libs.view.helpers * @since CakePHP(tm) v 1.2.0 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ /** * Pagination Helper class for easy generation of pagination links. @@ -105,7 +100,9 @@ function options($options = array()) { if (!isset($this->params['paging'][$model])) { $this->params['paging'][$model] = array(); } - $this->params['paging'][$model] = array_merge($this->params['paging'][$model], $options[$model]); + $this->params['paging'][$model] = array_merge( + $this->params['paging'][$model], $options[$model] + ); unset($options[$model]); } $this->options = array_filter(array_merge($this->options, $options)); @@ -278,7 +275,9 @@ function link($title, $url = array(), $options = array()) { */ function url($options = array(), $asArray = false, $model = null) { $paging = $this->params($model); - $url = array_merge(array_filter(Set::diff(array_merge($paging['defaults'], $paging['options']), $paging['defaults'])), $options); + $url = array_merge(array_filter(Set::diff(array_merge( + $paging['defaults'], $paging['options']), $paging['defaults'])), $options + ); if (isset($url['order'])) { $sort = $direction = null; @@ -424,7 +423,8 @@ function counter($options = array()) { if (!is_array($options['separator'])) { $options['separator'] = array(' - ', $options['separator']); } - $out = $start . $options['separator'][0] . $end . $options['separator'][1] . $paging['count']; + $out = $start . $options['separator'][0] . $end . $options['separator'][1]; + $out .= $paging['count']; break; case 'pages': $out = $paging['page'] . $options['separator'] . $paging['pageCount']; @@ -505,7 +505,8 @@ function numbers($options = array()) { $out .= $before; for ($i = $start; $i < $params['page']; $i++) { - $out .= $this->Html->tag($tag, $this->link($i, array('page' => $i), $options)) . $separator; + $out .= $this->Html->tag($tag, $this->link($i, array('page' => $i), $options)) + . $separator; } $out .= $this->Html->tag($tag, $params['page'], array('class' => 'current')); @@ -515,7 +516,8 @@ function numbers($options = array()) { $start = $params['page'] + 1; for ($i = $start; $i < $end; $i++) { - $out .= $this->Html->tag($tag, $this->link($i, array('page' => $i), $options)). $separator; + $out .= $this->Html->tag($tag, $this->link($i, array('page' => $i), $options)) + . $separator; } if ($end != $params['page']) { @@ -591,7 +593,8 @@ function first($first = '<< first', $options = array()) { } $out .= $after; } elseif ($params['page'] > 1) { - $out = $this->Html->tag($tag, $this->link($first, array('page' => 1), $options)) . $after; + $out = $this->Html->tag($tag, $this->link($first, array('page' => 1), $options)) + . $after; } return $out; } @@ -637,7 +640,9 @@ function last($last = 'last >>', $options = array()) { } $out = $before . $out; } elseif ($params['page'] < $params['pageCount']) { - $out = $before . $this->Html->tag($tag, $this->link($last, array('page' => $params['pageCount']), $options)); + $out = $before . $this->Html->tag( + $tag, $this->link($last, array('page' => $params['pageCount']), $options + )); } return $out; } diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index 5b05dfa9c..27ef1da67 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -1,5 +1,4 @@ <?php -/* SVN FILE: $Id$ */ /** * ControllerTest file * @@ -7,22 +6,18 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * - * Licensed under The Open Group Test Suite License - * Redistributions of files must retain the above copyright notice. + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org * @package cake * @subpackage cake.tests.cases.libs.controller * @since CakePHP(tm) v 1.2.0.5436 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ App::import('Core', 'Controller'); App::import('Component', 'Security'); @@ -988,6 +983,16 @@ function testReferer() { $expected = 'http://cakephp.org'; $this->assertIdentical($result, $expected); + $_SERVER['HTTP_REFERER'] = ''; + $referer = array( + 'controller' => 'pages', + 'action' => 'display', + 'home' + ); + $result = $Controller->referer($referer, false); + $expected = 'http://' . env('HTTP_HOST') . '/pages/display/home';; + $this->assertIdentical($result, $expected); + $_SERVER['HTTP_REFERER'] = ''; $result = $Controller->referer(null, false); $expected = '/'; diff --git a/cake/tests/cases/libs/debugger.test.php b/cake/tests/cases/libs/debugger.test.php index 3efbb9465..555ec2b34 100644 --- a/cake/tests/cases/libs/debugger.test.php +++ b/cake/tests/cases/libs/debugger.test.php @@ -7,22 +7,18 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * - * Licensed under The Open Group Test Suite License - * Redistributions of files must retain the above copyright notice. + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org * @package cake * @subpackage cake.tests.cases.libs * @since CakePHP(tm) v 1.2.0.5432 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ App::import('Core', 'Debugger'); /** @@ -88,10 +84,18 @@ function testDocRef() { * @return void */ function testExcerpt() { - $return = Debugger::excerpt(__FILE__, 2, 2); - $this->assertTrue(is_array($return)); - $this->assertEqual(count($return), 4); - $this->assertPattern('#/* SVN FILE: \$Id: debugger.test.php#', $return[1]); + $result = Debugger::excerpt(__FILE__, __LINE__, 2); + $this->assertTrue(is_array($result)); + $this->assertEqual(count($result), 5); + $this->assertPattern('/function(.+)testExcerpt/', $result[1]); + + $result = Debugger::excerpt(__FILE__, 2, 2); + $this->assertTrue(is_array($result)); + $this->assertEqual(count($result), 4); + + $expected = '<code><span style="color: #000000"><span style="color: #0000BB"><?php'; + $expected .= '</span></span></code>'; + $this->assertEqual($result[0], $expected); $return = Debugger::excerpt('[internal]', 2, 2); $this->assertTrue(empty($return)); @@ -135,13 +139,59 @@ function testOutput() { ob_start(); Debugger::output('js'); $buzz .= ''; + $result = explode('</a>', ob_get_clean()); + $this->assertTags($result[0], array( + 'a' => array( + 'href' => "javascript:void(0);", + 'onclick' => "document.getElementById('cakeErr4-trace').style.display = " . + "(document.getElementById('cakeErr4-trace').style.display == 'none'" . + " ? '' : 'none');" + ), + 'b' => array(), 'Notice', '/b', ' (8)' + )); + + $this->assertPattern('/Undefined variable: buzz/', $result[1]); + $this->assertPattern('/<a[^>]+>Code/', $result[1]); + $this->assertPattern('/<a[^>]+>Context/', $result[2]); + set_error_handler('simpleTestErrorHandler'); + } + +/** + * Tests that changes in output formats using Debugger::output() change the templates used. + * + * @return void + */ + function testChangeOutputFormats() { + Debugger::invoke(Debugger::getInstance()); + Debugger::output('js', array( + 'traceLine' => '{:reference} - <a href="txmt://open?url=file://{:file}' . + '&line={:line}">{:path}</a>, line {:line}' + )); + $result = Debugger::trace(); + $this->assertPattern('/' . preg_quote('txmt://open?url=file:///', '/') . '/', $result); + + Debugger::output('xml', array( + 'error' => '<error><code>{:code}</code><file>{:file}</file><line>{:line}</line>' . + '{:description}</error>', + 'context' => "<context>{:context}</context>", + 'trace' => "<stack>{:trace}</stack>", + )); + Debugger::output('xml'); + + ob_start(); + $foo .= ''; $result = ob_get_clean(); - $this->assertPattern("/<a href\='javascript:void\(0\);' onclick\='/", $result); - $this->assertPattern('/<b>Notice<\/b>/', $result); - $this->assertPattern('/Undefined variable: buzz/', $result); - $this->assertPattern('/<a[^>]+>Code<\/a>/', $result); - $this->assertPattern('/<a[^>]+>Context<\/a>/', $result); set_error_handler('simpleTestErrorHandler'); + + $data = array( + 'error' => array(), + 'code' => array(), '8', '/code', + 'file' => array(), 'preg:/[^<]+/', '/file', + 'line' => array(), '' . (intval(__LINE__) + -8), '/line', + 'Undefined variable: foo', + '/error' + ); + $this->assertTags($result, $data, true); } /** * testTrimPath method diff --git a/cake/tests/cases/libs/model/behavior.test.php b/cake/tests/cases/libs/model/behavior.test.php index 9b3760259..a3f45b888 100644 --- a/cake/tests/cases/libs/model/behavior.test.php +++ b/cake/tests/cases/libs/model/behavior.test.php @@ -1,5 +1,4 @@ <?php -/* SVN FILE: $Id$ */ /** * BehaviorTest file * @@ -7,21 +6,18 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * @link http://www.cakephp.org + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org * @package cake * @subpackage cake.tests.cases.libs.model * @since 1.2 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ App::import('Model', 'AppModel'); require_once dirname(__FILE__) . DS . 'models.php'; @@ -796,26 +792,26 @@ function testBehaviorDeleteCallbacks() { $Apple = new Apple(); $Apple->Behaviors->attach('Test', array('beforeFind' => 'off', 'beforeDelete' => 'off')); - $this->assertIdentical($Apple->del(6), true); + $this->assertIdentical($Apple->delete(6), true); $Apple->Behaviors->attach('Test', array('beforeDelete' => 'on')); $this->assertIdentical($Apple->delete(4), false); $Apple->Behaviors->attach('Test', array('beforeDelete' => 'test2')); if (ob_start()) { - $results = $Apple->del(4); + $results = $Apple->delete(4); $this->assertIdentical(trim(ob_get_clean()), 'beforeDelete success (cascading)'); $this->assertIdentical($results, true); } if (ob_start()) { - $results = $Apple->del(3, false); + $results = $Apple->delete(3, false); $this->assertIdentical(trim(ob_get_clean()), 'beforeDelete success'); $this->assertIdentical($results, true); } $Apple->Behaviors->attach('Test', array('beforeDelete' => 'off', 'afterDelete' => 'on')); if (ob_start()) { - $results = $Apple->del(2, false); + $results = $Apple->delete(2, false); $this->assertIdentical(trim(ob_get_clean()), 'afterDelete success'); $this->assertIdentical($results, true); } @@ -836,7 +832,7 @@ function testBehaviorOnErrorCallback() { } if (ob_start()) { - $Apple->del(99); + $Apple->delete(99); //$this->assertIdentical(trim(ob_get_clean()), 'onError trigger success'); } } diff --git a/cake/tests/cases/libs/model/model.test.php b/cake/tests/cases/libs/model/model.test.php index 77149c1cc..7815fe55d 100644 --- a/cake/tests/cases/libs/model/model.test.php +++ b/cake/tests/cases/libs/model/model.test.php @@ -1,5 +1,4 @@ <?php -/* SVN FILE: $Id$ */ /** * ModelTest file * @@ -7,22 +6,18 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * - * Licensed under The Open Group Test Suite License - * Redistributions of files must retain the above copyright notice. + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org * @package cake * @subpackage cake.tests.cases.libs.model * @since CakePHP(tm) v 1.2.0.4206 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ App::import('Core', array('AppModel', 'Model')); require_once dirname(__FILE__) . DS . 'models.php'; @@ -3890,7 +3885,7 @@ function testCounterCacheDecrease() { $User = new CounterCacheUser(); $Post = new CounterCachePost(); - $Post->del(2); + $Post->delete(2); $user = $User->find('first', array( 'conditions' => array('id' => 66),'recursive' => -1 )); @@ -4005,7 +4000,7 @@ function testDel() { $this->loadFixtures('Article'); $TestModel =& new Article(); - $result = $TestModel->del(2); + $result = $TestModel->delete(2); $this->assertTrue($result); $result = $TestModel->read(null, 2); @@ -4019,7 +4014,7 @@ function testDel() { ); $this->assertEqual($result, $expected); - $result = $TestModel->del(3); + $result = $TestModel->delete(3); $this->assertTrue($result); $result = $TestModel->read(null, 3); @@ -4130,7 +4125,7 @@ function testRecursiveDel() { $this->loadFixtures('Article', 'Comment', 'Attachment'); $TestModel =& new Article(); - $result = $TestModel->del(2); + $result = $TestModel->delete(2); $this->assertTrue($result); $TestModel->recursive = 2; @@ -6369,7 +6364,7 @@ function testDeleteDependentWithConditions() { $Cd =& new Cd(); $OverallFavorite =& new OverallFavorite(); - $Cd->del(1); + $Cd->delete(1); $result = $OverallFavorite->find('all', array('fields' => array('model_type', 'model_id', 'priority'))); $expected = array(array('OverallFavorite' => array('model_type' => 'Book', 'model_id' => 1, 'priority' => 2))); diff --git a/cake/tests/cases/libs/string.test.php b/cake/tests/cases/libs/string.test.php index 1e15a89be..d6fe7a1ab 100644 --- a/cake/tests/cases/libs/string.test.php +++ b/cake/tests/cases/libs/string.test.php @@ -7,22 +7,18 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * - * Licensed under The Open Group Test Suite License - * Redistributions of files must retain the above copyright notice. + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org * @package cake * @subpackage cake.tests.cases.libs * @since CakePHP(tm) v 1.2.0.5432 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ App::import('Core', 'String'); /** @@ -32,6 +28,7 @@ * @subpackage cake.tests.cases.libs */ class StringTest extends CakeTestCase { + /** * testUuidGeneration method * @@ -44,6 +41,7 @@ function testUuidGeneration() { $match = preg_match($pattern, $result); $this->assertTrue($match); } + /** * testMultipleUuidGeneration method * @@ -63,6 +61,7 @@ function testMultipleUuidGeneration() { $check[] = $result; } } + /** * testInsert method * @@ -199,13 +198,16 @@ function testInsert() { $expected = "Pre-pended result"; $this->assertEqual($result, $expected); } + /** * test Clean Insert * * @return void **/ function testCleanInsert() { - $result = String::cleanInsert(':incomplete', array('clean' => true, 'before' => ':', 'after' => '')); + $result = String::cleanInsert(':incomplete', array( + 'clean' => true, 'before' => ':', 'after' => '' + )); $this->assertEqual($result, ''); $result = String::cleanInsert(':incomplete', array( @@ -214,18 +216,40 @@ function testCleanInsert() { ); $this->assertEqual($result, 'complete'); - $result = String::cleanInsert(':in.complete', array('clean' => true, 'before' => ':', 'after' => '')); + $result = String::cleanInsert(':in.complete', array( + 'clean' => true, 'before' => ':', 'after' => '' + )); $this->assertEqual($result, ''); - $result = String::cleanInsert(':in.complete and', array('clean' => true, 'before' => ':', 'after' => '')); + $result = String::cleanInsert(':in.complete and', array( + 'clean' => true, 'before' => ':', 'after' => '') + ); $this->assertEqual($result, ''); - $result = String::cleanInsert(':in.complete or stuff', array('clean' => true, 'before' => ':', 'after' => '')); + $result = String::cleanInsert(':in.complete or stuff', array( + 'clean' => true, 'before' => ':', 'after' => '' + )); $this->assertEqual($result, 'stuff'); - $result = String::cleanInsert('<p class=":missing" id=":missing">Text here</p>', array('clean' => 'html', 'before' => ':', 'after' => '')); + $result = String::cleanInsert( + '<p class=":missing" id=":missing">Text here</p>', + array('clean' => 'html', 'before' => ':', 'after' => '') + ); $this->assertEqual($result, '<p>Text here</p>'); } + +/** + * Tests that non-insertable variables (i.e. arrays) are skipped when used as values in + * String::insert(). + * + * @return void + */ + function testAutoIgnoreBadInsertData() { + $data = array('foo' => 'alpha', 'bar' => 'beta', 'fale' => array()); + $result = String::insert('(:foo > :bar || :fale!)', $data, array('clean' => 'text')); + $this->assertEqual($result, '(alpha > beta || !)'); + } + /** * testTokenize method * @@ -254,4 +278,5 @@ function testTokenize() { $this->assertEqual($expected, $result); } } + ?> \ No newline at end of file diff --git a/index.php b/index.php index c6a3a1b18..c73b03a96 100644 --- a/index.php +++ b/index.php @@ -1,29 +1,25 @@ <?php -/* SVN FILE: $Id$ */ /** * Requests collector. * * This file collects requests if: * - no mod_rewrite is avilable or .htaccess files are not supported - * -/public is not set as a web root. + * - requires App.baseUrl to be uncommented in app/config/core.php + * - app/webroot is not set as a document root. * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org * @package cake * @since CakePHP(tm) v 0.2.9 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ /** * Get Cake's root directory @@ -34,29 +30,27 @@ define('WEBROOT_DIR', 'webroot'); define('WWW_ROOT', ROOT . DS . APP_DIR . DS . WEBROOT_DIR . DS); /** - * This only needs to be changed if the cake installed libs are located - * outside of the distributed directory structure. + * This only needs to be changed if the "cake" directory is located + * outside of the distributed structure. + * Full path to the directory containing "cake". Do not add trailing directory separator */ if (!defined('CAKE_CORE_INCLUDE_PATH')) { - //define ('CAKE_CORE_INCLUDE_PATH', FULL PATH TO DIRECTORY WHERE CAKE CORE IS INSTALLED DO NOT ADD A TRAILING DIRECTORY SEPARATOR'; define('CAKE_CORE_INCLUDE_PATH', ROOT); } + +/** + * Set the include path or define app and core path + */ if (function_exists('ini_set')) { - ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS); + ini_set('include_path', + ini_get('include_path') . PATH_SEPARATOR . CAKE_CORE_INCLUDE_PATH + . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS + ); define('APP_PATH', null); define('CORE_PATH', null); } else { define('APP_PATH', ROOT . DS . APP_DIR . DS); define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS); } - require CORE_PATH . 'cake' . DS . 'basics.php'; - $TIME_START = getMicrotime(); - require CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php'; - require LIBS . 'object.php'; - require LIBS . 'inflector.php'; - require LIBS . 'configure.php'; - - $bootstrap = true; - $url = null; require APP_DIR . DS . WEBROOT_DIR . DS . 'index.php'; ?> \ No newline at end of file From 06d3aee348ac3bdcccb6d4f6fc735c6c1e811e2b Mon Sep 17 00:00:00 2001 From: davidpersson <davidpersson@gmx.de> Date: Sat, 2 May 2009 23:34:39 +0200 Subject: [PATCH 0145/2083] Fixing help not getting called Adding tests --- cake/console/cake.php | 2 +- cake/tests/cases/console/cake.test.php | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/cake/console/cake.php b/cake/console/cake.php index 72236b84a..d62b88002 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -344,7 +344,7 @@ function dispatch() { } return $Shell->{$task}->execute(); } - $methods = get_class_methods('Shell'); + $methods = array_diff(get_class_methods('Shell'), array('help')); } $methods = array_diff(get_class_methods($Shell), $methods); $added = in_array(strtolower($arg), array_map('strtolower', $methods)); diff --git a/cake/tests/cases/console/cake.test.php b/cake/tests/cases/console/cake.test.php index 914890223..26d8faf5f 100644 --- a/cake/tests/cases/console/cake.test.php +++ b/cake/tests/cases/console/cake.test.php @@ -514,6 +514,17 @@ function testDispatchShellWithMain() { $this->assertTrue($result); $this->assertEqual($Dispatcher->args, array('initdb')); + $Shell = new MockWithMainShell(); + $Shell->setReturnValue('main', true); + $Shell->expectOnce('startup'); + $Shell->expectOnce('help'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->args = array('mock_with_main', 'help'); + $result = $Dispatcher->dispatch(); + $this->assertNull($result); + $this->assertEqual($Dispatcher->args, array()); + $Shell = new MockWithMainShell(); $Shell->setReturnValue('main', true); $Shell->expectNever('hr'); @@ -811,6 +822,19 @@ function testDispatchTask() { $result = $Dispatcher->dispatch(); $this->assertTrue($result); $this->assertEqual($Dispatcher->args, array()); + + $Shell = new MockWeekShell(); + $Task = new MockOnSundayTask(); + $Task->expectNever('execute'); + $Task->expectOnce('help'); + + $Shell->MockOnSunday =& $Task; + $Shell->taskNames = array('MockOnSunday'); + $Dispatcher->TestShell =& $Shell; + + $Dispatcher->args = array('mock_week', 'mock_on_sunday', 'help'); + $result = $Dispatcher->dispatch(); + $this->assertTrue($result); } /** * Verify shifting of arguments From 6180ca80c9ae24537463ed667ccfe05a58055894 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 3 May 2009 20:48:13 -0400 Subject: [PATCH 0146/2083] Adding common parameter handling for connection and plugin params. --- cake/console/libs/bake.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index 1a21780e8..6277342d5 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -52,6 +52,12 @@ function loadTasks() { if (isset($this->{$task}) && !in_array($task, array('Project', 'DbConfig', 'Fixture'))) { $path = Inflector::underscore(Inflector::pluralize($this->command)); $this->{$task}->path = $this->params['working'] . DS . $path . DS; + if (isset($this->params['connection'])) { + $this->{$task}->connection = $this->params['connection']; + } + if (isset($this->params['plugin'])) { + $this->{$task}->plugin = $this->params['plugin']; + } if (!is_dir($this->{$task}->path)) { $this->err(sprintf(__("%s directory could not be found.\nBe sure you have created %s", true), $task, $this->{$task}->path)); $this->_stop(); From e21cc3db72bd7c63e9bb87cb0d6fdd7c24637592 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 3 May 2009 21:43:22 -0400 Subject: [PATCH 0147/2083] Adding test cases for bake() Adding support for -connection param Adding partial support for -plugin param Separating file writing and code generation functions. Updating help() --- cake/console/libs/tasks/fixture.php | 64 ++++++++++++++----- .../cases/console/libs/tasks/fixture.test.php | 50 ++++++++++++++- 2 files changed, 96 insertions(+), 18 deletions(-) diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index a9f5b8054..8af08bdba 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -50,6 +50,12 @@ class FixtureTask extends Shell { * @access public */ var $path = null; +/** + * The db connection being used for baking + * + * @var string + **/ + var $connection = null; /** * Override initialize * @@ -63,6 +69,7 @@ function initialize() { } /** * Execution method always used for tasks + * Handles dispatching to interactive, named, or all processess. * * @access public */ @@ -87,12 +94,11 @@ function execute() { * @return void **/ function all() { - $ds = 'default'; - if (isset($this->params['connection'])) { - $ds = $this->params['connection']; + if (!isset($this->connection)) { + $this->connection = 'default'; } $this->interactive = false; - $tables = $this->Model->listAll($ds, false); + $tables = $this->Model->listAll($this->connection, false); foreach ($tables as $table) { $model = $this->_modelName($table); $this->bake($model); @@ -110,9 +116,12 @@ function __interactive($modelName = false) { $this->out(sprintf("Bake Fixture\nPath: %s", $this->path)); $this->hr(); - $useDbConfig = $this->DbConfig->getConfig(); - $modelName = $this->Model->getName($useDbConfig); - $useTable = $this->Model->getTable($modelName, $useDbConfig); + $useDbConfig = $this->connection; + if (!isset($this->connection)) { + $this->connection = $this->DbConfig->getConfig(); + } + $modelName = $this->Model->getName($this->connection); + $useTable = $this->Model->getTable($modelName, $this->connection); $importOptions = $this->importOptions($modelName); $this->bake($modelName, $useTable, $importOptions); } @@ -145,7 +154,7 @@ function importOptions($modelName) { * @access private */ function bake($model, $useTable = false, $importOptions = array()) { - $out = "\nclass {$model}Fixture extends CakeTestFixture {\n"; + $out = "class {$model}Fixture extends CakeTestFixture {\n"; $out .= "\tvar \$name = '$model';\n"; if (!$useTable) { @@ -160,13 +169,16 @@ function bake($model, $useTable = false, $importOptions = array()) { $modelImport = "'model' => '{$importOptions['schema']}'"; } if (isset($importOptions['records'])) { - $recordImport = ", 'records' => true"; + $recordImport = "'records' => true"; + } + if ($modelImport && $recordImport) { + $modelImport .= ', '; } $out .= sprintf("\tvar \$import = array(%s%s);\n", $modelImport, $recordImport); } $this->_Schema = new CakeSchema(); - $data = $this->_Schema->read(array('models' => false)); + $data = $this->_Schema->read(array('models' => false, 'connection' => $this->connection)); if (!isset($data['tables'][$useTable])) { $this->err('Could not find your selected table ' . $useTable); @@ -186,15 +198,29 @@ function bake($model, $useTable = false, $importOptions = array()) { $out .= $this->_generateRecords($tableInfo, $recordCount); } $out .= "}\n"; + $this->generateFixtureFile($model, $out); + return $out; + } - $path = TESTS . DS . 'fixtures' . DS; +/** + * Generate the fixture file, and write to disk + * + * @param string $model name of the model being generated + * @param string $fixture Contents of the fixture file. + * @access public + * @return void + **/ + function generateFixtureFile($model, $fixture) { + //@todo fix plugin pathing. + $path = $this->path; if (isset($this->plugin)) { $pluginPath = 'plugins' . DS . Inflector::underscore($this->plugin) . DS; $path = APP . $pluginPath . 'tests' . DS . 'fixtures' . DS; } - $filename = Inflector::underscore($model).'_fixture.php'; - $header = '$Id'; - $content = "<?php \n/* SVN FILE: $header$ */\n/* ". $model ." Fixture generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n{$out}?>"; + $filename = Inflector::underscore($model) . '_fixture.php'; + $content = "<?php\n/* " . $model . " Fixture generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n"; + $content .= $fixture; + $content .= "?>"; $this->out("\nBaking test fixture for $model..."); $this->createFile($path . $filename, $content); } @@ -226,7 +252,7 @@ function _generateSchema($tableInfo) { } } $out .= join(",\n", $cols); - $out .= "\n\t);\n"; + $out .= "\n\t);\n\n"; return $out; } @@ -237,7 +263,7 @@ function _generateSchema($tableInfo) { * @return string **/ function _generateRecords($tableInfo, $recordCount = 1) { - $out = "\t\$records = array(\n"; + $out = "\tvar \$records = array(\n"; for ($i = 0; $i < $recordCount; $i++) { $records = array(); @@ -306,9 +332,13 @@ function help() { $this->hr(); $this->out('Commands:'); $this->out("\nfixture <name>\n\tbakes fixture with specified name."); - $this->out("\nfixture -count <n>\n\tbakes fixture with <n> records."); $this->out("\nfixture all\n\tbakes all fixtures."); $this->out(""); + $this->out('Parameters:'); + $this->out("\t-count The number of records to include in the fixture(s)."); + $this->out("\t-connection Which database configuration to use for baking."); + $this->out("\t-plugin lowercased_underscored name of plugin to bake fixtures for."); + $this->out(""); $this->_stop(); } } diff --git a/cake/tests/cases/console/libs/tasks/fixture.test.php b/cake/tests/cases/console/libs/tasks/fixture.test.php index 60abb371e..0f8f2a3c6 100644 --- a/cake/tests/cases/console/libs/tasks/fixture.test.php +++ b/cake/tests/cases/console/libs/tasks/fixture.test.php @@ -108,7 +108,7 @@ function testImportOptions() { $result = $this->Task->importOptions('Article'); $expected = array('schema' => 'Article', 'records' => true); $this->assertEqual($result, $expected); - + $this->Task->setReturnValueAt(2, 'in', 'n'); $this->Task->setReturnValueAt(3, 'in', 'n'); @@ -116,6 +116,54 @@ function testImportOptions() { $expected = array(); $this->assertEqual($result, $expected); } +/** + * Test that bake works + * + * @return void + **/ + function testBake() { + $this->Task->connection = 'test_suite'; + $this->Task->path = '/my/path/'; + + $result = $this->Task->bake('Article'); + $this->assertPattern('/class ArticleFixture extends CakeTestFixture/', $result); + $this->assertPattern('/var \$fields/', $result); + $this->assertPattern('/var \$records/', $result); + $this->assertNoPattern('/var \$import/', $result); + + $result = $this->Task->bake('Article', 'comments'); + $this->assertPattern('/class ArticleFixture extends CakeTestFixture/', $result); + $this->assertPattern('/var \$name \= \'Article\';/', $result); + $this->assertPattern('/var \$table \= \'comments\';/', $result); + + $result = $this->Task->bake('Article', 'comments', array('records' => true)); + $this->assertPattern("/var \\\$import \= array\('records' \=\> true\);/", $result); + $this->assertNoPattern('/var \$records/', $result); + + $result = $this->Task->bake('Article', 'comments', array('schema' => 'Article')); + $this->assertPattern("/var \\\$import \= array\('model' \=\> 'Article'\);/", $result); + $this->assertNoPattern('/var \$fields/', $result); + $result = $this->Task->bake('Article', 'comments', array('schema' => 'Article', 'records' => true)); + $this->assertPattern("/var \\\$import \= array\('model' \=\> 'Article'\, 'records' \=\> true\);/", $result); + $this->assertNoPattern('/var \$fields/', $result); + $this->assertNoPattern('/var \$records/', $result); + } +/** + * Test that file generation includes headers and correct path for plugins. + * + * @return void + **/ + function testGenerateFixtureFile() { + $this->Task->connection = 'test_suite'; + $this->Task->path = '/my/path/'; + $filename = '/my/path/article_fixture.php'; + + $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/my fixture/'))); + $result = $this->Task->generateFixtureFile('Article', 'my fixture'); + + $this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/\<\?php(.*)\?\>/ms'))); + $result = $this->Task->generateFixtureFile('Article', 'my fixture'); + } } ?> \ No newline at end of file From f4dc4bc1ede057ce55dec929f8e1f7f464f08225 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 4 May 2009 23:08:15 -0400 Subject: [PATCH 0148/2083] Adding test cases to FixtureTask. Removing useless param. --- cake/console/libs/tasks/fixture.php | 2 +- .../cases/console/libs/tasks/fixture.test.php | 59 ++++++++++++++++++- 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 8af08bdba..52cf69a8b 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -110,7 +110,7 @@ function all() { * * @access private */ - function __interactive($modelName = false) { + function __interactive() { $this->interactive = true; $this->hr(); $this->out(sprintf("Bake Fixture\nPath: %s", $this->path)); diff --git a/cake/tests/cases/console/libs/tasks/fixture.test.php b/cake/tests/cases/console/libs/tasks/fixture.test.php index 0f8f2a3c6..871efbbb2 100644 --- a/cake/tests/cases/console/libs/tasks/fixture.test.php +++ b/cake/tests/cases/console/libs/tasks/fixture.test.php @@ -50,6 +50,11 @@ 'FixtureTask', 'MockFixtureTask', array('in', 'out', 'err', 'createFile', '_stop') ); + +Mock::generatePartial( + 'Shell', 'MockFixtureModelTask', + array('in', 'out', 'err', 'createFile', '_stop', 'getName', 'getTable', 'listAll') +); /** * FixtureTaskTest class * @@ -71,7 +76,8 @@ class FixtureTaskTest extends CakeTestCase { */ function startTest() { $this->Dispatcher =& new TestFixtureTaskMockShellDispatcher(); - $this->Task =& new MockFixtureTask($this->Dispatcher); + $this->Task =& new MockFixtureTask(); + $this->Task->Model =& new MockFixtureModelTask(); $this->Task->Dispatch = new $this->Dispatcher; } /** @@ -116,6 +122,57 @@ function testImportOptions() { $expected = array(); $this->assertEqual($result, $expected); } +/** + * test that execute passes runs bake depending with named model. + * + * @return void + **/ + function testExecuteWithNamedModel() { + $this->Task->connection = 'test_suite'; + $this->Task->path = '/my/path/'; + $this->Task->args = array('article'); + $filename = '/my/path/article_fixture.php'; + $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticleFixture/'))); + $this->Task->execute(); + } + +/** + * test that execute runs all() when args[0] = all + * + * @return void + **/ + function testExecuteIntoAll() { + $this->Task->connection = 'test_suite'; + $this->Task->path = '/my/path/'; + $this->Task->args = array('all'); + $this->Task->Model->setReturnValue('listAll', array('articles', 'comments')); + + $filename = '/my/path/article_fixture.php'; + $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticleFixture/'))); + $this->Task->execute(); + + $filename = '/my/path/comment_fixture.php'; + $this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/class CommentFixture/'))); + $this->Task->execute(); + } + +/** + * test interactive mode of execute + * + * @return void + **/ + function testExecuteInteractive() { + $this->Task->connection = 'test_suite'; + $this->Task->path = '/my/path/'; + + $this->Task->setReturnValue('in', 'y'); + $this->Task->Model->setReturnValue('getName', 'Article'); + $this->Task->Model->setReturnValue('getTable', 'articles', array('Article')); + + $filename = '/my/path/article_fixture.php'; + $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticleFixture/'))); + $this->Task->execute(); + } /** * Test that bake works * From bb2f6b2ef52c17ed6b2dce8f61a82ec764f1d839 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 5 May 2009 00:10:24 -0400 Subject: [PATCH 0149/2083] Consolidating $useDbConfig to $this->connection. Updating test cases. --- cake/console/libs/tasks/model.php | 81 +++++++++++-------- .../cases/console/libs/tasks/model.test.php | 9 ++- 2 files changed, 56 insertions(+), 34 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index bcb38a01a..8ba548d96 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -39,6 +39,13 @@ class ModelTask extends Shell { * @access public */ var $plugin = null; +/** + * Name of the db connection used. + * + * @var string + * @access public + */ + var $connection = null; /** * path to MODELS directory * @@ -87,9 +94,8 @@ function execute() { * @return void **/ function all() { - $ds = 'default'; - if (isset($this->params['connection'])) { - $ds = $this->params['connection']; + if (!isset($this->params['connection'])) { + $this->connection = 'default'; } $this->listAll($ds, false); $this->interactive = false; @@ -121,20 +127,21 @@ function __interactive() { $useTable = null; $primaryKey = 'id'; - $validate = array(); - $associations = array('belongsTo'=> array(), 'hasOne'=> array(), 'hasMany' => array(), 'hasAndBelongsToMany'=> array()); - - $useDbConfig = $this->DbConfig->getConfig(); - $currentModelName = $this->getName($useDbConfig); - $useTable = $this->getTable($currentModelName, $useDbConfig); - $db =& ConnectionManager::getDataSource($useDbConfig); + $validate = $associations = array(); + + if (empty($this->connection)) { + $this->connection = $this->DbConfig->getConfig(); + } + $currentModelName = $this->getName(); + $useTable = $this->getTable($currentModelName); + $db =& ConnectionManager::getDataSource($this->connection); $fullTableName = $db->fullTableName($useTable); $wannaDoValidation = $this->in(__('Would you like to supply validation criteria for the fields in your model?', true), array('y','n'), 'y'); if (in_array($useTable, $this->__tables)) { App::import('Model'); - $tempModel = new Model(array('name' => $currentModelName, 'table' => $useTable, 'ds' => $useDbConfig)); + $tempModel = new Model(array('name' => $currentModelName, 'table' => $useTable, 'ds' => $this->connection)); $fields = $tempModel->schema(); if (!array_key_exists('id', $fields)) { @@ -162,7 +169,7 @@ function __interactive() { $this->hr(); $this->out("Name: " . $currentModelName); - if ($useDbConfig !== 'default') { + if ($this->connection !== 'default') { $this->out("DB Config: " . $useDbConfig); } if ($fullTableName !== Inflector::tableize($currentModelName)) { @@ -205,7 +212,7 @@ function __interactive() { $looksGood = $this->in(__('Look okay?', true), array('y','n'), 'y'); if (low($looksGood) == 'y' || low($looksGood) == 'yes') { - if ($this->bake($currentModelName, $associations, $validate, $primaryKey, $useTable, $useDbConfig)) { + if ($this->bake($currentModelName, $associations, $validate, $primaryKey, $useTable, $this->connection)) { if ($this->_checkUnitTest()) { $this->bakeTest($currentModelName, $useTable, $associations); } @@ -233,7 +240,6 @@ function doValidation(&$model, $interactive = true) { } $validate = array(); - $options = array(); if (class_exists('Validation')) { @@ -242,29 +248,32 @@ function doValidation(&$model, $interactive = true) { } foreach ($fields as $fieldName => $field) { - $prompt = 'Field: ' . $fieldName . "\n"; - $prompt .= 'Type: ' . $field['type'] . "\n"; - $prompt .= '---------------------------------------------------------------'."\n"; - $prompt .= 'Please select one of the following validation options:'."\n"; - $prompt .= '---------------------------------------------------------------'."\n"; + if ($this->interactive) { + $this->out(''); + $this->out(sprintf(__('Field: %s', true), $fieldName)); + $this->out(sprintf(__('Type: %s', true), $field['type'])); + $this->hr(); + $this->out(__('Please select one of the following validation options:', true)); + $this->hr(); + } sort($options); - - $skip = 1; + $prompt = ''; + $default = 1; foreach ($options as $key => $option) { if ($option{0} != '_' && strtolower($option) != 'getinstance') { - $prompt .= "{$skip} - {$option}\n"; - $choices[$skip] = strtolower($option); - $skip++; + $prompt .= "{$default} - {$option}\n"; + $choices[$default] = strtolower($option); + $default++; } } $methods = array_flip($choices); - $prompt .= "{$skip} - Do not do any validation on this field.\n"; - $prompt .= "... or enter in a valid regex validation string.\n"; + $prompt .= sprintf(__("%s - Do not do any validation on this field.\n", true), $default); + $prompt .= __("... or enter in a valid regex validation string.\n", true); - $guess = $skip; + $guess = $default; if ($field['null'] != 1 && $fieldName != $model->primaryKey && !in_array($fieldName, array('created', 'modified', 'updated'))) { if ($fieldName == 'email') { $guess = $methods['email']; @@ -280,12 +289,11 @@ function doValidation(&$model, $interactive = true) { } if ($interactive === true) { - $this->out(''); $choice = $this->in($prompt, null, $guess); } else { $choice = $guess; } - if ($choice != $skip) { + if ($choice != $default) { if (is_numeric($choice) && isset($choices[$choice])) { $validate[$fieldName] = $choices[$choice]; } else { @@ -305,7 +313,6 @@ function doValidation(&$model, $interactive = true) { * @access public */ function doAssociations(&$model, $interactive = true) { - if (!is_object($model)) { return false; } @@ -735,13 +742,17 @@ function bakeTest($className, $useTable = null, $associations = array()) { $content = "<?php \n/* SVN FILE: $header$ */\n/* ". $className ." Test cases generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n{$out}?>"; return $this->createFile($path . $filename, $content); } + /** * outputs the a list of possible models or controllers from database * * @param string $useDbConfig Database configuration name * @access public */ - function listAll($useDbConfig = 'default', $interactive = true) { + function listAll($useDbConfig = null, $interactive = true) { + if (!isset($useDbConfig)) { + $useDbConfig = $this->connection; + } $db =& ConnectionManager::getDataSource($useDbConfig); $usePrefix = empty($db->config['prefix']) ? '' : $db->config['prefix']; if ($usePrefix) { @@ -779,7 +790,10 @@ function listAll($useDbConfig = 'default', $interactive = true) { * @param string $useDbConfig Name of the database config you want to get tables from. * @return void **/ - function getTable($modelName, $useDbConfig) { + function getTable($modelName, $useDbConfig = null) { + if (!isset($useDbConfig)) { + $useDbConfig = $this->connection; + } $db =& ConnectionManager::getDataSource($useDbConfig); $useTable = Inflector::tableize($modelName); $fullTableName = $db->fullTableName($useTable, false); @@ -801,7 +815,7 @@ function getTable($modelName, $useDbConfig) { * @return string the model name * @access public */ - function getName($useDbConfig) { + function getName($useDbConfig = null) { $this->listAll($useDbConfig); $enteredModel = ''; @@ -848,6 +862,7 @@ function help() { * @return null. **/ function fixture($className, $useTable = null) { + $this->Fixture->connection = $this->connection; $this->Fixture->bake($className, $useTable); } } diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index 954c5f2ad..256367340 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -63,6 +63,7 @@ class ModelTaskTest extends CakeTestCase { * @var array **/ var $fixtures = array('core.article', 'core.comment'); + /** * setUp method * @@ -92,12 +93,18 @@ function endTest() { * @return void **/ function testListAll() { - $this->Task->expectCallCount('out', 3); $this->Task->expectAt(1, 'out', array('1. Article')); $this->Task->expectAt(2, 'out', array('2. Comment')); $result = $this->Task->listAll('test_suite'); $expected = array('articles', 'comments'); $this->assertEqual($result, $expected); + + $this->Task->expectAt(4, 'out', array('1. Article')); + $this->Task->expectAt(5, 'out', array('2. Comment')); + $this->Task->connection = 'test_suite'; + $result = $this->Task->listAll(); + $expected = array('articles', 'comments'); + $this->assertEqual($result, $expected); } /** From 37d81cb92d00dfdaadb3ab93846d72a9dd7a63c5 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 5 May 2009 00:43:29 -0400 Subject: [PATCH 0150/2083] Adding __() Refactoring duplicate code, and pulling out separate methods. --- cake/console/libs/tasks/model.php | 114 ++++++++++++++++-------------- 1 file changed, 59 insertions(+), 55 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 8ba548d96..8e1164e57 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -59,7 +59,7 @@ class ModelTask extends Shell { * @var array * @access public */ - var $tasks = array('DbConfig', 'Fixture'); + var $tasks = array('DbConfig', 'Fixture', 'Test'); /** * Holds tables found on connection. * @@ -106,7 +106,6 @@ function all() { if (App::import('Model', $modelClass)) { $object = new $modelClass(); - $modelExists = true; } else { App::import('Model'); $object = new Model(array('name' => $modelClass, 'ds' => $ds)); @@ -125,7 +124,6 @@ function __interactive() { $this->hr(); $this->interactive = true; - $useTable = null; $primaryKey = 'id'; $validate = $associations = array(); @@ -137,29 +135,24 @@ function __interactive() { $db =& ConnectionManager::getDataSource($this->connection); $fullTableName = $db->fullTableName($useTable); - $wannaDoValidation = $this->in(__('Would you like to supply validation criteria for the fields in your model?', true), array('y','n'), 'y'); - if (in_array($useTable, $this->__tables)) { App::import('Model'); $tempModel = new Model(array('name' => $currentModelName, 'table' => $useTable, 'ds' => $this->connection)); - $fields = $tempModel->schema(); if (!array_key_exists('id', $fields)) { - foreach ($fields as $name => $field) { - if (isset($field['key']) && $field['key'] == 'primary') { - break; - } - } - $primaryKey = $this->in(__('What is the primaryKey?', true), null, $name); + $primaryKey = $this->findPrimaryKey($fields); } } - if (array_search($useTable, $this->__tables) !== false && (low($wannaDoValidation) == 'y' || low($wannaDoValidation) == 'yes')) { + $prompt = __('Would you like to supply validation criteria for the fields in your model?', true); + $wannaDoValidation = $this->in($prompt, array('y','n'), 'y'); + if (array_search($useTable, $this->__tables) !== false && strtolower($wannaDoValidation) == 'y') { $validate = $this->doValidation($tempModel); } - $wannaDoAssoc = $this->in(__('Would you like to define model associations (hasMany, hasOne, belongsTo, etc.)?', true), array('y','n'), 'y'); - if ((low($wannaDoAssoc) == 'y' || low($wannaDoAssoc) == 'yes')) { + $prompt = __('Would you like to define model associations (hasMany, hasOne, belongsTo, etc.)?', true); + $wannaDoAssoc = $this->in($prompt, array('y','n'), 'y'); + if (strtolower($wannaDoAssoc) == 'y') { $associations = $this->doAssociations($tempModel); } @@ -170,48 +163,29 @@ function __interactive() { $this->out("Name: " . $currentModelName); if ($this->connection !== 'default') { - $this->out("DB Config: " . $useDbConfig); + $this->out(sprintf(__("DB Config: %s", true), $useDbConfig)); } if ($fullTableName !== Inflector::tableize($currentModelName)) { - $this->out("DB Table: " . $fullTableName); + $this->out(sprintf(__("DB Table: %s", true), $fullTableName)); } if ($primaryKey != 'id') { - $this->out("Primary Key: " . $primaryKey); + $this->out(sprintf(__("Primary Key: %s", true), $primaryKey)); } if (!empty($validate)) { - $this->out("Validation: " . print_r($validate, true)); + $this->out(sprintf(__("Validation: %s", true), print_r($validate, true))); } if (!empty($associations)) { - $this->out("Associations:"); - - if (!empty($associations['belongsTo'])) { - for ($i = 0; $i < count($associations['belongsTo']); $i++) { - $this->out(" $currentModelName belongsTo {$associations['belongsTo'][$i]['alias']}"); - } - } - - if (!empty($associations['hasOne'])) { - for ($i = 0; $i < count($associations['hasOne']); $i++) { - $this->out(" $currentModelName hasOne {$associations['hasOne'][$i]['alias']}"); - } - } - - if (!empty($associations['hasMany'])) { - for ($i = 0; $i < count($associations['hasMany']); $i++) { - $this->out(" $currentModelName hasMany {$associations['hasMany'][$i]['alias']}"); - } - } - - if (!empty($associations['hasAndBelongsToMany'])) { - for ($i = 0; $i < count($associations['hasAndBelongsToMany']); $i++) { - $this->out(" $currentModelName hasAndBelongsToMany {$associations['hasAndBelongsToMany'][$i]['alias']}"); - } + $this->out(__("Associations:", true)); + $assocKeys = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany'); + foreach ($assocKeys as $assocKey) { + $this->_printAssociation($currentModelName, $assocKey, $associations); } } + $this->hr(); $looksGood = $this->in(__('Look okay?', true), array('y','n'), 'y'); - - if (low($looksGood) == 'y' || low($looksGood) == 'yes') { + + if (strtolower($looksGood) == 'y') { if ($this->bake($currentModelName, $associations, $validate, $primaryKey, $useTable, $this->connection)) { if ($this->_checkUnitTest()) { $this->bakeTest($currentModelName, $useTable, $associations); @@ -221,6 +195,37 @@ function __interactive() { return false; } } +/** + * Print out all the associations of a particular type + * + * @param string $modelName Name of the model relations belong to. + * @param string $type Name of association you want to see. i.e. 'belongsTo' + * @param string $associations Collection of associations. + * @access public + * @return void + **/ + function _printAssociation($modelName, $type, $associations) { + if (!empty($associations[$type])) { + for ($i = 0; $i < count($associations[$type]); $i++) { + $out = "\t" . $modelName . ' ' . $type . ' ' . $associations[$type][$i]['alias']; + $this->out($out); + } + } + } +/** + * Finds a primary Key in a list of fields. + * + * @param array $fields Array of fields that might have a primary key. + * @return string Name of field that is a primary key. + **/ + function findPrimaryKey($fields) { + foreach ($fields as $name => $field) { + if (isset($field['key']) && $field['key'] == 'primary') { + break; + } + } + return $this->in(__('What is the primaryKey?', true), null, $name); + } /** * Handles associations * @@ -229,7 +234,7 @@ function __interactive() { * @return array $validate * @access public */ - function doValidation(&$model, $interactive = true) { + function doValidation(&$model) { if (!is_object($model)) { return false; } @@ -238,9 +243,7 @@ function doValidation(&$model, $interactive = true) { if (empty($fields)) { return false; } - - $validate = array(); - $options = array(); + $validate = $options = array(); if (class_exists('Validation')) { $parent = get_class_methods(get_parent_class('Validation')); @@ -308,11 +311,10 @@ function doValidation(&$model, $interactive = true) { * Handles associations * * @param object $model - * @param boolean $interactive * @return array $assocaitons * @access public */ - function doAssociations(&$model, $interactive = true) { + function doAssociations(&$model) { if (!is_object($model)) { return false; } @@ -327,7 +329,9 @@ function doAssociations(&$model, $interactive = true) { $primaryKey = $model->primaryKey; $foreignKey = $this->_modelKey($model->name); - $associations = array('belongsTo' => array(), 'hasMany' => array(), 'hasOne'=> array(), 'hasAndBelongsToMany' => array()); + $associations = array( + 'belongsTo' => array(), 'hasMany' => array(), 'hasOne'=> array(), 'hasAndBelongsToMany' => array() + ); $possibleKeys = array(); //Look for belongsTo @@ -392,11 +396,11 @@ function doAssociations(&$model, $interactive = true) { } } - if ($interactive !== true) { + if ($this->interactive !== true) { unset($associations['hasOne']); } - if ($interactive === true) { + if ($this->interactive === true) { $this->hr(); if (empty($associations)) { $this->out(__('None found.', true)); @@ -526,7 +530,7 @@ function bake($name, $associations = array(), $validate = array(), $primaryKey if (is_object($name)) { if (!is_array($associations)) { $associations = $this->doAssociations($name, $associations); - $validate = $this->doValidation($name, $associations); + $validate = $this->doValidation($name); } $primaryKey = $name->primaryKey; $useTable = $name->table; From 2e2aa0cd3a2e9d178b7a7f09d176a6e78315ed0a Mon Sep 17 00:00:00 2001 From: jperras <joel.perras@gmail.com> Date: Thu, 7 May 2009 14:49:21 -0400 Subject: [PATCH 0151/2083] Cleaning up HttpSocket public/protected api; all protected methods are now prefixed with an underscore. Refactored associated tests. --- cake/libs/http_socket.php | 135 ++++++++---------- cake/tests/cases/libs/http_socket.test.php | 152 ++++++++++++++++++--- 2 files changed, 195 insertions(+), 92 deletions(-) diff --git a/cake/libs/http_socket.php b/cake/libs/http_socket.php index 62ee4460a..3cb790fd5 100644 --- a/cake/libs/http_socket.php +++ b/cake/libs/http_socket.php @@ -40,7 +40,8 @@ class HttpSocket extends CakeSocket { */ var $description = 'HTTP-based DataSource Interface'; /** - * When one activates the $quirksMode by setting it to true, all checks meant to enforce RFC 2616 (HTTP/1.1 specs) + * When one activates the $quirksMode by setting it to true, all checks meant to + * enforce RFC 2616 (HTTP/1.1 specs). * will be disabled and additional measures to deal with non-standard responses will be enabled. * * @var boolean @@ -143,10 +144,10 @@ class HttpSocket extends CakeSocket { */ function __construct($config = array()) { if (is_string($config)) { - $this->configUri($config); + $this->_configUri($config); } elseif (is_array($config)) { if (isset($config['request']['uri']) && is_string($config['request']['uri'])) { - $this->configUri($config['request']['uri']); + $this->_configUri($config['request']['uri']); unset($config['request']['uri']); } $this->config = Set::merge($this->config, $config); @@ -172,7 +173,7 @@ function request($request = array()) { if (!isset($request['uri'])) { $request['uri'] = null; } - $uri = $this->parseUri($request['uri']); + $uri = $this->_parseUri($request['uri']); if (!isset($uri['host'])) { $host = $this->config['host']; @@ -183,10 +184,10 @@ function request($request = array()) { } $request['uri'] = $this->url($request['uri']); - $request['uri'] = $this->parseUri($request['uri'], true); + $request['uri'] = $this->_parseUri($request['uri'], true); $this->request = Set::merge($this->request, $this->config['request'], $request); - $this->configUri($this->request['uri']); + $this->_configUri($this->request['uri']); if (isset($host)) { $this->config['host'] = $host; @@ -194,7 +195,7 @@ function request($request = array()) { $cookies = null; if (is_array($this->request['header'])) { - $this->request['header'] = $this->parseHeader($this->request['header']); + $this->request['header'] = $this->_parseHeader($this->request['header']); if (!empty($this->request['cookies'])) { $cookies = $this->buildCookies($this->request['cookies']); } @@ -209,7 +210,7 @@ function request($request = array()) { } if (is_array($this->request['body'])) { - $this->request['body'] = $this->httpSerialize($this->request['body']); + $this->request['body'] = $this->_httpSerialize($this->request['body']); } if (!empty($this->request['body']) && !isset($this->request['header']['Content-Type'])) { @@ -221,10 +222,10 @@ function request($request = array()) { } $connectionType = @$this->request['header']['Connection']; - $this->request['header'] = $this->buildHeader($this->request['header']).$cookies; + $this->request['header'] = $this->_buildHeader($this->request['header']).$cookies; if (empty($this->request['line'])) { - $this->request['line'] = $this->buildRequestLine($this->request); + $this->request['line'] = $this->_buildRequestLine($this->request); } if ($this->quirksMode === false && $this->request['line'] === false) { @@ -252,7 +253,7 @@ function request($request = array()) { $this->disconnect(); } - $this->response = $this->parseResponse($response); + $this->response = $this->_parseResponse($response); if (!empty($this->response['cookies'])) { $this->config['request']['cookies'] = array_merge($this->config['request']['cookies'], $this->response['cookies']); } @@ -262,7 +263,7 @@ function request($request = array()) { /** * Issues a GET request to the specified URI, query, and request. * - * @param mixed $uri URI to request (see {@link parseUri()}) + * @param mixed $uri URI to request (see {@link _parseUri()}) * @param array $query Query to append to URI * @param array $request An indexed array with indexes such as 'method' or uri * @return mixed Result of request @@ -270,13 +271,13 @@ function request($request = array()) { */ function get($uri = null, $query = array(), $request = array()) { if (!empty($query)) { - $uri =$this->parseUri($uri); + $uri =$this->_parseUri($uri); if (isset($uri['query'])) { $uri['query'] = array_merge($uri['query'], $query); } else { $uri['query'] = $query; } - $uri = $this->buildUri($uri); + $uri = $this->_buildUri($uri); } $request = Set::merge(array('method' => 'GET', 'uri' => $uri), $request); @@ -286,7 +287,7 @@ function get($uri = null, $query = array(), $request = array()) { /** * Issues a POST request to the specified URI, query, and request. * - * @param mixed $uri URI to request (see {@link parseUri()}) + * @param mixed $uri URI to request (see {@link _parseUri()}) * @param array $query Query to append to URI * @param array $request An indexed array with indexes such as 'method' or uri * @return mixed Result of request @@ -299,7 +300,7 @@ function post($uri = null, $data = array(), $request = array()) { /** * Issues a PUT request to the specified URI, query, and request. * - * @param mixed $uri URI to request (see {@link parseUri()}) + * @param mixed $uri URI to request (see {@link _parseUri()}) * @param array $query Query to append to URI * @param array $request An indexed array with indexes such as 'method' or uri * @return mixed Result of request @@ -312,7 +313,7 @@ function put($uri = null, $data = array(), $request = array()) { /** * Issues a DELETE request to the specified URI, query, and request. * - * @param mixed $uri URI to request (see {@link parseUri()}) + * @param mixed $uri URI to request (see {@link _parseUri()}) * @param array $query Query to append to URI * @param array $request An indexed array with indexes such as 'method' or uri * @return mixed Result of request @@ -346,16 +347,16 @@ function url($url = null, $uriTemplate = null) { } $base = array_merge($this->config['request']['uri'], array('scheme' => array('http', 'https'), 'port' => array(80, 443))); - $url = $this->parseUri($url, $base); + $url = $this->_parseUri($url, $base); if (empty($url)) { $url = $this->config['request']['uri']; } if (!empty($uriTemplate)) { - return $this->buildUri($url, $uriTemplate); + return $this->_buildUri($url, $uriTemplate); } - return $this->buildUri($url); + return $this->_buildUri($url); } /** * Parses the given message and breaks it down in parts. @@ -364,7 +365,7 @@ function url($url = null, $uriTemplate = null) { * @return array Parsed message (with indexed elements such as raw, status, header, body) * @access protected */ - function parseResponse($message) { + function _parseResponse($message) { if (is_array($message)) { return $message; } elseif (!is_string($message)) { @@ -394,12 +395,12 @@ function parseResponse($message) { $response['status']['reason-phrase'] = $match[3]; } - $response['header'] = $this->parseHeader($response['raw']['header']); - $decoded = $this->decodeBody($response['raw']['body'], @$response['header']['Transfer-Encoding']); + $response['header'] = $this->_parseHeader($response['raw']['header']); + $decoded = $this->_decodeBody($response['raw']['body'], @$response['header']['Transfer-Encoding']); $response['body'] = $decoded['body']; if (!empty($decoded['header'])) { - $response['header'] = $this->parseHeader($this->buildHeader($response['header']).$this->buildHeader($decoded['header'])); + $response['header'] = $this->_parseHeader($this->_buildHeader($response['header']).$this->_buildHeader($decoded['header'])); } if (!empty($response['header'])) { @@ -423,7 +424,7 @@ function parseResponse($message) { * @return mixed Array or false * @access protected */ - function decodeBody($body, $encoding = 'chunked') { + function _decodeBody($body, $encoding = 'chunked') { if (!is_string($body)) { return false; } @@ -434,7 +435,7 @@ function decodeBody($body, $encoding = 'chunked') { if (!is_callable(array(&$this, $decodeMethod))) { if (!$this->quirksMode) { - trigger_error(sprintf(__('HttpSocket::decodeBody - Unknown encoding: %s. Activate quirks mode to surpress error.', true), h($encoding)), E_USER_WARNING); + trigger_error(sprintf(__('HttpSocket::_decodeBody - Unknown encoding: %s. Activate quirks mode to surpress error.', true), h($encoding)), E_USER_WARNING); } return array('body' => $body, 'header' => false); } @@ -448,7 +449,7 @@ function decodeBody($body, $encoding = 'chunked') { * @return mixed Array or false * @access protected */ - function decodeChunkedBody($body) { + function _decodeChunkedBody($body) { if (!is_string($body)) { return false; } @@ -459,7 +460,7 @@ function decodeChunkedBody($body) { while ($chunkLength !== 0) { if (!preg_match("/^([0-9a-f]+) *(?:;(.+)=(.+))?\r\n/iU", $body, $match)) { if (!$this->quirksMode) { - trigger_error(__('HttpSocket::decodeChunkedBody - Could not parse malformed chunk. Activate quirks mode to do this.', true), E_USER_WARNING); + trigger_error(__('HttpSocket::_decodeChunkedBody - Could not parse malformed chunk. Activate quirks mode to do this.', true), E_USER_WARNING); return false; } break; @@ -498,26 +499,26 @@ function decodeChunkedBody($body) { $entityHeader = false; if (!empty($body)) { - $entityHeader = $this->parseHeader($body); + $entityHeader = $this->_parseHeader($body); } return array('body' => $decodedBody, 'header' => $entityHeader); } /** * Parses and sets the specified URI into current request configuration. * - * @param mixed $uri URI (see {@link parseUri()}) + * @param mixed $uri URI (see {@link _parseUri()}) * @return array Current configuration settings * @access protected */ - function configUri($uri = null) { + function _configUri($uri = null) { if (empty($uri)) { return false; } if (is_array($uri)) { - $uri = $this->parseUri($uri); + $uri = $this->_parseUri($uri); } else { - $uri = $this->parseUri($uri, true); + $uri = $this->_parseUri($uri, true); } if (!isset($uri['host'])) { @@ -542,18 +543,18 @@ function configUri($uri = null) { * @return string A fully qualified URL formated according to $uriTemplate * @access protected */ - function buildUri($uri = array(), $uriTemplate = '%scheme://%user:%pass@%host:%port/%path?%query#%fragment') { + function _buildUri($uri = array(), $uriTemplate = '%scheme://%user:%pass@%host:%port/%path?%query#%fragment') { if (is_string($uri)) { $uri = array('host' => $uri); } - $uri = $this->parseUri($uri, true); + $uri = $this->_parseUri($uri, true); if (!is_array($uri) || empty($uri)) { return false; } $uri['path'] = preg_replace('/^\//', null, $uri['path']); - $uri['query'] = $this->httpSerialize($uri['query']); + $uri['query'] = $this->_httpSerialize($uri['query']); $stripIfEmpty = array( 'query' => '?%query', 'fragment' => '#%fragment', @@ -589,7 +590,7 @@ function buildUri($uri = array(), $uriTemplate = '%scheme://%user:%pass@%host:%p * @return array Parsed URI * @access protected */ - function parseUri($uri = null, $base = array()) { + function _parseUri($uri = null, $base = array()) { $uriBase = array( 'scheme' => array('http', 'https'), 'host' => null, @@ -631,7 +632,7 @@ function parseUri($uri = null, $base = array()) { } if (array_key_exists('query', $uri)) { - $uri['query'] = $this->parseQuery($uri['query']); + $uri['query'] = $this->_parseQuery($uri['query']); } if (!array_intersect_key($uriBase, $uri)) { @@ -647,13 +648,13 @@ function parseUri($uri = null, $base = array()) { * - ?key[]=value1&key[]=value2 * * A leading '?' mark in $query is optional and does not effect the outcome of this function. For the complete capabilities of this implementation - * take a look at HttpSocketTest::testParseQuery() + * take a look at HttpSocketTest::testparseQuery() * * @param mixed $query A query string to parse into an array or an array to return directly "as is" * @return array The $query parsed into a possibly multi-level array. If an empty $query is given, an empty array is returned. * @access protected */ - function parseQuery($query) { + function _parseQuery($query) { if (is_array($query)) { return $query; } @@ -710,13 +711,13 @@ function parseQuery($query) { * @return string Request line * @access protected */ - function buildRequestLine($request = array(), $versionToken = 'HTTP/1.1') { + function _buildRequestLine($request = array(), $versionToken = 'HTTP/1.1') { $asteriskMethods = array('OPTIONS'); if (is_string($request)) { $isValid = preg_match("/(.+) (.+) (.+)\r\n/U", $request, $match); if (!$this->quirksMode && (!$isValid || ($match[2] == '*' && !in_array($match[3], $asteriskMethods)))) { - trigger_error(__('HttpSocket::buildRequestLine - Passed an invalid request line string. Activate quirks mode to do this.', true), E_USER_WARNING); + trigger_error(__('HttpSocket::_buildRequestLine - Passed an invalid request line string. Activate quirks mode to do this.', true), E_USER_WARNING); return false; } return $request; @@ -726,12 +727,12 @@ function buildRequestLine($request = array(), $versionToken = 'HTTP/1.1') { return false; } - $request['uri'] = $this->parseUri($request['uri']); + $request['uri'] = $this->_parseUri($request['uri']); $request = array_merge(array('method' => 'GET'), $request); - $request['uri'] = $this->buildUri($request['uri'], '/%path?%query'); + $request['uri'] = $this->_buildUri($request['uri'], '/%path?%query'); if (!$this->quirksMode && $request['uri'] === '*' && !in_array($request['method'], $asteriskMethods)) { - trigger_error(sprintf(__('HttpSocket::buildRequestLine - The "*" asterisk character is only allowed for the following methods: %s. Activate quirks mode to work outside of HTTP/1.1 specs.', true), join(',', $asteriskMethods)), E_USER_WARNING); + trigger_error(sprintf(__('HttpSocket::_buildRequestLine - The "*" asterisk character is only allowed for the following methods: %s. Activate quirks mode to work outside of HTTP/1.1 specs.', true), join(',', $asteriskMethods)), E_USER_WARNING); return false; } return $request['method'].' '.$request['uri'].' '.$versionToken.$this->lineBreak; @@ -743,7 +744,7 @@ function buildRequestLine($request = array(), $versionToken = 'HTTP/1.1') { * @return string Serialized variable * @access protected */ - function httpSerialize($data = array()) { + function _httpSerialize($data = array()) { if (is_string($data)) { return $data; } @@ -759,7 +760,7 @@ function httpSerialize($data = array()) { * @return string Header built from array * @access protected */ - function buildHeader($header, $mode = 'standard') { + function _buildHeader($header, $mode = 'standard') { if (is_string($header)) { return $header; } elseif (!is_array($header)) { @@ -773,7 +774,7 @@ function buildHeader($header, $mode = 'standard') { } foreach ((array)$contents as $content) { $contents = preg_replace("/\r\n(?![\t ])/", "\r\n ", $content); - $field = $this->escapeToken($field); + $field = $this->_escapeToken($field); $returnHeader .= $field.': '.$contents.$this->lineBreak; } @@ -788,7 +789,7 @@ function buildHeader($header, $mode = 'standard') { * @return array Parsed header * @access protected */ - function parseHeader($header) { + function _parseHeader($header) { if (is_array($header)) { foreach ($header as $field => $value) { unset($header[$field]); @@ -814,7 +815,7 @@ function parseHeader($header) { $value = trim($value); $value = preg_replace("/[\t ]\r\n/", "\r\n", $value); - $field = $this->unescapeToken($field); + $field = $this->_unescapeToken($field); $field = strtolower($field); preg_match_all('/(?:^|(?<=-))[a-z]/U', $field, $offsets, PREG_OFFSET_CAPTURE); @@ -875,29 +876,11 @@ function parseCookies($header) { function buildCookies($cookies) { $header = array(); foreach ($cookies as $name => $cookie) { - $header[] = $name.'='.$this->escapeToken($cookie['value'], array(';')); + $header[] = $name.'='.$this->_escapeToken($cookie['value'], array(';')); } - $header = $this->buildHeader(array('Cookie' => $header), 'pragmatic'); + $header = $this->_buildHeader(array('Cookie' => $header), 'pragmatic'); return $header; } -/** - * undocumented function - * - * @return void - * @access public - */ - function saveCookies() { - - } -/** - * undocumented function - * - * @return void - * @access public - */ - function loadCookies() { - - } /** * Unescapes a given $token according to RFC 2616 (HTTP 1.1 specs) * @@ -906,8 +889,8 @@ function loadCookies() { * @access protected * @todo Test $chars parameter */ - function unescapeToken($token, $chars = null) { - $regex = '/"(['.join('', $this->__tokenEscapeChars(true, $chars)).'])"/'; + function _unescapeToken($token, $chars = null) { + $regex = '/"(['.join('', $this->_tokenEscapeChars(true, $chars)).'])"/'; $token = preg_replace($regex, '\\1', $token); return $token; } @@ -919,8 +902,8 @@ function unescapeToken($token, $chars = null) { * @access protected * @todo Test $chars parameter */ - function escapeToken($token, $chars = null) { - $regex = '/(['.join('', $this->__tokenEscapeChars(true, $chars)).'])/'; + function _escapeToken($token, $chars = null) { + $regex = '/(['.join('', $this->_tokenEscapeChars(true, $chars)).'])/'; $token = preg_replace($regex, '"\\1"', $token); return $token; } @@ -929,10 +912,10 @@ function escapeToken($token, $chars = null) { * * @param boolean $hex true to get them as HEX values, false otherwise * @return array Escape chars - * @access private + * @access protected * @todo Test $chars parameter */ - function __tokenEscapeChars($hex = true, $chars = null) { + function _tokenEscapeChars($hex = true, $chars = null) { if (!empty($chars)) { $escape = $chars; } else { diff --git a/cake/tests/cases/libs/http_socket.test.php b/cake/tests/cases/libs/http_socket.test.php index ef9325693..010cc76e7 100644 --- a/cake/tests/cases/libs/http_socket.test.php +++ b/cake/tests/cases/libs/http_socket.test.php @@ -25,6 +25,132 @@ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ App::import('Core', 'HttpSocket'); + +class TestHttpSocket extends HttpSocket { +/** + * Convenience method for testing protected method + * + * @param mixed $uri URI (see {@link _parseUri()}) + * @return array Current configuration settings + */ + function configUri($uri = null) { + return parent::_configUri($uri); + } +/** + * Convenience method for testing protected method + * + * @param string $uri URI to parse + * @param mixed $base If true use default URI config, otherwise indexed array to set 'scheme', 'host', 'port', etc. + * @return array Parsed URI + */ + function parseUri($uri = null, $base = array()) { + return parent::_parseUri($uri, $base); + } +/** + * Convenience method for testing protected method + * + * @param array $uri A $uri array, or uses $this->config if left empty + * @param string $uriTemplate The Uri template/format to use + * @return string A fully qualified URL formated according to $uriTemplate + */ + function buildUri($uri = array(), $uriTemplate = '%scheme://%user:%pass@%host:%port/%path?%query#%fragment') { + return parent::_buildUri($uri, $uriTemplate); + } +/** + * Convenience method for testing protected method + * + * @param array $header Header to build + * @return string Header built from array + */ + function buildHeader($header, $mode = 'standard') { + return parent::_buildHeader($header, $mode); + } + +/** + * Convenience method for testing protected method + * + * @param string $message Message to parse + * @return array Parsed message (with indexed elements such as raw, status, header, body) + */ + function parseResponse($message) { + return parent::_parseResponse($message); + } +/** + * Convenience method for testing protected method + * + * @param array $header Header as an indexed array (field => value) + * @return array Parsed header + */ + function parseHeader($header) { + return parent::_parseHeader($header); + } +/** + * Convenience method for testing protected method + * + * @param mixed $query A query string to parse into an array or an array to return directly "as is" + * @return array The $query parsed into a possibly multi-level array. If an empty $query is given, an empty array is returned. + */ + function parseQuery($query) { + return parent::_parseQuery($query); + } +/** + * Convenience method for testing protected method + * + * @param string $body A string continaing the body to decode + * @param mixed $encoding Can be false in case no encoding is being used, or a string representing the encoding + * @return mixed Array or false + */ + function decodeBody($body, $encoding = 'chunked') { + return parent::_decodeBody($body, $encoding); + } +/** + * Convenience method for testing protected method + * + * @param string $body A string continaing the chunked body to decode + * @return mixed Array or false + */ + function decodeChunkedBody($body) { + return parent::_decodeChunkedBody($body); + } +/** + * Convenience method for testing protected method + * + * @param array $request Needs to contain a 'uri' key. Should also contain a 'method' key, otherwise defaults to GET. + * @param string $versionToken The version token to use, defaults to HTTP/1.1 + * @return string Request line + */ + function buildRequestLine($request = array(), $versionToken = 'HTTP/1.1') { + return parent::_buildRequestLine($request, $versionToken); + } +/** + * Convenience method for testing protected method + * + * @param boolean $hex true to get them as HEX values, false otherwise + * @return array Escape chars + */ + function tokenEscapeChars($hex = true, $chars = null) { + return parent::_tokenEscapeChars($hex, $chars); + } +/** + * Convenience method for testing protected method + * + * @param string $token Token to escape + * @return string Escaped token + */ + function EscapeToken($token, $chars = null) { + return parent::_escapeToken($token, $chars); + } +/** + * Convenience method for testing protected method + * + * @param string $token Token to unescape + * @return string Unescaped token + */ + function unescapeToken($token, $chars = null) { + return parent::_unescapeToken($token, $chars); + } +} + /** * Short description for class. * @@ -51,13 +177,13 @@ class HttpSocketTest extends CakeTestCase { * */ function setUp() { - if (!class_exists('TestHttpSocket')) { - Mock::generatePartial('HttpSocket', 'TestHttpSocket', array('read', 'write', 'connect')); - Mock::generatePartial('HttpSocket', 'TestHttpSocketRequests', array('read', 'write', 'connect', 'request')); + if (!class_exists('MockHttpSocket')) { + Mock::generatePartial('TestHttpSocket', 'MockHttpSocket', array('read', 'write', 'connect')); + Mock::generatePartial('TestHttpSocket', 'MockHttpSocketRequests', array('read', 'write', 'connect', 'request')); } - $this->Socket =& new TestHttpSocket(); - $this->RequestSocket =& new TestHttpSocketRequests(); + $this->Socket =& new MockHttpSocket(); + $this->RequestSocket =& new MockHttpSocketRequests(); } /** * We use this function to clean up after the test case was executed @@ -365,12 +491,6 @@ function testRequest() { $r = array('config' => $this->Socket->config, 'request' => $this->Socket->request); $v = $this->assertIdentical($r, $expectation, '%s in test #'.$i.' '); - if (!$v) { - debug('Result:'); - debug($r); - debug('Expected:'); - debug($expectation); - } $expectation['request']['raw'] = $raw; } @@ -1189,7 +1309,7 @@ function testBuildCookies() { $this->assertEqual($result, $expect); } /** - * Tests that HttpSocket::__tokenEscapeChars() returns the right characters. + * Tests that HttpSocket::_tokenEscapeChars() returns the right characters. * */ function testTokenEscapeChars() { @@ -1201,14 +1321,14 @@ function testTokenEscapeChars() { '\x0e','\x0f','\x10','\x11','\x12','\x13','\x14','\x15','\x16','\x17','\x18','\x19','\x1a','\x1b','\x1c','\x1d', '\x1e','\x1f','\x7f' ); - $r = $this->Socket->__tokenEscapeChars(); + $r = $this->Socket->tokenEscapeChars(); $this->assertEqual($r, $expected); foreach ($expected as $key => $char) { $expected[$key] = chr(hexdec(substr($char, 2))); } - $r = $this->Socket->__tokenEscapeChars(false); + $r = $this->Socket->tokenEscapeChars(false); $this->assertEqual($r, $expected); } @@ -1221,7 +1341,7 @@ function testEscapeToken() { $this->assertIdentical($this->Socket->escapeToken('Foo'), 'Foo'); - $escape = $this->Socket->__tokenEscapeChars(false); + $escape = $this->Socket->tokenEscapeChars(false); foreach ($escape as $char) { $token = 'My-special-'.$char.'-Token'; $escapedToken = $this->Socket->escapeToken($token); @@ -1245,7 +1365,7 @@ function testUnescapeToken() { $this->assertIdentical($this->Socket->unescapeToken('Foo'), 'Foo'); - $escape = $this->Socket->__tokenEscapeChars(false); + $escape = $this->Socket->tokenEscapeChars(false); foreach ($escape as $char) { $token = 'My-special-"'.$char.'"-Token'; $unescapedToken = $this->Socket->unescapeToken($token); From fd5b422357bd73a7146c9135c314c351b4cae2a2 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 7 May 2009 23:59:43 -0400 Subject: [PATCH 0152/2083] Fixing error when no connection is specified and bake fixture Foo is used. --- cake/console/libs/tasks/fixture.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 52cf69a8b..5d19da9f1 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -79,11 +79,14 @@ function execute() { } if (isset($this->args[0])) { + if (!isset($this->connection)) { + $this->connection = 'default'; + } if (strtolower($this->args[0]) == 'all') { return $this->all(); } $model = Inflector::camelize($this->args[0]); - return $this->bake($model); + $this->bake($model); } } @@ -94,9 +97,6 @@ function execute() { * @return void **/ function all() { - if (!isset($this->connection)) { - $this->connection = 'default'; - } $this->interactive = false; $tables = $this->Model->listAll($this->connection, false); foreach ($tables as $table) { From fae7ed55841038b17e2f1fdf4abbb09bd29071a5 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Fri, 8 May 2009 00:49:26 -0400 Subject: [PATCH 0153/2083] Refactoring model task. Starting to refactor validation generation to enable multiple validation. --- cake/console/libs/tasks/model.php | 185 +++++++++++------- .../cases/console/libs/tasks/model.test.php | 83 ++++++++ 2 files changed, 202 insertions(+), 66 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 8e1164e57..80b61d3c6 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -39,6 +39,7 @@ class ModelTask extends Shell { * @access public */ var $plugin = null; + /** * Name of the db connection used. * @@ -46,6 +47,7 @@ class ModelTask extends Shell { * @access public */ var $connection = null; + /** * path to MODELS directory * @@ -53,6 +55,7 @@ class ModelTask extends Shell { * @access public */ var $path = MODELS; + /** * tasks * @@ -60,12 +63,21 @@ class ModelTask extends Shell { * @access public */ var $tasks = array('DbConfig', 'Fixture', 'Test'); + /** * Holds tables found on connection. * * @var array **/ var $__tables = array(); + +/** + * Holds validation method map. + * + * @var array + **/ + var $__validations = array(); + /** * Execution method always used for tasks * @@ -77,42 +89,53 @@ function execute() { } if (!empty($this->args[0])) { + $this->interactive = false; + if (!isset($this->connection)) { + $this->connection = 'default'; + } if (strtolower($this->args[0]) == 'all') { return $this->all(); } $model = Inflector::camelize($this->args[0]); - if ($this->bake($model)) { + $object = $this->_getModelObject($model); + if ($this->bake($object, false)) { if ($this->_checkUnitTest()) { $this->bakeTest($model); } } } } + /** * Bake all models at once. * * @return void **/ function all() { - if (!isset($this->params['connection'])) { - $this->connection = 'default'; - } $this->listAll($ds, false); - $this->interactive = false; foreach ($this->__tables as $table) { $modelClass = Inflector::classify($table); $this->out(sprintf(__('Baking %s', true), $modelClass)); - - if (App::import('Model', $modelClass)) { - $object = new $modelClass(); - } else { - App::import('Model'); - $object = new Model(array('name' => $modelClass, 'ds' => $ds)); - } + $this->_getModelObject($modelClass); $this->bake($object, false); } } +/** + * Get a model object for a class name. + * + * @param string $className Name of class you want model to be. + * @return object Model instance + **/ + function _getModelObject($className) { + if (App::import('Model', $className)) { + $object = new $className(); + } else { + App::import('Model'); + $object = new Model(array('name' => $className, 'ds' => $this->connection)); + } + return $object; + } /** * Handles interactive baking * @@ -178,7 +201,7 @@ function __interactive() { $this->out(__("Associations:", true)); $assocKeys = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany'); foreach ($assocKeys as $assocKey) { - $this->_printAssociation($currentModelName, $assocKey, $associations); + $this->printAssociation($currentModelName, $assocKey, $associations); } } @@ -195,6 +218,7 @@ function __interactive() { return false; } } + /** * Print out all the associations of a particular type * @@ -204,7 +228,7 @@ function __interactive() { * @access public * @return void **/ - function _printAssociation($modelName, $type, $associations) { + function printAssociation($modelName, $type, $associations) { if (!empty($associations[$type])) { for ($i = 0; $i < count($associations[$type]); $i++) { $out = "\t" . $modelName . ' ' . $type . ' ' . $associations[$type][$i]['alias']; @@ -212,11 +236,13 @@ function _printAssociation($modelName, $type, $associations) { } } } + /** * Finds a primary Key in a list of fields. * * @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) { @@ -226,8 +252,9 @@ function findPrimaryKey($fields) { } return $this->in(__('What is the primaryKey?', true), null, $name); } + /** - * Handles associations + * Handles Generation and user interaction for creating validation. * * @param object $model * @param boolean $interactive @@ -243,65 +270,91 @@ function doValidation(&$model) { if (empty($fields)) { return false; } - $validate = $options = array(); - + $validate = array(); + $this->initValidations(); + foreach ($fields as $fieldName => $field) { + $validation = $this->fieldValidation($fieldName, $field, $model->primaryKey); + if (!empty($validation)) { + $validate[$fieldName] = $validation; + } + } + return $validate; + } +/** + * Populate the __validations array + * + * @return void + **/ + function initValidations() { + $options = $choices = array(); if (class_exists('Validation')) { $parent = get_class_methods(get_parent_class('Validation')); $options = array_diff(get_class_methods('Validation'), $parent); } - - foreach ($fields as $fieldName => $field) { - if ($this->interactive) { - $this->out(''); - $this->out(sprintf(__('Field: %s', true), $fieldName)); - $this->out(sprintf(__('Type: %s', true), $field['type'])); - $this->hr(); - $this->out(__('Please select one of the following validation options:', true)); - $this->hr(); - } - - sort($options); - $prompt = ''; - $default = 1; - foreach ($options as $key => $option) { - if ($option{0} != '_' && strtolower($option) != 'getinstance') { - $prompt .= "{$default} - {$option}\n"; - $choices[$default] = strtolower($option); - $default++; - } + sort($options); + $default = 1; + foreach ($options as $key => $option) { + if ($option{0} != '_' && strtolower($option) != 'getinstance') { + $choices[$default] = strtolower($option); + $default++; } - - $methods = array_flip($choices); - - $prompt .= sprintf(__("%s - Do not do any validation on this field.\n", true), $default); - $prompt .= __("... or enter in a valid regex validation string.\n", true); - - $guess = $default; - if ($field['null'] != 1 && $fieldName != $model->primaryKey && !in_array($fieldName, array('created', 'modified', 'updated'))) { - if ($fieldName == 'email') { - $guess = $methods['email']; - } elseif ($field['type'] == 'string') { - $guess = $methods['notempty']; - } elseif ($field['type'] == 'integer') { - $guess = $methods['numeric']; - } elseif ($field['type'] == 'boolean') { - $guess = $methods['numeric']; - } elseif ($field['type'] == 'datetime') { - $guess = $methods['date']; - } + } + $this->__validations = $choices; + return $choices; + } +/** + * Does individual field validation handling. + * + * @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 = array(); + if ($this->interactive) { + $this->out(''); + $this->out(sprintf(__('Field: %s', true), $fieldName)); + $this->out(sprintf(__('Type: %s', true), $metaData['type'])); + $this->hr(); + $this->out(__('Please select one of the following validation options:', true)); + $this->hr(); + } + $methods = array_flip($this->__validations); + $prompt = ''; + for ($i = 1; $i < $defaultChoice; $i++) { + $prompt .= $i . ' - ' . $this->__validations[$i] . "\n"; + } + $prompt .= sprintf(__("%s - Do not do any validation on this field.\n", true), $defaultChoice); + $prompt .= __("... or enter in a valid regex validation string.\n", true); + + $guess = $defaultChoice; + if ($metaData['null'] != 1 && !in_array($fieldName, array($primaryKey, 'created', 'modified', 'updated'))) { + if ($fieldName == 'email') { + $guess = $methods['email']; + } elseif ($metaData['type'] == 'string') { + $guess = $methods['notempty']; + } elseif ($metaData['type'] == 'integer') { + $guess = $methods['numeric']; + } elseif ($metaData['type'] == 'boolean') { + $guess = $methods['numeric']; + } elseif ($metaData['type'] == 'datetime' || $metaData['type'] == 'date') { + $guess = $methods['date']; + } elseif ($metaData['type'] == 'time') { + $guess = $methods['time']; } + } - if ($interactive === true) { - $choice = $this->in($prompt, null, $guess); + if ($this->interactive === true) { + $choice = $this->in($prompt, null, $guess); + } else { + $choice = $guess; + } + if ($choice != $defaultChoice) { + if (is_numeric($choice) && isset($choices[$choice])) { + $validate[$fieldName] = $choices[$choice]; } else { - $choice = $guess; - } - if ($choice != $default) { - if (is_numeric($choice) && isset($choices[$choice])) { - $validate[$fieldName] = $choices[$choice]; - } else { - $validate[$fieldName] = $choice; - } + $validate[$fieldName] = $choice; } } return $validate; diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index 256367340..91cc646a6 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -50,6 +50,10 @@ 'ModelTask', 'MockModelTask', array('in', 'out', 'err', 'createFile', '_stop') ); + +Mock::generate( + 'Model', 'MockModelTaskModel' +); /** * ModelTaskTest class * @@ -151,5 +155,84 @@ function testGetTableName() { $expected = 'my_table'; $this->assertEqual($result, $expected); } +/** + * test that initializing the validations works. + * + * @return void + **/ + function testInitValidations() { + $result = $this->Task->initValidations(); + $this->assertTrue(in_array('notempty', $result)); + } +/** + * test that individual field validation works, with interactive = false + * + * @return void + **/ + function testNoInteractiveFieldValidation() { + $this->Task->interactive = false; + + $result = $this->Task->fieldValidation('text', array('type' => 'string', 'length' => 10, 'null' => false)); + } +/** + * test the validation Generation routine + * + * @return void + **/ + function testDoValidation() { + $Model =& new MockModelTaskModel(); + $Model->setReturnValue('schema', array( + 'id' => array( + 'type' => 'integer', + 'length' => 11, + 'null' => false, + 'key' => 'primary', + ), + 'name' => array( + 'type' => 'string', + 'length' => 20, + 'null' => false, + ), + 'email' => array( + 'type' => 'string', + 'length' => 255, + 'null' => false, + ), + 'some_date' => array( + 'type' => 'date', + 'length' => '', + 'null' => false, + ), + 'some_time' => array( + 'type' => 'time', + 'length' => '', + 'null' => false, + ), + 'created' => array( + 'type' => 'datetime', + 'length' => '', + 'null' => false, + ) + )); + $this->Task->interactive = false; + + $result = $this->Task->doValidation($Model); + $expected = array( + 'name' => array( + 'notEmpty' => array('rule' => 'notEmpty') + ), + 'email' => array( + 'email' => array('rule' => 'email'), + ), + 'some_date' => array( + 'date' => array('rule' => 'date') + ), + 'some_time' => array( + 'time' => array('rule' => 'time') + ), + ); + debug($result); + $this->assertEqual($result, $expected); + } } ?> \ No newline at end of file From 103b97493a39553d6f40c269d328b135bc2be394 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Fri, 8 May 2009 01:09:19 -0400 Subject: [PATCH 0154/2083] Adding test cases for validation generation Updating validation generation functions. --- cake/console/libs/tasks/model.php | 98 +++++++++++-------- .../cases/console/libs/tasks/model.test.php | 43 ++++++-- 2 files changed, 91 insertions(+), 50 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 80b61d3c6..f37f0a1fc 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -201,7 +201,7 @@ function __interactive() { $this->out(__("Associations:", true)); $assocKeys = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany'); foreach ($assocKeys as $assocKey) { - $this->printAssociation($currentModelName, $assocKey, $associations); + $this->_printAssociation($currentModelName, $assocKey, $associations); } } @@ -225,10 +225,10 @@ function __interactive() { * @param string $modelName Name of the model relations belong to. * @param string $type Name of association you want to see. i.e. 'belongsTo' * @param string $associations Collection of associations. - * @access public + * @access protected * @return void **/ - function printAssociation($modelName, $type, $associations) { + function _printAssociation($modelName, $type, $associations) { if (!empty($associations[$type])) { for ($i = 0; $i < count($associations[$type]); $i++) { $out = "\t" . $modelName . ' ' . $type . ' ' . $associations[$type][$i]['alias']; @@ -311,50 +311,62 @@ function initValidations() { **/ function fieldValidation($fieldName, $metaData, $primaryKey = 'id') { $defaultChoice = count($this->__validations); - $validate = array(); - if ($this->interactive) { - $this->out(''); - $this->out(sprintf(__('Field: %s', true), $fieldName)); - $this->out(sprintf(__('Type: %s', true), $metaData['type'])); - $this->hr(); - $this->out(__('Please select one of the following validation options:', true)); - $this->hr(); - } - $methods = array_flip($this->__validations); - $prompt = ''; - for ($i = 1; $i < $defaultChoice; $i++) { - $prompt .= $i . ' - ' . $this->__validations[$i] . "\n"; - } - $prompt .= sprintf(__("%s - Do not do any validation on this field.\n", true), $defaultChoice); - $prompt .= __("... or enter in a valid regex validation string.\n", true); + $validate = $alredyChosen = array(); - $guess = $defaultChoice; - if ($metaData['null'] != 1 && !in_array($fieldName, array($primaryKey, 'created', 'modified', 'updated'))) { - if ($fieldName == 'email') { - $guess = $methods['email']; - } elseif ($metaData['type'] == 'string') { - $guess = $methods['notempty']; - } elseif ($metaData['type'] == 'integer') { - $guess = $methods['numeric']; - } elseif ($metaData['type'] == 'boolean') { - $guess = $methods['numeric']; - } elseif ($metaData['type'] == 'datetime' || $metaData['type'] == 'date') { - $guess = $methods['date']; - } elseif ($metaData['type'] == 'time') { - $guess = $methods['time']; + $anotherValidator = 'y'; + while ($anotherValidator == 'y') { + if ($this->interactive) { + $this->out(''); + $this->out(sprintf(__('Field: %s', true), $fieldName)); + $this->out(sprintf(__('Type: %s', true), $metaData['type'])); + $this->hr(); + $this->out(__('Please select one of the following validation options:', true)); + $this->hr(); } - } - if ($this->interactive === true) { - $choice = $this->in($prompt, null, $guess); - } else { - $choice = $guess; - } - if ($choice != $defaultChoice) { - if (is_numeric($choice) && isset($choices[$choice])) { - $validate[$fieldName] = $choices[$choice]; + $prompt = ''; + for ($i = 1; $i < $defaultChoice; $i++) { + $prompt .= $i . ' - ' . $this->__validations[$i] . "\n"; + } + $prompt .= sprintf(__("%s - Do not do any validation on this field.\n", true), $defaultChoice); + $prompt .= __("... or enter in a valid regex validation string.\n", true); + + $methods = array_flip($this->__validations); + $guess = $defaultChoice; + if ($metaData['null'] != 1 && !in_array($fieldName, array($primaryKey, 'created', 'modified', 'updated'))) { + if ($fieldName == 'email') { + $guess = $methods['email']; + } elseif ($metaData['type'] == 'string') { + $guess = $methods['notempty']; + } elseif ($metaData['type'] == 'integer') { + $guess = $methods['numeric']; + } elseif ($metaData['type'] == 'boolean') { + $guess = $methods['numeric']; + } elseif ($metaData['type'] == 'datetime' || $metaData['type'] == 'date') { + $guess = $methods['date']; + } elseif ($metaData['type'] == 'time') { + $guess = $methods['time']; + } + } + + if ($this->interactive === true) { + $choice = $this->in($prompt, null, $guess); + $alreadyChosen[] = $choice; + } else { + $choice = $guess; + } + $validatorName = $this->__validations[$choice]; + if ($choice != $defaultChoice) { + if (is_numeric($choice) && isset($this->__validations[$choice])) { + $validate[$validatorName] = $this->__validations[$choice]; + } else { + $validate[$validatorName] = $choice; + } + } + if ($this->interactive == true) { + $anotherValidator = $this->in(__('Would you like to add another validation rule?', true), array('y', 'n'), 'n'); } else { - $validate[$fieldName] = $choice; + $anotherValidator = 'n'; } } return $validate; diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index 91cc646a6..0143a64ec 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -164,23 +164,53 @@ function testInitValidations() { $result = $this->Task->initValidations(); $this->assertTrue(in_array('notempty', $result)); } + /** * test that individual field validation works, with interactive = false + * tests the guessing features of validation * * @return void **/ - function testNoInteractiveFieldValidation() { + function testFieldValidationGuessing() { $this->Task->interactive = false; + $this->Task->initValidations(); $result = $this->Task->fieldValidation('text', array('type' => 'string', 'length' => 10, 'null' => false)); + $expected = array('notempty' => 'notempty'); + + $result = $this->Task->fieldValidation('text', array('type' => 'date', 'length' => 10, 'null' => false)); + $expected = array('date' => 'date'); + + $result = $this->Task->fieldValidation('text', array('type' => 'time', 'length' => 10, 'null' => false)); + $expected = array('time' => 'time'); + + $result = $this->Task->fieldValidation('email', array('type' => 'string', 'length' => 10, 'null' => false)); + $expected = array('email' => 'email'); + + $result = $this->Task->fieldValidation('test', array('type' => 'integer', 'length' => 10, 'null' => false)); + $expected = array('numeric' => 'numeric'); + + $result = $this->Task->fieldValidation('test', array('type' => 'boolean', 'length' => 10, 'null' => false)); + $expected = array('numeric' => 'numeric'); + } + +/** + * test that interactive field validation works and returns multiple validators. + * + * @return void + **/ + function testInteractiveFieldValidation() { + } + /** * test the validation Generation routine * * @return void **/ - function testDoValidation() { + function testNonInteractiveDoValidation() { $Model =& new MockModelTaskModel(); + $Model->primaryKey = 'id'; $Model->setReturnValue('schema', array( 'id' => array( 'type' => 'integer', @@ -219,19 +249,18 @@ function testDoValidation() { $result = $this->Task->doValidation($Model); $expected = array( 'name' => array( - 'notEmpty' => array('rule' => 'notEmpty') + 'notempty' => 'notempty' ), 'email' => array( - 'email' => array('rule' => 'email'), + 'email' => 'email', ), 'some_date' => array( - 'date' => array('rule' => 'date') + 'date' => 'date' ), 'some_time' => array( - 'time' => array('rule' => 'time') + 'time' => 'time' ), ); - debug($result); $this->assertEqual($result, $expected); } } From 8775f153757ed6e1007f3021da45a28461cbaa9d Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 9 May 2009 00:35:03 -0400 Subject: [PATCH 0155/2083] Updating multiple validation generation. Adding test coverage for interactive validations. --- cake/console/libs/tasks/model.php | 8 ++++++-- cake/tests/cases/console/libs/tasks/model.test.php | 11 ++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index f37f0a1fc..4d4cfa661 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -311,7 +311,7 @@ function initValidations() { **/ function fieldValidation($fieldName, $metaData, $primaryKey = 'id') { $defaultChoice = count($this->__validations); - $validate = $alredyChosen = array(); + $validate = $alreadyChosen = array(); $anotherValidator = 'y'; while ($anotherValidator == 'y') { @@ -351,6 +351,10 @@ function fieldValidation($fieldName, $metaData, $primaryKey = 'id') { if ($this->interactive === true) { $choice = $this->in($prompt, null, $guess); + if (in_array($choice, $alreadyChosen)) { + $this->out(__('You have already chosen that validation rule, please choose again', true)); + continue; + } $alreadyChosen[] = $choice; } else { $choice = $guess; @@ -363,7 +367,7 @@ function fieldValidation($fieldName, $metaData, $primaryKey = 'id') { $validate[$validatorName] = $choice; } } - if ($this->interactive == true) { + if ($this->interactive == true && $choice != $defaultChoice) { $anotherValidator = $this->in(__('Would you like to add another validation rule?', true), array('y', 'n'), 'n'); } else { $anotherValidator = 'n'; diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index 0143a64ec..07dcabed0 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -200,7 +200,16 @@ function testFieldValidationGuessing() { * @return void **/ function testInteractiveFieldValidation() { - + $this->Task->initValidations(); + $this->Task->interactive = true; + $this->Task->setReturnValueAt(0, 'in', '20'); + $this->Task->setReturnValueAt(1, 'in', 'y'); + $this->Task->setReturnValueAt(2, 'in', '16'); + $this->Task->setReturnValueAt(3, 'in', 'n'); + + $result = $this->Task->fieldValidation('text', array('type' => 'string', 'length' => 10, 'null' => false)); + $expected = array('notempty' => 'notempty', 'maxlength' => 'maxlength'); + $this->assertEqual($result, $expected); } /** From 11e2912945ab5b6cc4afee91d1f243b618253cf4 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 9 May 2009 01:00:14 -0400 Subject: [PATCH 0156/2083] Making output fit nicely on 80col display. --- cake/console/libs/tasks/model.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 4d4cfa661..75a16b2f4 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -167,13 +167,13 @@ function __interactive() { } } - $prompt = __('Would you like to supply validation criteria for the fields in your model?', true); + $prompt = __("Would you like to supply validation criteria \nfor the fields in your model?", true); $wannaDoValidation = $this->in($prompt, array('y','n'), 'y'); if (array_search($useTable, $this->__tables) !== false && strtolower($wannaDoValidation) == 'y') { $validate = $this->doValidation($tempModel); } - $prompt = __('Would you like to define model associations (hasMany, hasOne, belongsTo, etc.)?', true); + $prompt = __("Would you like to define model associations\n(hasMany, hasOne, belongsTo, etc.)?", true); $wannaDoAssoc = $this->in($prompt, array('y','n'), 'y'); if (strtolower($wannaDoAssoc) == 'y') { $associations = $this->doAssociations($tempModel); @@ -352,7 +352,7 @@ function fieldValidation($fieldName, $metaData, $primaryKey = 'id') { if ($this->interactive === true) { $choice = $this->in($prompt, null, $guess); if (in_array($choice, $alreadyChosen)) { - $this->out(__('You have already chosen that validation rule, please choose again', true)); + $this->out(__("You have already chosen that validation rule,\nplease choose again", true)); continue; } $alreadyChosen[] = $choice; @@ -874,7 +874,7 @@ function getTable($modelName, $useDbConfig = null) { if (array_search($useTable, $this->__tables) === false) { $this->out(''); - $this->out(sprintf(__("Given your model named '%s', Cake would expect a database table named '%s'", true), $modelName, $fullTableName)); + $this->out(sprintf(__("Given your model named '%s',\nCake would expect a database table named '%s'", true), $modelName, $fullTableName)); $tableIsGood = $this->in(__('Do you want to use this table?', true), array('y','n'), 'y'); } if (low($tableIsGood) == 'n' || low($tableIsGood) == 'no') { @@ -894,7 +894,7 @@ function getName($useDbConfig = null) { $enteredModel = ''; while ($enteredModel == '') { - $enteredModel = $this->in(__("Enter a number from the list above, type in the name of another model, or 'q' to exit", true), null, 'q'); + $enteredModel = $this->in(__("Enter a number from the list above,\ntype in the name of another model, or 'q' to exit", true), null, 'q'); if ($enteredModel === 'q') { $this->out(__("Exit", true)); @@ -902,7 +902,7 @@ function getName($useDbConfig = null) { } if ($enteredModel == '' || intval($enteredModel) > count($this->_modelNames)) { - $this->err(__("The model name you supplied was empty, or the number you selected was not an option. Please try again.", true)); + $this->err(__("The model name you supplied was empty,\nor the number you selected was not an option. Please try again.", true)); $enteredModel = ''; } } From 31a266fc4c311b8bdef93db3e1f8f6a7eb436b2e Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 9 May 2009 02:20:46 -0400 Subject: [PATCH 0157/2083] Refactoring association generation. --- cake/console/libs/tasks/model.php | 169 ++++++++++++++++++------------ 1 file changed, 104 insertions(+), 65 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 75a16b2f4..4ab1c25b5 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -387,83 +387,22 @@ function doAssociations(&$model) { if (!is_object($model)) { return false; } + App::import('Model'); $this->out(__('One moment while the associations are detected.', true)); $fields = $model->schema(); - if (empty($fields)) { return false; } - $primaryKey = $model->primaryKey; - $foreignKey = $this->_modelKey($model->name); - $associations = array( 'belongsTo' => array(), 'hasMany' => array(), 'hasOne'=> array(), 'hasAndBelongsToMany' => array() ); $possibleKeys = array(); - //Look for belongsTo - $i = 0; - foreach ($fields as $fieldName => $field) { - $offset = strpos($fieldName, '_id'); - if ($fieldName != $model->primaryKey && $offset !== false) { - $tmpModelName = $this->_modelNameFromKey($fieldName); - $associations['belongsTo'][$i]['alias'] = $tmpModelName; - $associations['belongsTo'][$i]['className'] = $tmpModelName; - $associations['belongsTo'][$i]['foreignKey'] = $fieldName; - $i++; - } - } - //Look for hasOne and hasMany and hasAndBelongsToMany - $i = $j = 0; - - foreach ($this->__tables as $otherTable) { - App::import('Model'); - $tmpModelName = $this->_modelName($otherTable); - $tempOtherModel = & new Model(array('name' => $tmpModelName, 'table' => $otherTable, 'ds' => $model->useDbConfig)); - $modelFieldsTemp = $tempOtherModel->schema(); - - $offset = strpos($otherTable, $model->table . '_'); - $otherOffset = strpos($otherTable, '_' . $model->table); - - foreach ($modelFieldsTemp as $fieldName => $field) { - if ($field['type'] == 'integer' || $field['type'] == 'string') { - $possibleKeys[$otherTable][] = $fieldName; - } - if ($fieldName != $model->primaryKey && $fieldName == $foreignKey && $offset === false && $otherOffset === false) { - $associations['hasOne'][$j]['alias'] = $tempOtherModel->name; - $associations['hasOne'][$j]['className'] = $tempOtherModel->name; - $associations['hasOne'][$j]['foreignKey'] = $fieldName; - - $associations['hasMany'][$j]['alias'] = $tempOtherModel->name; - $associations['hasMany'][$j]['className'] = $tempOtherModel->name; - $associations['hasMany'][$j]['foreignKey'] = $fieldName; - $j++; - } - } - - if ($offset !== false) { - $offset = strlen($model->table . '_'); - $tmpModelName = $this->_modelName(substr($otherTable, $offset)); - $associations['hasAndBelongsToMany'][$i]['alias'] = $tmpModelName; - $associations['hasAndBelongsToMany'][$i]['className'] = $tmpModelName; - $associations['hasAndBelongsToMany'][$i]['foreignKey'] = $foreignKey; - $associations['hasAndBelongsToMany'][$i]['associationForeignKey'] = $this->_modelKey($tmpModelName); - $associations['hasAndBelongsToMany'][$i]['joinTable'] = $otherTable; - $i++; - } - - if ($otherOffset !== false) { - $tmpModelName = $this->_modelName(substr($otherTable, 0, $otherOffset)); - $associations['hasAndBelongsToMany'][$i]['alias'] = $tmpModelName; - $associations['hasAndBelongsToMany'][$i]['className'] = $tmpModelName; - $associations['hasAndBelongsToMany'][$i]['foreignKey'] = $foreignKey; - $associations['hasAndBelongsToMany'][$i]['associationForeignKey'] = $this->_modelKey($tmpModelName); - $associations['hasAndBelongsToMany'][$i]['joinTable'] = $otherTable; - $i++; - } - } + $associations = $this->_findBelongsTo($model, $associations); + $associations = $this->_findHasOneAndMany($model, $associations); + $associations = $this->_findHasAndBelongsToMany($model, $associations); if ($this->interactive !== true) { unset($associations['hasOne']); @@ -583,6 +522,104 @@ function doAssociations(&$model) { } return $associations; } + +/** + * Find belongsTo relations and add them to the associations list. + * + * @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) { + $offset = strpos($fieldName, '_id'); + if ($fieldName != $model->primaryKey && $offset !== false) { + $tmpModelName = $this->_modelNameFromKey($fieldName); + $assoc = array( + 'alias' => $tmpModelName, + 'className' => $tmpModelName, + 'foreignKey' => $fieldName, + ); + $associations['belongsTo'][] = $assoc; + } + } + return $associations; + } + +/** + * Find the hasOne and HasMany relations and add them to associations list + * + * @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); + var_dump($foreignKey); + foreach ($this->__tables as $otherTable) { + $tempOtherModel = $this->_getModelObject($this->_modelName($otherTable)); + $modelFieldsTemp = $tempOtherModel->schema(); + + $pattern = '/_' . preg_quote($otherTable, '/') . '|' . preg_quote($otherTable, '/') . '_/'; + $possibleJoinTable = preg_match($pattern , $model->table); + foreach ($modelFieldsTemp as $fieldName => $field) { + if ($fieldName != $model->primaryKey && $fieldName == $foreignKey && $possibleJoinTable == false) { + $assoc = array( + 'alias' => $tempOtherModel->name, + 'className' => $tempOtherModel->name, + 'foreignKey' => $fieldName + ); + $associations['hasOne'][] = $assoc; + $associations['hasMany'][] = $assoc; + } + } + } + return $associations; + } + +/** + * Find the hasAndBelongsToMany relations and add them to associations list + * + * @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) { + $tempOtherModel = $this->_getModelObject($this->_modelName($otherTable)); + $modelFieldsTemp = $tempOtherModel->schema(); + + $offset = strpos($otherTable, $model->table . '_'); + $otherOffset = strpos($otherTable, '_' . $model->table); + + if ($offset !== false) { + $offset = strlen($model->table . '_'); + $habtmName = $this->_modelName(substr($otherTable, $offset)); + $assoc = array( + 'alias' => $habtmName, + 'className' => $habtmName, + 'foreignKey' => $foreignKey, + 'associationForeignKey' => $this->_modelKey($habtmName), + 'joinTable' => $otherTable + ); + $associations['hasAndBelongsToMany'][] = $assoc; + } elseif ($otherOffset !== false) { + $habtmName = $this->_modelName(substr($otherTable, 0, $otherOffset)); + $assoc = array( + 'alias' => $habtmName, + 'className' => $habtmName, + 'foreignKey' => $foreignKey, + 'associationForeignKey' => $this->_modelKey($habtmName), + 'joinTable' => $otherTable + ); + $associations['hasAndBelongsToMany'][] = $assoc; + } + } + return $associations; + } + /** * Assembles and writes a Model file. * @@ -913,6 +950,7 @@ function getName($useDbConfig = null) { } return $currentModelName; } + /** * Displays help contents * @@ -929,6 +967,7 @@ function help() { $this->out(""); $this->_stop(); } + /** * Interact with FixtureTask to automatically bake fixtures when baking models. * From 046764146979ff3aab6dcd86d3c3b85d06688285 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 9 May 2009 02:22:29 -0400 Subject: [PATCH 0158/2083] minor cleanup --- cake/console/libs/tasks/model.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 4ab1c25b5..61c27fa8d 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -536,12 +536,11 @@ function _findBelongsTo(&$model, $associations) { $offset = strpos($fieldName, '_id'); if ($fieldName != $model->primaryKey && $offset !== false) { $tmpModelName = $this->_modelNameFromKey($fieldName); - $assoc = array( + $associations['belongsTo'][] = array( 'alias' => $tmpModelName, 'className' => $tmpModelName, 'foreignKey' => $fieldName, ); - $associations['belongsTo'][] = $assoc; } } return $associations; @@ -556,7 +555,6 @@ function _findBelongsTo(&$model, $associations) { **/ function _findHasOneAndMany(&$model, $associations) { $foreignKey = $this->_modelKey($model->name); - var_dump($foreignKey); foreach ($this->__tables as $otherTable) { $tempOtherModel = $this->_getModelObject($this->_modelName($otherTable)); $modelFieldsTemp = $tempOtherModel->schema(); @@ -597,24 +595,22 @@ function _findHasAndBelongsToMany(&$model, $associations) { if ($offset !== false) { $offset = strlen($model->table . '_'); $habtmName = $this->_modelName(substr($otherTable, $offset)); - $assoc = array( + $associations['hasAndBelongsToMany'][] = array( 'alias' => $habtmName, 'className' => $habtmName, 'foreignKey' => $foreignKey, 'associationForeignKey' => $this->_modelKey($habtmName), 'joinTable' => $otherTable ); - $associations['hasAndBelongsToMany'][] = $assoc; } elseif ($otherOffset !== false) { $habtmName = $this->_modelName(substr($otherTable, 0, $otherOffset)); - $assoc = array( + $associations['hasAndBelongsToMany'][] = array( 'alias' => $habtmName, 'className' => $habtmName, 'foreignKey' => $foreignKey, 'associationForeignKey' => $this->_modelKey($habtmName), 'joinTable' => $otherTable ); - $associations['hasAndBelongsToMany'][] = $assoc; } } return $associations; From 4b4875e0a91a7929f3d8c9b8e12a0240b12d9a6d Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 9 May 2009 21:28:51 -0400 Subject: [PATCH 0159/2083] Renaming methods, fixing issue with habtm bleed through. Added test cases for all relation generation. --- cake/console/libs/tasks/model.php | 16 +-- .../cases/console/libs/tasks/model.test.php | 115 ++++++++++++++++-- 2 files changed, 116 insertions(+), 15 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 61c27fa8d..a982cfb28 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -400,9 +400,9 @@ function doAssociations(&$model) { ); $possibleKeys = array(); - $associations = $this->_findBelongsTo($model, $associations); - $associations = $this->_findHasOneAndMany($model, $associations); - $associations = $this->_findHasAndBelongsToMany($model, $associations); + $associations = $this->findBelongsTo($model, $associations); + $associations = $this->findHasOneAndMany($model, $associations); + $associations = $this->findHasAndBelongsToMany($model, $associations); if ($this->interactive !== true) { unset($associations['hasOne']); @@ -530,7 +530,7 @@ function doAssociations(&$model) { * @param array $associations Array of inprogress associations * @return array $associations with belongsTo added in. **/ - function _findBelongsTo(&$model, $associations) { + function findBelongsTo(&$model, $associations) { $fields = $model->schema(); foreach ($fields as $fieldName => $field) { $offset = strpos($fieldName, '_id'); @@ -553,14 +553,14 @@ function _findBelongsTo(&$model, $associations) { * @param array $associations Array of inprogress associations * @return array $associations with hasOne and hasMany added in. **/ - function _findHasOneAndMany(&$model, $associations) { + function findHasOneAndMany(&$model, $associations) { $foreignKey = $this->_modelKey($model->name); foreach ($this->__tables as $otherTable) { $tempOtherModel = $this->_getModelObject($this->_modelName($otherTable)); $modelFieldsTemp = $tempOtherModel->schema(); - $pattern = '/_' . preg_quote($otherTable, '/') . '|' . preg_quote($otherTable, '/') . '_/'; - $possibleJoinTable = preg_match($pattern , $model->table); + $pattern = '/_' . preg_quote($model->table, '/') . '|' . preg_quote($model->table, '/') . '_/'; + $possibleJoinTable = preg_match($pattern , $otherTable); foreach ($modelFieldsTemp as $fieldName => $field) { if ($fieldName != $model->primaryKey && $fieldName == $foreignKey && $possibleJoinTable == false) { $assoc = array( @@ -583,7 +583,7 @@ function _findHasOneAndMany(&$model, $associations) { * @param array $associations Array of inprogress associations * @return array $associations with hasAndBelongsToMany added in. **/ - function _findHasAndBelongsToMany(&$model, $associations) { + function findHasAndBelongsToMany(&$model, $associations) { $foreignKey = $this->_modelKey($model->name); foreach ($this->__tables as $otherTable) { $tempOtherModel = $this->_getModelObject($this->_modelName($otherTable)); diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index 07dcabed0..c5f74d89b 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -66,7 +66,7 @@ class ModelTaskTest extends CakeTestCase { * * @var array **/ - var $fixtures = array('core.article', 'core.comment'); + var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag'); /** * setUp method @@ -98,16 +98,21 @@ function endTest() { **/ function testListAll() { $this->Task->expectAt(1, 'out', array('1. Article')); - $this->Task->expectAt(2, 'out', array('2. Comment')); + $this->Task->expectAt(2, 'out', array('2. ArticlesTag')); + $this->Task->expectAt(3, 'out', array('3. Comment')); + $this->Task->expectAt(4, 'out', array('4. Tag')); $result = $this->Task->listAll('test_suite'); - $expected = array('articles', 'comments'); + $expected = array('articles', 'articles_tags', 'comments', 'tags'); $this->assertEqual($result, $expected); - $this->Task->expectAt(4, 'out', array('1. Article')); - $this->Task->expectAt(5, 'out', array('2. Comment')); + $this->Task->expectAt(6, 'out', array('1. Article')); + $this->Task->expectAt(7, 'out', array('2. ArticlesTag')); + $this->Task->expectAt(8, 'out', array('3. Comment')); + $this->Task->expectAt(9, 'out', array('4. Tag')); + $this->Task->connection = 'test_suite'; $result = $this->Task->listAll(); - $expected = array('articles', 'comments'); + $expected = array('articles', 'articles_tags', 'comments', 'tags'); $this->assertEqual($result, $expected); } @@ -128,7 +133,7 @@ function testGetName() { $expected = 'Article'; $this->assertEqual($result, $expected); - $this->Task->setReturnValueAt(2, 'in', 2); + $this->Task->setReturnValueAt(2, 'in', 3); $result = $this->Task->getName('test_suite'); $expected = 'Comment'; $this->assertEqual($result, $expected); @@ -272,5 +277,101 @@ function testNonInteractiveDoValidation() { ); $this->assertEqual($result, $expected); } + +/** + * test that finding primary key works + * + * @return void + **/ + function testFindPrimaryKey() { + $fields = array( + 'one' => array(), + 'two' => array(), + 'key' => array('key' => 'primary') + ); + $this->Task->expectAt(0, 'in', array('*', null, 'key')); + $this->Task->setReturnValue('in', 'my_field'); + $result = $this->Task->findPrimaryKey($fields); + $expected = 'my_field'; + $this->assertEqual($result, $expected); + } + +/** + * test that belongsTo generation works. + * + * @return void + **/ + function testBelongsToGeneration() { + $model = new Model(array('ds' => 'test_suite', 'name' => 'Comment')); + $result = $this->Task->findBelongsTo($model, array()); + $expected = array( + 'belongsTo' => array( + array( + 'alias' => 'Article', + 'className' => 'Article', + 'foreignKey' => 'article_id', + ), + array( + 'alias' => 'User', + 'className' => 'User', + 'foreignKey' => 'user_id', + ), + ) + ); + $this->assertEqual($result, $expected); + } + +/** + * test that hasOne and/or hasMany relations are generated properly. + * + * @return void + **/ + function testHasManyHasOneGeneration() { + $model = new Model(array('ds' => 'test_suite', 'name' => 'Article')); + $this->Task->connection = 'test_suite'; + $this->Task->listAll(); + $result = $this->Task->findHasOneAndMany($model, array()); + $expected = array( + 'hasMany' => array( + array( + 'alias' => 'Comment', + 'className' => 'Comment', + 'foreignKey' => 'article_id', + ), + ), + 'hasOne' => array( + array( + 'alias' => 'Comment', + 'className' => 'Comment', + 'foreignKey' => 'article_id', + ), + ), + ); + $this->assertEqual($result, $expected); + } + +/** + * test that habtm generation works + * + * @return void + **/ + function testHasAndBelongsToManyGeneration() { + $model = new Model(array('ds' => 'test_suite', 'name' => 'Article')); + $this->Task->connection = 'test_suite'; + $this->Task->listAll(); + $result = $this->Task->findHasAndBelongsToMany($model, array()); + $expected = array( + 'hasAndBelongsToMany' => array( + array( + 'alias' => 'Tag', + 'className' => 'Tag', + 'foreignKey' => 'article_id', + 'joinTable' => 'articles_tags', + 'associationForeignKey' => 'tag_id', + ), + ), + ); + $this->assertEqual($result, $expected); + } } ?> \ No newline at end of file From 5c48603bd0e655da4a932c166dfbad54973a5b3e Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 9 May 2009 23:32:22 -0400 Subject: [PATCH 0160/2083] Refactoring methods, adding self join association detection. Test cases updated. --- cake/console/libs/tasks/model.php | 103 ++++++++++-------- .../cases/console/libs/tasks/model.test.php | 74 +++++++++++-- 2 files changed, 124 insertions(+), 53 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index a982cfb28..7d72dbf21 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -78,6 +78,15 @@ class ModelTask extends Shell { **/ var $__validations = array(); +/** + * startup method + * + * @return void + **/ + function startup() { + App::import('Core', 'Model'); + } + /** * Execution method always used for tasks * @@ -127,13 +136,8 @@ function all() { * @param string $className Name of class you want model to be. * @return object Model instance **/ - function _getModelObject($className) { - if (App::import('Model', $className)) { - $object = new $className(); - } else { - App::import('Model'); - $object = new Model(array('name' => $className, 'ds' => $this->connection)); - } + function &_getModelObject($className) { + $object = new Model(array('name' => $className, 'ds' => $this->connection)); return $object; } /** @@ -159,7 +163,6 @@ function __interactive() { $fullTableName = $db->fullTableName($useTable); if (in_array($useTable, $this->__tables)) { - App::import('Model'); $tempModel = new Model(array('name' => $currentModelName, 'table' => $useTable, 'ds' => $this->connection)); $fields = $tempModel->schema(); if (!array_key_exists('id', $fields)) { @@ -387,7 +390,6 @@ function doAssociations(&$model) { if (!is_object($model)) { return false; } - App::import('Model'); $this->out(__('One moment while the associations are detected.', true)); $fields = $model->schema(); @@ -415,38 +417,7 @@ function doAssociations(&$model) { } else { $this->out(__('Please confirm the following associations:', true)); $this->hr(); - foreach ($associations as $type => $settings) { - if (!empty($associations[$type])) { - $count = count($associations[$type]); - $response = 'y'; - for ($i = 0; $i < $count; $i++) { - $prompt = "{$model->name} {$type} {$associations[$type][$i]['alias']}"; - $response = $this->in("{$prompt}?", array('y','n'), 'y'); - - if ('n' == low($response) || 'no' == low($response)) { - unset($associations[$type][$i]); - } else { - if ($model->name === $associations[$type][$i]['alias']) { - if ($type === 'belongsTo') { - $alias = 'Parent' . $associations[$type][$i]['alias']; - } - if ($type === 'hasOne' || $type === 'hasMany') { - $alias = 'Child' . $associations[$type][$i]['alias']; - } - - $alternateAlias = $this->in(sprintf(__('This is a self join. Use %s as the alias', true), $alias), array('y', 'n'), 'y'); - - if ('n' == low($alternateAlias) || 'no' == low($alternateAlias)) { - $associations[$type][$i]['alias'] = $this->in(__('Specify an alternate alias.', true)); - } else { - $associations[$type][$i]['alias'] = $alias; - } - } - } - } - $associations[$type] = array_merge($associations[$type]); - } - } + $associations = $this->confirmAssociations($model, $associations); } $wannaDoMoreAssoc = $this->in(__('Would you like to define some additional model associations?', true), array('y','n'), 'n'); @@ -534,13 +505,19 @@ function findBelongsTo(&$model, $associations) { $fields = $model->schema(); foreach ($fields as $fieldName => $field) { $offset = strpos($fieldName, '_id'); - if ($fieldName != $model->primaryKey && $offset !== false) { + if ($fieldName != $model->primaryKey && $fieldName != 'parent_id' && $offset !== false) { $tmpModelName = $this->_modelNameFromKey($fieldName); $associations['belongsTo'][] = array( 'alias' => $tmpModelName, 'className' => $tmpModelName, 'foreignKey' => $fieldName, ); + } elseif ($fieldName == 'parent_id') { + $associations['belongsTo'][] = array( + 'alias' => 'Parent' . $model->name, + 'className' => $model->name, + 'foreignKey' => $fieldName, + ); } } return $associations; @@ -561,16 +538,29 @@ function findHasOneAndMany(&$model, $associations) { $pattern = '/_' . preg_quote($model->table, '/') . '|' . preg_quote($model->table, '/') . '_/'; $possibleJoinTable = preg_match($pattern , $otherTable); + if ($possibleJoinTable == true) { + continue; + } foreach ($modelFieldsTemp as $fieldName => $field) { - if ($fieldName != $model->primaryKey && $fieldName == $foreignKey && $possibleJoinTable == false) { + $assoc = false; + if ($fieldName != $model->primaryKey && $fieldName == $foreignKey) { $assoc = array( 'alias' => $tempOtherModel->name, 'className' => $tempOtherModel->name, 'foreignKey' => $fieldName ); + } elseif ($otherTable == $model->table && $fieldName == 'parent_id') { + $assoc = array( + 'alias' => 'Child' . $model->name, + 'className' => $model->name, + 'foreignKey' => $fieldName + ); + } + if ($assoc) { $associations['hasOne'][] = $assoc; $associations['hasMany'][] = $assoc; } + } } return $associations; @@ -615,6 +605,33 @@ function findHasAndBelongsToMany(&$model, $associations) { } return $associations; } +/** + * Interact with the user and confirm associations. + * + * @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])) { + $count = count($associations[$type]); + $response = 'y'; + for ($i = 0; $i < $count; $i++) { + $prompt = "{$model->name} {$type} {$associations[$type][$i]['alias']}"; + $response = $this->in("{$prompt}?", array('y','n'), 'y'); + + if ('n' == low($response)) { + unset($associations[$type][$i]); + } elseif ($type == 'hasMany') { + unset($associations['hasOne'][$i]); + } + } + $associations[$type] = array_merge($associations[$type]); + } + } + return $associations; + } /** * Assembles and writes a Model file. diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index c5f74d89b..065d76afa 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -39,6 +39,7 @@ if (!class_exists('ModelTask')) { require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'model.php'; + require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'fixture.php'; } Mock::generatePartial( @@ -54,6 +55,10 @@ Mock::generate( 'Model', 'MockModelTaskModel' ); + +Mock::generate( + 'FixtureTask', 'MockModelTaskFixtureTask' +); /** * ModelTaskTest class * @@ -66,7 +71,7 @@ class ModelTaskTest extends CakeTestCase { * * @var array **/ - var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag'); + var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag', 'core.category_thread'); /** * setUp method @@ -99,20 +104,22 @@ function endTest() { function testListAll() { $this->Task->expectAt(1, 'out', array('1. Article')); $this->Task->expectAt(2, 'out', array('2. ArticlesTag')); - $this->Task->expectAt(3, 'out', array('3. Comment')); - $this->Task->expectAt(4, 'out', array('4. Tag')); + $this->Task->expectAt(3, 'out', array('3. CategoryThread')); + $this->Task->expectAt(4, 'out', array('4. Comment')); + $this->Task->expectAt(5, 'out', array('5. Tag')); $result = $this->Task->listAll('test_suite'); - $expected = array('articles', 'articles_tags', 'comments', 'tags'); + $expected = array('articles', 'articles_tags', 'category_threads', 'comments', 'tags'); $this->assertEqual($result, $expected); - $this->Task->expectAt(6, 'out', array('1. Article')); - $this->Task->expectAt(7, 'out', array('2. ArticlesTag')); - $this->Task->expectAt(8, 'out', array('3. Comment')); - $this->Task->expectAt(9, 'out', array('4. Tag')); + $this->Task->expectAt(7, 'out', array('1. Article')); + $this->Task->expectAt(8, 'out', array('2. ArticlesTag')); + $this->Task->expectAt(9, 'out', array('3. CategoryThread')); + $this->Task->expectAt(10, 'out', array('4. Comment')); + $this->Task->expectAt(11, 'out', array('5. Tag')); $this->Task->connection = 'test_suite'; $result = $this->Task->listAll(); - $expected = array('articles', 'articles_tags', 'comments', 'tags'); + $expected = array('articles', 'articles_tags', 'category_threads', 'comments', 'tags'); $this->assertEqual($result, $expected); } @@ -133,7 +140,7 @@ function testGetName() { $expected = 'Article'; $this->assertEqual($result, $expected); - $this->Task->setReturnValueAt(2, 'in', 3); + $this->Task->setReturnValueAt(2, 'in', 4); $result = $this->Task->getName('test_suite'); $expected = 'Comment'; $this->assertEqual($result, $expected); @@ -319,6 +326,20 @@ function testBelongsToGeneration() { ) ); $this->assertEqual($result, $expected); + + + $model = new Model(array('ds' => 'test_suite', 'name' => 'CategoryThread')); + $result = $this->Task->findBelongsTo($model, array()); + $expected = array( + 'belongsTo' => array( + array( + 'alias' => 'ParentCategoryThread', + 'className' => 'CategoryThread', + 'foreignKey' => 'parent_id', + ), + ) + ); + $this->assertEqual($result, $expected); } /** @@ -348,6 +369,27 @@ function testHasManyHasOneGeneration() { ), ); $this->assertEqual($result, $expected); + + + $model = new Model(array('ds' => 'test_suite', 'name' => 'CategoryThread')); + $result = $this->Task->findHasOneAndMany($model, array()); + $expected = array( + 'hasOne' => array( + array( + 'alias' => 'ChildCategoryThread', + 'className' => 'CategoryThread', + 'foreignKey' => 'parent_id', + ), + ), + 'hasMany' => array( + array( + 'alias' => 'ChildCategoryThread', + 'className' => 'CategoryThread', + 'foreignKey' => 'parent_id', + ), + ) + ); + $this->assertEqual($result, $expected); } /** @@ -373,5 +415,17 @@ function testHasAndBelongsToManyGeneration() { ); $this->assertEqual($result, $expected); } + +/** + * Ensure that the fixutre object is correctly called. + * + * @return void + **/ + function testFixture() { + $this->Task->Fixture =& new MockModelTaskFixtureTask(); + $this->Task->Fixture->expectAt(0, 'bake', array('Article', 'articles')); + $this->Task->fixture('Article', 'articles'); + } + } ?> \ No newline at end of file From ec443c43718076b00ef481e1091414253c8399bd Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 10 May 2009 01:04:40 -0400 Subject: [PATCH 0161/2083] Moving method and adding tests. --- cake/console/libs/tasks/model.php | 173 ++++++++++-------- .../cases/console/libs/tasks/model.test.php | 33 ++++ 2 files changed, 134 insertions(+), 72 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 7d72dbf21..e5f90484c 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -130,6 +130,7 @@ function all() { $this->bake($object, false); } } + /** * Get a model object for a class name. * @@ -140,6 +141,7 @@ function &_getModelObject($className) { $object = new Model(array('name' => $className, 'ds' => $this->connection)); return $object; } + /** * Handles interactive baking * @@ -326,7 +328,7 @@ function fieldValidation($fieldName, $metaData, $primaryKey = 'id') { $this->out(__('Please select one of the following validation options:', true)); $this->hr(); } - + $prompt = ''; for ($i = 1; $i < $defaultChoice; $i++) { $prompt .= $i . ' - ' . $this->__validations[$i] . "\n"; @@ -419,77 +421,7 @@ function doAssociations(&$model) { $this->hr(); $associations = $this->confirmAssociations($model, $associations); } - - $wannaDoMoreAssoc = $this->in(__('Would you like to define some additional model associations?', true), array('y','n'), 'n'); - - while ((low($wannaDoMoreAssoc) == 'y' || low($wannaDoMoreAssoc) == 'yes')) { - $assocs = array(1 => 'belongsTo', 2 => 'hasOne', 3 => 'hasMany', 4 => 'hasAndBelongsToMany'); - $bad = true; - while ($bad) { - $this->out(__('What is the association type?', true)); - $prompt = "1. belongsTo\n"; - $prompt .= "2. hasOne\n"; - $prompt .= "3. hasMany\n"; - $prompt .= "4. hasAndBelongsToMany\n"; - $assocType = intval($this->in($prompt, null, __("Enter a number", true))); - - if (intval($assocType) < 1 || intval($assocType) > 4) { - $this->out(__('The selection you entered was invalid. Please enter a number between 1 and 4.', true)); - } else { - $bad = false; - } - } - $this->out(__('For the following options be very careful to match your setup exactly. Any spelling mistakes will cause errors.', true)); - $this->hr(); - $alias = $this->in(__('What is the alias for this association?', true)); - $className = $this->in(sprintf(__('What className will %s use?', true), $alias), null, $alias ); - $suggestedForeignKey = null; - if ($assocType == '1') { - $showKeys = $possibleKeys[$model->table]; - $suggestedForeignKey = $this->_modelKey($alias); - } else { - $otherTable = Inflector::tableize($className); - if (in_array($otherTable, $this->__tables)) { - if ($assocType < '4') { - $showKeys = $possibleKeys[$otherTable]; - } else { - $showKeys = null; - } - } else { - $otherTable = $this->in(__('What is the table for this model?', true)); - $showKeys = $possibleKeys[$otherTable]; - } - $suggestedForeignKey = $this->_modelKey($model->name); - } - if (!empty($showKeys)) { - $this->out(__('A helpful List of possible keys', true)); - for ($i = 0; $i < count($showKeys); $i++) { - $this->out($i + 1 . ". " . $showKeys[$i]); - } - $foreignKey = $this->in(__('What is the foreignKey?', true), null, __("Enter a number", true)); - if (intval($foreignKey) > 0 && intval($foreignKey) <= $i ) { - $foreignKey = $showKeys[intval($foreignKey) - 1]; - } - } - if (!isset($foreignKey)) { - $foreignKey = $this->in(__('What is the foreignKey? Specify your own.', true), null, $suggestedForeignKey); - } - if ($assocType == '4') { - $associationForeignKey = $this->in(__('What is the associationForeignKey?', true), null, $this->_modelKey($model->name)); - $joinTable = $this->in(__('What is the joinTable?', true)); - } - $associations[$assocs[$assocType]] = array_values((array)$associations[$assocs[$assocType]]); - $count = count($associations[$assocs[$assocType]]); - $i = ($count > 0) ? $count : 0; - $associations[$assocs[$assocType]][$i]['alias'] = $alias; - $associations[$assocs[$assocType]][$i]['className'] = $className; - $associations[$assocs[$assocType]][$i]['foreignKey'] = $foreignKey; - if ($assocType == '4') { - $associations[$assocs[$assocType]][$i]['associationForeignKey'] = $associationForeignKey; - $associations[$assocs[$assocType]][$i]['joinTable'] = $joinTable; - } - $wannaDoMoreAssoc = $this->in(__('Define another association?', true), array('y','n'), 'y'); - } + $associations = $this->doMoreAssociations($model, $associations); } return $associations; } @@ -605,6 +537,7 @@ function findHasAndBelongsToMany(&$model, $associations) { } return $associations; } + /** * Interact with the user and confirm associations. * @@ -633,6 +566,100 @@ function confirmAssociations(&$model, $associations) { return $associations; } +/** + * Interact with the user and generate additional non-conventional associations + * + * @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'); + $possibleKeys = $this->_generatePossibleKeys(); + while (low($wannaDoMoreAssoc) == 'y') { + $assocs = array(1 => 'belongsTo', 2 => 'hasOne', 3 => 'hasMany', 4 => 'hasAndBelongsToMany'); + $this->out(__('What is the association type?', true)); + $prompt = "1. belongsTo\n"; + $prompt .= "2. hasOne\n"; + $prompt .= "3. hasMany\n"; + $prompt .= "4. hasAndBelongsToMany\n"; + $assocType = intval($this->in($prompt, array_keys($assocs), __("Enter a number", true))); + + $this->out(__("For the following options be very careful to match your setup exactly.\nAny spelling mistakes will cause errors.", true)); + $this->hr(); + + $alias = $this->in(__('What is the alias for this association?', true)); + $className = $this->in(sprintf(__('What className will %s use?', true), $alias), null, $alias ); + $suggestedForeignKey = null; + + if ($assocType == '1') { + $showKeys = $possibleKeys[$model->table]; + $suggestedForeignKey = $this->_modelKey($alias); + } else { + $otherTable = Inflector::tableize($className); + if (in_array($otherTable, $this->__tables)) { + if ($assocType < '4') { + $showKeys = $possibleKeys[$otherTable]; + } else { + $showKeys = null; + } + } else { + $otherTable = $this->in(__('What is the table for this model?', true)); + $showKeys = $possibleKeys[$otherTable]; + } + $suggestedForeignKey = $this->_modelKey($model->name); + } + if (!empty($showKeys)) { + $this->out(__('A helpful List of possible keys', true)); + for ($i = 0; $i < count($showKeys); $i++) { + $this->out($i + 1 . ". " . $showKeys[$i]); + } + $foreignKey = $this->in(__('What is the foreignKey?', true), null, __("Enter a number", true)); + if (intval($foreignKey) > 0 && intval($foreignKey) <= $i ) { + $foreignKey = $showKeys[intval($foreignKey) - 1]; + } + } + if (!isset($foreignKey)) { + $foreignKey = $this->in(__('What is the foreignKey? Specify your own.', true), null, $suggestedForeignKey); + } + if ($assocType == '4') { + $associationForeignKey = $this->in(__('What is the associationForeignKey?', true), null, $this->_modelKey($model->name)); + $joinTable = $this->in(__('What is the joinTable?', true)); + } + $associations[$assocs[$assocType]] = array_values((array)$associations[$assocs[$assocType]]); + $count = count($associations[$assocs[$assocType]]); + $i = ($count > 0) ? $count : 0; + $associations[$assocs[$assocType]][$i]['alias'] = $alias; + $associations[$assocs[$assocType]][$i]['className'] = $className; + $associations[$assocs[$assocType]][$i]['foreignKey'] = $foreignKey; + if ($assocType == '4') { + $associations[$assocs[$assocType]][$i]['associationForeignKey'] = $associationForeignKey; + $associations[$assocs[$assocType]][$i]['joinTable'] = $joinTable; + } + $wannaDoMoreAssoc = $this->in(__('Define another association?', true), array('y','n'), 'y'); + } + return $associations; + } + +/** + * 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) { + $tempOtherModel = & new Model(array('table' => $otherTable, 'ds' => $this->connection)); + $modelFieldsTemp = $tempOtherModel->schema(); + foreach ($modelFieldsTemp as $fieldName => $field) { + if ($field['type'] == 'integer' || $field['type'] == 'string') { + $possible[$otherTable][] = $fieldName; + } + } + } + return $possible; + } /** * Assembles and writes a Model file. * @@ -906,6 +933,7 @@ function listAll($useDbConfig = null, $interactive = true) { } return $this->__tables; } + /** * Interact with the user to determine the table name of a particular model * @@ -932,6 +960,7 @@ function getTable($modelName, $useDbConfig = null) { } return $useTable; } + /** * Forces the user to specify the model he wants to bake, and returns the selected model name. * diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index 065d76afa..0fbde6017 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -427,5 +427,38 @@ function testFixture() { $this->Task->fixture('Article', 'articles'); } +/** + * test confirming of associations, and that when an association is hasMany + * a question for the hasOne is also not asked. + * + * @return void + **/ + function testConfirmAssociations() { + $associations = array( + 'hasOne' => array( + array( + 'alias' => 'ChildCategoryThread', + 'className' => 'CategoryThread', + 'foreignKey' => 'parent_id', + ), + ), + 'hasMany' => array( + array( + 'alias' => 'ChildCategoryThread', + 'className' => 'CategoryThread', + 'foreignKey' => 'parent_id', + ), + ) + ); + $model = new Model(array('ds' => 'test_suite', 'name' => 'CategoryThread')); + $this->Task->setReturnValueAt(0, 'in', 'y'); + $result = $this->Task->confirmAssociations($model, $associations); + $this->assertTrue(empty($result['hasOne'])); + + $this->Task->setReturnValue('in', 'n'); + $result = $this->Task->confirmAssociations($model, $associations); + $this->assertTrue(empty($result['hasMany'])); + $this->assertTrue(empty($result['hasOne'])); + } } ?> \ No newline at end of file From d066a4a0d678dd6afd178f43a31ce97eb96d3361 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 10 May 2009 01:35:59 -0400 Subject: [PATCH 0162/2083] Extracting method out. --- cake/console/libs/tasks/model.php | 53 ++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index e5f90484c..6ec8c1a41 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -142,6 +142,32 @@ function &_getModelObject($className) { return $object; } +/** + * Generate a key value list of options and a prompt. + * + * @param array $options Array of options to use for the selections. indexes must start at 0 + * @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); + while (!$valid) { + foreach ($options as $i => $option) { + $this->out($i + 1 .'. ' . $option); + } + if (empty($prompt)) { + $prompt = __('Make a selection from the choices above', true); + } + $choice = $this->in($prompt, null, $default); + if (intval($choice) > 0 && intval($choice) <= $max) { + $valid = true; + } + } + return $choice - 1; + } + /** * Handles interactive baking * @@ -578,14 +604,10 @@ function doMoreAssociations($model, $associations) { $wannaDoMoreAssoc = $this->in($prompt, array('y','n'), 'n'); $possibleKeys = $this->_generatePossibleKeys(); while (low($wannaDoMoreAssoc) == 'y') { - $assocs = array(1 => 'belongsTo', 2 => 'hasOne', 3 => 'hasMany', 4 => 'hasAndBelongsToMany'); + $assocs = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany'); $this->out(__('What is the association type?', true)); - $prompt = "1. belongsTo\n"; - $prompt .= "2. hasOne\n"; - $prompt .= "3. hasMany\n"; - $prompt .= "4. hasAndBelongsToMany\n"; - $assocType = intval($this->in($prompt, array_keys($assocs), __("Enter a number", true))); - + $assocType = intval($this->inOptions($assocs, __('Enter a number',true))); + $this->out(__("For the following options be very careful to match your setup exactly.\nAny spelling mistakes will cause errors.", true)); $this->hr(); @@ -593,13 +615,13 @@ function doMoreAssociations($model, $associations) { $className = $this->in(sprintf(__('What className will %s use?', true), $alias), null, $alias ); $suggestedForeignKey = null; - if ($assocType == '1') { + if ($assocType == 0) { $showKeys = $possibleKeys[$model->table]; $suggestedForeignKey = $this->_modelKey($alias); } else { $otherTable = Inflector::tableize($className); if (in_array($otherTable, $this->__tables)) { - if ($assocType < '4') { + if ($assocType < 3) { $showKeys = $possibleKeys[$otherTable]; } else { $showKeys = null; @@ -612,18 +634,13 @@ function doMoreAssociations($model, $associations) { } if (!empty($showKeys)) { $this->out(__('A helpful List of possible keys', true)); - for ($i = 0; $i < count($showKeys); $i++) { - $this->out($i + 1 . ". " . $showKeys[$i]); - } - $foreignKey = $this->in(__('What is the foreignKey?', true), null, __("Enter a number", true)); - if (intval($foreignKey) > 0 && intval($foreignKey) <= $i ) { - $foreignKey = $showKeys[intval($foreignKey) - 1]; - } + $foreignKey = $this->inOptions($showKeys, __('What is the foreignKey?', true)); + $foreignKey = $showKeys[intval($foreignKey)]; } if (!isset($foreignKey)) { $foreignKey = $this->in(__('What is the foreignKey? Specify your own.', true), null, $suggestedForeignKey); } - if ($assocType == '4') { + if ($assocType == 3) { $associationForeignKey = $this->in(__('What is the associationForeignKey?', true), null, $this->_modelKey($model->name)); $joinTable = $this->in(__('What is the joinTable?', true)); } @@ -633,7 +650,7 @@ function doMoreAssociations($model, $associations) { $associations[$assocs[$assocType]][$i]['alias'] = $alias; $associations[$assocs[$assocType]][$i]['className'] = $className; $associations[$assocs[$assocType]][$i]['foreignKey'] = $foreignKey; - if ($assocType == '4') { + if ($assocType == 3) { $associations[$assocs[$assocType]][$i]['associationForeignKey'] = $associationForeignKey; $associations[$assocs[$assocType]][$i]['joinTable'] = $joinTable; } From 6be70c3cfa7ab5bfa9a9e66f2d230f7fec4e280e Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 10 May 2009 11:01:15 -0400 Subject: [PATCH 0163/2083] Adding test coverage for inOptions. --- .../cases/console/libs/tasks/model.test.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index 0fbde6017..a5f684e6a 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -460,5 +460,25 @@ function testConfirmAssociations() { $this->assertTrue(empty($result['hasMany'])); $this->assertTrue(empty($result['hasOne'])); } + +/** + * test that inOptions generates questions and only accepts a valid answer + * + * @return void + **/ + function testInOptions() { + $options = array('one', 'two', 'three'); + $this->Task->expectAt(0, 'out', array('1. one')); + $this->Task->expectAt(1, 'out', array('2. two')); + $this->Task->expectAt(2, 'out', array('3. three')); + $this->Task->setReturnValueAt(0, 'in', 10); + + $this->Task->expectAt(3, 'out', array('1. one')); + $this->Task->expectAt(4, 'out', array('2. two')); + $this->Task->expectAt(5, 'out', array('3. three')); + $this->Task->setReturnValueAt(1, 'in', 2); + $result = $this->Task->inOptions($options, 'Pick a number'); + $this->assertEqual($result, 1); + } } ?> \ No newline at end of file From ef519621b476f398ea65324384e837833a427b64 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 10 May 2009 12:11:20 -0400 Subject: [PATCH 0164/2083] Adding tests for doAssociations --- .../cases/console/libs/tasks/model.test.php | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index a5f684e6a..9c49bde37 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -416,6 +416,36 @@ function testHasAndBelongsToManyGeneration() { $this->assertEqual($result, $expected); } +/** + * test non interactive doAssociations + * + * @return void + **/ + function testDoAssociationsNonInteractive() { + $this->Task->connection = 'test_suite'; + $this->Task->interactive = false; + $model = new Model(array('ds' => 'test_suite', 'name' => 'Article')); + $result = $this->Task->doAssociations($model); + $expected = array( + 'hasMany' => array( + array( + 'alias' => 'Comment', + 'className' => 'Comment', + 'foreignKey' => 'article_id', + ), + ), + 'hasAndBelongsToMany' => array( + array( + 'alias' => 'Tag', + 'className' => 'Tag', + 'foreignKey' => 'article_id', + 'joinTable' => 'articles_tags', + 'associationForeignKey' => 'tag_id', + ), + ), + ); + + } /** * Ensure that the fixutre object is correctly called. * @@ -448,6 +478,13 @@ function testConfirmAssociations() { 'className' => 'CategoryThread', 'foreignKey' => 'parent_id', ), + ), + 'belongsTo' => array( + array( + 'alias' => 'User', + 'className' => 'User', + 'foreignKey' => 'user_id', + ), ) ); $model = new Model(array('ds' => 'test_suite', 'name' => 'CategoryThread')); From 4b75c6b78e849d0bf74d3d1e9115d853e12c40f0 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 10 May 2009 12:43:38 -0400 Subject: [PATCH 0165/2083] minor cleanup --- cake/console/libs/tasks/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 6ec8c1a41..39307355b 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -972,7 +972,7 @@ function getTable($modelName, $useDbConfig = null) { $this->out(sprintf(__("Given your model named '%s',\nCake would expect a database table named '%s'", true), $modelName, $fullTableName)); $tableIsGood = $this->in(__('Do you want to use this table?', true), array('y','n'), 'y'); } - if (low($tableIsGood) == 'n' || low($tableIsGood) == 'no') { + if (strtolower($tableIsGood) == 'n') { $useTable = $this->in(__('What is the name of the table (enter "null" to use NO table)?', true)); } return $useTable; From 328756f6865c3374f29343db7c385e39e1c9b4ba Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 10 May 2009 13:33:05 -0400 Subject: [PATCH 0166/2083] Adding fixture template --- .../libs/templates/objects/fixture.ctp | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 cake/console/libs/templates/objects/fixture.ctp diff --git a/cake/console/libs/templates/objects/fixture.ctp b/cake/console/libs/templates/objects/fixture.ctp new file mode 100644 index 000000000..23484a3cd --- /dev/null +++ b/cake/console/libs/templates/objects/fixture.ctp @@ -0,0 +1,40 @@ +<?php +/** + * Fixture Template file + * + * Fixture Template used when baking fixtures with bake + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org + * @package cake + * @subpackage cake. + * @since CakePHP(tm) v 1.3 + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + */ +?> +<?php echo '<?php'; ?> +/* <?php echo $model; ?> Fixture generated on: <?php echo date('Y-m-d H:m:s') . " : ". time(); ?> */ +class <?php echo $model; ?>Fixture extends CakeTestFixture { + var $name = '<?php echo $model; ?>'; +<?php if ($useTable): ?> + var $table = '<?php echo $useTable; ?>'; +<?php endif; ?> +<?php if ($import): ?> + var $import = <?php echo $import; ?>; +<?php endif;?> +<?php if ($schema): ?> + var $fields = <?php echo $schema; ?>; +<?php endif;?> +<?php if ($records): ?> + var $records = <?php echo $records; ?>; +<?php endif;?> +} +<?php echo '?>'; ?> \ No newline at end of file From a6d16500a95920301852ce8d04e323507ccecb92 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 10 May 2009 13:33:52 -0400 Subject: [PATCH 0167/2083] Adding CodeGenerator in a temporary place. --- cake/console/libs/tasks/fixture.php | 95 +++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 5d19da9f1..64ad60299 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -342,4 +342,99 @@ function help() { $this->_stop(); } } + +/** + * Similar to View but has no dependancy on controller + * + **/ +class CodeGenerator { +/** + * variables to add to template scope + * + * @var array + **/ + var $templateVars = array(); +/** + * set the paths for the code generator to search for templates + * + * @param array $paths Array of paths to look in + * @access public + * @return void + **/ + function setPaths($paths) { + $this->_paths = $paths; + } + +/** + * Find a template + * + * @param string $directory Subdirectory to look for ie. 'views', 'objects' + * @param string $filename lower_case_underscored filename you want. + * @access public + * @return string filename or false if scan failed. + **/ + function _findTemplate($directory, $filename) { + foreach ($this->_paths as $path) { + $templatePath = $path . 'templates' . DS . $directory . DS . $filename . '.ctp'; + if (file_exists($templatePath) && is_file($templatePath)) { + return $templatePath; + } + } + return false; + } + +/** + * Set variable values to the template scope + * + * @param mixed $one A string or an array of data. + * @param mixed $two Value in case $one is a string (which then works as the key). + * Unused if $one is an associative array, otherwise serves as the values to $one's keys. + * @return void + */ + function set($one, $two = null) { + $data = null; + if (is_array($one)) { + if (is_array($two)) { + $data = array_combine($one, $two); + } else { + $data = $one; + } + } else { + $data = array($one => $two); + } + + if ($data == null) { + return false; + } + + foreach ($data as $name => $value) { + $this->viewVars[$name] = $value; + } + } + +/** + * Runs the template + * + * @param string $directory directory / type of thing you want + * @param string $filename template name + * @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); + } + $templateFile = $this->_findTemplate($directory, $filename); + if ($templateFile) { + extract($this->templateVars); + ob_start(); + ob_implicit_flush(0); + include($templatePath); + $content = ob_get_clean(); + return $content; + } + return ''; + } +} ?> From 3ea2b5a87d3b3c03ff4c326e78eaa47d3fa6bf02 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 10 May 2009 22:16:38 -0400 Subject: [PATCH 0168/2083] Moving CodeGenerator class into bake shell. Updating FixtureTask and test cases. Updating template for fixtures. --- cake/console/libs/bake.php | 95 ++++++++++++ cake/console/libs/tasks/fixture.php | 136 +++--------------- .../libs/templates/objects/fixture.ctp | 8 +- .../cases/console/libs/tasks/fixture.test.php | 8 +- 4 files changed, 128 insertions(+), 119 deletions(-) diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index 6277342d5..bce32a767 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -218,4 +218,99 @@ function help() { } } + +/** + * Similar to View but has no dependancy on controller + * + **/ +class CodeGenerator { +/** + * variables to add to template scope + * + * @var array + **/ + var $templateVars = array(); +/** + * set the paths for the code generator to search for templates + * + * @param array $paths Array of paths to look in + * @access public + * @return void + **/ + function setPaths($paths) { + $this->_paths = $paths; + } + +/** + * Find a template + * + * @param string $directory Subdirectory to look for ie. 'views', 'objects' + * @param string $filename lower_case_underscored filename you want. + * @access public + * @return string filename or false if scan failed. + **/ + function _findTemplate($directory, $filename) { + foreach ($this->_paths as $path) { + $templatePath = $path . 'templates' . DS . $directory . DS . $filename . '.ctp'; + if (file_exists($templatePath) && is_file($templatePath)) { + return $templatePath; + } + } + return false; + } + +/** + * Set variable values to the template scope + * + * @param mixed $one A string or an array of data. + * @param mixed $two Value in case $one is a string (which then works as the key). + * Unused if $one is an associative array, otherwise serves as the values to $one's keys. + * @return void + */ + function set($one, $two = null) { + $data = null; + if (is_array($one)) { + if (is_array($two)) { + $data = array_combine($one, $two); + } else { + $data = $one; + } + } else { + $data = array($one => $two); + } + + if ($data == null) { + return false; + } + + foreach ($data as $name => $value) { + $this->templateVars[$name] = $value; + } + } + +/** + * Runs the template + * + * @param string $directory directory / type of thing you want + * @param string $filename template name + * @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); + } + $templateFile = $this->_findTemplate($directory, $filename); + if ($templateFile) { + extract($this->templateVars); + ob_start(); + ob_implicit_flush(0); + include($templateFile); + $content = ob_get_clean(); + return $content; + } + return ''; + } +} ?> \ No newline at end of file diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 64ad60299..e5e8541b6 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -154,16 +154,14 @@ function importOptions($modelName) { * @access private */ function bake($model, $useTable = false, $importOptions = array()) { - $out = "class {$model}Fixture extends CakeTestFixture {\n"; - $out .= "\tvar \$name = '$model';\n"; - + $table = $schema = $records = $import = null; if (!$useTable) { $useTable = Inflector::tableize($model); } elseif ($useTable != Inflector::tableize($model)) { - $out .= "\tvar \$table = '$useTable';\n"; + $table = $useTable; } - $modelImport = $recordImport = null; + $modelImport = $import = $recordImport = null; if (!empty($importOptions)) { if (isset($importOptions['schema'])) { $modelImport = "'model' => '{$importOptions['schema']}'"; @@ -174,7 +172,7 @@ function bake($model, $useTable = false, $importOptions = array()) { if ($modelImport && $recordImport) { $modelImport .= ', '; } - $out .= sprintf("\tvar \$import = array(%s%s);\n", $modelImport, $recordImport); + $import = sprintf("array(%s%s);\n", $modelImport, $recordImport); } $this->_Schema = new CakeSchema(); @@ -187,7 +185,7 @@ function bake($model, $useTable = false, $importOptions = array()) { $tableInfo = $data['tables'][$useTable]; if (is_null($modelImport)) { - $out .= $this->_generateSchema($tableInfo); + $schema = $this->_generateSchema($tableInfo); } if (is_null($recordImport)) { @@ -195,10 +193,9 @@ function bake($model, $useTable = false, $importOptions = array()) { if (isset($this->params['count'])) { $recordCount = $this->params['count']; } - $out .= $this->_generateRecords($tableInfo, $recordCount); + $records = $this->_generateRecords($tableInfo, $recordCount); } - $out .= "}\n"; - $this->generateFixtureFile($model, $out); + $out = $this->generateFixtureFile($model, compact('records', 'table', 'schema', 'import', 'fields')); return $out; } @@ -210,7 +207,10 @@ function bake($model, $useTable = false, $importOptions = array()) { * @access public * @return void **/ - function generateFixtureFile($model, $fixture) { + function generateFixtureFile($model, $otherVars) { + $defaults = array('table' => null, 'schema' => null, 'records' => null, 'import' => null, 'fields' => null); + $vars = array_merge($defaults, $otherVars); + //@todo fix plugin pathing. $path = $this->path; if (isset($this->plugin)) { @@ -218,11 +218,16 @@ function generateFixtureFile($model, $fixture) { $path = APP . $pluginPath . 'tests' . DS . 'fixtures' . DS; } $filename = Inflector::underscore($model) . '_fixture.php'; - $content = "<?php\n/* " . $model . " Fixture generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n"; - $content .= $fixture; - $content .= "?>"; + + $Generator = new CodeGenerator(); + $Generator->setPaths($this->Dispatch->shellPaths); + $Generator->set('model', $model); + $Generator->set($vars); + $content = $Generator->generate('objects', 'fixture'); + $this->out("\nBaking test fixture for $model..."); $this->createFile($path . $filename, $content); + return $content; } /** @@ -233,7 +238,7 @@ function generateFixtureFile($model, $fixture) { **/ function _generateSchema($tableInfo) { $cols = array(); - $out = "\n\tvar \$fields = array(\n"; + $out = "array(\n"; foreach ($tableInfo as $field => $fieldInfo) { if (is_array($fieldInfo)) { if ($field != 'indexes') { @@ -252,7 +257,7 @@ function _generateSchema($tableInfo) { } } $out .= join(",\n", $cols); - $out .= "\n\t);\n\n"; + $out .= "\n\t)"; return $out; } @@ -263,7 +268,7 @@ function _generateSchema($tableInfo) { * @return string **/ function _generateRecords($tableInfo, $recordCount = 1) { - $out = "\tvar \$records = array(\n"; + $out = "array(\n"; for ($i = 0; $i < $recordCount; $i++) { $records = array(); @@ -317,7 +322,7 @@ function _generateRecords($tableInfo, $recordCount = 1) { $out .= implode(",\n", $records); $out .= "\n\t\t),\n"; } - $out .= "\t);\n"; + $out .= "\t)"; return $out; } @@ -342,99 +347,4 @@ function help() { $this->_stop(); } } - -/** - * Similar to View but has no dependancy on controller - * - **/ -class CodeGenerator { -/** - * variables to add to template scope - * - * @var array - **/ - var $templateVars = array(); -/** - * set the paths for the code generator to search for templates - * - * @param array $paths Array of paths to look in - * @access public - * @return void - **/ - function setPaths($paths) { - $this->_paths = $paths; - } - -/** - * Find a template - * - * @param string $directory Subdirectory to look for ie. 'views', 'objects' - * @param string $filename lower_case_underscored filename you want. - * @access public - * @return string filename or false if scan failed. - **/ - function _findTemplate($directory, $filename) { - foreach ($this->_paths as $path) { - $templatePath = $path . 'templates' . DS . $directory . DS . $filename . '.ctp'; - if (file_exists($templatePath) && is_file($templatePath)) { - return $templatePath; - } - } - return false; - } - -/** - * Set variable values to the template scope - * - * @param mixed $one A string or an array of data. - * @param mixed $two Value in case $one is a string (which then works as the key). - * Unused if $one is an associative array, otherwise serves as the values to $one's keys. - * @return void - */ - function set($one, $two = null) { - $data = null; - if (is_array($one)) { - if (is_array($two)) { - $data = array_combine($one, $two); - } else { - $data = $one; - } - } else { - $data = array($one => $two); - } - - if ($data == null) { - return false; - } - - foreach ($data as $name => $value) { - $this->viewVars[$name] = $value; - } - } - -/** - * Runs the template - * - * @param string $directory directory / type of thing you want - * @param string $filename template name - * @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); - } - $templateFile = $this->_findTemplate($directory, $filename); - if ($templateFile) { - extract($this->templateVars); - ob_start(); - ob_implicit_flush(0); - include($templatePath); - $content = ob_get_clean(); - return $content; - } - return ''; - } -} ?> diff --git a/cake/console/libs/templates/objects/fixture.ctp b/cake/console/libs/templates/objects/fixture.ctp index 23484a3cd..34d84bf4a 100644 --- a/cake/console/libs/templates/objects/fixture.ctp +++ b/cake/console/libs/templates/objects/fixture.ctp @@ -20,19 +20,21 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ ?> -<?php echo '<?php'; ?> +<?php echo '<?php' . "\n"; ?> /* <?php echo $model; ?> Fixture generated on: <?php echo date('Y-m-d H:m:s') . " : ". time(); ?> */ class <?php echo $model; ?>Fixture extends CakeTestFixture { var $name = '<?php echo $model; ?>'; -<?php if ($useTable): ?> - var $table = '<?php echo $useTable; ?>'; +<?php if ($table): ?> + var $table = '<?php echo $table; ?>'; <?php endif; ?> <?php if ($import): ?> var $import = <?php echo $import; ?>; <?php endif;?> + <?php if ($schema): ?> var $fields = <?php echo $schema; ?>; <?php endif;?> + <?php if ($records): ?> var $records = <?php echo $records; ?>; <?php endif;?> diff --git a/cake/tests/cases/console/libs/tasks/fixture.test.php b/cake/tests/cases/console/libs/tasks/fixture.test.php index 871efbbb2..10b3c862c 100644 --- a/cake/tests/cases/console/libs/tasks/fixture.test.php +++ b/cake/tests/cases/console/libs/tasks/fixture.test.php @@ -38,6 +38,7 @@ } if (!class_exists('FixtureTask')) { + require CAKE . 'console' . DS . 'libs' . DS . 'bake.php'; require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'fixture.php'; } @@ -79,6 +80,7 @@ function startTest() { $this->Task =& new MockFixtureTask(); $this->Task->Model =& new MockFixtureModelTask(); $this->Task->Dispatch = new $this->Dispatcher; + $this->Task->Dispatch->shellPaths = Configure::read('shellPaths'); } /** * tearDown method @@ -216,11 +218,11 @@ function testGenerateFixtureFile() { $this->Task->path = '/my/path/'; $filename = '/my/path/article_fixture.php'; - $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/my fixture/'))); - $result = $this->Task->generateFixtureFile('Article', 'my fixture'); + $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/Article/'))); + $result = $this->Task->generateFixtureFile('Article', array()); $this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/\<\?php(.*)\?\>/ms'))); - $result = $this->Task->generateFixtureFile('Article', 'my fixture'); + $result = $this->Task->generateFixtureFile('Article', array()); } } ?> \ No newline at end of file From dff90e892ed0890def6f405f9a464b81b16301a4 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 12 May 2009 21:19:15 -0400 Subject: [PATCH 0169/2083] Adding Template Task, removing CodeGenerator. --- cake/console/libs/bake.php | 95 --------------------- cake/console/libs/tasks/template.php | 120 +++++++++++++++++++++++++++ 2 files changed, 120 insertions(+), 95 deletions(-) create mode 100644 cake/console/libs/tasks/template.php diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index bce32a767..6277342d5 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -218,99 +218,4 @@ function help() { } } - -/** - * Similar to View but has no dependancy on controller - * - **/ -class CodeGenerator { -/** - * variables to add to template scope - * - * @var array - **/ - var $templateVars = array(); -/** - * set the paths for the code generator to search for templates - * - * @param array $paths Array of paths to look in - * @access public - * @return void - **/ - function setPaths($paths) { - $this->_paths = $paths; - } - -/** - * Find a template - * - * @param string $directory Subdirectory to look for ie. 'views', 'objects' - * @param string $filename lower_case_underscored filename you want. - * @access public - * @return string filename or false if scan failed. - **/ - function _findTemplate($directory, $filename) { - foreach ($this->_paths as $path) { - $templatePath = $path . 'templates' . DS . $directory . DS . $filename . '.ctp'; - if (file_exists($templatePath) && is_file($templatePath)) { - return $templatePath; - } - } - return false; - } - -/** - * Set variable values to the template scope - * - * @param mixed $one A string or an array of data. - * @param mixed $two Value in case $one is a string (which then works as the key). - * Unused if $one is an associative array, otherwise serves as the values to $one's keys. - * @return void - */ - function set($one, $two = null) { - $data = null; - if (is_array($one)) { - if (is_array($two)) { - $data = array_combine($one, $two); - } else { - $data = $one; - } - } else { - $data = array($one => $two); - } - - if ($data == null) { - return false; - } - - foreach ($data as $name => $value) { - $this->templateVars[$name] = $value; - } - } - -/** - * Runs the template - * - * @param string $directory directory / type of thing you want - * @param string $filename template name - * @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); - } - $templateFile = $this->_findTemplate($directory, $filename); - if ($templateFile) { - extract($this->templateVars); - ob_start(); - ob_implicit_flush(0); - include($templateFile); - $content = ob_get_clean(); - return $content; - } - return ''; - } -} ?> \ No newline at end of file diff --git a/cake/console/libs/tasks/template.php b/cake/console/libs/tasks/template.php new file mode 100644 index 000000000..ab4c607c9 --- /dev/null +++ b/cake/console/libs/tasks/template.php @@ -0,0 +1,120 @@ +<?php +/** + * Template Task can generate templated output Used in other Tasks + * + * + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org + * @package cake + * @subpackage cake. + * @since CakePHP(tm) v 1.3 + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + */ +class TemplateTask extends Shell { +/** + * variables to add to template scope + * + * @var array + **/ + var $templateVars = array(); +/** + * Initialize callback + * + * @access public + * @return void + **/ + function initialize() { + $this->_paths = $this->Dispatch->shellPaths; + } +/** + * set the paths for the code generator to search for templates + * + * @param array $paths Array of paths to look in + * @access public + * @return void + **/ + function setPaths($paths) { + $this->_paths = $paths; + } + +/** + * Find a template + * + * @param string $directory Subdirectory to look for ie. 'views', 'objects' + * @param string $filename lower_case_underscored filename you want. + * @access public + * @return string filename or false if scan failed. + **/ + function _findTemplate($directory, $filename) { + foreach ($this->_paths as $path) { + $templatePath = $path . 'templates' . DS . $directory . DS . $filename . '.ctp'; + if (file_exists($templatePath) && is_file($templatePath)) { + return $templatePath; + } + } + return false; + } + +/** + * Set variable values to the template scope + * + * @param mixed $one A string or an array of data. + * @param mixed $two Value in case $one is a string (which then works as the key). + * Unused if $one is an associative array, otherwise serves as the values to $one's keys. + * @return void + */ + function set($one, $two = null) { + $data = null; + if (is_array($one)) { + if (is_array($two)) { + $data = array_combine($one, $two); + } else { + $data = $one; + } + } else { + $data = array($one => $two); + } + + if ($data == null) { + return false; + } + + foreach ($data as $name => $value) { + $this->templateVars[$name] = $value; + } + } + +/** + * Runs the template + * + * @param string $directory directory / type of thing you want + * @param string $filename template name + * @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); + } + $templateFile = $this->_findTemplate($directory, $filename); + if ($templateFile) { + extract($this->templateVars); + ob_start(); + ob_implicit_flush(0); + include($templateFile); + $content = ob_get_clean(); + return $content; + } + return ''; + } +} \ No newline at end of file From a38233e75d10b2884b9e6d8fc0e0f72d0085d19f Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 12 May 2009 21:26:37 -0400 Subject: [PATCH 0170/2083] Updating FixtureTask and FixtureTask test to use TemplateTask --- cake/console/libs/tasks/fixture.php | 10 ++++------ cake/tests/cases/console/libs/tasks/fixture.test.php | 4 +++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index e5e8541b6..ec1bc7240 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -42,7 +42,7 @@ class FixtureTask extends Shell { * @var array * @access public */ - var $tasks = array('DbConfig', 'Model'); + var $tasks = array('DbConfig', 'Model', 'Template'); /** * path to fixtures directory * @@ -219,11 +219,9 @@ function generateFixtureFile($model, $otherVars) { } $filename = Inflector::underscore($model) . '_fixture.php'; - $Generator = new CodeGenerator(); - $Generator->setPaths($this->Dispatch->shellPaths); - $Generator->set('model', $model); - $Generator->set($vars); - $content = $Generator->generate('objects', 'fixture'); + $this->Template->set('model', $model); + $this->Template->set($vars); + $content = $this->Template->generate('objects', 'fixture'); $this->out("\nBaking test fixture for $model..."); $this->createFile($path . $filename, $content); diff --git a/cake/tests/cases/console/libs/tasks/fixture.test.php b/cake/tests/cases/console/libs/tasks/fixture.test.php index 10b3c862c..2ec79fd49 100644 --- a/cake/tests/cases/console/libs/tasks/fixture.test.php +++ b/cake/tests/cases/console/libs/tasks/fixture.test.php @@ -38,7 +38,7 @@ } if (!class_exists('FixtureTask')) { - require CAKE . 'console' . DS . 'libs' . DS . 'bake.php'; + require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php'; require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'fixture.php'; } @@ -80,7 +80,9 @@ function startTest() { $this->Task =& new MockFixtureTask(); $this->Task->Model =& new MockFixtureModelTask(); $this->Task->Dispatch = new $this->Dispatcher; + $this->Task->Template =& new TemplateTask($this->Task->Dispatch); $this->Task->Dispatch->shellPaths = Configure::read('shellPaths'); + $this->Task->Template->initialize(); } /** * tearDown method From 3a36979a210e5325662d9088a179abf51969fb40 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 12 May 2009 21:35:06 -0400 Subject: [PATCH 0171/2083] fixing doc block --- .../cases/console/libs/tasks/fixture.test.php | 29 +++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/cake/tests/cases/console/libs/tasks/fixture.test.php b/cake/tests/cases/console/libs/tasks/fixture.test.php index 2ec79fd49..f5f41f059 100644 --- a/cake/tests/cases/console/libs/tasks/fixture.test.php +++ b/cake/tests/cases/console/libs/tasks/fixture.test.php @@ -1,28 +1,23 @@ <?php -/* SVN FILE: $Id$ */ /** - * TestTaskTest file + * FixtureTask Test case * - * Test Case for test generation shell task + * * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org * @package cake - * @subpackage cake.tests.cases.console.libs.tasks - * @since CakePHP v 1.2.0.7726 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @subpackage cake. + * @since CakePHP(tm) v 1.3 + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ App::import('Core', 'Shell'); @@ -37,10 +32,8 @@ ob_end_clean(); } -if (!class_exists('FixtureTask')) { - require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php'; - require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'fixture.php'; -} +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php'; +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'fixture.php'; Mock::generatePartial( 'ShellDispatcher', 'TestFixtureTaskMockShellDispatcher', From 15fb1a711a1b71898896f2b7b71dfda393e264a4 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 12 May 2009 22:00:30 -0400 Subject: [PATCH 0172/2083] Updating TemplateTask adding test case and test object file. --- cake/console/libs/tasks/template.php | 14 +- .../console/libs/tasks/template.test.php | 124 ++++++++++++++++++ .../shells/templates/objects/test_object.ctp | 2 + 3 files changed, 128 insertions(+), 12 deletions(-) create mode 100644 cake/tests/cases/console/libs/tasks/template.test.php create mode 100644 cake/tests/test_app/vendors/shells/templates/objects/test_object.ctp diff --git a/cake/console/libs/tasks/template.php b/cake/console/libs/tasks/template.php index ab4c607c9..6fe7ddfed 100644 --- a/cake/console/libs/tasks/template.php +++ b/cake/console/libs/tasks/template.php @@ -33,17 +33,7 @@ class TemplateTask extends Shell { * @return void **/ function initialize() { - $this->_paths = $this->Dispatch->shellPaths; - } -/** - * set the paths for the code generator to search for templates - * - * @param array $paths Array of paths to look in - * @access public - * @return void - **/ - function setPaths($paths) { - $this->_paths = $paths; + $this->templatePaths = $this->Dispatch->shellPaths; } /** @@ -55,7 +45,7 @@ function setPaths($paths) { * @return string filename or false if scan failed. **/ function _findTemplate($directory, $filename) { - foreach ($this->_paths as $path) { + foreach ($this->templatePaths as $path) { $templatePath = $path . 'templates' . DS . $directory . DS . $filename . '.ctp'; if (file_exists($templatePath) && is_file($templatePath)) { return $templatePath; diff --git a/cake/tests/cases/console/libs/tasks/template.test.php b/cake/tests/cases/console/libs/tasks/template.test.php new file mode 100644 index 000000000..86baa4559 --- /dev/null +++ b/cake/tests/cases/console/libs/tasks/template.test.php @@ -0,0 +1,124 @@ +<?php +/** + * TemplateTask file + * + * Test Case for TemplateTask generation shell task + * + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org + * @package cake + * @subpackage cake. + * @since CakePHP(tm) v 1.3 + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + */ +App::import('Core', 'Shell'); + +if (!defined('DISABLE_AUTO_DISPATCH')) { + define('DISABLE_AUTO_DISPATCH', true); +} + +if (!class_exists('ShellDispatcher')) { + ob_start(); + $argv = false; + require CAKE . 'console' . DS . 'cake.php'; + ob_end_clean(); +} + +if (!class_exists('TemplateTask')) { + require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php'; +} + +Mock::generatePartial( + 'ShellDispatcher', 'TestTemplateTaskMockShellDispatcher', + array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment') +); + +Mock::generatePartial( + 'TemplateTask', 'MockTemplateTask', + array('in', 'out', 'err', 'createFile', '_stop') +); + +/** + * TemplateTaskTest class + * + * @package cake + * @subpackage cake.tests.cases.console.libs.tasks + */ +class TemplateTaskTest extends CakeTestCase { +/** + * setUp method + * + * @return void + * @access public + */ + function startTest() { + $this->Dispatcher =& new TestTemplateTaskMockShellDispatcher(); + $this->Task =& new MockTemplateTask($this->Dispatcher); + $this->Task->Dispatch = new $this->Dispatcher; + $this->Task->Dispatch->shellPaths = Configure::read('shellPaths'); + } + +/** + * tearDown method + * + * @return void + * @access public + */ + function endTest() { + unset($this->Task, $this->Dispatcher); + ClassRegistry::flush(); + } + +/** + * test that set sets variables + * + * @return void + **/ + function testSet() { + $this->Task->set('one', 'two'); + $this->assertTrue(isset($this->Task->templateVars['one'])); + $this->assertEqual($this->Task->templateVars['one'], 'two'); + + $this->Task->set(array('one' => 'three', 'four' => 'five')); + $this->assertTrue(isset($this->Task->templateVars['one'])); + $this->assertEqual($this->Task->templateVars['one'], 'three'); + $this->assertTrue(isset($this->Task->templateVars['four'])); + $this->assertEqual($this->Task->templateVars['four'], 'five'); + } + +/** + * test Initialize + * + * @return void + **/ + function testInitialize() { + $this->Task->initialize(); + $this->assertEqual($this->Task->templatePaths, $this->Task->Dispatch->shellPaths); + } + +/** + * test generate + * + * @return void + **/ + function testGenerate() { + $this->Task->templatePaths = array( + TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS . 'shells' . DS + ); + $result = $this->Task->generate('objects', 'test_object', array('test' => 'foo')); + $expected = "I got rendered\nfoo"; + $this->assertEqual($result, $expected); + + + } +} +?> \ No newline at end of file diff --git a/cake/tests/test_app/vendors/shells/templates/objects/test_object.ctp b/cake/tests/test_app/vendors/shells/templates/objects/test_object.ctp new file mode 100644 index 000000000..c524b8231 --- /dev/null +++ b/cake/tests/test_app/vendors/shells/templates/objects/test_object.ctp @@ -0,0 +1,2 @@ +I got rendered +<?php echo $test; ?> \ No newline at end of file From 333713e9783c113d6748f51ee27c3e7e4c80df31 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 12 May 2009 22:01:27 -0400 Subject: [PATCH 0173/2083] removing whitespace. --- cake/tests/cases/console/libs/tasks/template.test.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/cake/tests/cases/console/libs/tasks/template.test.php b/cake/tests/cases/console/libs/tasks/template.test.php index 86baa4559..f12656436 100644 --- a/cake/tests/cases/console/libs/tasks/template.test.php +++ b/cake/tests/cases/console/libs/tasks/template.test.php @@ -117,8 +117,6 @@ function testGenerate() { $result = $this->Task->generate('objects', 'test_object', array('test' => 'foo')); $expected = "I got rendered\nfoo"; $this->assertEqual($result, $expected); - - } } ?> \ No newline at end of file From a7f0071c610e56e718c83028631fa3b44a72ffc4 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 13 May 2009 23:35:41 -0400 Subject: [PATCH 0174/2083] Forcing templatePaths to exist. --- cake/console/libs/tasks/template.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cake/console/libs/tasks/template.php b/cake/console/libs/tasks/template.php index 6fe7ddfed..d68ba61fe 100644 --- a/cake/console/libs/tasks/template.php +++ b/cake/console/libs/tasks/template.php @@ -26,6 +26,13 @@ class TemplateTask extends Shell { * @var array **/ var $templateVars = array(); + +/** + * Paths to look for templates on. + * + * @var array + **/ + var $templatePaths = array(); /** * Initialize callback * @@ -96,6 +103,9 @@ function generate($directory, $filename, $vars = null) { if ($vars !== null) { $this->set($vars); } + if (empty($this->templatePaths)) { + $this->initialize(); + } $templateFile = $this->_findTemplate($directory, $filename); if ($templateFile) { extract($this->templateVars); From 3c08369e3af7d260712868e5754fd77b30e23c92 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 13 May 2009 23:36:13 -0400 Subject: [PATCH 0175/2083] Adding bake model template. Adding tests for bake model. --- cake/console/libs/tasks/model.php | 13 +- cake/console/libs/templates/objects/model.ctp | 125 ++++++++++++++++++ .../cases/console/libs/tasks/model.test.php | 93 ++++++++++++- 3 files changed, 223 insertions(+), 8 deletions(-) create mode 100644 cake/console/libs/templates/objects/model.ctp diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 39307355b..c9f2920be 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -62,7 +62,7 @@ class ModelTask extends Shell { * @var array * @access public */ - var $tasks = array('DbConfig', 'Fixture', 'Test'); + var $tasks = array('DbConfig', 'Fixture', 'Test', 'Template'); /** * Holds tables found on connection. @@ -700,7 +700,12 @@ function bake($name, $associations = array(), $validate = array(), $primaryKey $useDbConfig = $name->useDbConfig; $name = $name->name; } - + + $this->Template->set(compact('name', 'useDbConfig', 'associations', 'validate', 'primaryKey', 'useTable')); + $this->Template->set('plugin', $this->plugin); + $out = $this->Template->generate('objects', 'model'); + + /* $out = "<?php\n"; $out .= "class {$name} extends {$this->plugin}AppModel {\n\n"; $out .= "\tvar \$name = '{$name}';\n"; @@ -841,9 +846,11 @@ function bake($name, $associations = array(), $validate = array(), $primaryKey } $out .= "}\n"; $out .= "?>"; + */ $filename = $this->path . Inflector::underscore($name) . '.php'; $this->out("\nBaking model class for $name..."); - return $this->createFile($filename, $out); + $this->createFile($filename, $out); + return $out; } /** diff --git a/cake/console/libs/templates/objects/model.ctp b/cake/console/libs/templates/objects/model.ctp new file mode 100644 index 000000000..5cb28dc9c --- /dev/null +++ b/cake/console/libs/templates/objects/model.ctp @@ -0,0 +1,125 @@ +<?php +/** + * Model template file. + * + * Used by bake to create new Model files. + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org + * @package cake + * @subpackage cake.console.libs.templates.objects + * @since CakePHP(tm) v 1.3 + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + */ + +echo "<?php\n"; ?> +class <?php echo $name ?> extends <?php echo $plugin; ?>AppModel { + var $name = '<?php echo $name; ?>'; +<?php if ($useDbConfig != 'default'): ?> + var $useDbConfig = '<?php echo $useDbConfig; ?>'; +<?php endif;?> +<?php if (($useTable && $useTable !== Inflector::tableize($name)) || $useTable === false): + $table = "'$useTable'"; + if (!$useTable): + $table = 'false'; + endif; + echo "\tvar \$useTable = $table;\n"; +endif; ?> +<?php if ($primaryKey !== 'id'): ?> + var $primaryKey = '<?php echo $primaryKey; ?>'; +<?php endif; ?> +<?php +if (!empty($validate)): + echo "\tvar \$validate = array(\n"; + foreach ($validate as $field => $validations): + echo "\t\t'$field' => array(\n"; + foreach ($validations as $key => $validator): + echo "\t\t\t'$key' => array('rule' => array('$validator')),\n"; + endforeach; + echo "\t\t),\n"; + endforeach; + echo "\t);\n"; +endif; + +foreach (array('hasOne', 'belongsTo') as $assocType): + if (!empty($associations[$assocType])): + $typeCount = count($associations[$assocType]); + echo "\n\tvar \$$assocType = array("; + foreach ($associations[$assocType] as $i => $relation): + $out = "\n\t\t'{$relation['alias']}' => array(\n"; + $out .= "\t\t\t'className' => '{$relation['className']}',\n"; + $out .= "\t\t\t'foreignKey' => '{$relation['foreignKey']}',\n"; + $out .= "\t\t\t'conditions' => '',\n"; + $out .= "\t\t\t'fields' => '',\n"; + $out .= "\t\t\t'order' => ''\n"; + $out .= "\t\t)"; + if ($i + 1 < $typeCount) { + $out .= ","; + } + echo $out; + endforeach; + echo "\n\t);\n"; + endif; +endforeach; + +if (!empty($associations['hasMany'])): + $belongsToCount = count($associations['hasMany']); + echo "\n\tvar \$hasMany = array("; + foreach ($associations['hasMany'] as $i => $relation): + $out = "\n\t\t'{$relation['alias']}' => array(\n"; + $out .= "\t\t\t'className' => '{$relation['className']}',\n"; + $out .= "\t\t\t'foreignKey' => '{$relation['foreignKey']}',\n"; + $out .= "\t\t\t'dependent' => false,\n"; + $out .= "\t\t\t'conditions' => '',\n"; + $out .= "\t\t\t'fields' => '',\n"; + $out .= "\t\t\t'order' => '',\n"; + $out .= "\t\t\t'limit' => '',\n"; + $out .= "\t\t\t'offset' => '',\n"; + $out .= "\t\t\t'exclusive' => '',\n"; + $out .= "\t\t\t'finderQuery' => '',\n"; + $out .= "\t\t\t'counterQuery' => ''\n"; + $out .= "\t\t)"; + if ($i + 1 < $belongsToCount) { + $out .= ","; + } + echo $out; + endforeach; + echo "\n\t);\n\n"; +endif; + +if (!empty($associations['hasAndBelongsToMany'])): + $habtmCount = count($associations['hasAndBelongsToMany']); + echo "\n\tvar \$hasAndBelongsToMany = array("; + foreach ($associations['hasAndBelongsToMany'] as $i => $relation): + $out = "\n\t\t'{$relation['alias']}' => array(\n"; + $out .= "\t\t\t'className' => '{$relation['className']}',\n"; + $out .= "\t\t\t'joinTable' => '{$relation['joinTable']}',\n"; + $out .= "\t\t\t'foreignKey' => '{$relation['foreignKey']}',\n"; + $out .= "\t\t\t'associationForeignKey' => '{$relation['associationForeignKey']}',\n"; + $out .= "\t\t\t'unique' => true,\n"; + $out .= "\t\t\t'conditions' => '',\n"; + $out .= "\t\t\t'fields' => '',\n"; + $out .= "\t\t\t'order' => '',\n"; + $out .= "\t\t\t'limit' => '',\n"; + $out .= "\t\t\t'offset' => '',\n"; + $out .= "\t\t\t'finderQuery' => '',\n"; + $out .= "\t\t\t'deleteQuery' => '',\n"; + $out .= "\t\t\t'insertQuery' => ''\n"; + $out .= "\t\t)"; + if ($i + 1 < $habtmCount) { + $out .= ","; + } + echo $out; + endforeach; + echo "\n\t);\n\n"; +endif; +?> +<?php echo '?>'; ?> diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index 9c49bde37..d66a6c9d3 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -37,10 +37,10 @@ ob_end_clean(); } -if (!class_exists('ModelTask')) { - require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'model.php'; - require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'fixture.php'; -} +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'model.php'; +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'fixture.php'; +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php'; + Mock::generatePartial( 'ShellDispatcher', 'TestModelTaskMockShellDispatcher', @@ -82,7 +82,9 @@ class ModelTaskTest extends CakeTestCase { function startTest() { $this->Dispatcher =& new TestModelTaskMockShellDispatcher(); $this->Task =& new MockModelTask($this->Dispatcher); - $this->Task->Dispatch = new $this->Dispatcher; + $this->Task->Dispatch =& new $this->Dispatcher; + $this->Task->Dispatch->shellPaths = Configure::read('shellPaths'); + $this->Task->Template =& new TemplateTask($this->Task->Dispatch); } /** @@ -517,5 +519,86 @@ function testInOptions() { $result = $this->Task->inOptions($options, 'Pick a number'); $this->assertEqual($result, 1); } + +/** + * test baking validation + * + * @return void + **/ + function testBakeValidation() { + $validate = array( + 'name' => array( + 'notempty' => 'notempty' + ), + 'email' => array( + 'email' => 'email', + ), + 'some_date' => array( + 'date' => 'date' + ), + 'some_time' => array( + 'time' => 'time' + ) + ); + $result = $this->Task->bake('Article', array(), $validate); + $this->assertPattern('/class Article extends AppModel \{/', $result); + $this->assertPattern('/\$name \= \'Article\'/', $result); + $this->assertPattern('/\$validate \= array\(/', $result); + $pattern = '/' . preg_quote("'notempty' => array('rule' => array('notempty')),", '/') . '/'; + $this->assertPattern($pattern, $result); + } +/** + * test baking relations + * + * @return void + **/ + function testBakeRelations() { + $associations = array( + 'belongsTo' => array( + array( + 'alias' => 'SomethingElse', + 'className' => 'SomethingElse', + 'foreignKey' => 'something_else_id', + ), + array( + 'alias' => 'User', + 'className' => 'User', + 'foreignKey' => 'user_id', + ), + ), + 'hasOne' => array( + array( + 'alias' => 'OtherModel', + 'className' => 'OtherModel', + 'foreignKey' => 'other_model_id', + ), + ), + 'hasMany' => array( + array( + 'alias' => 'Comment', + 'className' => 'Comment', + 'foreignKey' => 'parent_id', + ), + ), + 'hasAndBelongsToMany' => array( + array( + 'alias' => 'Tag', + 'className' => 'Tag', + 'foreignKey' => 'article_id', + 'joinTable' => 'articles_tags', + 'associationForeignKey' => 'tag_id', + ), + ) + ); + $result = $this->Task->bake('Article', $associations, array()); + $this->assertPattern('/\$hasAndBelongsToMany \= array\(/', $result); + $this->assertPattern('/\$hasMany \= array\(/', $result); + $this->assertPattern('/\$belongsTo \= array\(/', $result); + $this->assertPattern('/\$hasOne \= array\(/', $result); + $this->assertPattern('/Tag/', $result); + $this->assertPattern('/OtherModel/', $result); + $this->assertPattern('/SomethingElse/', $result); + $this->assertPattern('/Comment/', $result); + } } ?> \ No newline at end of file From 4a9a5bce69741debb3ad29afcf40d8910b6c16b2 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 13 May 2009 23:37:21 -0400 Subject: [PATCH 0176/2083] Removing template code. --- cake/console/libs/tasks/model.php | 145 +----------------------------- 1 file changed, 2 insertions(+), 143 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index c9f2920be..1fb2e0c6f 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -700,153 +700,12 @@ function bake($name, $associations = array(), $validate = array(), $primaryKey $useDbConfig = $name->useDbConfig; $name = $name->name; } - + $this->Template->set(compact('name', 'useDbConfig', 'associations', 'validate', 'primaryKey', 'useTable')); $this->Template->set('plugin', $this->plugin); $out = $this->Template->generate('objects', 'model'); - /* - $out = "<?php\n"; - $out .= "class {$name} extends {$this->plugin}AppModel {\n\n"; - $out .= "\tvar \$name = '{$name}';\n"; - - if ($useDbConfig !== 'default') { - $out .= "\tvar \$useDbConfig = '$useDbConfig';\n"; - } - - if (($useTable && $useTable !== Inflector::tableize($name)) || $useTable === false) { - $table = "'$useTable'"; - if (!$useTable) { - $table = 'false'; - } - $out .= "\tvar \$useTable = $table;\n"; - } - - if ($primaryKey !== 'id') { - $out .= "\tvar \$primaryKey = '$primaryKey';\n"; - } - - $validateCount = count($validate); - if (is_array($validate) && $validateCount > 0) { - $out .= "\tvar \$validate = array(\n"; - $keys = array_keys($validate); - for ($i = 0; $i < $validateCount; $i++) { - $val = "'" . $validate[$keys[$i]] . "'"; - $out .= "\t\t'" . $keys[$i] . "' => array({$val})"; - if ($i + 1 < $validateCount) { - $out .= ","; - } - $out .= "\n"; - } - $out .= "\t);\n"; - } - $out .= "\n"; - - if (!empty($associations)) { - if (!empty($associations['belongsTo']) || !empty($associations['hasOne']) || !empty($associations['hasMany']) || !empty($associations['hasAndBelongsToMany'])) { - $out.= "\t//The Associations below have been created with all possible keys, those that are not needed can be removed\n"; - } - - if (!empty($associations['belongsTo'])) { - $out .= "\tvar \$belongsTo = array(\n"; - $belongsToCount = count($associations['belongsTo']); - - for ($i = 0; $i < $belongsToCount; $i++) { - $out .= "\t\t'{$associations['belongsTo'][$i]['alias']}' => array(\n"; - $out .= "\t\t\t'className' => '{$associations['belongsTo'][$i]['className']}',\n"; - $out .= "\t\t\t'foreignKey' => '{$associations['belongsTo'][$i]['foreignKey']}',\n"; - $out .= "\t\t\t'conditions' => '',\n"; - $out .= "\t\t\t'fields' => '',\n"; - $out .= "\t\t\t'order' => ''\n"; - $out .= "\t\t)"; - if ($i + 1 < $belongsToCount) { - $out .= ","; - } - $out .= "\n"; - - } - $out .= "\t);\n\n"; - } - - if (!empty($associations['hasOne'])) { - $out .= "\tvar \$hasOne = array(\n"; - $hasOneCount = count($associations['hasOne']); - - for ($i = 0; $i < $hasOneCount; $i++) { - $out .= "\t\t'{$associations['hasOne'][$i]['alias']}' => array(\n"; - $out .= "\t\t\t'className' => '{$associations['hasOne'][$i]['className']}',\n"; - $out .= "\t\t\t'foreignKey' => '{$associations['hasOne'][$i]['foreignKey']}',\n"; - $out .= "\t\t\t'dependent' => false,\n"; - $out .= "\t\t\t'conditions' => '',\n"; - $out .= "\t\t\t'fields' => '',\n"; - $out .= "\t\t\t'order' => ''\n"; - $out .= "\t\t)"; - if ($i + 1 < $hasOneCount) { - $out .= ","; - } - $out .= "\n"; - - } - $out .= "\t);\n\n"; - } - - if (!empty($associations['hasMany'])) { - $out .= "\tvar \$hasMany = array(\n"; - $hasManyCount = count($associations['hasMany']); - - for ($i = 0; $i < $hasManyCount; $i++) { - $out .= "\t\t'{$associations['hasMany'][$i]['alias']}' => array(\n"; - $out .= "\t\t\t'className' => '{$associations['hasMany'][$i]['className']}',\n"; - $out .= "\t\t\t'foreignKey' => '{$associations['hasMany'][$i]['foreignKey']}',\n"; - $out .= "\t\t\t'dependent' => false,\n"; - $out .= "\t\t\t'conditions' => '',\n"; - $out .= "\t\t\t'fields' => '',\n"; - $out .= "\t\t\t'order' => '',\n"; - $out .= "\t\t\t'limit' => '',\n"; - $out .= "\t\t\t'offset' => '',\n"; - $out .= "\t\t\t'exclusive' => '',\n"; - $out .= "\t\t\t'finderQuery' => '',\n"; - $out .= "\t\t\t'counterQuery' => ''\n"; - $out .= "\t\t)"; - if ($i + 1 < $hasManyCount) { - $out .= ","; - } - $out .= "\n"; - } - $out .= "\t);\n\n"; - } - - if (!empty($associations['hasAndBelongsToMany'])) { - $out .= "\tvar \$hasAndBelongsToMany = array(\n"; - $hasAndBelongsToManyCount = count($associations['hasAndBelongsToMany']); - - for ($i = 0; $i < $hasAndBelongsToManyCount; $i++) { - $out .= "\t\t'{$associations['hasAndBelongsToMany'][$i]['alias']}' => array(\n"; - $out .= "\t\t\t'className' => '{$associations['hasAndBelongsToMany'][$i]['className']}',\n"; - $out .= "\t\t\t'joinTable' => '{$associations['hasAndBelongsToMany'][$i]['joinTable']}',\n"; - $out .= "\t\t\t'foreignKey' => '{$associations['hasAndBelongsToMany'][$i]['foreignKey']}',\n"; - $out .= "\t\t\t'associationForeignKey' => '{$associations['hasAndBelongsToMany'][$i]['associationForeignKey']}',\n"; - $out .= "\t\t\t'unique' => true,\n"; - $out .= "\t\t\t'conditions' => '',\n"; - $out .= "\t\t\t'fields' => '',\n"; - $out .= "\t\t\t'order' => '',\n"; - $out .= "\t\t\t'limit' => '',\n"; - $out .= "\t\t\t'offset' => '',\n"; - $out .= "\t\t\t'finderQuery' => '',\n"; - $out .= "\t\t\t'deleteQuery' => '',\n"; - $out .= "\t\t\t'insertQuery' => ''\n"; - $out .= "\t\t)"; - if ($i + 1 < $hasAndBelongsToManyCount) { - $out .= ","; - } - $out .= "\n"; - } - $out .= "\t);\n\n"; - } - } - $out .= "}\n"; - $out .= "?>"; - */ + //@todo solve plugin model paths. $filename = $this->path . Inflector::underscore($name) . '.php'; $this->out("\nBaking model class for $name..."); $this->createFile($filename, $out); From a85bf16560740c424198d9e29c3fc735a2dcd7bc Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 13 May 2009 23:50:46 -0400 Subject: [PATCH 0177/2083] Cleaning up model template. --- cake/console/libs/templates/objects/model.ctp | 16 +++++++++++----- .../cases/console/libs/tasks/model.test.php | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/cake/console/libs/templates/objects/model.ctp b/cake/console/libs/templates/objects/model.ctp index 5cb28dc9c..06b2ca22e 100644 --- a/cake/console/libs/templates/objects/model.ctp +++ b/cake/console/libs/templates/objects/model.ctp @@ -21,6 +21,7 @@ */ echo "<?php\n"; ?> + class <?php echo $name ?> extends <?php echo $plugin; ?>AppModel { var $name = '<?php echo $name; ?>'; <?php if ($useDbConfig != 'default'): ?> @@ -32,11 +33,11 @@ class <?php echo $name ?> extends <?php echo $plugin; ?>AppModel { $table = 'false'; endif; echo "\tvar \$useTable = $table;\n"; -endif; ?> -<?php if ($primaryKey !== 'id'): ?> +endif; +if ($primaryKey !== 'id'): ?> var $primaryKey = '<?php echo $primaryKey; ?>'; -<?php endif; ?> -<?php +<?php endif; + if (!empty($validate)): echo "\tvar \$validate = array(\n"; foreach ($validate as $field => $validations): @@ -47,7 +48,11 @@ if (!empty($validate)): echo "\t\t),\n"; endforeach; echo "\t);\n"; -endif; +endif; + +?> + //The Associations below have been created with all possible keys, those that are not needed can be removed +<?php foreach (array('hasOne', 'belongsTo') as $assocType): if (!empty($associations[$assocType])): @@ -122,4 +127,5 @@ if (!empty($associations['hasAndBelongsToMany'])): echo "\n\t);\n\n"; endif; ?> +} <?php echo '?>'; ?> diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index d66a6c9d3..7ae9b592e 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -547,6 +547,7 @@ function testBakeValidation() { $pattern = '/' . preg_quote("'notempty' => array('rule' => array('notempty')),", '/') . '/'; $this->assertPattern($pattern, $result); } + /** * test baking relations * From 3f7821c258477ad91b49a6be20a152f0b121c3b2 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 14 May 2009 21:42:07 -0400 Subject: [PATCH 0178/2083] Adding test cases for bake model all Adding test cases for bake model MyModel Fixing all() Starting refactor into Test task --- cake/console/libs/tasks/model.php | 11 ++-- .../cases/console/libs/tasks/model.test.php | 54 +++++++++++++++++-- 2 files changed, 57 insertions(+), 8 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 1fb2e0c6f..d83f4e9ab 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -121,12 +121,12 @@ function execute() { * @return void **/ function all() { - $this->listAll($ds, false); + $this->listAll($this->connection, false); foreach ($this->__tables as $table) { $modelClass = Inflector::classify($table); $this->out(sprintf(__('Baking %s', true), $modelClass)); - $this->_getModelObject($modelClass); + $object = $this->_getModelObject($modelClass); $this->bake($object, false); } } @@ -242,6 +242,7 @@ function __interactive() { if (strtolower($looksGood) == 'y') { if ($this->bake($currentModelName, $associations, $validate, $primaryKey, $useTable, $this->connection)) { if ($this->_checkUnitTest()) { + $this->bakeFixture($currentModelName, $useTable); $this->bakeTest($currentModelName, $useTable, $associations); } } @@ -719,7 +720,9 @@ function bake($name, $associations = array(), $validate = array(), $primaryKey * @access private */ function bakeTest($className, $useTable = null, $associations = array()) { - $this->fixture($className, $useTable); + $this->Test->plugin = $this->plugin; + $this->Test->connection = $this->connection; + return $this->Test->bake('Model', $className); $fixtureInc = 'app'; if ($this->plugin) { @@ -898,7 +901,7 @@ function help() { * * @return null. **/ - function fixture($className, $useTable = null) { + function bakeFixture($className, $useTable = null) { $this->Fixture->connection = $this->connection; $this->Fixture->bake($className, $useTable); } diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index 7ae9b592e..b4821a03d 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -49,7 +49,7 @@ Mock::generatePartial( 'ModelTask', 'MockModelTask', - array('in', 'out', 'err', 'createFile', '_stop') + array('in', 'out', 'err', 'createFile', '_stop', '_checkUnitTest') ); Mock::generate( @@ -85,6 +85,8 @@ function startTest() { $this->Task->Dispatch =& new $this->Dispatcher; $this->Task->Dispatch->shellPaths = Configure::read('shellPaths'); $this->Task->Template =& new TemplateTask($this->Task->Dispatch); + $this->Task->Fixture =& new MockModelTaskFixtureTask(); + $this->Task->Test =& new MockModelTaskFixtureTask(); } /** @@ -453,10 +455,9 @@ function testDoAssociationsNonInteractive() { * * @return void **/ - function testFixture() { - $this->Task->Fixture =& new MockModelTaskFixtureTask(); + function testBakeFixture() { $this->Task->Fixture->expectAt(0, 'bake', array('Article', 'articles')); - $this->Task->fixture('Article', 'articles'); + $this->Task->bakeFixture('Article', 'articles'); } /** @@ -601,5 +602,50 @@ function testBakeRelations() { $this->assertPattern('/SomethingElse/', $result); $this->assertPattern('/Comment/', $result); } + +/** + * test that execute passes runs bake depending with named model. + * + * @return void + **/ + function testExecuteWithNamedModel() { + $this->Task->connection = 'test_suite'; + $this->Task->path = '/my/path/'; + $this->Task->args = array('article'); + $filename = '/my/path/article.php'; + $this->Task->setReturnValue('_checkUnitTest', 1); + $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class Article extends AppModel/'))); + $this->Task->execute(); + } + +/** + * test that execute runs all() when args[0] = all + * + * @return void + **/ + function testExecuteIntoAll() { + $this->Task->connection = 'test_suite'; + $this->Task->path = '/my/path/'; + $this->Task->args = array('all'); +//core.article', 'core.comment', 'core.articles_tag', 'core.tag', 'core.category_thread + + $filename = '/my/path/article.php'; + $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class Article/'))); + $this->Task->execute(); + + $filename = '/my/path/articles_tag.php'; + $this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/class ArticlesTag/'))); + + $filename = '/my/path/category_thread.php'; + $this->Task->expectAt(2, 'createFile', array($filename, new PatternExpectation('/class CategoryThread/'))); + + $filename = '/my/path/comment.php'; + $this->Task->expectAt(3, 'createFile', array($filename, new PatternExpectation('/class Comment/'))); + + $filename = '/my/path/tag.php'; + $this->Task->expectAt(4, 'createFile', array($filename, new PatternExpectation('/class Tag/'))); + + $this->Task->execute(); + } } ?> \ No newline at end of file From 8a5d6cae773d65c7356b1dcb8171d144095b1a13 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 14 May 2009 22:19:43 -0400 Subject: [PATCH 0179/2083] Removing junk --- cake/tests/cases/console/libs/tasks/model.test.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index b4821a03d..0cdaca828 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -627,8 +627,7 @@ function testExecuteIntoAll() { $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; $this->Task->args = array('all'); -//core.article', 'core.comment', 'core.articles_tag', 'core.tag', 'core.category_thread - + $filename = '/my/path/article.php'; $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class Article/'))); $this->Task->execute(); From ad930f277d0eb1966f634f63b07df99d20e9bf26 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 14 May 2009 22:23:36 -0400 Subject: [PATCH 0180/2083] Moving test generation to a temporary home --- cake/console/libs/tasks/model.php | 54 --------------------------- cake/console/libs/tasks/test.php | 61 +++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 54 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index d83f4e9ab..0985deca0 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -723,60 +723,6 @@ function bakeTest($className, $useTable = null, $associations = array()) { $this->Test->plugin = $this->plugin; $this->Test->connection = $this->connection; return $this->Test->bake('Model', $className); - - $fixtureInc = 'app'; - if ($this->plugin) { - $fixtureInc = 'plugin.'.Inflector::underscore($this->plugin); - } - - $fixture[] = "'{$fixtureInc}." . Inflector::underscore($className) ."'"; - - if (!empty($associations)) { - $assoc[] = Set::extract($associations, 'belongsTo.{n}.className'); - $assoc[] = Set::extract($associations, 'hasOne.{n}.className'); - $assoc[] = Set::extract($associations, 'hasMany.{n}.className'); - foreach ($assoc as $key => $value) { - if (is_array($value)) { - foreach ($value as $class) { - $fixture[] = "'{$fixtureInc}." . Inflector::underscore($class) ."'"; - } - } - } - } - $fixture = join(", ", $fixture); - - $import = $className; - if (isset($this->plugin)) { - $import = $this->plugin . '.' . $className; - } - - $out = "App::import('Model', '$import');\n\n"; - $out .= "class {$className}TestCase extends CakeTestCase {\n"; - $out .= "\tvar \${$className} = null;\n"; - $out .= "\tvar \$fixtures = array($fixture);\n\n"; - $out .= "\tfunction startTest() {\n"; - $out .= "\t\t\$this->{$className} =& ClassRegistry::init('{$className}');\n"; - $out .= "\t}\n\n"; - $out .= "\tfunction endTest() {\n"; - $out .= "\t\tunset(\$this->{$className});\n"; - $out .= "\t}\n\n"; - $out .= "\tfunction test{$className}Instance() {\n"; - $out .= "\t\t\$this->assertTrue(is_a(\$this->{$className}, '{$className}'));\n"; - $out .= "\t}\n\n"; - $out .= "}\n"; - - $path = MODEL_TESTS; - if (isset($this->plugin)) { - $pluginPath = 'plugins' . DS . Inflector::underscore($this->plugin) . DS; - $path = APP . $pluginPath . 'tests' . DS . 'cases' . DS . 'models' . DS; - } - - $filename = Inflector::underscore($className).'.test.php'; - $this->out("\nBaking unit test for $className..."); - - $header = '$Id'; - $content = "<?php \n/* SVN FILE: $header$ */\n/* ". $className ." Test cases generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n{$out}?>"; - return $this->createFile($path . $filename, $content); } /** diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 45b853448..5d35acba4 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -199,5 +199,66 @@ function __extras($class) { } return $extras; } + +/** + * Create a test for a Model object. + * + * @return void + **/ + function bakeModelTest($className) { + $fixtureInc = 'app'; + if ($this->plugin) { + $fixtureInc = 'plugin.'.Inflector::underscore($this->plugin); + } + + $fixture[] = "'{$fixtureInc}." . Inflector::underscore($className) ."'"; + + if (!empty($associations)) { + $assoc[] = Set::extract($associations, 'belongsTo.{n}.className'); + $assoc[] = Set::extract($associations, 'hasOne.{n}.className'); + $assoc[] = Set::extract($associations, 'hasMany.{n}.className'); + foreach ($assoc as $key => $value) { + if (is_array($value)) { + foreach ($value as $class) { + $fixture[] = "'{$fixtureInc}." . Inflector::underscore($class) ."'"; + } + } + } + } + $fixture = join(", ", $fixture); + + $import = $className; + if (isset($this->plugin)) { + $import = $this->plugin . '.' . $className; + } + + $out = "App::import('Model', '$import');\n\n"; + $out .= "class {$className}TestCase extends CakeTestCase {\n"; + $out .= "\tvar \${$className} = null;\n"; + $out .= "\tvar \$fixtures = array($fixture);\n\n"; + $out .= "\tfunction startTest() {\n"; + $out .= "\t\t\$this->{$className} =& ClassRegistry::init('{$className}');\n"; + $out .= "\t}\n\n"; + $out .= "\tfunction endTest() {\n"; + $out .= "\t\tunset(\$this->{$className});\n"; + $out .= "\t}\n\n"; + $out .= "\tfunction test{$className}Instance() {\n"; + $out .= "\t\t\$this->assertTrue(is_a(\$this->{$className}, '{$className}'));\n"; + $out .= "\t}\n\n"; + $out .= "}\n"; + + $path = MODEL_TESTS; + if (isset($this->plugin)) { + $pluginPath = 'plugins' . DS . Inflector::underscore($this->plugin) . DS; + $path = APP . $pluginPath . 'tests' . DS . 'cases' . DS . 'models' . DS; + } + + $filename = Inflector::underscore($className).'.test.php'; + $this->out("\nBaking unit test for $className..."); + + $header = '$Id'; + $content = "<?php \n/* SVN FILE: $header$ */\n/* ". $className ." Test cases generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n{$out}?>"; + return $this->createFile($path . $filename, $content); + } } ?> \ No newline at end of file From 305104140c5e3e265693ff8b99e17460eb906cfc Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 14 May 2009 22:36:04 -0400 Subject: [PATCH 0181/2083] Adding tests for __interactive --- cake/console/libs/tasks/model.php | 2 +- .../cases/console/libs/tasks/model.test.php | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 0985deca0..2112c057b 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -217,7 +217,7 @@ function __interactive() { $this->out("Name: " . $currentModelName); if ($this->connection !== 'default') { - $this->out(sprintf(__("DB Config: %s", true), $useDbConfig)); + $this->out(sprintf(__("DB Config: %s", true), $this->connection)); } if ($fullTableName !== Inflector::tableize($currentModelName)) { $this->out(sprintf(__("DB Table: %s", true), $fullTableName)); diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index 0cdaca828..c323a3ea3 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -646,5 +646,27 @@ function testExecuteIntoAll() { $this->Task->execute(); } + +/** + * test the interactive side of bake. + * + * @return void + **/ + function testExecuteIntoInteractive() { + $this->Task->connection = 'test_suite'; + $this->Task->path = '/my/path/'; + + $this->Task->setReturnValueAt(0, 'in', '1'); //choose article + $this->Task->setReturnValueAt(1, 'in', 'n'); //no validation + $this->Task->setReturnValueAt(2, 'in', 'y'); //yes to associations + $this->Task->setReturnValueAt(3, 'in', 'y'); //yes to comment relation + $this->Task->setReturnValueAt(4, 'in', 'y'); //yes to user relation + $this->Task->setReturnValueAt(5, 'in', 'y'); //yes to tag relation + $this->Task->setReturnValueAt(6, 'in', 'n'); //no to looksGood? + + $filename = '/my/path/article.php'; + $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class Article/'))); + $this->Task->execute(); + } } ?> \ No newline at end of file From e6881cced494d391e2d5f0e3d8f9054944bb91f1 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 14 May 2009 23:00:29 -0400 Subject: [PATCH 0182/2083] Extracted another method. --- cake/console/libs/tasks/model.php | 62 ++++++++++++++++++------------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 2112c057b..28e62d050 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -689,7 +689,7 @@ function _generatePossibleKeys() { * @param string $useDbConfig Database configuration setting to use * @access private */ - function bake($name, $associations = array(), $validate = array(), $primaryKey = 'id', $useTable = null, $useDbConfig = 'default') { + function bake($name, $associations = array(), $validate = array(), $primaryKey = 'id', $useTable = null, $useDbConfig = 'default') { if (is_object($name)) { if (!is_array($associations)) { @@ -731,35 +731,15 @@ function bakeTest($className, $useTable = null, $associations = array()) { * @param string $useDbConfig Database configuration name * @access public */ - function listAll($useDbConfig = null, $interactive = true) { - if (!isset($useDbConfig)) { - $useDbConfig = $this->connection; - } - $db =& ConnectionManager::getDataSource($useDbConfig); - $usePrefix = empty($db->config['prefix']) ? '' : $db->config['prefix']; - if ($usePrefix) { - $tables = array(); - foreach ($db->listSources() as $table) { - if (!strncmp($table, $usePrefix, strlen($usePrefix))) { - $tables[] = substr($table, strlen($usePrefix)); - } - } - } else { - $tables = $db->listSources(); - } - if (empty($tables)) { - $this->err(__('Your database does not have any tables.', true)); - $this->_stop(); - } - - $this->__tables = $tables; + function listAll($useDbConfig = null) { + $this->__tables = $this->getAllTables($useDbConfig); - if ($interactive === true) { + if ($this->interactive === true) { $this->out(__('Possible Models based on your current database:', true)); $this->_modelNames = array(); - $count = count($tables); + $count = count($this->__tables); for ($i = 0; $i < $count; $i++) { - $this->_modelNames[] = $this->_modelName($tables[$i]); + $this->_modelNames[] = $this->_modelName($this->__tables[$i]); $this->out($i + 1 . ". " . $this->_modelNames[$i]); } } @@ -793,6 +773,36 @@ function getTable($modelName, $useDbConfig = null) { return $useTable; } +/** + * Get an Array of all the tables in the supplied connection + * will halt the script if no tables are found. + * + * @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; + } + $tables = array(); + $db =& ConnectionManager::getDataSource($useDbConfig); + $usePrefix = empty($db->config['prefix']) ? '' : $db->config['prefix']; + if ($usePrefix) { + foreach ($db->listSources() as $table) { + if (!strncmp($table, $usePrefix, strlen($usePrefix))) { + $tables[] = substr($table, strlen($usePrefix)); + } + } + } else { + $tables = $db->listSources(); + } + if (empty($tables)) { + $this->err(__('Your database does not have any tables.', true)); + $this->_stop(); + } + return $tables; + } + /** * Forces the user to specify the model he wants to bake, and returns the selected model name. * From 03e231c05ddc7df17f915527b3093c76282c29f1 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 14 May 2009 23:17:42 -0400 Subject: [PATCH 0183/2083] Adding test case for controller task. Refactoring listAll() to use Model task which has the necessary code. --- cake/console/libs/tasks/controller.php | 39 ++---- .../console/libs/tasks/controller.test.php | 123 ++++++++++++++++++ 2 files changed, 134 insertions(+), 28 deletions(-) create mode 100644 cake/tests/cases/console/libs/tasks/controller.test.php diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index ec69bb21f..3248351c2 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -44,7 +44,7 @@ class ControllerTask extends Shell { * @var array * @access public */ - var $tasks = array('Project'); + var $tasks = array('Model', 'Project', 'Template'); /** * path to CONTROLLERS directory * @@ -105,12 +105,8 @@ function execute() { * @return void **/ function all() { - $ds = 'default'; - if (isset($this->params['connection'])) { - $ds = $this->params['connection']; - } $this->interactive = false; - $this->listAll($ds, false); + $this->listAll($this->connection, false); foreach ($this->__tables as $table) { $model = $this->_modelName($table); $controller = $this->_controllerName($model); @@ -509,40 +505,27 @@ function bakeTest($className) { $content = "<?php \n/* SVN FILE: $header$ */\n/* ". $className ."Controller Test cases generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n{$out}?>"; return $this->createFile($path . $filename, $content); } + /** - * Outputs and gets the list of possible models or controllers from database + * Outputs and gets the list of possible controllers from database * * @param string $useDbConfig Database configuration name * @param boolean $interactive Whether you are using listAll interactively and want options output. * @return array Set of controllers * @access public */ - function listAll($useDbConfig = 'default', $interactive = true) { - $db =& ConnectionManager::getDataSource($useDbConfig); - $usePrefix = empty($db->config['prefix']) ? '' : $db->config['prefix']; - if ($usePrefix) { - $tables = array(); - foreach ($db->listSources() as $table) { - if (!strncmp($table, $usePrefix, strlen($usePrefix))) { - $tables[] = substr($table, strlen($usePrefix)); - } - } - } else { - $tables = $db->listSources(); - } - - if (empty($tables)) { - $this->err(__('Your database does not have any tables.', true)); - $this->_stop(); + function listAll($useDbConfig = null) { + if (is_null($useDbConfig)) { + $useDbConfig = $this->connection; } + $this->__tables = $this->Model->getAllTables($useDbConfig); - $this->__tables = $tables; - if ($interactive == true) { + if ($this->interactive == true) { $this->out('Possible Controllers based on your current database:'); $this->_controllerNames = array(); - $count = count($tables); + $count = count($this->__tables); for ($i = 0; $i < $count; $i++) { - $this->_controllerNames[] = $this->_controllerName($this->_modelName($tables[$i])); + $this->_controllerNames[] = $this->_controllerName($this->_modelName($this->__tables[$i])); $this->out($i + 1 . ". " . $this->_controllerNames[$i]); } return $this->_controllerNames; diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php new file mode 100644 index 000000000..dccddc275 --- /dev/null +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -0,0 +1,123 @@ +<?php +/** + * ControllerTask Test Case + * + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org + * @package cake + * @subpackage cake.tests.cases.console.libs.tasks + * @since CakePHP(tm) v 1.3 + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + */ +App::import('Core', 'Shell'); + +if (!defined('DISABLE_AUTO_DISPATCH')) { + define('DISABLE_AUTO_DISPATCH', true); +} + +if (!class_exists('ShellDispatcher')) { + ob_start(); + $argv = false; + require CAKE . 'console' . DS . 'cake.php'; + ob_end_clean(); +} + +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'controller.php'; +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'model.php'; +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php'; + + +Mock::generatePartial( + 'ShellDispatcher', 'TestControllerTaskMockShellDispatcher', + array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment') +); + +Mock::generatePartial( + 'ControllerTask', 'MockControllerTask', + array('in', 'out', 'err', 'createFile', '_stop', '_checkUnitTest') +); + +Mock::generatePartial( + 'ModelTask', 'ControllerMockModelTask', + array('in', 'out', 'err', 'createFile', '_stop', '_checkUnitTest') +); + +/** + * ControllerTaskTest class + * + * @package cake + * @subpackage cake.tests.cases.console.libs.tasks + */ +class ControllerTaskTest extends CakeTestCase { +/** + * fixtures + * + * @var array + **/ + var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag'); + +/** + * setUp method + * + * @return void + * @access public + */ + function startTest() { + $this->Dispatcher =& new TestControllerTaskMockShellDispatcher(); + $this->Task =& new MockControllerTask($this->Dispatcher); + $this->Task->Dispatch =& new $this->Dispatcher; + $this->Task->Dispatch->shellPaths = Configure::read('shellPaths'); + $this->Task->Template =& new TemplateTask($this->Task->Dispatch); + $this->Task->Model =& new ControllerMockModelTask($this->Task->Dispatch); + } + +/** + * tearDown method + * + * @return void + * @access public + */ + function endTest() { + unset($this->Task, $this->Dispatcher); + ClassRegistry::flush(); + } + +/** + * test ListAll + * + * @return void + **/ + function testListAll() { + $this->Task->connection = 'test_suite'; + $this->Task->interactive = true; + $this->Task->expectAt(1, 'out', array('1. Articles')); + $this->Task->expectAt(2, 'out', array('2. ArticlesTags')); + $this->Task->expectAt(3, 'out', array('3. Comments')); + $this->Task->expectAt(4, 'out', array('4. Tags')); + + $expected = array('Articles', 'ArticlesTags', 'Comments', 'Tags'); + $result = $this->Task->listAll('test_suite'); + $this->assertEqual($result, $expected); + + $this->Task->expectAt(6, 'out', array('1. Articles')); + $this->Task->expectAt(7, 'out', array('2. ArticlesTags')); + $this->Task->expectAt(8, 'out', array('4. Comments')); + $this->Task->expectAt(9, 'out', array('5. Tags')); + + $this->Task->interactive = false; + $result = $this->Task->listAll(); + + $expected = array('articles', 'articles_tags', 'comments', 'tags'); + $this->assertEqual($result, $expected); + } +} +?> \ No newline at end of file From 9b9b1fbf211b674e0b2f9c67b035b2a11db55098 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 14 May 2009 23:25:52 -0400 Subject: [PATCH 0184/2083] Updating doc block --- cake/tests/cases/console/libs/tasks/model.test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index c323a3ea3..aec16157b 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -128,7 +128,7 @@ function testListAll() { } /** - * Test that listAll scans the database connection and lists all the tables in it.s + * Test that getName interacts with the user and returns the model name. * * @return void **/ From 68a858b39a310afb1b73b7a48af19461056cdc15 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 14 May 2009 23:28:27 -0400 Subject: [PATCH 0185/2083] Adding test case for getName --- cake/console/libs/tasks/controller.php | 10 +++---- .../console/libs/tasks/controller.test.php | 27 +++++++++++++++++++ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 3248351c2..9ea0a81a4 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -536,16 +536,16 @@ function listAll($useDbConfig = null) { /** * Forces the user to specify the controller he wants to bake, and returns the selected controller name. * + * @param string $useDbConfig Connection name to get a controller name for. * @return string Controller name * @access public */ - function getName() { - $useDbConfig = 'default'; + function getName($useDbConfig = null) { $controllers = $this->listAll($useDbConfig); $enteredController = ''; while ($enteredController == '') { - $enteredController = $this->in(__("Enter a number from the list above, type in the name of another controller, or 'q' to exit", true), null, 'q'); + $enteredController = $this->in(__("Enter a number from the list above,\ntype in the name of another controller, or 'q' to exit", true), null, 'q'); if ($enteredController === 'q') { $this->out(__("Exit", true)); @@ -553,8 +553,7 @@ function getName() { } if ($enteredController == '' || intval($enteredController) > count($controllers)) { - $this->out(__('Error:', true)); - $this->out(__("The Controller name you supplied was empty, or the number \nyou selected was not an option. Please try again.", true)); + $this->err(__("The Controller name you supplied was empty,\nor the number you selected was not an option. Please try again.", true)); $enteredController = ''; } } @@ -564,7 +563,6 @@ function getName() { } else { $controllerName = Inflector::camelize($enteredController); } - return $controllerName; } /** diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index dccddc275..47fda0d66 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -119,5 +119,32 @@ function testListAll() { $expected = array('articles', 'articles_tags', 'comments', 'tags'); $this->assertEqual($result, $expected); } + +/** + * Test that getName interacts with the user and returns the controller name. + * + * @return void + **/ + function testGetName() { + $this->Task->setReturnValue('in', 1); + + $this->Task->setReturnValueAt(0, 'in', 'q'); + $this->Task->expectOnce('_stop'); + $this->Task->getName('test_suite'); + + $this->Task->setReturnValueAt(1, 'in', 1); + $result = $this->Task->getName('test_suite'); + $expected = 'Articles'; + $this->assertEqual($result, $expected); + + $this->Task->setReturnValueAt(2, 'in', 3); + $result = $this->Task->getName('test_suite'); + $expected = 'Comments'; + $this->assertEqual($result, $expected); + + $this->Task->setReturnValueAt(3, 'in', 10); + $result = $this->Task->getName('test_suite'); + $this->Task->expectOnce('err'); + } } ?> \ No newline at end of file From b1de3166e948684b30acd3659f6a5801f5677bfc Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 14 May 2009 23:33:10 -0400 Subject: [PATCH 0186/2083] Removing dead options. --- cake/console/libs/tasks/controller.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 9ea0a81a4..0f11c7e84 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -149,29 +149,29 @@ function __interactive($controllerName = false) { } $doItInteractive = $this->in(join("\n", $question), array('y','n'), 'y'); - if (low($doItInteractive) == 'y' || low($doItInteractive) == 'yes') { + if (strtolower($doItInteractive) == 'y') { $this->interactive = true; $wannaUseScaffold = $this->in(__("Would you like to use scaffolding?", true), array('y','n'), 'n'); - if (low($wannaUseScaffold) == 'n' || low($wannaUseScaffold) == 'no') { + if (strtolower($wannaUseScaffold) == 'n') { $wannaDoScaffolding = $this->in(__("Would you like to include some basic class methods (index(), add(), view(), edit())?", true), array('y','n'), 'n'); - if (low($wannaDoScaffolding) == 'y' || low($wannaDoScaffolding) == 'yes') { + if (strtolower($wannaDoScaffolding) == 'y') { $wannaDoAdmin = $this->in(__("Would you like to create the methods for admin routing?", true), array('y','n'), 'n'); } $wannaDoHelpers = $this->in(__("Would you like this controller to use other helpers besides HtmlHelper and FormHelper?", true), array('y','n'), 'n'); - if (low($wannaDoHelpers) == 'y' || low($wannaDoHelpers) == 'yes') { + if (strtolower($wannaDoHelpers) == 'y') { $helpersList = $this->in(__("Please provide a comma separated list of the other helper names you'd like to use.\nExample: 'Ajax, Javascript, Time'", true)); $helpersListTrimmed = str_replace(' ', '', $helpersList); $helpers = explode(',', $helpersListTrimmed); } $wannaDoComponents = $this->in(__("Would you like this controller to use any components?", true), array('y','n'), 'n'); - if (low($wannaDoComponents) == 'y' || low($wannaDoComponents) == 'yes') { + if (strtolower($wannaDoComponents) == 'y') { $componentsList = $this->in(__("Please provide a comma separated list of the component names you'd like to use.\nExample: 'Acl, Security, RequestHandler'", true)); $componentsListTrimmed = str_replace(' ', '', $componentsList); $components = explode(',', $componentsListTrimmed); @@ -184,17 +184,17 @@ function __interactive($controllerName = false) { } else { $wannaDoScaffolding = $this->in(__("Would you like to include some basic class methods (index(), add(), view(), edit())?", true), array('y','n'), 'y'); - if (low($wannaDoScaffolding) == 'y' || low($wannaDoScaffolding) == 'yes') { + if (strtolower($wannaDoScaffolding) == 'y') { $wannaDoAdmin = $this->in(__("Would you like to create the methods for admin routing?", true), array('y','n'), 'y'); } } $admin = false; - if ((low($wannaDoAdmin) == 'y' || low($wannaDoAdmin) == 'yes')) { + if (strtolower($wannaDoAdmin) == 'y') { $admin = $this->getAdmin(); } - if (low($wannaDoScaffolding) == 'y' || low($wannaDoScaffolding) == 'yes') { + if (strtolower($wannaDoScaffolding) == 'y') { $actions = $this->bakeActions($controllerName, null, in_array(low($wannaUseSession), array('y', 'yes'))); if ($admin) { $actions .= $this->bakeActions($controllerName, $admin, in_array(low($wannaUseSession), array('y', 'yes'))); @@ -208,7 +208,7 @@ function __interactive($controllerName = false) { $this->hr(); $this->out("Controller Name: $controllerName"); - if (low($wannaUseScaffold) == 'y' || low($wannaUseScaffold) == 'yes') { + if (strtolower($wannaUseScaffold) == 'y') { $this->out(" var \$scaffold;"); $actions = 'scaffold'; } @@ -239,7 +239,7 @@ function __interactive($controllerName = false) { $this->hr(); $looksGood = $this->in(__('Look okay?', true), array('y','n'), 'y'); - if (low($looksGood) == 'y' || low($looksGood) == 'yes') { + if (strtolower($looksGood) == 'y') { $baked = $this->bake($controllerName, $actions, $helpers, $components, $uses); if ($baked && $this->_checkUnitTest()) { $this->bakeTest($controllerName); From d609a62dc58ca4ce6da8369286540e02a1c04aaf Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Fri, 15 May 2009 00:03:53 -0400 Subject: [PATCH 0187/2083] Adding welcome message back to model task --- cake/console/libs/tasks/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 28e62d050..c585d9394 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -85,6 +85,7 @@ class ModelTask extends Shell { **/ function startup() { App::import('Core', 'Model'); + parent::startup(); } /** From 9eb27f14d7e3b7ed33a051d3b7c72e317d03d88b Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Fri, 15 May 2009 00:04:57 -0400 Subject: [PATCH 0188/2083] Adding tests and starting clean up of __interactive. --- cake/console/libs/tasks/controller.php | 90 ++++++++++++------- .../console/libs/tasks/controller.test.php | 34 +++++++ 2 files changed, 90 insertions(+), 34 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 0f11c7e84..2469369dc 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -44,7 +44,7 @@ class ControllerTask extends Shell { * @var array * @access public */ - var $tasks = array('Model', 'Project', 'Template'); + var $tasks = array('Model', 'Project', 'Template', 'DbConfig'); /** * path to CONTROLLERS directory * @@ -70,6 +70,9 @@ function execute() { } if (isset($this->args[0])) { + if (!isset($this->connection)) { + $this->connection = 'default'; + } if (strtolower($this->args[0]) == 'all') { return $this->all(); } @@ -121,33 +124,34 @@ function all() { * * @access private */ - function __interactive($controllerName = false) { - if (!$controllerName) { - $this->interactive = true; - $this->hr(); - $this->out(sprintf("Bake Controller\nPath: %s", $this->path)); - $this->hr(); - $actions = ''; - $uses = array(); - $helpers = array(); - $components = array(); - $wannaUseSession = 'y'; - $wannaDoAdmin = 'n'; - $wannaUseScaffold = 'n'; - $wannaDoScaffolding = 'y'; - $controllerName = $this->getName(); + function __interactive() { + $this->interactive = true; + $this->hr(); + $this->out(sprintf("Bake Controller\nPath: %s", $this->path)); + $this->hr(); + + if (empty($this->connection)) { + $this->connection = $this->DbConfig->getConfig(); } + + $controllerName = $this->getName(); $this->hr(); $this->out("Baking {$controllerName}Controller"); $this->hr(); + $actions = ''; + $wannaUseSession = 'y'; + $wannaDoAdmin = 'n'; + $wannaUseScaffold = 'n'; + $wannaDoScaffolding = 'y'; + $controllerFile = low(Inflector::underscore($controllerName)); $question[] = __("Would you like to build your controller interactively?", true); if (file_exists($this->path . $controllerFile .'_controller.php')) { $question[] = sprintf(__("Warning: Choosing no will overwrite the %sController.", true), $controllerName); } - $doItInteractive = $this->in(join("\n", $question), array('y','n'), 'y'); + $doItInteractive = $this->in(join("\n", $question), array('y', 'n'), 'y'); if (strtolower($doItInteractive) == 'y') { $this->interactive = true; @@ -161,21 +165,8 @@ function __interactive($controllerName = false) { if (strtolower($wannaDoScaffolding) == 'y') { $wannaDoAdmin = $this->in(__("Would you like to create the methods for admin routing?", true), array('y','n'), 'n'); } - - $wannaDoHelpers = $this->in(__("Would you like this controller to use other helpers besides HtmlHelper and FormHelper?", true), array('y','n'), 'n'); - - if (strtolower($wannaDoHelpers) == 'y') { - $helpersList = $this->in(__("Please provide a comma separated list of the other helper names you'd like to use.\nExample: 'Ajax, Javascript, Time'", true)); - $helpersListTrimmed = str_replace(' ', '', $helpersList); - $helpers = explode(',', $helpersListTrimmed); - } - $wannaDoComponents = $this->in(__("Would you like this controller to use any components?", true), array('y','n'), 'n'); - - if (strtolower($wannaDoComponents) == 'y') { - $componentsList = $this->in(__("Please provide a comma separated list of the component names you'd like to use.\nExample: 'Acl, Security, RequestHandler'", true)); - $componentsListTrimmed = str_replace(' ', '', $componentsList); - $components = explode(',', $componentsListTrimmed); - } + $helpers = $this->doHelpers(); + $components = $this->doComponents(); $wannaUseSession = $this->in(__("Would you like to use Sessions?", true), array('y','n'), 'y'); } else { @@ -244,8 +235,6 @@ function __interactive($controllerName = false) { if ($baked && $this->_checkUnitTest()) { $this->bakeTest($controllerName); } - } else { - $this->__interactive($controllerName); } } else { $baked = $this->bake($controllerName, $actions, $helpers, $components, $uses); @@ -506,6 +495,38 @@ function bakeTest($className) { return $this->createFile($path . $filename, $content); } +/** + * Interact with the user and get a list of additional helpers + * + * @return array Helpers that the user wants to use. + **/ + function doHelpers() { + $wannaDoHelpers = $this->in(__("Would you like this controller to use other helpers\nbesides HtmlHelper and FormHelper?", true), array('y','n'), 'n'); + $helpers = array(); + if (strtolower($wannaDoHelpers) == 'y') { + $helpersList = $this->in(__("Please provide a comma separated list of the other\nhelper names you'd like to use.\nExample: 'Ajax, Javascript, Time'", true)); + $helpersListTrimmed = str_replace(' ', '', $helpersList); + $helpers = explode(',', $helpersListTrimmed); + } + return $helpers; + } + +/** + * Interact with the user and get a list of additional components + * + * @return array Components the user wants to use. + **/ + function doComponents() { + $wannaDoComponents = $this->in(__("Would you like this controller to use any components?", true), array('y','n'), 'n'); + $components = array(); + if (strtolower($wannaDoComponents) == 'y') { + $componentsList = $this->in(__("Please provide a comma separated list of the component names you'd like to use.\nExample: 'Acl, Security, RequestHandler'", true)); + $componentsListTrimmed = str_replace(' ', '', $componentsList); + $components = explode(',', $componentsListTrimmed); + } + return $components; + } + /** * Outputs and gets the list of possible controllers from database * @@ -565,6 +586,7 @@ function getName($useDbConfig = null) { } return $controllerName; } + /** * Displays help contents * diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 47fda0d66..6b84f568a 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -146,5 +146,39 @@ function testGetName() { $result = $this->Task->getName('test_suite'); $this->Task->expectOnce('err'); } + +/** + * test helper interactions + * + * @return void + **/ + function testDoHelpers() { + $this->Task->setReturnValueAt(0, 'in', 'n'); + $result = $this->Task->doHelpers(); + $this->assertEqual($result, array()); + + $this->Task->setReturnValueAt(1, 'in', 'y'); + $this->Task->setReturnValueAt(2, 'in', ' Javascript, Ajax, CustomOne '); + $result = $this->Task->doHelpers(); + $expected = array('Javascript', 'Ajax', 'CustomOne'); + $this->assertEqual($result, $expected); + } + +/** + * test component interactions + * + * @return void + **/ + function testDoComponents() { + $this->Task->setReturnValueAt(0, 'in', 'n'); + $result = $this->Task->doComponents(); + $this->assertEqual($result, array()); + + $this->Task->setReturnValueAt(1, 'in', 'y'); + $this->Task->setReturnValueAt(2, 'in', ' RequestHandler, Security '); + $result = $this->Task->doComponents(); + $expected = array('RequestHandler', 'Security'); + $this->assertEqual($result, $expected); + } } ?> \ No newline at end of file From 938ba849d2da28f3c9361923a40e592df67fd8d1 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 16 May 2009 22:41:38 -0400 Subject: [PATCH 0189/2083] Refactoring doXX methods Adding doUses seems to have gotten lost at one point. --- cake/console/libs/tasks/controller.php | 131 +++++++++++++++---------- 1 file changed, 81 insertions(+), 50 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 2469369dc..38185a99a 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -138,14 +138,15 @@ function __interactive() { $this->hr(); $this->out("Baking {$controllerName}Controller"); $this->hr(); - + + $helpers = $components = $uses = array(); $actions = ''; $wannaUseSession = 'y'; - $wannaDoAdmin = 'n'; - $wannaUseScaffold = 'n'; - $wannaDoScaffolding = 'y'; + $wannaBakeAdminCrud = 'n'; + $useDynamicScaffold = 'n'; + $wannaBakeCrud = 'y'; - $controllerFile = low(Inflector::underscore($controllerName)); + $controllerFile = strtolower(Inflector::underscore($controllerName)); $question[] = __("Would you like to build your controller interactively?", true); if (file_exists($this->path . $controllerFile .'_controller.php')) { @@ -155,41 +156,31 @@ function __interactive() { if (strtolower($doItInteractive) == 'y') { $this->interactive = true; + $useDynamicScaffold = $this->in( + __("Would you like to use dynamic scaffolding?", true), array('y','n'), 'n' + ); - $wannaUseScaffold = $this->in(__("Would you like to use scaffolding?", true), array('y','n'), 'n'); - - if (strtolower($wannaUseScaffold) == 'n') { - - $wannaDoScaffolding = $this->in(__("Would you like to include some basic class methods (index(), add(), view(), edit())?", true), array('y','n'), 'n'); - - if (strtolower($wannaDoScaffolding) == 'y') { - $wannaDoAdmin = $this->in(__("Would you like to create the methods for admin routing?", true), array('y','n'), 'n'); - } + if (strtolower($useDynamicScaffold) == 'n') { + list($wannaBakeCrud, $wannaBakeCrud) = $this->_askAboutMethods(); + $helpers = $this->doHelpers(); $components = $this->doComponents(); + $uses = $this->doUses(); $wannaUseSession = $this->in(__("Would you like to use Sessions?", true), array('y','n'), 'y'); } else { - $wannaDoScaffolding = 'n'; + $wannaBakeCrud = 'n'; } } else { - $wannaDoScaffolding = $this->in(__("Would you like to include some basic class methods (index(), add(), view(), edit())?", true), array('y','n'), 'y'); - - if (strtolower($wannaDoScaffolding) == 'y') { - $wannaDoAdmin = $this->in(__("Would you like to create the methods for admin routing?", true), array('y','n'), 'y'); - } + list($wannaBakeCrud, $wannaBakeCrud) = $this->_askAboutMethods(); } - $admin = false; - if (strtolower($wannaDoAdmin) == 'y') { - $admin = $this->getAdmin(); + if (strtolower($wannaBakeCrud) == 'y') { + $actions = $this->bakeActions($controllerName, null, strtolower($wannaUseSession) == 'y'); } - - if (strtolower($wannaDoScaffolding) == 'y') { - $actions = $this->bakeActions($controllerName, null, in_array(low($wannaUseSession), array('y', 'yes'))); - if ($admin) { - $actions .= $this->bakeActions($controllerName, $admin, in_array(low($wannaUseSession), array('y', 'yes'))); - } + if (strtolower($wannaBakeAdminCrud) == 'y') { + $admin = $this->getAdmin(); + $actions .= $this->bakeActions($controllerName, $admin, strtolower($wannaUseSession) == 'y'); } if ($this->interactive === true) { @@ -197,15 +188,15 @@ function __interactive() { $this->hr(); $this->out('The following controller will be created:'); $this->hr(); - $this->out("Controller Name: $controllerName"); + $this->out("Controller Name:\t$controllerName"); - if (strtolower($wannaUseScaffold) == 'y') { - $this->out(" var \$scaffold;"); + if (strtolower($useDynamicScaffold) == 'y') { + $this->out("\t\tvar \$scaffold;"); $actions = 'scaffold'; } if (count($helpers)) { - $this->out("Helpers: ", false); + $this->out("Helpers:", false); foreach ($helpers as $help) { if ($help != $helpers[count($helpers) - 1]) { @@ -217,7 +208,7 @@ function __interactive() { } if (count($components)) { - $this->out("Components: ", false); + $this->out("Components:", false); foreach ($components as $comp) { if ($comp != $components[count($components) - 1]) { @@ -243,6 +234,24 @@ function __interactive() { } } } + +/** + * 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), + array('y','n'), 'n' + ); + $wannaBakeAdminCrud = $this->in( + __("Would you like to create the basic class methods for admin routing?", true), + array('y','n'), 'n' + ); + return array($wannaBakeCrud, $wannaBakeAdminCrud); + } + /** * Bake scaffold actions * @@ -501,14 +510,10 @@ function bakeTest($className) { * @return array Helpers that the user wants to use. **/ function doHelpers() { - $wannaDoHelpers = $this->in(__("Would you like this controller to use other helpers\nbesides HtmlHelper and FormHelper?", true), array('y','n'), 'n'); - $helpers = array(); - if (strtolower($wannaDoHelpers) == 'y') { - $helpersList = $this->in(__("Please provide a comma separated list of the other\nhelper names you'd like to use.\nExample: 'Ajax, Javascript, Time'", true)); - $helpersListTrimmed = str_replace(' ', '', $helpersList); - $helpers = explode(',', $helpersListTrimmed); - } - return $helpers; + return $this->_doPropertyChoices( + __("Would you like this controller to use other helpers\nbesides HtmlHelper and FormHelper?", true), + __("Please provide a comma separated list of the other\nhelper names you'd like to use.\nExample: 'Ajax, Javascript, Time'", true) + ); } /** @@ -517,14 +522,40 @@ function doHelpers() { * @return array Components the user wants to use. **/ function doComponents() { - $wannaDoComponents = $this->in(__("Would you like this controller to use any components?", true), array('y','n'), 'n'); - $components = array(); - if (strtolower($wannaDoComponents) == 'y') { - $componentsList = $this->in(__("Please provide a comma separated list of the component names you'd like to use.\nExample: 'Acl, Security, RequestHandler'", true)); - $componentsListTrimmed = str_replace(' ', '', $componentsList); - $components = explode(',', $componentsListTrimmed); - } - return $components; + return $this->_doPropertyChoices( + __("Would you like this controller to use any components?", true), + __("Please provide a comma separated list of the component names you'd like to use.\nExample: 'Acl, Security, RequestHandler'", true) + ); + } + +/** + * Interact with the user and get a list of additional models to use + * + * @return array Models the user wants to use. + **/ + function doUses() { + return $this->_doPropertyChoices( + __("Would you like this controller to use any additional models?", true), + __("Please provide a comma separated list of the model names you'd like to use.\nExample: 'Post, Comment, User'", true) + ); + } + +/** + * Common code for property choice handling. + * + * @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(); + if (strtolower($proceed) == 'y') { + $propertyList = $this->in($example); + $propertyListTrimmed = str_replace(' ', '', $propertyList); + $property = explode(',', $propertyListTrimmed); + } + return $property; } /** From 08394629c9f474dd154f7d50551693df88cbf97c Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 16 May 2009 23:17:40 -0400 Subject: [PATCH 0190/2083] Creating confirmController and test case. --- cake/console/libs/tasks/controller.php | 80 ++++++++++--------- .../console/libs/tasks/controller.test.php | 21 ++++- 2 files changed, 64 insertions(+), 37 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 38185a99a..8764ad92c 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -167,7 +167,9 @@ function __interactive() { $components = $this->doComponents(); $uses = $this->doUses(); - $wannaUseSession = $this->in(__("Would you like to use Sessions?", true), array('y','n'), 'y'); + $wannaUseSession = $this->in( + __("Would you like to use Session flash messages?", true), array('y','n'), 'y' + ); } else { $wannaBakeCrud = 'n'; } @@ -184,41 +186,7 @@ function __interactive() { } if ($this->interactive === true) { - $this->out(''); - $this->hr(); - $this->out('The following controller will be created:'); - $this->hr(); - $this->out("Controller Name:\t$controllerName"); - - if (strtolower($useDynamicScaffold) == 'y') { - $this->out("\t\tvar \$scaffold;"); - $actions = 'scaffold'; - } - - if (count($helpers)) { - $this->out("Helpers:", false); - - foreach ($helpers as $help) { - if ($help != $helpers[count($helpers) - 1]) { - $this->out(ucfirst($help) . ", ", false); - } else { - $this->out(ucfirst($help)); - } - } - } - - if (count($components)) { - $this->out("Components:", false); - - foreach ($components as $comp) { - if ($comp != $components[count($components) - 1]) { - $this->out(ucfirst($comp) . ", ", false); - } else { - $this->out(ucfirst($comp)); - } - } - } - $this->hr(); + $this->confirmController($controllerName, $useDynamicScaffold, $uses, $helpers, $components); $looksGood = $this->in(__('Look okay?', true), array('y','n'), 'y'); if (strtolower($looksGood) == 'y') { @@ -235,6 +203,46 @@ function __interactive() { } } +/** + * Confirm a to be baked controller with the user + * + * @return void + **/ + function confirmController($controllerName, $useDynamicScaffold, $uses, $helpers, $components) { + $this->out(''); + $this->hr(); + $this->out('The following controller will be created:'); + $this->hr(); + $this->out("Controller Name:\n\t$controllerName"); + + if (strtolower($useDynamicScaffold) == 'y') { + $this->out("\t\tvar \$scaffold;"); + $actions = 'scaffold'; + } + + $properties = array( + 'helpers' => __("Helpers:", true), + 'components' => __('Components:', true), + 'uses' => __('Uses:', true) + ); + + foreach ($properties as $var => $title) { + if (count($$var)) { + $output = ''; + $length = count($$var); + foreach ($$var as $i => $propElement) { + if ($i != $length -1) { + $output .= ucfirst($propElement) . ', '; + } else { + $output .= ucfirst($propElement); + } + } + $this->out($title . "\n\t" . $output); + } + } + $this->hr(); + } + /** * Interact with the user and ask about which methods (admin or regular they want to bake) * diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 6b84f568a..2bdab3f88 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -43,7 +43,7 @@ Mock::generatePartial( 'ControllerTask', 'MockControllerTask', - array('in', 'out', 'err', 'createFile', '_stop', '_checkUnitTest') + array('in', 'hr', 'out', 'err', 'createFile', '_stop', '_checkUnitTest') ); Mock::generatePartial( @@ -180,5 +180,24 @@ function testDoComponents() { $expected = array('RequestHandler', 'Security'); $this->assertEqual($result, $expected); } + +/** + * test Confirming controller user interaction + * + * @return void + **/ + function testConfirmController() { + $controller = 'Posts'; + $scaffold = false; + $helpers = array('Ajax', 'Time'); + $components = array('Acl', 'Auth'); + $uses = array('Comment', 'User'); + + $this->Task->expectAt(2, 'out', array("Controller Name:\n\t$controller")); + $this->Task->expectAt(3, 'out', array("Helpers:\n\tAjax, Time")); + $this->Task->expectAt(4, 'out', array("Components:\n\tAcl, Auth")); + $this->Task->expectAt(5, 'out', array("Uses:\n\tComment, User")); + $this->Task->confirmController($controller, $scaffold, $uses, $helpers, $components); + } } ?> \ No newline at end of file From c0f06be65e0d54003f1d643224170c3d165ce4ce Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 17 May 2009 00:04:33 -0400 Subject: [PATCH 0191/2083] Adding test case for bake output. --- .../console/libs/tasks/controller.test.php | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 2bdab3f88..5bec03b8b 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -199,5 +199,31 @@ function testConfirmController() { $this->Task->expectAt(5, 'out', array("Uses:\n\tComment, User")); $this->Task->confirmController($controller, $scaffold, $uses, $helpers, $components); } + +/** + * test the bake method + * + * @return void + **/ + function testBake() { + $helpers = array('Ajax', 'Time'); + $components = array('Acl', 'Auth'); + $uses = array('Comment', 'User'); + $this->Task->setReturnValue('createFile', true); + + $result = $this->Task->bake('Articles', '--actions--', $helpers, $components, $uses); + $this->assertPattern('/class ArticlesController extends AppController/', $result); + $this->assertPattern('/\$components \= array\(\'Acl\', \'Auth\'\)/', $result); + $this->assertPattern('/\$uses \= array\(\'Article\', \'Comment\', \'User\'\)/', $result); + $this->assertPattern('/\$helpers \= array\(\'Html\', \'Form\', \'Ajax\', \'Time\'\)/', $result); + $this->assertPattern('/\-\-actions\-\-/', $result); + + $result = $this->Task->bake('Articles', 'scaffold', $helpers, $components, $uses); + $this->assertPattern('/class ArticlesController extends AppController/', $result); + $this->assertPattern('/var \$scaffold/', $result); + $this->assertNoPattern('/helpers/', $result); + $this->assertNoPattern('/components/', $result); + $this->assertNoPattern('/uses/', $result); + } } ?> \ No newline at end of file From d31c43d40995ad29c4fa2d68029dad1628fde6b9 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 17 May 2009 00:05:07 -0400 Subject: [PATCH 0192/2083] Refactoring code generation into controller.ctp --- cake/console/libs/tasks/controller.php | 61 ++++-------------- .../libs/templates/objects/controller.ctp | 64 +++++++++++++++++++ 2 files changed, 77 insertions(+), 48 deletions(-) create mode 100644 cake/console/libs/templates/objects/controller.ctp diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 8764ad92c..088150239 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -160,7 +160,10 @@ function __interactive() { __("Would you like to use dynamic scaffolding?", true), array('y','n'), 'n' ); - if (strtolower($useDynamicScaffold) == 'n') { + if (strtolower($useDynamicScaffold) == 'y') { + $wannaBakeCrud = 'n'; + $actions = 'scaffold'; + } else { list($wannaBakeCrud, $wannaBakeCrud) = $this->_askAboutMethods(); $helpers = $this->doHelpers(); @@ -170,8 +173,6 @@ function __interactive() { $wannaUseSession = $this->in( __("Would you like to use Session flash messages?", true), array('y','n'), 'y' ); - } else { - $wannaBakeCrud = 'n'; } } else { list($wannaBakeCrud, $wannaBakeCrud) = $this->_askAboutMethods(); @@ -216,8 +217,7 @@ function confirmController($controllerName, $useDynamicScaffold, $uses, $helpers $this->out("Controller Name:\n\t$controllerName"); if (strtolower($useDynamicScaffold) == 'y') { - $this->out("\t\tvar \$scaffold;"); - $actions = 'scaffold'; + $this->out("var \$scaffold;"); } $properties = array( @@ -428,52 +428,17 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) { * @access private */ function bake($controllerName, $actions = '', $helpers = null, $components = null, $uses = null) { - $out = "<?php\n"; - $out .= "class $controllerName" . "Controller extends {$this->plugin}AppController {\n\n"; - $out .= "\tvar \$name = '$controllerName';\n"; + $isScaffold = ($actions === 'scaffold') ? true : false; - if (low($actions) == 'scaffold') { - $out .= "\tvar \$scaffold;\n"; - } else { - if (count($uses)) { - $out .= "\tvar \$uses = array('" . $this->_modelName($controllerName) . "', "; - - foreach ($uses as $use) { - if ($use != $uses[count($uses) - 1]) { - $out .= "'" . $this->_modelName($use) . "', "; - } else { - $out .= "'" . $this->_modelName($use) . "'"; - } - } - $out .= ");\n"; - } + $this->Template->set('plugin', $this->plugin); + $this->Template->set(compact('controllerName', 'actions', 'helpers', 'components', 'uses', 'isScaffold')); + $contents = $this->Template->generate('objects', 'controller'); - $out .= "\tvar \$helpers = array('Html', 'Form'"; - if (count($helpers)) { - foreach ($helpers as $help) { - $out .= ", '" . Inflector::camelize($help) . "'"; - } - } - $out .= ");\n"; - - if (count($components)) { - $out .= "\tvar \$components = array("; - - foreach ($components as $comp) { - if ($comp != $components[count($components) - 1]) { - $out .= "'" . Inflector::camelize($comp) . "', "; - } else { - $out .= "'" . Inflector::camelize($comp) . "'"; - } - } - $out .= ");\n"; - } - $out .= $actions; - } - $out .= "}\n"; - $out .= "?>"; $filename = $this->path . $this->_controllerPath($controllerName) . '_controller.php'; - return $this->createFile($filename, $out); + if ($this->createFile($filename, $contents)) { + return $contents; + } + return false; } /** * Assembles and writes a unit test file diff --git a/cake/console/libs/templates/objects/controller.ctp b/cake/console/libs/templates/objects/controller.ctp new file mode 100644 index 000000000..61f104fe7 --- /dev/null +++ b/cake/console/libs/templates/objects/controller.ctp @@ -0,0 +1,64 @@ +<?php +/** + * Controller bake template file + * + * Allows templating of Controllers generated from bake. + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org + * @package cake + * @subpackage cake. + * @since CakePHP(tm) v 1.3 + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + */ + +echo "<?php\n"; +?> +class <?php echo $controllerName; ?>Controller extends <?php echo $plugin; ?>AppController { + + var $name = '<?php echo $controllerName; ?>'; +<?php if ($isScaffold): ?> + var $scaffold; +<?php else: ?> +<?php +if (count($uses)): + echo "\tvar \$uses = array('" . $this->_modelName($controllerName) . "'"; + foreach ($uses as $use): + echo ", '" . $this->_modelName($use) . "'"; + endforeach; + echo ");\n"; +endif; + +echo "\tvar \$helpers = array('Html', 'Form'"; +if (count($helpers)): + foreach ($helpers as $help): + echo ", '" . Inflector::camelize($help) . "'"; + endforeach; +endif; +echo ");\n"; + +if (count($components)): + echo "\tvar \$components = array("; + for ($i = 0, $len = count($components); $i < $len; $i++): + if ($i != $len - 1): + echo "'" . Inflector::camelize($components[$i]) . "', "; + else: + echo "'" . Inflector::camelize($components[$i]) . "'"; + endif; + endfor; + echo ");\n"; +endif; + +echo $actions; + +endif; ?> +} +<?php echo "?>"; ?> \ No newline at end of file From 9d405faf8f74db15b273165df5e23b1b55d7f3eb Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 17 May 2009 00:31:37 -0400 Subject: [PATCH 0193/2083] Allowing controller bake all to use connections other than default. --- cake/console/libs/tasks/controller.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 088150239..fc49f0c73 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -59,6 +59,7 @@ class ControllerTask extends Shell { */ function initialize() { } + /** * Execution method always used for tasks * @@ -101,6 +102,7 @@ function execute() { } } } + /** * Bake All the controllers at once. Will only bake controllers for models that exist. * @@ -110,6 +112,7 @@ function execute() { function all() { $this->interactive = false; $this->listAll($this->connection, false); + ClassRegistry::config('Model', array('ds' => $this->connection)); foreach ($this->__tables as $table) { $model = $this->_modelName($table); $controller = $this->_controllerName($model); @@ -119,6 +122,7 @@ function all() { } } } + /** * Interactive * @@ -272,16 +276,17 @@ function _askAboutMethods() { function bakeActions($controllerName, $admin = null, $wannaUseSession = true) { $currentModelName = $this->_modelName($controllerName); if (!App::import('Model', $currentModelName)) { - $this->err(__('You must have a model for this class to build scaffold methods. Please try again.', true)); - exit; + $this->err(__('You must have a model for this class to build basic methods. Please try again.', true)); + $this->_stop(); } $actions = null; - $modelObj =& new $currentModelName(); + $modelObj =& ClassRegistry::init($currentModelName); $controllerPath = $this->_controllerPath($controllerName); $pluralName = $this->_pluralName($currentModelName); $singularName = Inflector::variable($currentModelName); $singularHumanName = Inflector::humanize($currentModelName); $pluralHumanName = Inflector::humanize($controllerName); + $actions .= "\n"; $actions .= "\tfunction {$admin}index() {\n"; $actions .= "\t\t\$this->{$currentModelName}->recursive = 0;\n"; @@ -440,6 +445,7 @@ function bake($controllerName, $actions = '', $helpers = null, $components = nul } return false; } + /** * Assembles and writes a unit test file * From 0d7b86fc8b169e513e618c4fc0491ee668c39b8b Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 18 May 2009 22:26:16 -0400 Subject: [PATCH 0194/2083] Removing $uses as part of bake. --- cake/console/libs/tasks/controller.php | 26 ++++------------ .../libs/templates/objects/controller.ctp | 7 ----- .../console/libs/tasks/controller.test.php | 30 ++++++++++++++++--- 3 files changed, 32 insertions(+), 31 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index fc49f0c73..2df4ef5bd 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -143,7 +143,7 @@ function __interactive() { $this->out("Baking {$controllerName}Controller"); $this->hr(); - $helpers = $components = $uses = array(); + $helpers = $components = array(); $actions = ''; $wannaUseSession = 'y'; $wannaBakeAdminCrud = 'n'; @@ -172,7 +172,6 @@ function __interactive() { $helpers = $this->doHelpers(); $components = $this->doComponents(); - $uses = $this->doUses(); $wannaUseSession = $this->in( __("Would you like to use Session flash messages?", true), array('y','n'), 'y' @@ -195,13 +194,13 @@ function __interactive() { $looksGood = $this->in(__('Look okay?', true), array('y','n'), 'y'); if (strtolower($looksGood) == 'y') { - $baked = $this->bake($controllerName, $actions, $helpers, $components, $uses); + $baked = $this->bake($controllerName, $actions, $helpers, $components); if ($baked && $this->_checkUnitTest()) { $this->bakeTest($controllerName); } } } else { - $baked = $this->bake($controllerName, $actions, $helpers, $components, $uses); + $baked = $this->bake($controllerName, $actions, $helpers, $components); if ($baked && $this->_checkUnitTest()) { $this->bakeTest($controllerName); } @@ -213,7 +212,7 @@ function __interactive() { * * @return void **/ - function confirmController($controllerName, $useDynamicScaffold, $uses, $helpers, $components) { + function confirmController($controllerName, $useDynamicScaffold, $helpers, $components) { $this->out(''); $this->hr(); $this->out('The following controller will be created:'); @@ -227,7 +226,6 @@ function confirmController($controllerName, $useDynamicScaffold, $uses, $helpers $properties = array( 'helpers' => __("Helpers:", true), 'components' => __('Components:', true), - 'uses' => __('Uses:', true) ); foreach ($properties as $var => $title) { @@ -432,11 +430,11 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) { * @return string Baked controller * @access private */ - function bake($controllerName, $actions = '', $helpers = null, $components = null, $uses = null) { + function bake($controllerName, $actions = '', $helpers = null, $components = null) { $isScaffold = ($actions === 'scaffold') ? true : false; $this->Template->set('plugin', $this->plugin); - $this->Template->set(compact('controllerName', 'actions', 'helpers', 'components', 'uses', 'isScaffold')); + $this->Template->set(compact('controllerName', 'actions', 'helpers', 'components', 'isScaffold')); $contents = $this->Template->generate('objects', 'controller'); $filename = $this->path . $this->_controllerPath($controllerName) . '_controller.php'; @@ -507,18 +505,6 @@ function doComponents() { ); } -/** - * Interact with the user and get a list of additional models to use - * - * @return array Models the user wants to use. - **/ - function doUses() { - return $this->_doPropertyChoices( - __("Would you like this controller to use any additional models?", true), - __("Please provide a comma separated list of the model names you'd like to use.\nExample: 'Post, Comment, User'", true) - ); - } - /** * Common code for property choice handling. * diff --git a/cake/console/libs/templates/objects/controller.ctp b/cake/console/libs/templates/objects/controller.ctp index 61f104fe7..539210d2e 100644 --- a/cake/console/libs/templates/objects/controller.ctp +++ b/cake/console/libs/templates/objects/controller.ctp @@ -29,13 +29,6 @@ class <?php echo $controllerName; ?>Controller extends <?php echo $plugin; ?>App var $scaffold; <?php else: ?> <?php -if (count($uses)): - echo "\tvar \$uses = array('" . $this->_modelName($controllerName) . "'"; - foreach ($uses as $use): - echo ", '" . $this->_modelName($use) . "'"; - endforeach; - echo ");\n"; -endif; echo "\tvar \$helpers = array('Html', 'Form'"; if (count($helpers)): diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 5bec03b8b..a29a0e174 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -196,8 +196,7 @@ function testConfirmController() { $this->Task->expectAt(2, 'out', array("Controller Name:\n\t$controller")); $this->Task->expectAt(3, 'out', array("Helpers:\n\tAjax, Time")); $this->Task->expectAt(4, 'out', array("Components:\n\tAcl, Auth")); - $this->Task->expectAt(5, 'out', array("Uses:\n\tComment, User")); - $this->Task->confirmController($controller, $scaffold, $uses, $helpers, $components); + $this->Task->confirmController($controller, $scaffold, $helpers, $components); } /** @@ -214,7 +213,6 @@ function testBake() { $result = $this->Task->bake('Articles', '--actions--', $helpers, $components, $uses); $this->assertPattern('/class ArticlesController extends AppController/', $result); $this->assertPattern('/\$components \= array\(\'Acl\', \'Auth\'\)/', $result); - $this->assertPattern('/\$uses \= array\(\'Article\', \'Comment\', \'User\'\)/', $result); $this->assertPattern('/\$helpers \= array\(\'Html\', \'Form\', \'Ajax\', \'Time\'\)/', $result); $this->assertPattern('/\-\-actions\-\-/', $result); @@ -223,7 +221,31 @@ function testBake() { $this->assertPattern('/var \$scaffold/', $result); $this->assertNoPattern('/helpers/', $result); $this->assertNoPattern('/components/', $result); - $this->assertNoPattern('/uses/', $result); + } + +/** + * test that execute runs all when the first arg == all + * + * @return void + **/ + function testExecuteIntoAll() { + $this->Task->connection = 'test_suite'; + $this->Task->path = '/my/path/'; + $this->Task->args = array('all'); + + $filename = '/my/path/articles_controller.php'; + $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticlesController/'))); + + $filename = '/my/path/articles_tags_contoller.php'; + $this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/class ArticlesTagsController/'))); + + $filename = '/my/path/comments_controller.php'; + $this->Task->expectAt(2, 'createFile', array($filename, new PatternExpectation('/class CommentsController/'))); + + $filename = '/my/path/tags_controller.php'; + $this->Task->expectAt(4, 'createFile', array($filename, new PatternExpectation('/class TagsController/'))); + + $this->Task->execute(); } } ?> \ No newline at end of file From 4f6d3219efd42f390dbe349d87430ee7e01a36fd Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 18 May 2009 23:46:20 -0400 Subject: [PATCH 0195/2083] Adding test cases for bakeActions --- .../console/libs/tasks/controller.test.php | 90 +++++++++++++++++-- 1 file changed, 81 insertions(+), 9 deletions(-) diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index a29a0e174..7394bb1c3 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -51,6 +51,18 @@ array('in', 'out', 'err', 'createFile', '_stop', '_checkUnitTest') ); +if (!class_exists('Article')) { + define('ARTICLE_MODEL_CREATED', true); + App::import('Core', 'Model'); + + class Article extends Model { + var $name = 'Article'; + var $hasMany = array('Comment'); + var $hasAndBelongToMany = array('Tag'); + } + +} + /** * ControllerTaskTest class * @@ -223,12 +235,81 @@ function testBake() { $this->assertNoPattern('/components/', $result); } +/** + * test that bakeActions is creating the correct controller Code. (Using sessions) + * + * @return void + **/ + function testBakeActionsUsingSessions() { + $result = $this->Task->bakeActions('Articles', null, true); + + $this->assertTrue(strpos($result, 'function index() {') !== false); + $this->assertTrue(strpos($result, '$this->Article->recursive = 0;') !== false); + $this->assertTrue(strpos($result, "\$this->set('articles', \$this->paginate());") !== false); + + $this->assertTrue(strpos($result, 'function view($id = null)') !== false); + $this->assertTrue(strpos($result, "\$this->Session->setFlash(__('Invalid Article', true))") !== false); + $this->assertTrue(strpos($result, "\$this->set('article', \$this->Article->read(null, \$id)") !== false); + + $this->assertTrue(strpos($result, 'function add()') !== false); + $this->assertTrue(strpos($result, 'if (!empty($this->data))') !== false); + $this->assertTrue(strpos($result, 'if ($this->Article->save($this->data))') !== false); + $this->assertTrue(strpos($result, "\$this->Session->setFlash(__('The Article has been saved', true))") !== false); + + $this->assertTrue(strpos($result, 'function edit($id = null)') !== false); + $this->assertTrue(strpos($result, "\$this->Session->setFlash(__('The Article could not be saved. Please, try again.', true));") !== false); + + $this->assertTrue(strpos($result, 'function delete($id = null)') !== false); + $this->assertTrue(strpos($result, 'if ($this->Article->del($id))') !== false); + $this->assertTrue(strpos($result, "\$this->Session->setFlash(__('Article deleted', true))") !== false); + + + $result = $this->Task->bakeActions('Articles', 'admin_', true); + + $this->assertTrue(strpos($result, 'function admin_index() {') !== false); + $this->assertTrue(strpos($result, 'function admin_add()') !== false); + $this->assertTrue(strpos($result, 'function admin_view($id = null)') !== false); + $this->assertTrue(strpos($result, 'function admin_edit($id = null)') !== false); + $this->assertTrue(strpos($result, 'function admin_delete($id = null)') !== false); + } + +/** + * Test baking with Controller::flash() or no sessions. + * + * @return void + **/ + function testBakeActionsWithNoSessions() { + $result = $this->Task->bakeActions('Articles', null, false); + + $this->assertTrue(strpos($result, 'function index() {') !== false); + $this->assertTrue(strpos($result, '$this->Article->recursive = 0;') !== false); + $this->assertTrue(strpos($result, "\$this->set('articles', \$this->paginate());") !== false); + + $this->assertTrue(strpos($result, 'function view($id = null)') !== false); + $this->assertTrue(strpos($result, "\$this->flash(__('Invalid Article', true), array('action'=>'index'))") !== false); + $this->assertTrue(strpos($result, "\$this->set('article', \$this->Article->read(null, \$id)") !== false); + + $this->assertTrue(strpos($result, 'function add()') !== false); + $this->assertTrue(strpos($result, 'if (!empty($this->data))') !== false); + $this->assertTrue(strpos($result, 'if ($this->Article->save($this->data))') !== false); + $this->assertTrue(strpos($result, "\$this->flash(__('The Article has been saved.', true), array('action'=>'index'))") !== false); + + $this->assertTrue(strpos($result, 'function edit($id = null)') !== false); + + $this->assertTrue(strpos($result, 'function delete($id = null)') !== false); + $this->assertTrue(strpos($result, 'if ($this->Article->del($id))') !== false); + $this->assertTrue(strpos($result, "\$this->flash(__('Article deleted', true), array('action'=>'index'))") !== false); + } /** * test that execute runs all when the first arg == all * * @return void **/ function testExecuteIntoAll() { + $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Execute into all could not be run as an Article model was already loaded'); + if ($skip) { + return; + } $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; $this->Task->args = array('all'); @@ -236,15 +317,6 @@ function testExecuteIntoAll() { $filename = '/my/path/articles_controller.php'; $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticlesController/'))); - $filename = '/my/path/articles_tags_contoller.php'; - $this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/class ArticlesTagsController/'))); - - $filename = '/my/path/comments_controller.php'; - $this->Task->expectAt(2, 'createFile', array($filename, new PatternExpectation('/class CommentsController/'))); - - $filename = '/my/path/tags_controller.php'; - $this->Task->expectAt(4, 'createFile', array($filename, new PatternExpectation('/class TagsController/'))); - $this->Task->execute(); } } From 8bcd8ff890e8c3ef72495c658be29e8317bd3585 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 18 May 2009 23:49:44 -0400 Subject: [PATCH 0196/2083] Adding skipIf's Fixing typo, adding assertions. --- .../cases/console/libs/tasks/controller.test.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 7394bb1c3..b5b2c2cb5 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -58,7 +58,7 @@ class Article extends Model { var $name = 'Article'; var $hasMany = array('Comment'); - var $hasAndBelongToMany = array('Tag'); + var $hasAndBelongsToMany = array('Tag'); } } @@ -241,6 +241,10 @@ function testBake() { * @return void **/ function testBakeActionsUsingSessions() { + $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Testing bakeActions requires Article Model to be undefined. %s'); + if ($skip) { + return; + } $result = $this->Task->bakeActions('Articles', null, true); $this->assertTrue(strpos($result, 'function index() {') !== false); @@ -279,6 +283,10 @@ function testBakeActionsUsingSessions() { * @return void **/ function testBakeActionsWithNoSessions() { + $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Testing bakeActions requires Article Model to be undefined. %s'); + if ($skip) { + return; + } $result = $this->Task->bakeActions('Articles', null, false); $this->assertTrue(strpos($result, 'function index() {') !== false); @@ -295,18 +303,20 @@ function testBakeActionsWithNoSessions() { $this->assertTrue(strpos($result, "\$this->flash(__('The Article has been saved.', true), array('action'=>'index'))") !== false); $this->assertTrue(strpos($result, 'function edit($id = null)') !== false); + $this->assertTrue(strpos($result, "\$this->Article->Tag->find('list')") !== false); $this->assertTrue(strpos($result, 'function delete($id = null)') !== false); $this->assertTrue(strpos($result, 'if ($this->Article->del($id))') !== false); $this->assertTrue(strpos($result, "\$this->flash(__('Article deleted', true), array('action'=>'index'))") !== false); } + /** * test that execute runs all when the first arg == all * * @return void **/ function testExecuteIntoAll() { - $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Execute into all could not be run as an Article model was already loaded'); + $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Execute into all could not be run as an Article model was already loaded. %s'); if ($skip) { return; } From 2cae04308cc0e7ec69e909d81bd27bed1ae4cdcc Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 19 May 2009 00:18:59 -0400 Subject: [PATCH 0197/2083] Adding tests for interactive mode. Fixing notice error. --- cake/console/libs/tasks/controller.php | 2 +- .../console/libs/tasks/controller.test.php | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 2df4ef5bd..873dc640d 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -190,7 +190,7 @@ function __interactive() { } if ($this->interactive === true) { - $this->confirmController($controllerName, $useDynamicScaffold, $uses, $helpers, $components); + $this->confirmController($controllerName, $useDynamicScaffold, $helpers, $components); $looksGood = $this->in(__('Look okay?', true), array('y','n'), 'y'); if (strtolower($looksGood) == 'y') { diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index b5b2c2cb5..928eecafc 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -304,12 +304,36 @@ function testBakeActionsWithNoSessions() { $this->assertTrue(strpos($result, 'function edit($id = null)') !== false); $this->assertTrue(strpos($result, "\$this->Article->Tag->find('list')") !== false); + $this->assertTrue(strpos($result, "\$this->set(compact('tags'))") !== false); $this->assertTrue(strpos($result, 'function delete($id = null)') !== false); $this->assertTrue(strpos($result, 'if ($this->Article->del($id))') !== false); $this->assertTrue(strpos($result, "\$this->flash(__('Article deleted', true), array('action'=>'index'))") !== false); } +/** + * test Interactive mode. + * + * @return void + **/ + function testInteractive() { + $this->Task->connection = 'test_suite'; + $this->Task->path = '/my/path'; + $this->Task->setReturnValueAt(0, 'in', '1'); + $this->Task->setReturnValueAt(1, 'in', 'y'); // build interactive + $this->Task->setReturnValueAt(2, 'in', 'n'); // build no scaffolds + $this->Task->setReturnValueAt(3, 'in', 'y'); // build normal methods + $this->Task->setReturnValueAt(4, 'in', 'n'); // build admin methods + $this->Task->setReturnValueAt(5, 'in', 'n'); // helpers? + $this->Task->setReturnValueAt(6, 'in', 'n'); // components? + $this->Task->setReturnValueAt(7, 'in', 'y'); // use sessions + $this->Task->setReturnValueAt(8, 'in', 'y'); // looks good + + $this->Task->execute(); + + $filename = '/my/path/articles_controller.php'; + $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticlesController/'))); + } /** * test that execute runs all when the first arg == all * From a4f6fdc3b955e9bf61bfdcae1740b27aa527c55b Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 19 May 2009 23:53:41 -0400 Subject: [PATCH 0198/2083] Refactoring bake action generation into a template file. Adding template file for controller actions. --- cake/console/libs/tasks/controller.php | 136 +---------------- .../templates/objects/controller_actions.ctp | 138 ++++++++++++++++++ 2 files changed, 143 insertions(+), 131 deletions(-) create mode 100644 cake/console/libs/templates/objects/controller_actions.ctp diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 873dc640d..2b538b83b 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -277,7 +277,7 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) { $this->err(__('You must have a model for this class to build basic methods. Please try again.', true)); $this->_stop(); } - $actions = null; + $modelObj =& ClassRegistry::init($currentModelName); $controllerPath = $this->_controllerPath($controllerName); $pluralName = $this->_pluralName($currentModelName); @@ -285,136 +285,10 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) { $singularHumanName = Inflector::humanize($currentModelName); $pluralHumanName = Inflector::humanize($controllerName); - $actions .= "\n"; - $actions .= "\tfunction {$admin}index() {\n"; - $actions .= "\t\t\$this->{$currentModelName}->recursive = 0;\n"; - $actions .= "\t\t\$this->set('{$pluralName}', \$this->paginate());\n"; - $actions .= "\t}\n"; - $actions .= "\n"; - $actions .= "\tfunction {$admin}view(\$id = null) {\n"; - $actions .= "\t\tif (!\$id) {\n"; - if ($wannaUseSession) { - $actions .= "\t\t\t\$this->Session->setFlash(__('Invalid {$singularHumanName}.', true));\n"; - $actions .= "\t\t\t\$this->redirect(array('action'=>'index'));\n"; - } else { - $actions .= "\t\t\t\$this->flash(__('Invalid {$singularHumanName}', true), array('action'=>'index'));\n"; - } - $actions .= "\t\t}\n"; - $actions .= "\t\t\$this->set('".$singularName."', \$this->{$currentModelName}->read(null, \$id));\n"; - $actions .= "\t}\n"; - $actions .= "\n"; - - /* ADD ACTION */ - $compact = array(); - $actions .= "\tfunction {$admin}add() {\n"; - $actions .= "\t\tif (!empty(\$this->data)) {\n"; - $actions .= "\t\t\t\$this->{$currentModelName}->create();\n"; - $actions .= "\t\t\tif (\$this->{$currentModelName}->save(\$this->data)) {\n"; - if ($wannaUseSession) { - $actions .= "\t\t\t\t\$this->Session->setFlash(__('The ".$singularHumanName." has been saved', true));\n"; - $actions .= "\t\t\t\t\$this->redirect(array('action'=>'index'));\n"; - } else { - $actions .= "\t\t\t\t\$this->flash(__('{$currentModelName} saved.', true), array('action'=>'index'));\n"; - } - $actions .= "\t\t\t} else {\n"; - if ($wannaUseSession) { - $actions .= "\t\t\t\t\$this->Session->setFlash(__('The {$singularHumanName} could not be saved. Please, try again.', true));\n"; - } - $actions .= "\t\t\t}\n"; - $actions .= "\t\t}\n"; - foreach ($modelObj->hasAndBelongsToMany as $associationName => $relation) { - if (!empty($associationName)) { - $habtmModelName = $this->_modelName($associationName); - $habtmSingularName = $this->_singularName($associationName); - $habtmPluralName = $this->_pluralName($associationName); - $actions .= "\t\t\${$habtmPluralName} = \$this->{$currentModelName}->{$habtmModelName}->find('list');\n"; - $compact[] = "'{$habtmPluralName}'"; - } - } - foreach ($modelObj->belongsTo as $associationName => $relation) { - if (!empty($associationName)) { - $belongsToModelName = $this->_modelName($associationName); - $belongsToPluralName = $this->_pluralName($associationName); - $actions .= "\t\t\${$belongsToPluralName} = \$this->{$currentModelName}->{$belongsToModelName}->find('list');\n"; - $compact[] = "'{$belongsToPluralName}'"; - } - } - if (!empty($compact)) { - $actions .= "\t\t\$this->set(compact(".join(', ', $compact)."));\n"; - } - $actions .= "\t}\n"; - $actions .= "\n"; - - /* EDIT ACTION */ - $compact = array(); - $actions .= "\tfunction {$admin}edit(\$id = null) {\n"; - $actions .= "\t\tif (!\$id && empty(\$this->data)) {\n"; - if ($wannaUseSession) { - $actions .= "\t\t\t\$this->Session->setFlash(__('Invalid {$singularHumanName}', true));\n"; - $actions .= "\t\t\t\$this->redirect(array('action'=>'index'));\n"; - } else { - $actions .= "\t\t\t\$this->flash(__('Invalid {$singularHumanName}', true), array('action'=>'index'));\n"; - } - $actions .= "\t\t}\n"; - $actions .= "\t\tif (!empty(\$this->data)) {\n"; - $actions .= "\t\t\tif (\$this->{$currentModelName}->save(\$this->data)) {\n"; - if ($wannaUseSession) { - $actions .= "\t\t\t\t\$this->Session->setFlash(__('The ".$singularHumanName." has been saved', true));\n"; - $actions .= "\t\t\t\t\$this->redirect(array('action'=>'index'));\n"; - } else { - $actions .= "\t\t\t\t\$this->flash(__('The ".$singularHumanName." has been saved.', true), array('action'=>'index'));\n"; - } - $actions .= "\t\t\t} else {\n"; - if ($wannaUseSession) { - $actions .= "\t\t\t\t\$this->Session->setFlash(__('The {$singularHumanName} could not be saved. Please, try again.', true));\n"; - } - $actions .= "\t\t\t}\n"; - $actions .= "\t\t}\n"; - $actions .= "\t\tif (empty(\$this->data)) {\n"; - $actions .= "\t\t\t\$this->data = \$this->{$currentModelName}->read(null, \$id);\n"; - $actions .= "\t\t}\n"; - - foreach ($modelObj->hasAndBelongsToMany as $associationName => $relation) { - if (!empty($associationName)) { - $habtmModelName = $this->_modelName($associationName); - $habtmSingularName = $this->_singularName($associationName); - $habtmPluralName = $this->_pluralName($associationName); - $actions .= "\t\t\${$habtmPluralName} = \$this->{$currentModelName}->{$habtmModelName}->find('list');\n"; - $compact[] = "'{$habtmPluralName}'"; - } - } - foreach ($modelObj->belongsTo as $associationName => $relation) { - if (!empty($associationName)) { - $belongsToModelName = $this->_modelName($associationName); - $belongsToPluralName = $this->_pluralName($associationName); - $actions .= "\t\t\${$belongsToPluralName} = \$this->{$currentModelName}->{$belongsToModelName}->find('list');\n"; - $compact[] = "'{$belongsToPluralName}'"; - } - } - if (!empty($compact)) { - $actions .= "\t\t\$this->set(compact(".join(',', $compact)."));\n"; - } - $actions .= "\t}\n"; - $actions .= "\n"; - $actions .= "\tfunction {$admin}delete(\$id = null) {\n"; - $actions .= "\t\tif (!\$id) {\n"; - if ($wannaUseSession) { - $actions .= "\t\t\t\$this->Session->setFlash(__('Invalid id for {$singularHumanName}', true));\n"; - $actions .= "\t\t\t\$this->redirect(array('action'=>'index'));\n"; - } else { - $actions .= "\t\t\t\$this->flash(__('Invalid {$singularHumanName}', true), array('action'=>'index'));\n"; - } - $actions .= "\t\t}\n"; - $actions .= "\t\tif (\$this->{$currentModelName}->del(\$id)) {\n"; - if ($wannaUseSession) { - $actions .= "\t\t\t\$this->Session->setFlash(__('{$singularHumanName} deleted', true));\n"; - $actions .= "\t\t\t\$this->redirect(array('action'=>'index'));\n"; - } else { - $actions .= "\t\t\t\$this->flash(__('{$singularHumanName} deleted', true), array('action'=>'index'));\n"; - } - $actions .= "\t\t}\n"; - $actions .= "\t}\n"; - $actions .= "\n"; + $this->Template->set(compact('admin', 'controllerPath', 'pluralName', 'singularName', 'singularHumanName', + 'pluralHumanName', 'modelObj', 'wannaUseSession', 'currentModelName')); + $actions = $this->Template->generate('objects', 'controller_actions'); + return $actions; } diff --git a/cake/console/libs/templates/objects/controller_actions.ctp b/cake/console/libs/templates/objects/controller_actions.ctp new file mode 100644 index 000000000..90c4a02c3 --- /dev/null +++ b/cake/console/libs/templates/objects/controller_actions.ctp @@ -0,0 +1,138 @@ +<?php +/** + * Bake Template for Controller action generation. + * + * + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org + * @package cake + * @subpackage cake.console.libs.template.objects + * @since CakePHP(tm) v 1.3 + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + */ +?> + + function <?php echo $admin ?>index() { + $this-><?php echo $currentModelName ?>->recursive = 0; + $this->set('<?php echo $pluralName ?>', $this->paginate()); + } + + + function <?php echo $admin ?>view($id = null) { + if (!$id) { +<?php if ($wannaUseSession): ?> + $this->Session->setFlash(__('Invalid <?php echo $singularHumanName ?>', true)); + $this->redirect(array('action'=>'index')); +<?php else: ?> + $this->flash(__('Invalid <?php echo $singularHumanName; ?>', true), array('action'=>'index')); +<?php endif; ?> + } + $this->set('<?php echo $singularName; ?>', $this-><?php echo $currentModelName; ?>->read(null, $id)); + } + +<?php $compact = array(); ?> + + function <?php echo $admin ?>add() { + if (!empty($this->data)) { + $this-><?php echo $currentModelName; ?>->create(); + if ($this-><?php echo $currentModelName; ?>->save($this->data)) { +<?php if ($wannaUseSession): ?> + $this->Session->setFlash(__('The <?php echo $singularHumanName; ?> has been saved', true)); + $this->redirect(array('action'=>'index')); +<?php else: ?> + $this->flash(__('<?php echo $currentModelName; ?> saved.', true), array('action'=>'index')); +<?php endif; ?> + } else { +<?php if ($wannaUseSession): ?> + $this->Session->setFlash(__('The <?php echo $singularHumanName; ?> could not be saved. Please, try again.', true)); +<?php endif; ?> + } + } +<?php + foreach (array('belongsTo', 'hasAndBelongsToMany') as $assoc): + foreach ($modelObj->{$assoc} as $associationName => $relation): + if (!empty($associationName)): + $otherModelName = $this->_modelName($associationName); + $otherPluralName = $this->_pluralName($associationName); + echo "\t\t\${$otherPluralName} = \$this->{$currentModelName}->{$otherModelName}->find('list');\n"; + $compact[] = "'{$otherPluralName}'"; + endif; + endforeach; + endforeach; + if (!empty($compact)): + echo "\t\t\$this->set(compact(".join(', ', $compact)."));\n"; + endif; +?> + } + +<?php $compact = array(); ?> + function <?php echo $admin; ?>edit($id = null) { + if (!$id && empty($this->data)) { +<?php if ($wannaUseSession): ?> + $this->Session->setFlash(__('Invalid <?php echo $singularHumanName; ?>', true)); + $this->redirect(array('action'=>'index')); +<?php else: ?> + $this->flash(__('Invalid <?php echo $singularHumanName; ?>', true), array('action'=>'index')); +<?php endif; ?> + } + if (!empty($this->data)) { + if ($this-><?php echo $currentModelName; ?>->save($this->data)) { +<?php if ($wannaUseSession): ?> + $this->Session->setFlash(__('The <?php echo $singularHumanName; ?> has been saved', true)); + $this->redirect(array('action'=>'index')); +<?php else: ?> + $this->flash(__('The <?php echo $singularHumanName; ?> has been saved.', true), array('action'=>'index')); +<?php endif; ?> + } else { +<?php if ($wannaUseSession): ?> + $this->Session->setFlash(__('The <?php echo $singularHumanName; ?> could not be saved. Please, try again.', true)); +<?php endif; ?> + } + } + if (empty($this->data)) { + $this->data = $this-><?php echo $currentModelName; ?>->read(null, $id); + } +<?php + foreach (array('belongsTo', 'hasAndBelongsToMany') as $assoc): + foreach ($modelObj->{$assoc} as $associationName => $relation): + if (!empty($associationName)): + $otherModelName = $this->_modelName($associationName); + $otherPluralName = $this->_pluralName($associationName); + echo "\t\t\${$otherPluralName} = \$this->{$currentModelName}->{$otherModelName}->find('list');\n"; + $compact[] = "'{$otherPluralName}'"; + endif; + endforeach; + endforeach; + if (!empty($compact)): + echo "\t\t\$this->set(compact(".join(', ', $compact)."));\n"; + endif; + ?> + } + + function <?php echo $admin; ?>delete($id = null) { + if (!$id) { +<?php if ($wannaUseSession): ?> + $this->Session->setFlash(__('Invalid id for <?php echo $singularHumanName; ?>', true)); + $this->redirect(array('action'=>'index')); +<?php else: ?> + $this->flash(__('Invalid <?php echo $singularHumanName; ?>', true), array('action'=>'index')); +<?php endif; ?> + } + if ($this-><?php echo $currentModelName; ?>->del($id)) { +<?php if ($wannaUseSession): ?> + $this->Session->setFlash(__('<?php echo $singularHumanName; ?> deleted', true)); + $this->redirect(array('action'=>'index')); +<?php else: ?> + $this->flash(__('<?php echo $singularHumanName; ?> deleted', true), array('action'=>'index')); +<?php endif; ?> + } + } From 6eada280cf09c7c631adc462d59060457547ad7a Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 20 May 2009 00:00:36 -0400 Subject: [PATCH 0199/2083] Fixing typo. Removing newlines --- cake/console/libs/tasks/controller.php | 3 +-- cake/console/libs/templates/objects/controller_actions.ctp | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 2b538b83b..5e42a53d8 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -168,7 +168,7 @@ function __interactive() { $wannaBakeCrud = 'n'; $actions = 'scaffold'; } else { - list($wannaBakeCrud, $wannaBakeCrud) = $this->_askAboutMethods(); + list($wannaBakeCrud, $wannaBakeAdminCrud) = $this->_askAboutMethods(); $helpers = $this->doHelpers(); $components = $this->doComponents(); @@ -288,7 +288,6 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) { $this->Template->set(compact('admin', 'controllerPath', 'pluralName', 'singularName', 'singularHumanName', 'pluralHumanName', 'modelObj', 'wannaUseSession', 'currentModelName')); $actions = $this->Template->generate('objects', 'controller_actions'); - return $actions; } diff --git a/cake/console/libs/templates/objects/controller_actions.ctp b/cake/console/libs/templates/objects/controller_actions.ctp index 90c4a02c3..c4b1ce935 100644 --- a/cake/console/libs/templates/objects/controller_actions.ctp +++ b/cake/console/libs/templates/objects/controller_actions.ctp @@ -26,7 +26,6 @@ $this->set('<?php echo $pluralName ?>', $this->paginate()); } - function <?php echo $admin ?>view($id = null) { if (!$id) { <?php if ($wannaUseSession): ?> @@ -40,7 +39,6 @@ } <?php $compact = array(); ?> - function <?php echo $admin ?>add() { if (!empty($this->data)) { $this-><?php echo $currentModelName; ?>->create(); From e8eaf97dcfc04789bbc1ead574df3a0ac5ac1f46 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 20 May 2009 00:31:59 -0400 Subject: [PATCH 0200/2083] Additional tests for execute --- .../console/libs/tasks/controller.test.php | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 928eecafc..3f7b017d5 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -334,6 +334,7 @@ function testInteractive() { $filename = '/my/path/articles_controller.php'; $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticlesController/'))); } + /** * test that execute runs all when the first arg == all * @@ -351,6 +352,50 @@ function testExecuteIntoAll() { $filename = '/my/path/articles_controller.php'; $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticlesController/'))); + $this->Task->execute(); + } + +/** + * test that `cake bake controller foo scaffold` works. + * + * @return void + **/ + function testExecuteWithScaffoldParam() { + $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Execute with scaffold param requires no Article model to be defined. %s'); + if ($skip) { + return; + } + $this->Task->connection = 'test_suite'; + $this->Task->path = '/my/path/'; + $this->Task->args = array('Articles', 'scaffold'); + + $filename = '/my/path/articles_controller.php'; + $this->Task->expectAt(0, 'createFile', array( + $filename, new NoPatternExpectation('/admin_index/') + )); + + $this->Task->execute(); + } + +/** + * test that `cake bake controller foo scaffold admin` works + * + * @return void + **/ + function testExecuteWithAdminScaffoldParams() { + $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Execute with scaffold admin param requires no Article model to be defined. %s'); + if ($skip) { + return; + } + $this->Task->connection = 'test_suite'; + $this->Task->path = '/my/path/'; + $this->Task->args = array('Articles', 'scaffold', 'admin'); + + $filename = '/my/path/articles_controller.php'; + $this->Task->expectAt(0, 'createFile', array( + $filename, new PatternExpectation('/admin_index/') + )); + $this->Task->execute(); } } From de1b495afbab6fddb2176a87f9f3d3c02ad0b9b6 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 20 May 2009 00:46:09 -0400 Subject: [PATCH 0201/2083] Adding some i18n strings. Moving test creation to TestTask. --- cake/console/libs/tasks/controller.php | 34 ++++--------------------- cake/console/libs/tasks/test.php | 35 ++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 29 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 5e42a53d8..2cf5ad343 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -215,9 +215,9 @@ function __interactive() { function confirmController($controllerName, $useDynamicScaffold, $helpers, $components) { $this->out(''); $this->hr(); - $this->out('The following controller will be created:'); + $this->out(__('The following controller will be created:', true)); $this->hr(); - $this->out("Controller Name:\n\t$controllerName"); + $this->out(sprintf(__("Controller Name:\n\t%s", true), $controllerName)); if (strtolower($useDynamicScaffold) == 'y') { $this->out("var \$scaffold;"); @@ -325,33 +325,9 @@ function bake($controllerName, $actions = '', $helpers = null, $components = nul * @access private */ function bakeTest($className) { - $import = $className; - if ($this->plugin) { - $import = $this->plugin . '.' . $className; - } - $out = "App::import('Controller', '$import');\n\n"; - $out .= "class Test{$className} extends {$className}Controller {\n"; - $out .= "\tvar \$autoRender = false;\n}\n\n"; - $out .= "class {$className}ControllerTest extends CakeTestCase {\n"; - $out .= "\tvar \${$className} = null;\n\n"; - $out .= "\tfunction startTest() {\n\t\t\$this->{$className} = new Test{$className}();"; - $out .= "\n\t\t\$this->{$className}->constructClasses();\n\t}\n\n"; - $out .= "\tfunction test{$className}ControllerInstance() {\n"; - $out .= "\t\t\$this->assertTrue(is_a(\$this->{$className}, '{$className}Controller'));\n\t}\n\n"; - $out .= "\tfunction endTest() {\n\t\tunset(\$this->{$className});\n\t}\n}\n"; - - $path = CONTROLLER_TESTS; - if (isset($this->plugin)) { - $pluginPath = 'plugins' . DS . Inflector::underscore($this->plugin) . DS; - $path = APP . $pluginPath . 'tests' . DS . 'cases' . DS . 'controllers' . DS; - } - - $filename = Inflector::underscore($className).'_controller.test.php'; - $this->out("\nBaking unit test for $className..."); - - $header = '$Id'; - $content = "<?php \n/* SVN FILE: $header$ */\n/* ". $className ."Controller Test cases generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n{$out}?>"; - return $this->createFile($path . $filename, $content); + $this->Test->plugin = $this->plugin; + $this->Test->connection = $this->connection; + return $this->Test->bake('Controller', $className); } /** diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 5d35acba4..879e80349 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -260,5 +260,40 @@ function bakeModelTest($className) { $content = "<?php \n/* SVN FILE: $header$ */\n/* ". $className ." Test cases generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n{$out}?>"; return $this->createFile($path . $filename, $content); } + +/** + * Create a test case for a controller. + * + * @return void + **/ + function bakeControllerTest() { + $import = $className; + if ($this->plugin) { + $import = $this->plugin . '.' . $className; + } + $out = "App::import('Controller', '$import');\n\n"; + $out .= "class Test{$className} extends {$className}Controller {\n"; + $out .= "\tvar \$autoRender = false;\n}\n\n"; + $out .= "class {$className}ControllerTest extends CakeTestCase {\n"; + $out .= "\tvar \${$className} = null;\n\n"; + $out .= "\tfunction startTest() {\n\t\t\$this->{$className} = new Test{$className}();"; + $out .= "\n\t\t\$this->{$className}->constructClasses();\n\t}\n\n"; + $out .= "\tfunction test{$className}ControllerInstance() {\n"; + $out .= "\t\t\$this->assertTrue(is_a(\$this->{$className}, '{$className}Controller'));\n\t}\n\n"; + $out .= "\tfunction endTest() {\n\t\tunset(\$this->{$className});\n\t}\n}\n"; + + $path = CONTROLLER_TESTS; + if (isset($this->plugin)) { + $pluginPath = 'plugins' . DS . Inflector::underscore($this->plugin) . DS; + $path = APP . $pluginPath . 'tests' . DS . 'cases' . DS . 'controllers' . DS; + } + + $filename = Inflector::underscore($className).'_controller.test.php'; + $this->out("\nBaking unit test for $className..."); + + $header = '$Id'; + $content = "<?php \n/* SVN FILE: $header$ */\n/* ". $className ."Controller Test cases generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n{$out}?>"; + return $this->createFile($path . $filename, $content); + } } ?> \ No newline at end of file From dc016735030860b645f1fe1179a9a59712c3e874 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 20 May 2009 22:28:15 -0400 Subject: [PATCH 0202/2083] More i18n strings. --- cake/console/libs/tasks/controller.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 2cf5ad343..33320b4f9 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -44,7 +44,7 @@ class ControllerTask extends Shell { * @var array * @access public */ - var $tasks = array('Model', 'Project', 'Template', 'DbConfig'); + var $tasks = array('Model', 'Test', 'Template', 'DbConfig'); /** * path to CONTROLLERS directory * @@ -80,7 +80,7 @@ function execute() { $controller = Inflector::camelize($this->args[0]); $actions = null; if (isset($this->args[1]) && $this->args[1] == 'scaffold') { - $this->out('Baking scaffold for ' . $controller); + $this->out(__('Baking scaffold for ', true) . $controller); $actions = $this->bakeActions($controller); } else { $actions = 'scaffold'; @@ -131,7 +131,7 @@ function all() { function __interactive() { $this->interactive = true; $this->hr(); - $this->out(sprintf("Bake Controller\nPath: %s", $this->path)); + $this->out(sprintf(__("Bake Controller\nPath: %s", true), $this->path)); $this->hr(); if (empty($this->connection)) { @@ -140,7 +140,7 @@ function __interactive() { $controllerName = $this->getName(); $this->hr(); - $this->out("Baking {$controllerName}Controller"); + $this->out(sprintf(__('Baking %sController', true), $controllerName)); $this->hr(); $helpers = $components = array(); @@ -387,7 +387,7 @@ function listAll($useDbConfig = null) { $this->__tables = $this->Model->getAllTables($useDbConfig); if ($this->interactive == true) { - $this->out('Possible Controllers based on your current database:'); + $this->out(__('Possible Controllers based on your current database:', true)); $this->_controllerNames = array(); $count = count($this->__tables); for ($i = 0; $i < $count; $i++) { From 5843d5e40a50f331901855b917f994f7c5513f41 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 20 May 2009 23:15:31 -0400 Subject: [PATCH 0203/2083] Adding test case for DbConfig task making DbConfigTask testable. --- cake/console/libs/tasks/db_config.php | 22 ++- .../console/libs/tasks/db_config.test.php | 155 ++++++++++++++++++ 2 files changed, 168 insertions(+), 9 deletions(-) create mode 100644 cake/tests/cases/console/libs/tasks/db_config.test.php diff --git a/cake/console/libs/tasks/db_config.php b/cake/console/libs/tasks/db_config.php index 856b1226c..283bba162 100644 --- a/cake/console/libs/tasks/db_config.php +++ b/cake/console/libs/tasks/db_config.php @@ -24,9 +24,6 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ -if (!class_exists('File')) { - uses('file'); -} /** * Task class for creating and updating the database configuration file. * @@ -52,6 +49,13 @@ class DbConfigTask extends Shell { 'login'=> 'root', 'password'=> 'password', 'database'=> 'project_name', 'schema'=> null, 'prefix'=> null, 'encoding' => null, 'port' => null ); +/** + * String name of the database config class name. + * Used for testing. + * + * @var string + **/ + var $databaseClassName = 'DATABASE_CONFIG'; /** * initialization callback * @@ -92,8 +96,7 @@ function __interactive() { if (preg_match('/[^a-z0-9_]/i', $name)) { $name = ''; $this->out('The name may only contain unaccented latin characters, numbers or underscores'); - } - else if (preg_match('/^[^a-z_]/i', $name)) { + } else if (preg_match('/^[^a-z_]/i', $name)) { $name = ''; $this->out('The name must start with an unaccented latin character or an underscore'); } @@ -240,7 +243,7 @@ function __verify($config) { $this->hr(); $looksGood = $this->in('Look okay?', array('y', 'n'), 'y'); - if (low($looksGood) == 'y' || low($looksGood) == 'yes') { + if (strtolower($looksGood) == 'y') { return $config; } return false; @@ -262,7 +265,7 @@ function bake($configs) { $oldConfigs = array(); if (file_exists($filename)) { - $db = new DATABASE_CONFIG; + $db = new $this->databaseClassName; $temp = get_class_vars(get_class($db)); foreach ($temp as $configName => $info) { @@ -346,7 +349,7 @@ function bake($configs) { $out .= "}\n"; $out .= "?>"; - $filename = $this->path.'database.php'; + $filename = $this->path . 'database.php'; return $this->createFile($filename, $out); } @@ -357,7 +360,7 @@ function bake($configs) { **/ function getConfig() { $useDbConfig = 'default'; - $configs = get_class_vars('DATABASE_CONFIG'); + $configs = get_class_vars($this->databaseClassName); if (!is_array($configs)) { return $this->execute(); @@ -369,5 +372,6 @@ function getConfig() { } return $useDbConfig; } + } ?> \ No newline at end of file diff --git a/cake/tests/cases/console/libs/tasks/db_config.test.php b/cake/tests/cases/console/libs/tasks/db_config.test.php new file mode 100644 index 000000000..27a4f820e --- /dev/null +++ b/cake/tests/cases/console/libs/tasks/db_config.test.php @@ -0,0 +1,155 @@ +<?php +/** + * DBConfigTask Test Case + * + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org + * @package cake + * @subpackage cake.tests.cases.console.libs.tasks + * @since CakePHP(tm) v 1.3 + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + */ +App::import('Core', 'Shell'); + +if (!defined('DISABLE_AUTO_DISPATCH')) { + define('DISABLE_AUTO_DISPATCH', true); +} + +if (!class_exists('ShellDispatcher')) { + ob_start(); + $argv = false; + require CAKE . 'console' . DS . 'cake.php'; + ob_end_clean(); +} + +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'db_config.php'; +//require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php'; + + +Mock::generatePartial( + 'ShellDispatcher', 'TestDbConfigTaskMockShellDispatcher', + array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment') +); + +Mock::generatePartial( + 'DbConfigTask', 'MockDbConfigTask', + array('in', 'hr', 'out', 'err', 'createFile', '_stop', '_checkUnitTest') +); + +class TEST_DATABASE_CONFIG { + var $default = array( + 'driver' => 'mysql', + 'persistent' => false, + 'host' => 'localhost', + 'login' => 'user', + 'password' => 'password', + 'database' => 'database_name', + 'prefix' => '', + ); + + var $otherOne = array( + 'driver' => 'mysql', + 'persistent' => false, + 'host' => 'localhost', + 'login' => 'user', + 'password' => 'password', + 'database' => 'other_one', + 'prefix' => '', + ); +} + +/** + * DbConfigTest class + * + * @package cake + * @subpackage cake.tests.cases.console.libs.tasks + */ +class DbConfigTaskTest extends CakeTestCase { + +/** + * setUp method + * + * @return void + * @access public + */ + function startTest() { + $this->Dispatcher =& new TestDbConfigTaskMockShellDispatcher(); + $this->Task =& new MockDbConfigTask($this->Dispatcher); + $this->Task->Dispatch =& new $this->Dispatcher; + $this->Task->Dispatch->shellPaths = Configure::read('shellPaths'); + //$this->Task->Template =& new TemplateTask($this->Task->Dispatch); + + $this->Task->params['working'] = rtrim(APP, '/'); + $this->Task->databaseClassName = 'TEST_DATABASE_CONFIG'; + } + +/** + * tearDown method + * + * @return void + * @access public + */ + function endTest() { + unset($this->Task, $this->Dispatcher); + ClassRegistry::flush(); + } + +/** + * Test the getConfig method. + * + * @return void + **/ + function testGetConfig() { + $this->Task->setReturnValueAt(0, 'in', 'otherOne'); + $result = $this->Task->getConfig(); + $this->assertEqual($result, 'otherOne'); + } + +/** + * test that initialize sets the path up. + * + * @return void + **/ + function testInitialize() { + $this->assertTrue(empty($this->Task->path)); + $this->Task->initialize(); + $this->assertFalse(empty($this->Task->path)); + $this->assertEqual($this->Task->path, APP . 'config' . DS); + + } +/** + * test execute and by extension __interactive + * + * @return void + **/ + function testExecuteIntoInteractive() { + $this->Task->initialize(); + + $this->Task->expectOnce('_stop'); + $this->Task->setReturnValue('in', 'y'); + $this->Task->setReturnValueAt(0, 'in', 'default'); + $this->Task->setReturnValueAt(1, 'in', 'n'); + $this->Task->setReturnValueAt(2, 'in', 'localhost'); + $this->Task->setReturnValueAt(3, 'in', 'n'); + $this->Task->setReturnValueAt(4, 'in', 'root'); + $this->Task->setReturnValueAt(5, 'in', 'password'); + $this->Task->setReturnValueAt(6, 'in', 'cake_test'); + $this->Task->setReturnValueAt(7, 'in', 'n'); + $this->Task->setReturnValueAt(8, 'in', 'y'); + $this->Task->setReturnValueAt(9, 'in', 'y'); + $this->Task->setReturnValueAt(10, 'in', 'y'); + $this->Task->setReturnValueAt(11, 'in', 'n'); + + $result = $this->Task->execute(); + } +} +?> \ No newline at end of file From fe2e3d82fd1e2185680c64d89967d00b2864d915 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 20 May 2009 23:21:36 -0400 Subject: [PATCH 0204/2083] Removing while() loops wrapping in() with concrete options. --- cake/console/libs/tasks/db_config.php | 31 +++++++++------------------ 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/cake/console/libs/tasks/db_config.php b/cake/console/libs/tasks/db_config.php index 283bba162..da2d8bf97 100644 --- a/cake/console/libs/tasks/db_config.php +++ b/cake/console/libs/tasks/db_config.php @@ -101,29 +101,22 @@ function __interactive() { $this->out('The name must start with an unaccented latin character or an underscore'); } } - $driver = ''; - while ($driver == '') { - $driver = $this->in('Driver:', array('db2', 'firebird', 'mssql', 'mysql', 'mysqli', 'odbc', 'oracle', 'postgres', 'sqlite', 'sybase'), 'mysql'); - } - $persistent = ''; - - while ($persistent == '') { - $persistent = $this->in('Persistent Connection?', array('y', 'n'), 'n'); - } + $driver = $this->in('Driver:', array('db2', 'firebird', 'mssql', 'mysql', 'mysqli', 'odbc', 'oracle', 'postgres', 'sqlite', 'sybase'), 'mysql'); + $persistent = $this->in('Persistent Connection?', array('y', 'n'), 'n'); if (low($persistent) == 'n') { $persistent = 'false'; } else { $persistent = 'true'; } - $host = ''; + $host = ''; while ($host == '') { $host = $this->in('Database Host:', null, 'localhost'); } - $port = ''; + $port = ''; while ($port == '') { $port = $this->in('Port?', null, 'n'); } @@ -131,8 +124,8 @@ function __interactive() { if (low($port) == 'n') { $port = null; } - $login = ''; + $login = ''; while ($login == '') { $login = $this->in('User:', null, 'root'); } @@ -144,43 +137,39 @@ function __interactive() { if ($password == '') { $blank = $this->in('The password you supplied was empty. Use an empty password?', array('y', 'n'), 'n'); - if ($blank == 'y') - { + if ($blank == 'y') { $blankPassword = true; } } } - $database = ''; + $database = ''; while ($database == '') { $database = $this->in('Database Name:', null, 'cake'); } - $prefix = ''; + $prefix = ''; while ($prefix == '') { $prefix = $this->in('Table Prefix?', null, 'n'); } - if (low($prefix) == 'n') { $prefix = null; } - $encoding = ''; + $encoding = ''; while ($encoding == '') { $encoding = $this->in('Table encoding?', null, 'n'); } - if (low($encoding) == 'n') { $encoding = null; } - $schema = ''; + $schema = ''; if ($driver == 'postgres') { while ($schema == '') { $schema = $this->in('Table schema?', null, 'n'); } } - if (low($schema) == 'n') { $schema = null; } From 838af5862e97f773f72fabd8849429868a255be7 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 23 May 2009 22:56:54 -0400 Subject: [PATCH 0205/2083] Making test bail if any of the required models exist. --- .../console/libs/tasks/controller.test.php | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 3f7b017d5..cc7927952 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -51,7 +51,11 @@ array('in', 'out', 'err', 'createFile', '_stop', '_checkUnitTest') ); -if (!class_exists('Article')) { +$imported = App::import('Model', 'Article'); +$imported = $imported || App::import('Model', 'Comment'); +$imported = $imported || App::import('Model', 'Tag'); + +if (!$imported) { define('ARTICLE_MODEL_CREATED', true); App::import('Core', 'Model'); @@ -241,7 +245,8 @@ function testBake() { * @return void **/ function testBakeActionsUsingSessions() { - $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Testing bakeActions requires Article Model to be undefined. %s'); + $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), + 'Testing bakeActions requires Article, Comment & Tag Model to be undefined. %s'); if ($skip) { return; } @@ -283,7 +288,8 @@ function testBakeActionsUsingSessions() { * @return void **/ function testBakeActionsWithNoSessions() { - $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Testing bakeActions requires Article Model to be undefined. %s'); + $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), + 'Testing bakeActions requires Article, Tag, Comment Models to be undefined. %s'); if ($skip) { return; } @@ -341,7 +347,8 @@ function testInteractive() { * @return void **/ function testExecuteIntoAll() { - $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Execute into all could not be run as an Article model was already loaded. %s'); + $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), + 'Execute into all could not be run as an Article, Tag or Comment model was already loaded. %s'); if ($skip) { return; } @@ -361,7 +368,8 @@ function testExecuteIntoAll() { * @return void **/ function testExecuteWithScaffoldParam() { - $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Execute with scaffold param requires no Article model to be defined. %s'); + $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), + 'Execute with scaffold param requires no Article, Tag or Comment model to be defined. %s'); if ($skip) { return; } @@ -383,7 +391,8 @@ function testExecuteWithScaffoldParam() { * @return void **/ function testExecuteWithAdminScaffoldParams() { - $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Execute with scaffold admin param requires no Article model to be defined. %s'); + $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), + 'Execute with scaffold admin param requires no Article, Tag or Comment model to be defined. %s'); if ($skip) { return; } From 4fe3c2efe1f2216f93c570b3d6f187a1653f394f Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 23 May 2009 23:25:14 -0400 Subject: [PATCH 0206/2083] Removing ability to bake $useTable = false models. --- cake/console/libs/tasks/model.php | 2 +- cake/console/libs/templates/objects/model.ctp | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index c585d9394..3e67d6e9a 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -769,7 +769,7 @@ function getTable($modelName, $useDbConfig = null) { $tableIsGood = $this->in(__('Do you want to use this table?', true), array('y','n'), 'y'); } if (strtolower($tableIsGood) == 'n') { - $useTable = $this->in(__('What is the name of the table (enter "null" to use NO table)?', true)); + $useTable = $this->in(__('What is the name of the table?', true)); } return $useTable; } diff --git a/cake/console/libs/templates/objects/model.ctp b/cake/console/libs/templates/objects/model.ctp index 06b2ca22e..dadf31f76 100644 --- a/cake/console/libs/templates/objects/model.ctp +++ b/cake/console/libs/templates/objects/model.ctp @@ -27,11 +27,8 @@ class <?php echo $name ?> extends <?php echo $plugin; ?>AppModel { <?php if ($useDbConfig != 'default'): ?> var $useDbConfig = '<?php echo $useDbConfig; ?>'; <?php endif;?> -<?php if (($useTable && $useTable !== Inflector::tableize($name)) || $useTable === false): +<?php if ($useTable && $useTable !== Inflector::tableize($name)): $table = "'$useTable'"; - if (!$useTable): - $table = 'false'; - endif; echo "\tvar \$useTable = $table;\n"; endif; if ($primaryKey !== 'id'): ?> From dee9b6370b3df63b6e1d897f495ccff444445e08 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 23 May 2009 23:30:41 -0400 Subject: [PATCH 0207/2083] Adding test template. --- cake/console/libs/templates/objects/test.ctp | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 cake/console/libs/templates/objects/test.ctp diff --git a/cake/console/libs/templates/objects/test.ctp b/cake/console/libs/templates/objects/test.ctp new file mode 100644 index 000000000..09c161e5b --- /dev/null +++ b/cake/console/libs/templates/objects/test.ctp @@ -0,0 +1,26 @@ +<?php +/** + * Test Case bake template + * + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org + * @package cake + * @subpackage cake.console.libs.templates.objects + * @since CakePHP(tm) v 1.3 + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + */ +echo "<?php\n"; +?> +class <?php echo $name; ?>TestCase extends CakeTestCase { + +} +<?php echo '?>'; ?> \ No newline at end of file From f20a7e4f611cc304a9550ea6767fa7f0d47bd497 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 23 May 2009 23:48:25 -0400 Subject: [PATCH 0208/2083] Adding method extraction and test case. --- cake/console/libs/tasks/test.php | 20 ++++++++++ .../cases/console/libs/tasks/test.test.php | 37 ++++++++++++++++--- 2 files changed, 51 insertions(+), 6 deletions(-) diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 879e80349..c45f75fde 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -200,6 +200,26 @@ function __extras($class) { return $extras; } +/** + * Get methods declared in the class given. + * No parent methods will be returned + * + * @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)); + $thisMethods = array_diff($classMethods, $parentMethods); + $out = array(); + foreach ($thisMethods as $method) { + if (substr($method, 0, 1) != '_') { + $out[] = $method; + } + } + return $out; + } + /** * Create a test for a Model object. * diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index c8835cfcb..b131a604b 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -42,13 +42,25 @@ } Mock::generatePartial( - 'ShellDispatcher', 'TestTestTaskMockShellDispatcher', - array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment') - ); + 'ShellDispatcher', 'TestTestTaskMockShellDispatcher', + array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment') +); Mock::generatePartial( - 'TestTask', 'MockTestTask', - array('in', 'out', 'createFile') - ); + 'TestTask', 'MockTestTask', + array('in', 'out', 'createFile') +); + +class TestTaskSubjectClass extends Object { + function methodOne() { + + } + function methodTwo() { + + } + function _noTest() { + + } +} /** * TestTaskTest class * @@ -96,5 +108,18 @@ function testFilePathGeneration () { $this->Task->expectAt(1, 'createFile', array($file, '*')); $this->Task->bake('Model', 'MyClass'); } + +/** + * Test that method introspection pulls all relevant non parent class + * methods into the test case. + * + * @return void + **/ + function testMethodIntrospection() { + $result = $this->Task->getTestableMethods('TestTaskSubjectClass'); + $expected = array('methodOne', 'methodTwo'); + $this->assertEqual($result, $expected); + + } } ?> \ No newline at end of file From 61191d88cd46fc0c3afdbb42aecdfac422bddab3 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 24 May 2009 01:15:31 -0400 Subject: [PATCH 0209/2083] Adding test cases and ability to pull all fixtures for a model. --- cake/console/libs/tasks/test.php | 57 +++++++++++++ .../cases/console/libs/tasks/test.test.php | 84 +++++++++++++++++-- 2 files changed, 132 insertions(+), 9 deletions(-) diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index c45f75fde..3039dec9b 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -220,6 +220,63 @@ function getTestableMethods($className) { return $out; } +/** + * Generate the list of fixtures that will be required to run this test based on + * loaded models. + * + * @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')) { + $this->_processModel($subject); + } elseif (is_a($subject, 'Controller')) { + $this->_processController($subject); + } + return array_values($this->_fixtures); + } + +/** + * Process a model recursively and pull out all the + * model names converting them to fixture names. + * + * @return void + **/ + function _processModel(&$subject) { + $this->_addFixture($subject->name); + $associated = $subject->getAssociated(); + foreach ($associated as $alias => $type) { + $className = $subject->{$alias}->name; + if (!isset($this->_fixtures[$className])) { + $this->_processModel($subject->{$alias}); + } + if ($type == 'hasAndBelongsToMany') { + $joinModel = Inflector::classify($subject->hasAndBelongsToMany[$alias]['joinTable']); + if (!isset($this->_fixtures[$joinModel])) { + $this->_processModel($subject->{$joinModel}); + } + } + } + } + +/** + * Add classname to the fixture list. + * Sets the app. or plugin.plugin_name. prefix. + * + * @return void + **/ + function _addFixture($name) { + $parent = get_parent_class($name); + $prefix = 'app.'; + if (strtolower($parent) != 'appmodel' && strtolower(substr($parent, -8)) == 'appmodel') { + $pluginName = substr($parent, 0, strlen($parent) -8); + $prefix = 'plugin.' . Inflector::underscore($pluginName) . '.'; + } + $fixture = $prefix . Inflector::underscore($name); + $this->_fixtures[$name] = $fixture; + } + /** * Create a test for a Model object. * diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index b131a604b..d1a3f0e38 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -49,18 +49,66 @@ 'TestTask', 'MockTestTask', array('in', 'out', 'createFile') ); - +/** + * Test subject for method extraction + * + **/ class TestTaskSubjectClass extends Object { - function methodOne() { - - } - function methodTwo() { - - } - function _noTest() { + function methodOne() { } + function methodTwo() { } + function _noTest() { } +} - } +/** + * Test subject models for fixture generation + **/ +class TestTaskArticle extends Model { + var $name = 'TestTaskArticle'; + var $useTable = 'articles'; + var $hasMany = array( + 'Comment' => array( + 'className' => 'TestTask.TestTaskComment', + 'foreignKey' => 'article_id', + ) + ); + var $hasAndBelongsToMany = array( + 'Tag' => array( + 'className' => 'TestTaskTag', + 'joinTable' => 'articles_tags', + 'foreignKey' => 'article_id', + 'associationForeignKey' => 'tag_id' + ) + ); +} +class TestTaskTag extends Model { + var $name = 'TestTaskTag'; + var $useTable = 'tags'; + var $hasAndBelongsToMany = array( + 'Article' => array( + 'className' => 'TestTaskArticle', + 'joinTable' => 'articles_tags', + 'foreignKey' => 'tag_id', + 'associationForeignKey' => 'article_id' + ) + ); +} +/** + * Simulated Plugin + **/ +class TestTaskAppModel extends Model { + } +class TestTaskComment extends TestTaskAppModel { + var $name = 'TestTaskComment'; + var $useTable = 'comments'; + var $belongsTo = array( + 'Article' => array( + 'className' => 'TestTaskArticle', + 'foreignKey' => 'article_id', + ) + ); +} + /** * TestTaskTest class * @@ -68,6 +116,8 @@ function _noTest() { * @subpackage cake.tests.cases.console.libs.tasks */ class TestTaskTest extends CakeTestCase { + + var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag'); /** * setUp method * @@ -79,6 +129,7 @@ function setUp() { $this->Task =& new MockTestTask($this->Dispatcher); $this->Task->Dispatch = new $this->Dispatcher; } + /** * tearDown method * @@ -88,6 +139,7 @@ function setUp() { function tearDown() { ClassRegistry::flush(); } + /** * Test that file path generation doesn't continuously append paths. * @@ -119,6 +171,20 @@ function testMethodIntrospection() { $result = $this->Task->getTestableMethods('TestTaskSubjectClass'); $expected = array('methodOne', 'methodTwo'); $this->assertEqual($result, $expected); + } + +/** + * test that the generation of fixtures works correctly. + * + * @return void + **/ + function testFixtureArrayGeneration() { + $subject = ClassRegistry::init('TestTaskArticle'); + $result = $this->Task->generateFixtureList($subject); + $expected = array('plugin.test_task.test_task_comment', 'app.articles_tags', + 'app.test_task_article', 'app.test_task_tag'); + + $this->assertEqual(sort($result), sort($expected)); } } From 1d6ceffb926898e780ff3702469cb32641c93a6c Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 24 May 2009 01:30:04 -0400 Subject: [PATCH 0210/2083] Adding test case and function for generating fixture lists from controller objects. --- cake/console/libs/tasks/test.php | 20 ++++++++++++++-- .../cases/console/libs/tasks/test.test.php | 24 ++++++++++++++++++- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 3039dec9b..81609be98 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -221,7 +221,7 @@ function getTestableMethods($className) { } /** - * Generate the list of fixtures that will be required to run this test based on + * Generate the list of fixtures that will be required to run this test based on * loaded models. * * @param object The object you want to generate fixtures for. @@ -238,7 +238,7 @@ function generateFixtureList(&$subject) { } /** - * Process a model recursively and pull out all the + * Process a model recursively and pull out all the * model names converting them to fixture names. * * @return void @@ -260,6 +260,22 @@ function _processModel(&$subject) { } } +/** + * Process all the models attached to a controller + * and generate a fixture list. + * + * @return void + **/ + function _processController(&$subject) { + $subject->constructClasses(); + $models = array(Inflector::classify($subject->name)); + if (!empty($subject->uses)) { + $models = $subject->uses; + } + foreach ($models as $model) { + $this->_processModel($subject->{$model}); + } + } /** * Add classname to the fixture list. * Sets the app. or plugin.plugin_name. prefix. diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index d1a3f0e38..774312756 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -25,6 +25,7 @@ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ App::import('Core', 'Shell'); +App::import('Core', array('Controller', 'Model')); if (!defined('DISABLE_AUTO_DISPATCH')) { define('DISABLE_AUTO_DISPATCH', true); @@ -49,6 +50,7 @@ 'TestTask', 'MockTestTask', array('in', 'out', 'createFile') ); + /** * Test subject for method extraction * @@ -109,6 +111,11 @@ class TestTaskComment extends TestTaskAppModel { ); } +class TestTaskCommentsController extends Controller { + var $name = 'TestTaskComments'; + var $uses = array('TestTaskComment', 'TestTaskTag'); +} + /** * TestTaskTest class * @@ -178,7 +185,7 @@ function testMethodIntrospection() { * * @return void **/ - function testFixtureArrayGeneration() { + function testFixtureArrayGenerationFromModel() { $subject = ClassRegistry::init('TestTaskArticle'); $result = $this->Task->generateFixtureList($subject); $expected = array('plugin.test_task.test_task_comment', 'app.articles_tags', @@ -187,5 +194,20 @@ function testFixtureArrayGeneration() { $this->assertEqual(sort($result), sort($expected)); } + +/** + * test that the generation of fixtures works correctly. + * + * @return void + **/ + function testFixtureArrayGenerationFromController() { + $subject = new TestTaskCommentsController(); + $result = $this->Task->generateFixtureList($subject); + $expected = array('plugin.test_task.test_task_comment', 'app.articles_tags', + 'app.test_task_article', 'app.test_task_tag'); + + $this->assertEqual(sort($result), sort($expected)); + + } } ?> \ No newline at end of file From eb9f40c6f4faea75522b291f8e9c2085112d9535 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 24 May 2009 20:12:17 -0400 Subject: [PATCH 0211/2083] extracting out object type interaction. test case added. --- cake/console/libs/tasks/test.php | 71 +++++++++++++------ .../cases/console/libs/tasks/test.test.php | 17 ++++- 2 files changed, 63 insertions(+), 25 deletions(-) diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 81609be98..2c530f2b6 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -45,6 +45,14 @@ class TestTask extends Shell { * @access public */ var $path = TESTS; + +/** + * class types that methods can be generated for + * + * @var array + **/ + var $classTypes = array('Model', 'Controller', 'Component', 'Behavior', 'Helper'); + /** * Execution method always used for tasks * @@ -66,40 +74,31 @@ function execute() { } } } + /** * Handles interactive baking * * @access private */ - function __interactive($class = null) { + function __interactive($type = null) { $this->hr(); - $this->out(sprintf("Bake Tests\nPath: %s", $this->path)); + $this->out(__('Bake Tests', true)); + $this->out(sprintf(__("Path: %s", true), $this->path)); $this->hr(); - $key = null; - $options = array('Behavior', 'Helper', 'Component', 'Model', 'Controller'); - - if ($class !== null) { - $class = Inflector::camelize($class); - if (in_array($class, $options)) { - $key = array_search($class); + $selection = null; + if ($type) { + $type = Inflector::camelize($type); + if (in_array($type, $this->classTypes)) { + $selection = array_search($type); } } + if (!$selection) { + $selection = $this->getObjectType(); + } + /* - while ($class == null) { - $cases = array(); - $this->hr(); - $this->out("Select a class:"); - $this->hr(); - - $keys = array(); - foreach ($options as $key => $option) { - $this->out(++$key . '. ' . $option); - $keys[] = $key; - } - $keys[] = 'q'; - - $key = $this->in(__("Enter the class to test or (q)uit", true), $keys, 'q'); + $key = $this->in(__("Enter the class to bake a test for or (q)uit", true), $keys, 'q'); if ($key != 'q') { if (isset($options[--$key])) { @@ -127,7 +126,32 @@ function __interactive($class = null) { $this->_stop(); } } + */ } + +/** + * Interact with the user and get their chosen type. Can exit the script. + * + * @return int Index of users chosen object type. + **/ + function getObjectType() { + $this->hr(); + $this->out(__("Select an object type:", true)); + $this->hr(); + + $keys = array(); + foreach ($this->classTypes as $key => $option) { + $this->out(++$key . '. ' . $option); + $keys[] = $key; + } + $keys[] = 'q'; + $selection = $this->in(__("Enter the type of object to bake a test for or (q)uit", true), $keys, 'q'); + if ($selection == 'q') { + $this->_stop(); + } + return $selection; + } + /** * Writes File * @@ -276,6 +300,7 @@ function _processController(&$subject) { $this->_processModel($subject->{$model}); } } + /** * Add classname to the fixture list. * Sets the app. or plugin.plugin_name. prefix. diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index 774312756..2124c54bb 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -48,7 +48,7 @@ ); Mock::generatePartial( 'TestTask', 'MockTestTask', - array('in', 'out', 'createFile') + array('in', '_stop', 'err', 'out', 'createFile') ); /** @@ -192,7 +192,6 @@ function testFixtureArrayGenerationFromModel() { 'app.test_task_article', 'app.test_task_tag'); $this->assertEqual(sort($result), sort($expected)); - } /** @@ -207,7 +206,21 @@ function testFixtureArrayGenerationFromController() { 'app.test_task_article', 'app.test_task_tag'); $this->assertEqual(sort($result), sort($expected)); + } +/** + * test user interaction to get object type + * + * @return void + **/ + function testGetObjectType() { + $this->Task->expectOnce('_stop'); + $this->Task->setReturnValueAt(0, 'in', 'q'); + $this->Task->getObjectType(); + + $this->Task->setReturnValueAt(1, 'in', 2); + $result = $this->Task->getObjectType(); + $this->assertEqual($result, 2); } } ?> \ No newline at end of file From 587b0ca07d3e6fe0e71a25eff4abdd750d2e7831 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 24 May 2009 23:50:21 -0400 Subject: [PATCH 0212/2083] Test generation for models is partially complete. fixtures and introspected methods work. --- cake/console/libs/tasks/test.php | 259 +++++++++++++----- cake/console/libs/templates/objects/test.ctp | 15 +- .../cases/console/libs/tasks/test.test.php | 109 ++++++-- 3 files changed, 292 insertions(+), 91 deletions(-) diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 2c530f2b6..a52020968 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -46,6 +46,13 @@ class TestTask extends Shell { */ var $path = TESTS; +/** + * Tasks used. + * + * @var array + **/ + var $tasks = array('Template'); + /** * class types that methods can be generated for * @@ -53,6 +60,20 @@ class TestTask extends Shell { **/ 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; + /** * Execution method always used for tasks * @@ -68,8 +89,8 @@ function execute() { } if (count($this->args) > 1) { - $class = Inflector::underscore($this->args[0]); - if ($this->bake($class, $this->args[1])) { + $type = Inflector::underscore($this->args[0]); + if ($this->bake($type, $this->args[1])) { $this->out('done'); } } @@ -81,6 +102,7 @@ function execute() { * @access private */ function __interactive($type = null) { + $this->interactive = true; $this->hr(); $this->out(__('Bake Tests', true)); $this->out(sprintf(__("Path: %s", true), $this->path)); @@ -89,75 +111,54 @@ function __interactive($type = null) { $selection = null; if ($type) { $type = Inflector::camelize($type); - if (in_array($type, $this->classTypes)) { - $selection = array_search($type); + if (!in_array($type, $this->classTypes)) { + unset($type); } } - if (!$selection) { - $selection = $this->getObjectType(); - } - /* - - $key = $this->in(__("Enter the class to bake a test for or (q)uit", true), $keys, 'q'); - - if ($key != 'q') { - if (isset($options[--$key])) { - $class = $options[$key]; - } - - if ($class) { - $name = $this->in(__("Enter the name for the test or (q)uit", true), null, 'q'); - if ($name !== 'q') { - $case = null; - while ($case !== 'q') { - $case = $this->in(__("Enter a test case or (q)uit", true), null, 'q'); - if ($case !== 'q') { - $cases[] = $case; - } - } - if ($this->bake($class, $name, $cases)) { - $this->out(__("Test baked\n", true)); - $type = null; - } - $class = null; - } - } - } else { - $this->_stop(); - } + if (!$type) { + $type = $this->getObjectType(); } - */ + $className = $this->getClassName($type); + return $this->bake($type, $className); } /** - * Interact with the user and get their chosen type. Can exit the script. + * Completes final steps for generating data to create test case. * - * @return int Index of users chosen object type. - **/ - function getObjectType() { - $this->hr(); - $this->out(__("Select an object type:", true)); - $this->hr(); + * @param string $type Type of object to bake test case for ie. Model, Controller + * @param string $className the 'cake name' for the class ie. Posts for the PostsController + * @access public + */ + function bake($type, $className) { + if ($this->typeCanDetectFixtures($type) && $this->isLoadableClass($type, $className)) { + $this->out(__('Bake is detecting possible fixtures..', true)); + $testSubject =& $this->buildTestSubject($type, $className); + $this->generateFixtureList($testSubject); + } elseif ($this->interactive) { + $this->getUserFixtures(); + } + $fullClassName = $this->getRealClassName($type, $className); - $keys = array(); - foreach ($this->classTypes as $key => $option) { - $this->out(++$key . '. ' . $option); - $keys[] = $key; + $methods = array(); + if (class_exists($fullClassName)) { + $methods = $this->getTestableMethods($fullClassName); } - $keys[] = 'q'; - $selection = $this->in(__("Enter the type of object to bake a test for or (q)uit", true), $keys, 'q'); - if ($selection == 'q') { - $this->_stop(); + + $this->Template->set('fixtures', $this->_fixtures); + $this->Template->set('plugin', $this->plugin); + $this->Template->set(compact('className', 'methods', 'type', 'fullClassName')); + $out = $this->Template->generate('objects', 'test'); + + if (strpos($this->path, $type) === false) { + $this->filePath = $this->path . 'cases' . DS . Inflector::tableize($type) . DS; } - return $selection; - } + $made = $this->createFile($this->filePath . Inflector::underscore($className) . '.test.php', $out); + if ($made) { + return $out; + } + return false; -/** - * Writes File - * - * @access public - */ - function bake($class, $name = null, $cases = array()) { + /* if (!$name) { return false; } @@ -205,23 +206,102 @@ function bake($class, $name = null, $cases = array()) { } $header = '$Id'; - $content = "<?php \n/* SVN FILE: $header$ */\n/* ". $name ." Test cases generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n{$out}?>"; + $content = "<?php \n/* SVN FILE: $header$ * /\n/* ". $name ." Test cases generated on: " . date('Y-m-d H:m:s') . " : ". time() . "* /\n{$out}?>"; return $this->createFile($this->filePath . Inflector::underscore($name) . '.test.php', $content); + */ } + /** - * Handles the extra stuff needed + * Interact with the user and get their chosen type. Can exit the script. * - * @access private - */ - function __extras($class) { - $extras = null; - switch ($class) { - case 'Model': - $extras = "\n\tvar \$cacheSources = false;"; - $extras .= "\n\tvar \$useDbConfig = 'test_suite';\n"; - break; + * @return string Users chosen type. + **/ + function getObjectType() { + $this->hr(); + $this->out(__("Select an object type:", true)); + $this->hr(); + + $keys = array(); + foreach ($this->classTypes as $key => $option) { + $this->out(++$key . '. ' . $option); + $keys[] = $key; } - return $extras; + $keys[] = 'q'; + $selection = $this->in(__("Enter the type of object to bake a test for or (q)uit", true), $keys, 'q'); + if ($selection == 'q') { + return $this->_stop(); + } + return $this->classTypes[$selection - 1]; + } + +/** + * Get the user chosen Class name for the chosen type + * + * @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 = Configure::listObjects(strtolower($objectType)); + $this->out(sprintf(__('Choose a %s class', true), $objectType)); + $keys = array(); + foreach ($options as $key => $option) { + $this->out(++$key . '. ' . $option); + $keys[] = $key; + } + $selection = $this->in(__('Choose an existing class, or enter the name of a class that does not exist', true)); + if (isset($options[$selection - 1])) { + return $options[$selection - 1]; + } + return $selection; + } + +/** + * Checks whether the chosen type can find its own fixtures. + * Currently only model, and controller are supported + * + * @return boolean + **/ + function typeCanDetectFixtures($type) { + $type = strtolower($type); + return ($type == 'controller' || $type == 'model'); + } + +/** + * 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); + } + +/** + * Construct an instance of the class to be tested. + * So that fixtures and methods can be detected + * + * @return object + **/ + function &buildTestSubject($type, $class) { + App::import($type, $class); + $class = $this->getRealClassName($type, $class); + if (strtolower($type) == 'model') { + $instance =& ClassRegistry::init($class); + } else { + $instance =& new $class(); + } + return $instance; + } + +/** + * Gets the real class name from the cake short form. + * + * @return string Real classname + **/ + function getRealClassName($type, $class) { + if (strtolower($type) == 'model') { + return $class; + } + return $class . $type; } /** @@ -266,6 +346,7 @@ function generateFixtureList(&$subject) { * model names converting them to fixture names. * * @return void + * @access protected **/ function _processModel(&$subject) { $this->_addFixture($subject->name); @@ -289,6 +370,7 @@ function _processModel(&$subject) { * and generate a fixture list. * * @return void + * @access protected **/ function _processController(&$subject) { $subject->constructClasses(); @@ -306,6 +388,7 @@ function _processController(&$subject) { * Sets the app. or plugin.plugin_name. prefix. * * @return void + * @access protected **/ function _addFixture($name) { $parent = get_parent_class($name); @@ -318,6 +401,38 @@ function _addFixture($name) { $this->_fixtures[$name] = $fixture; } +/** + * 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(); + if (strtolower($proceed) == 'y') { + $fixtureList = $this->in(__("Please provide a comma separated list of the fixtures names you'd like to use.\nExample: 'app.comment, app.post, plugin.forums.post'", true)); + $fixtureListTrimmed = str_replace(' ', '', $fixtureList); + $fixtures = explode(',', $fixtureListTrimmed); + } + $this->_fixtures = array_merge($this->_fixtures, $fixtures); + return $fixtures; + } + +/** + * Handles the extra stuff needed + * + * @access private + */ + function __extras($class) { + $extras = null; + switch ($class) { + case 'Model': + $extras = "\n\tvar \$cacheSources = false;"; + $extras .= "\n\tvar \$useDbConfig = 'test_suite';\n"; + break; + } + return $extras; + } /** * Create a test for a Model object. * diff --git a/cake/console/libs/templates/objects/test.ctp b/cake/console/libs/templates/objects/test.ctp index 09c161e5b..8300c5356 100644 --- a/cake/console/libs/templates/objects/test.ctp +++ b/cake/console/libs/templates/objects/test.ctp @@ -20,7 +20,18 @@ */ echo "<?php\n"; ?> -class <?php echo $name; ?>TestCase extends CakeTestCase { - +App::import('<?php echo $type; ?>', '<?php echo $className;?>'); + +class <?php echo $className; ?>TestCase extends CakeTestCase { +<?php if (!empty($fixtures)): ?> + var $fixtures = array('<?php echo join("', '", $fixtures); ?>'); + +<?php endif; ?> +<?php foreach ($methods as $method): ?> + function test<?php echo Inflector::classify($method); ?>() { + + } + +<?php endforeach;?> } <?php echo '?>'; ?> \ No newline at end of file diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index 2124c54bb..59e947805 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -40,6 +40,7 @@ if (!class_exists('TestTask')) { require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'test.php'; + require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php'; } Mock::generatePartial( @@ -48,19 +49,9 @@ ); Mock::generatePartial( 'TestTask', 'MockTestTask', - array('in', '_stop', 'err', 'out', 'createFile') + array('in', '_stop', 'err', 'out', 'createFile', 'isLoadableClass') ); -/** - * Test subject for method extraction - * - **/ -class TestTaskSubjectClass extends Object { - function methodOne() { } - function methodTwo() { } - function _noTest() { } -} - /** * Test subject models for fixture generation **/ @@ -81,6 +72,15 @@ class TestTaskArticle extends Model { 'associationForeignKey' => 'tag_id' ) ); + function doSomething() { + + } + function doSomethingElse() { + + } + function _innerMethod() { + + } } class TestTaskTag extends Model { var $name = 'TestTaskTag'; @@ -131,10 +131,12 @@ class TestTaskTest extends CakeTestCase { * @return void * @access public */ - function setUp() { + function startTest() { $this->Dispatcher =& new TestTestTaskMockShellDispatcher(); + $this->Dispatcher->shellPaths = Configure::read('shellPaths'); $this->Task =& new MockTestTask($this->Dispatcher); - $this->Task->Dispatch = new $this->Dispatcher; + $this->Task->Dispatch =& $this->Dispatcher; + $this->Task->Template =& new TemplateTask($this->Dispatcher); } /** @@ -143,7 +145,7 @@ function setUp() { * @return void * @access public */ - function tearDown() { + function endTest() { ClassRegistry::flush(); } @@ -175,8 +177,8 @@ function testFilePathGeneration () { * @return void **/ function testMethodIntrospection() { - $result = $this->Task->getTestableMethods('TestTaskSubjectClass'); - $expected = array('methodOne', 'methodTwo'); + $result = $this->Task->getTestableMethods('TestTaskArticle'); + $expected = array('doSomething', 'doSomethingElse'); $this->assertEqual($result, $expected); } @@ -220,7 +222,80 @@ function testGetObjectType() { $this->Task->setReturnValueAt(1, 'in', 2); $result = $this->Task->getObjectType(); - $this->assertEqual($result, 2); + $this->assertEqual($result, $this->Task->classTypes[1]); + } + +/** + * test that getClassName returns the user choice as a classname. + * + * @return void + **/ + function testGetClassName() { + $this->Task->setReturnValueAt(0, 'in', 'MyCustomClass'); + $result = $this->Task->getClassName('Model'); + $this->assertEqual($result, 'MyCustomClass'); + + $this->Task->setReturnValueAt(1, 'in', 1); + $result = $this->Task->getClassName('Model'); + $options = Configure::listObjects('model'); + $this->assertEqual($result, $options[0]); + } + +/** + * Test the user interaction for defining additional fixtures. + * + * @return void + **/ + function testGetUserFixtures() { + $this->Task->setReturnValueAt(0, 'in', 'y'); + $this->Task->setReturnValueAt(1, 'in', 'app.pizza, app.topping, app.side_dish'); + $result = $this->Task->getUserFixtures(); + $expected = array('app.pizza', 'app.topping', 'app.side_dish'); + $this->assertEqual($result, $expected); + } + +/** + * test that resolving classnames works + * + * @return void + **/ + function testGetRealClassname() { + $result = $this->Task->getRealClassname('Model', 'Post'); + $this->assertEqual($result, 'Post'); + + $result = $this->Task->getRealClassname('Controller', 'Posts'); + $this->assertEqual($result, 'PostsController'); + + $result = $this->Task->getRealClassname('Helper', 'Form'); + $this->assertEqual($result, 'FormHelper'); + + $result = $this->Task->getRealClassname('Behavior', 'Containable'); + $this->assertEqual($result, 'ContainableBehavior'); + + $result = $this->Task->getRealClassname('Component', 'Auth'); + $this->assertEqual($result, 'AuthComponent'); + } + +/** + * test baking files. + * + * @return void + **/ + function testBake() { + $this->Task->setReturnValue('createFile', true); + $this->Task->setReturnValue('isLoadableClass', true); + + $result = $this->Task->bake('Model', 'TestTaskArticle'); + + $this->assertPattern('/App::import\(\'Model\', \'TestTaskArticle\'\)/', $result); + $this->assertPattern('/class TestTaskArticleTestCase extends CakeTestCase/', $result); + $this->assertPattern('/function testDoSomething\(\)/', $result); + $this->assertPattern('/function testDoSomethingElse\(\)/', $result); + + $this->assertPattern("/'app\.test_task_article'/", $result); + $this->assertPattern("/'plugin\.test_task\.test_task_comment'/", $result); + $this->assertPattern("/'app\.test_task_tag'/", $result); + $this->assertPattern("/'app\.articles_tag'/", $result); } } ?> \ No newline at end of file From 975aab8009d0f2bf63a17ae837b40c3d37607296 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 25 May 2009 00:54:23 -0400 Subject: [PATCH 0213/2083] Fixing plugin imports Adding contstructor generation. and test case for controller construction. --- cake/console/libs/tasks/test.php | 91 ++++++++----------- cake/console/libs/templates/objects/test.ctp | 16 +++- .../cases/console/libs/tasks/test.test.php | 18 ++++ 3 files changed, 68 insertions(+), 57 deletions(-) diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index a52020968..ae50b9da7 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -143,10 +143,17 @@ function bake($type, $className) { if (class_exists($fullClassName)) { $methods = $this->getTestableMethods($fullClassName); } + $mock = $this->generateMockClass($type, $fullClassName); + $construction = $this->generateConstructor($type, $fullClassName); + + $plugin = null; + if ($this->plugin) { + $plugin = $this->plugin . '.'; + } $this->Template->set('fixtures', $this->_fixtures); - $this->Template->set('plugin', $this->plugin); - $this->Template->set(compact('className', 'methods', 'type', 'fullClassName')); + $this->Template->set('plugin', $plugin); + $this->Template->set(compact('className', 'methods', 'type', 'fullClassName', 'mock', 'construction')); $out = $this->Template->generate('objects', 'test'); if (strpos($this->path, $type) === false) { @@ -157,58 +164,6 @@ function bake($type, $className) { return $out; } return false; - - /* - if (!$name) { - return false; - } - - if (!is_array($cases)) { - $cases = array($cases); - } - - if (strpos($this->path, $class) === false) { - $this->filePath = $this->path . 'cases' . DS . Inflector::tableize($class) . DS; - } - - $class = Inflector::classify($class); - $name = Inflector::classify($name); - - $import = $name; - if (isset($this->plugin)) { - $import = $this->plugin . '.' . $name; - } - $extras = $this->__extras($class); - $out = "App::import('$class', '$import');\n"; - if ($class == 'Model') { - $class = null; - } - $out .= "class Test{$name} extends {$name}{$class} {\n"; - $out .= "{$extras}"; - $out .= "}\n\n"; - $out .= "class {$name}{$class}Test extends CakeTestCase {\n"; - $out .= "\n\tfunction startTest() {"; - $out .= "\n\t\t\$this->{$name} = new Test{$name}();"; - $out .= "\n\t}\n"; - $out .= "\n\tfunction test{$name}Instance() {\n"; - $out .= "\t\t\$this->assertTrue(is_a(\$this->{$name}, '{$name}{$class}'));\n\t}\n"; - foreach ($cases as $case) { - $case = Inflector::classify($case); - $out .= "\n\tfunction test{$case}() {\n\n\t}\n"; - } - $out .= "}\n"; - - $this->out("Baking unit test for $name..."); - $this->out($out); - $ok = $this->in(__('Is this correct?', true), array('y', 'n'), 'y'); - if ($ok == 'n') { - return false; - } - - $header = '$Id'; - $content = "<?php \n/* SVN FILE: $header$ * /\n/* ". $name ." Test cases generated on: " . date('Y-m-d H:m:s') . " : ". time() . "* /\n{$out}?>"; - return $this->createFile($this->filePath . Inflector::underscore($name) . '.test.php', $content); - */ } /** @@ -277,7 +232,7 @@ function isLoadableClass($type, $class) { /** * Construct an instance of the class to be tested. - * So that fixtures and methods can be detected + * So that fixtures can be detected * * @return object **/ @@ -418,6 +373,31 @@ function getUserFixtures() { return $fixtures; } +/** + * Generate a stub class or mock as needed. + * + * @return void + **/ + function generateMockClass($type, $class) { + return ''; + } + +/** + * 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') { + return "ClassRegistry::init('$fullClassName');"; + } + if ($type == 'controller') { + return "new Test$fullClassName();\n\t\t\$this->{$fullClassName}->constructClasses();"; + } + return "new $fullClassName"; + } + /** * Handles the extra stuff needed * @@ -433,6 +413,7 @@ function __extras($class) { } return $extras; } + /** * Create a test for a Model object. * diff --git a/cake/console/libs/templates/objects/test.ctp b/cake/console/libs/templates/objects/test.ctp index 8300c5356..c1b3cc76d 100644 --- a/cake/console/libs/templates/objects/test.ctp +++ b/cake/console/libs/templates/objects/test.ctp @@ -19,14 +19,26 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ echo "<?php\n"; +echo "/* ". $className ." Test cases generated on: " . date('Y-m-d H:m:s') . " : ". time() . "* /" ?> -App::import('<?php echo $type; ?>', '<?php echo $className;?>'); +App::import('<?php echo $type; ?>', '<?php echo $plugin . $className;?>'); -class <?php echo $className; ?>TestCase extends CakeTestCase { +<?php echo $mock; ?> + +class <?php echo $fullClassName; ?>TestCase extends CakeTestCase { <?php if (!empty($fixtures)): ?> var $fixtures = array('<?php echo join("', '", $fixtures); ?>'); <?php endif; ?> + function startTest() { + $this-><?php echo $className . ' =& ' . $construction; ?> + } + + function endTest() { + unset($this-><?php echo $className;?>); + ClassRegistry::flush(); + } + <?php foreach ($methods as $method): ?> function test<?php echo Inflector::classify($method); ?>() { diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index 59e947805..3a86100cc 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -289,6 +289,13 @@ function testBake() { $this->assertPattern('/App::import\(\'Model\', \'TestTaskArticle\'\)/', $result); $this->assertPattern('/class TestTaskArticleTestCase extends CakeTestCase/', $result); + + $this->assertPattern('/function startTest\(\)/', $result); + $this->assertPattern("/\\\$this->TestTaskArticle \=\& ClassRegistry::init\('TestTaskArticle'\)/", $result); + + $this->assertPattern('/function endTest\(\)/', $result); + $this->assertPattern('/unset\(\$this->TestTaskArticle\)/', $result); + $this->assertPattern('/function testDoSomething\(\)/', $result); $this->assertPattern('/function testDoSomethingElse\(\)/', $result); @@ -297,5 +304,16 @@ function testBake() { $this->assertPattern("/'app\.test_task_tag'/", $result); $this->assertPattern("/'app\.articles_tag'/", $result); } + +/** + * test Constructor generation ensure that constructClasses is called for controllers + * + * @return void + **/ + function testGenerateContsructor() { + $result = $this->Task->generateConstructor('controller', 'PostsController'); + $expected = "new TestPostsController();\n\t\t\$this->PostsController->constructClasses();"; + $this->assertEqual($result, $expected); + } } ?> \ No newline at end of file From 66b36ba3b8ebb8d329c84ebf08eccdf1d12f3444 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 25 May 2009 01:02:59 -0400 Subject: [PATCH 0214/2083] Adding tests for other object types. --- cake/console/libs/tasks/test.php | 6 +++--- cake/tests/cases/console/libs/tasks/test.test.php | 10 +++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index ae50b9da7..f00ac01b5 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -390,12 +390,12 @@ function generateMockClass($type, $class) { function generateConstructor($type, $fullClassName) { $type = strtolower($type); if ($type == 'model') { - return "ClassRegistry::init('$fullClassName');"; + return "ClassRegistry::init('$fullClassName');\n"; } if ($type == 'controller') { - return "new Test$fullClassName();\n\t\t\$this->{$fullClassName}->constructClasses();"; + return "new Test$fullClassName();\n\t\t\$this->{$fullClassName}->constructClasses();\n"; } - return "new $fullClassName"; + return "new $fullClassName()\n"; } /** diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index 3a86100cc..e5e513289 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -312,7 +312,15 @@ function testBake() { **/ function testGenerateContsructor() { $result = $this->Task->generateConstructor('controller', 'PostsController'); - $expected = "new TestPostsController();\n\t\t\$this->PostsController->constructClasses();"; + $expected = "new TestPostsController();\n\t\t\$this->PostsController->constructClasses();\n"; + $this->assertEqual($result, $expected); + + $result = $this->Task->generateConstructor('model', 'Post'); + $expected = "ClassRegistry::init('Post');\n"; + $this->assertEqual($result, $expected); + + $result = $this->Task->generateConstructor('helper', 'FormHelper'); + $expected = "new FormHelper()\n"; $this->assertEqual($result, $expected); } } From 877616ad9b229c66381bb5645954e866f520479e Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 25 May 2009 01:19:54 -0400 Subject: [PATCH 0215/2083] Fixing broken comment. --- cake/console/libs/templates/objects/test.ctp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/console/libs/templates/objects/test.ctp b/cake/console/libs/templates/objects/test.ctp index c1b3cc76d..e06a44eaf 100644 --- a/cake/console/libs/templates/objects/test.ctp +++ b/cake/console/libs/templates/objects/test.ctp @@ -19,7 +19,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ echo "<?php\n"; -echo "/* ". $className ." Test cases generated on: " . date('Y-m-d H:m:s') . " : ". time() . "* /" +echo "/* ". $className ." Test cases generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n"; ?> App::import('<?php echo $type; ?>', '<?php echo $plugin . $className;?>'); From 518c318887485291c54e9c1de9f33dcc22c48321 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 25 May 2009 23:48:41 -0400 Subject: [PATCH 0216/2083] Adding tests and code for controller stub generation. --- cake/console/libs/tasks/test.php | 12 +++--- cake/console/libs/templates/objects/test.ctp | 10 ++++- .../cases/console/libs/tasks/test.test.php | 42 ++++++++++++++++++- 3 files changed, 57 insertions(+), 7 deletions(-) diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index f00ac01b5..718eff603 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -143,7 +143,7 @@ function bake($type, $className) { if (class_exists($fullClassName)) { $methods = $this->getTestableMethods($fullClassName); } - $mock = $this->generateMockClass($type, $fullClassName); + $mock = $this->hasMockClass($type, $fullClassName); $construction = $this->generateConstructor($type, $fullClassName); $plugin = null; @@ -374,12 +374,14 @@ function getUserFixtures() { } /** - * Generate a stub class or mock as needed. + * Is a mock class required for this type of test? + * Controllers require a mock class. * - * @return void + * @return boolean **/ - function generateMockClass($type, $class) { - return ''; + function hasMockClass($type) { + $type = strtolower($type); + return $type == 'controller'; } /** diff --git a/cake/console/libs/templates/objects/test.ctp b/cake/console/libs/templates/objects/test.ctp index e06a44eaf..b19b89793 100644 --- a/cake/console/libs/templates/objects/test.ctp +++ b/cake/console/libs/templates/objects/test.ctp @@ -23,8 +23,16 @@ echo "/* ". $className ." Test cases generated on: " . date('Y-m-d H:m:s') . " : ?> App::import('<?php echo $type; ?>', '<?php echo $plugin . $className;?>'); -<?php echo $mock; ?> +<?php if ($mock and strtolower($type) == 'controller'): ?> +class Test<?php echo $fullClassName; ?> extends <?php echo $fullClassName; ?> { + var $autoRender = false; + function redirect($url, $status = null, $exit = true) { + $this->redirectUrl = $url; + } +} + +<?php endif; ?> class <?php echo $fullClassName; ?>TestCase extends CakeTestCase { <?php if (!empty($fixtures)): ?> var $fixtures = array('<?php echo join("', '", $fixtures); ?>'); diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index e5e513289..735cb7082 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -281,7 +281,7 @@ function testGetRealClassname() { * * @return void **/ - function testBake() { + function testBakeModelTest() { $this->Task->setReturnValue('createFile', true); $this->Task->setReturnValue('isLoadableClass', true); @@ -305,6 +305,36 @@ function testBake() { $this->assertPattern("/'app\.articles_tag'/", $result); } +/** + * test baking controller test files, ensure that the stub class is generated. + * + * @return void + **/ + function testBakeControllerTest() { + $this->Task->setReturnValue('createFile', true); + $this->Task->setReturnValue('isLoadableClass', true); + + $result = $this->Task->bake('Controller', 'TestTaskComments'); + + $this->assertPattern('/App::import\(\'Controller\', \'TestTaskComments\'\)/', $result); + $this->assertPattern('/class TestTaskCommentsControllerTestCase extends CakeTestCase/', $result); + + $this->assertPattern('/class TestTestTaskCommentsController extends TestTaskCommentsController/', $result); + $this->assertPattern('/var \$autoRender = false/', $result); + $this->assertPattern('/function redirect\(\$url, \$status = null, \$exit = true\)/', $result); + + $this->assertPattern('/function startTest\(\)/', $result); + $this->assertPattern("/\\\$this->TestTaskComments \=\& new TestTestTaskCommentsController()/", $result); + + $this->assertPattern('/function endTest\(\)/', $result); + $this->assertPattern('/unset\(\$this->TestTaskComments\)/', $result); + + $this->assertPattern("/'app\.test_task_article'/", $result); + $this->assertPattern("/'plugin\.test_task\.test_task_comment'/", $result); + $this->assertPattern("/'app\.test_task_tag'/", $result); + $this->assertPattern("/'app\.articles_tag'/", $result); + } + /** * test Constructor generation ensure that constructClasses is called for controllers * @@ -323,5 +353,15 @@ function testGenerateContsructor() { $expected = "new FormHelper()\n"; $this->assertEqual($result, $expected); } + +/** + * Test that mock class generation works for the appropriate classes + * + * @return void + **/ + function testMockClassGeneration() { + $result = $this->Task->hasMockClass('controller'); + $this->assertTrue($result); + } } ?> \ No newline at end of file From 79568cc74212d35a4b10d9e7d53a15c8a0cabb7d Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 25 May 2009 23:57:15 -0400 Subject: [PATCH 0217/2083] Fixing controller test file generation --- cake/console/libs/tasks/test.php | 2 +- cake/tests/cases/console/libs/tasks/test.test.php | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 718eff603..431073986 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -159,7 +159,7 @@ function bake($type, $className) { if (strpos($this->path, $type) === false) { $this->filePath = $this->path . 'cases' . DS . Inflector::tableize($type) . DS; } - $made = $this->createFile($this->filePath . Inflector::underscore($className) . '.test.php', $out); + $made = $this->createFile($this->filePath . Inflector::underscore($fullClassName) . '.test.php', $out); if ($made) { return $out; } diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index 735cb7082..d2f122a94 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -161,13 +161,16 @@ function testFilePathGeneration () { $this->Task->Dispatch->expectNever('stderr'); $this->Task->Dispatch->expectNever('_stop'); - $this->Task->setReturnValueAt(0, 'in', 'y'); + $this->Task->setReturnValue('in', 'y'); $this->Task->expectAt(0, 'createFile', array($file, '*')); $this->Task->bake('Model', 'MyClass'); - $this->Task->setReturnValueAt(1, 'in', 'y'); $this->Task->expectAt(1, 'createFile', array($file, '*')); $this->Task->bake('Model', 'MyClass'); + + $file = TESTS . 'cases' . DS . 'controllers' . DS . 'comments_controller.test.php'; + $this->Task->expectAt(2, 'createFile', array($file, '*')); + $this->Task->bake('Controller', 'Comments'); } /** From fe235f4e943b1adf693e20db91b7fe1d4e1ab325 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 26 May 2009 00:20:17 -0400 Subject: [PATCH 0218/2083] Tweaking template. --- cake/console/libs/templates/objects/model.ctp | 1 - 1 file changed, 1 deletion(-) diff --git a/cake/console/libs/templates/objects/model.ctp b/cake/console/libs/templates/objects/model.ctp index dadf31f76..849be35b3 100644 --- a/cake/console/libs/templates/objects/model.ctp +++ b/cake/console/libs/templates/objects/model.ctp @@ -21,7 +21,6 @@ */ echo "<?php\n"; ?> - class <?php echo $name ?> extends <?php echo $plugin; ?>AppModel { var $name = '<?php echo $name; ?>'; <?php if ($useDbConfig != 'default'): ?> From 2b6ea8748c330b059de849f64c613dca3ffb1996 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 26 May 2009 00:36:25 -0400 Subject: [PATCH 0219/2083] Adding flush so models in registry are always fresh fixes issues baking model + test --- cake/console/libs/tasks/test.php | 1 + .../cases/console/libs/tasks/test.test.php | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 431073986..fd0efbb12 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -237,6 +237,7 @@ function isLoadableClass($type, $class) { * @return object **/ function &buildTestSubject($type, $class) { + ClassRegistry::flush(); App::import($type, $class); $class = $this->getRealClassName($type, $class); if (strtolower($type) == 'model') { diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index d2f122a94..6646d6605 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -228,6 +228,30 @@ function testGetObjectType() { $this->assertEqual($result, $this->Task->classTypes[1]); } +/** + * creating test subjects should clear the registry so the registry is always fresh + * + * @return void + **/ + function testRegistryClearWhenBuildingTestObjects() { + ClassRegistry::flush(); + $model = ClassRegistry::init('TestTaskComment'); + $model->bindModel(array( + 'belongsTo' => array( + 'Random' => array( + 'className' => 'TestTaskArticle', + 'foreignKey' => 'article_id', + ) + ) + )); + $keys = ClassRegistry::keys(); + $this->assertTrue(in_array('random', $keys)); + $object =& $this->Task->buildTestSubject('Model', 'TestTaskComment'); + + $keys = ClassRegistry::keys(); + $this->assertFalse(in_array('random', $keys)); + } + /** * test that getClassName returns the user choice as a classname. * From b301654b968448865b78da422a4afeadd9d9be16 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 30 May 2009 00:14:57 -0400 Subject: [PATCH 0220/2083] Adding test cases for execute() --- .../cases/console/libs/tasks/test.test.php | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index 6646d6605..9dec56987 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -390,5 +390,31 @@ function testMockClassGeneration() { $result = $this->Task->hasMockClass('controller'); $this->assertTrue($result); } + +/** + * test execute with a type defined + * + * @return void + **/ + function testExecuteWithOneArg() { + $this->Task->args[0] = 'Model'; + $this->Task->setReturnValueAt(0, 'in', 'TestTaskTag'); + $this->Task->setReturnValue('isLoadableClass', true); + $this->Task->expectAt(0, 'createFile', array('*', new PatternExpectation('/class TestTaskTagTestCase extends CakeTestCase/'))); + $this->Task->execute(); + } + +/** + * test execute with type and class name defined + * + * @return void + **/ + function testExecuteWithTwoArgs() { + $this->Task->args = array('Model', 'TestTaskTag'); + $this->Task->setReturnValueAt(0, 'in', 'TestTaskTag'); + $this->Task->setReturnValue('isLoadableClass', true); + $this->Task->expectAt(0, 'createFile', array('*', new PatternExpectation('/class TestTaskTagTestCase extends CakeTestCase/'))); + $this->Task->execute(); + } } ?> \ No newline at end of file From f1821f563144d4351beb9708cac72ed4707da246 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 30 May 2009 00:28:18 -0400 Subject: [PATCH 0221/2083] Adding test case for ViewTask --- .../cases/console/libs/tasks/view.test.php | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 cake/tests/cases/console/libs/tasks/view.test.php diff --git a/cake/tests/cases/console/libs/tasks/view.test.php b/cake/tests/cases/console/libs/tasks/view.test.php new file mode 100644 index 000000000..5acf40f6e --- /dev/null +++ b/cake/tests/cases/console/libs/tasks/view.test.php @@ -0,0 +1,118 @@ +<?php +/* SVN FILE: $Id$ */ +/** + * TestTaskTest file + * + * Test Case for test generation shell task + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2006-2008, Cake Software Foundation, Inc. + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @package cake + * @subpackage cake.tests.cases.console.libs.tasks + * @since CakePHP v 1.2.0.7726 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +App::import('Core', 'Shell'); +App::import('Core', array('Controller', 'Model')); + +if (!defined('DISABLE_AUTO_DISPATCH')) { + define('DISABLE_AUTO_DISPATCH', true); +} + +if (!class_exists('ShellDispatcher')) { + ob_start(); + $argv = false; + require CAKE . 'console' . DS . 'cake.php'; + ob_end_clean(); +} + +if (!class_exists('TestTask')) { + require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'view.php'; + require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php'; +} + +Mock::generatePartial( + 'ShellDispatcher', 'TestTestTaskMockShellDispatcher', + array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment') +); +Mock::generatePartial( + 'ViewTask', 'MockViewTask', + array('in', '_stop', 'err', 'out', 'createFile') +); + +/** + * ViewTaskTest class + * + * @package cake + * @subpackage cake.tests.cases.console.libs.tasks + */ +class ViewTaskTest extends CakeTestCase { + + var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag'); +/** + * setUp method + * + * @return void + * @access public + */ + function startTest() { + $this->Dispatcher =& new TestTestTaskMockShellDispatcher(); + $this->Dispatcher->shellPaths = Configure::read('shellPaths'); + $this->Task =& new MockViewTask($this->Dispatcher); + $this->Task->Dispatch =& $this->Dispatcher; + $this->Task->Template =& new TemplateTask($this->Dispatcher); + } + +/** + * tearDown method + * + * @return void + * @access public + */ + function endTest() { + ClassRegistry::flush(); + } + +/** + * Test getContent and parsing of Templates. + * + * @return void + **/ + function testGetContent() { + $vars = array( + 'modelClass' => 'TestViewModel', + 'schema' => array(), + 'primaryKey' => 'id', + 'displayField' => 'name', + 'singularVar' => 'testViewModel', + 'pluralVar' => 'testViewModels', + 'singularHumanName' => 'Test View Model', + 'pluralHumanName' => 'Test View Models', + 'fields' => array('id', 'name', 'body'), + 'associations' => array() + ); + $result = $this->Task->getContent('view', $vars); + + $this->assertPattern('/Delete Test View Model/', $result); + $this->assertPattern('/Edit Test View Model/', $result); + $this->assertPattern('/List Test View Models/', $result); + $this->assertPattern('/New Test View Model/', $result); + + $this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'id\'\]/', $result); + $this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'name\'\]/', $result); + $this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'body\'\]/', $result); + } +} +?> \ No newline at end of file From fb2be781f2f513db8594e621597966a88164a198 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 30 May 2009 00:32:57 -0400 Subject: [PATCH 0222/2083] Refactoring to use TemplateTask --- cake/console/libs/tasks/view.php | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index b85dac809..054dd978b 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -45,7 +45,7 @@ class ViewTask extends Shell { * @var array * @access public */ - var $tasks = array('Project', 'Controller'); + var $tasks = array('Project', 'Controller', 'Template'); /** * path to VIEWS directory * @@ -175,6 +175,7 @@ function all() { } } } + /** * Handles interactive baking * @@ -353,29 +354,21 @@ function getContent($template = null, $vars = null) { $action = $template; $template = 'form'; } - $loaded = false; - foreach ($this->Dispatch->shellPaths as $path) { - $templatePath = $path . 'templates' . DS . 'views' . DS .Inflector::underscore($template).'.ctp'; - if (file_exists($templatePath) && is_file($templatePath)) { - $loaded = true; - break; - } - } if (!$vars) { $vars = $this->__loadController(); } - if ($loaded) { - extract($vars); - ob_start(); - ob_implicit_flush(0); - include($templatePath); - $content = ob_get_clean(); - return $content; + + $this->Template->set($vars); + $output = $this->Template->generate('views', $template); + + if (!empty($output)) { + return $output; } $this->hr(); $this->err(sprintf(__('Template for %s could not be found', true), $template)); return false; } + /** * Displays help contents * From 9967b10b58cb9bfb6cb7cd0c046ca45231eecd2a Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 30 May 2009 00:34:45 -0400 Subject: [PATCH 0223/2083] Removing dead options. --- cake/console/libs/tasks/view.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 054dd978b..8c5564697 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -191,25 +191,25 @@ function __interactive() { $this->controllerName = $this->Controller->getName(); - $this->controllerPath = low(Inflector::underscore($this->controllerName)); + $this->controllerPath = strtolower(Inflector::underscore($this->controllerName)); $interactive = $this->in("Would you like bake to build your views interactively?\nWarning: Choosing no will overwrite {$this->controllerName} views if it exist.", array('y','n'), 'y'); - if (low($interactive) == 'y' || low($interactive) == 'yes') { + if (strtolower($interactive) == 'y') { $this->interactive = true; $wannaDoScaffold = $this->in("Would you like to create some scaffolded views (index, add, view, edit) for this controller?\nNOTE: Before doing so, you'll need to create your controller and model classes (including associated models).", array('y','n'), 'n'); } - if (low($wannaDoScaffold) == 'y' || low($wannaDoScaffold) == 'yes') { + if (strtolower($wannaDoScaffold) == 'y') { $wannaDoAdmin = $this->in("Would you like to create the views for admin routing?", array('y','n'), 'y'); } $admin = false; - if ((low($wannaDoAdmin) == 'y' || low($wannaDoAdmin) == 'yes')) { + if (strtolower($wannaDoAdmin) == 'y') { $admin = $this->getAdmin(); } - if (low($wannaDoScaffold) == 'y' || low($wannaDoScaffold) == 'yes') { + if (strtolower($wannaDoScaffold) == 'y') { $actions = $this->scaffoldActions; if ($admin) { foreach ($actions as $action) { From 03e7ca71b6ed8ffd019ee37f7d1f31097b63f159 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 30 May 2009 00:46:25 -0400 Subject: [PATCH 0224/2083] Reformatting help() --- cake/console/libs/tasks/fixture.php | 6 +++--- cake/console/libs/tasks/view.php | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index ec1bc7240..056297041 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -338,9 +338,9 @@ function help() { $this->out("\nfixture all\n\tbakes all fixtures."); $this->out(""); $this->out('Parameters:'); - $this->out("\t-count The number of records to include in the fixture(s)."); - $this->out("\t-connection Which database configuration to use for baking."); - $this->out("\t-plugin lowercased_underscored name of plugin to bake fixtures for."); + $this->out("\t-count The number of records to include in the fixture(s)."); + $this->out("\t-connection Which database configuration to use for baking."); + $this->out("\t-plugin lowercased_underscored name of plugin to bake fixtures for."); $this->out(""); $this->_stop(); } diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 8c5564697..438818885 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -379,9 +379,19 @@ function help() { $this->out("Usage: cake bake view <arg1> <arg2>..."); $this->hr(); $this->out('Commands:'); - $this->out("\n\tview <controller>\n\t\twill read the given controller for methods\n\t\tand bake corresponding views.\n\t\tIf var scaffold is found it will bake the scaffolded actions\n\t\t(index,view,add,edit)"); - $this->out("\n\tview <controller> <action>\n\t\twill bake a template. core templates: (index, add, edit, view)"); - $this->out("\n\tview <controller> <template> <alias>\n\t\twill use the template specified but name the file based on the alias"); + $this->out(''); + $this->out("view <controller>"); + $this->out("\twill read the given controller for methods"); + $this->out("\tand bake corresponding views."); + $this->out("\tIf var scaffold is found it will bake the scaffolded actions"); + $this->out("\t(index,view,add,edit)"); + $this->out(''); + $this->out("view <controller> <action>"); + $this->out("\twill bake a template. core templates: (index, add, edit, view)"); + $this->out(''); + $this->out("view <controller> <template> <alias>"); + $this->out("\twill use the template specified"); + $this->out("\tbut name the file based on the alias"); $this->out(""); $this->_stop(); } From 4c76b2f1a84d92db532cb841ecd2d8ab3e30ce86 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 30 May 2009 00:55:44 -0400 Subject: [PATCH 0225/2083] Unifying formatting of help() messages. --- cake/console/libs/tasks/controller.php | 23 ++++++++++++++++++----- cake/console/libs/tasks/model.php | 12 +++++++++--- cake/console/libs/tasks/plugin.php | 16 ++++++++++++---- cake/console/libs/tasks/project.php | 5 ++++- 4 files changed, 43 insertions(+), 13 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 33320b4f9..856717c1b 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -442,11 +442,24 @@ function help() { $this->out("Usage: cake bake controller <arg1> <arg2>..."); $this->hr(); $this->out('Commands:'); - $this->out("\n\tcontroller <name>\n\t\tbakes controller with var \$scaffold"); - $this->out("\n\tcontroller <name> scaffold\n\t\tbakes controller with scaffold actions.\n\t\t(index, view, add, edit, delete)"); - $this->out("\n\tcontroller <name> scaffold admin\n\t\tbakes a controller with scaffold actions for both public and Configure::read('Routing.admin')"); - $this->out("\n\tcontroller <name> admin\n\t\tbakes a controller with scaffold actions only for Configure::read('Routing.admin')"); - $this->out("\n\tcontroller all\n\t\tbakes all controllers with CRUD methods."); + $this->out(''); + $this->out("controller <name>"); + $this->out("\tbakes controller with var \$scaffold"); + $this->out(''); + $this->out("controller <name> scaffold"); + $this->out("\tbakes controller with scaffold actions."); + $this->out("\t(index, view, add, edit, delete)"); + $this->out(''); + $this->out("controller <name> scaffold admin"); + $this->out("\tbakes a controller with scaffold actions for both public"); + $this->out("\tand Configure::read('Routing.admin')"); + $this->out(''); + $this->out("controller <name> admin"); + $this->out("\tbakes a controller with scaffold actions only for"); + $this->out("\tConfigure::read('Routing.admin')"); + $this->out(''); + $this->out("controller all"); + $this->out("\tbakes all controllers with CRUD methods."); $this->out(""); $this->_stop(); } diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 3e67d6e9a..4f11985f9 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -846,9 +846,15 @@ function help() { $this->out("Usage: cake bake model <arg1>"); $this->hr(); $this->out('Commands:'); - $this->out("\n\tmodel\n\t\tbakes model in interactive mode."); - $this->out("\n\tmodel <name>\n\t\tbakes model file with no associations or validation"); - $this->out("\n\tmodel all\n\t\tbakes all model files with associations and validation"); + $this->out(''); + $this->out("model"); + $this->out("\tbakes model in interactive mode."); + $this->out(''); + $this->out("model <name>"); + $this->out("\tbakes model file with no associations or validation"); + $this->out(''); + $this->out("model all"); + $this->out("\tbakes all model files with associations and validation"); $this->out(""); $this->_stop(); } diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index 1fc81374b..a5e880853 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -191,10 +191,18 @@ function help() { $this->out("Usage: cake bake plugin <arg1> <arg2>..."); $this->hr(); $this->out('Commands:'); - $this->out("\n\tplugin <name>\n\t\tbakes plugin directory structure"); - $this->out("\n\tplugin <name> model\n\t\tbakes model. Run 'cake bake model help' for more info."); - $this->out("\n\tplugin <name> controller\n\t\tbakes controller. Run 'cake bake controller help' for more info."); - $this->out("\n\tplugin <name> view\n\t\tbakes view. Run 'cake bake view help' for more info."); + $this->out(''); + $this->out("plugin <name>"); + $this->out("\tbakes plugin directory structure"); + $this->out(''); + $this->out("plugin <name> model"); + $this->out("\tbakes model. Run 'cake bake model help' for more info."); + $this->out(''); + $this->out("plugin <name> controller"); + $this->out("\tbakes controller. Run 'cake bake controller help' for more info."); + $this->out(''); + $this->out("plugin <name> view"); + $this->out("\tbakes view. Run 'cake bake view help' for more info."); $this->out(""); $this->_stop(); } diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php index 0502f8429..898bf285c 100644 --- a/cake/console/libs/tasks/project.php +++ b/cake/console/libs/tasks/project.php @@ -273,7 +273,10 @@ function help() { $this->out("Usage: cake bake project <arg1>"); $this->hr(); $this->out('Commands:'); - $this->out("\n\tproject <name>\n\t\tbakes app directory structure.\n\t\tif <name> begins with '/' path is absolute."); + $this->out(''); + $this->out("project <name>"); + $this->out("\tbakes app directory structure."); + $this->out("\tif <name> begins with '/' path is absolute."); $this->out(""); $this->_stop(); } From 5f2ee8fc4447548f4c2875b176fa1a8fa544ca1c Mon Sep 17 00:00:00 2001 From: gwoo <gwoo@cakephp.org> Date: Tue, 2 Jun 2009 14:52:30 -0700 Subject: [PATCH 0226/2083] renaming session to cake_session --- cake/libs/{session.php => cake_session.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cake/libs/{session.php => cake_session.php} (100%) diff --git a/cake/libs/session.php b/cake/libs/cake_session.php similarity index 100% rename from cake/libs/session.php rename to cake/libs/cake_session.php From 303bc0fc896722c7a9822fd234218756df69ddbb Mon Sep 17 00:00:00 2001 From: gwoo <gwoo@cakephp.org> Date: Tue, 2 Jun 2009 17:21:15 -0700 Subject: [PATCH 0227/2083] fixing up some tests. pretty much all greens for me. --- cake/libs/cake_session.php | 2 +- cake/tests/cases/dispatcher.test.php | 9 ------- cake/tests/cases/libs/cache/apc.test.php | 9 ------- cake/tests/cases/libs/cache/xcache.test.php | 9 ------- cake/tests/cases/libs/model/model.test.php | 25 ------------------- .../cases/libs/view/helpers/html.test.php | 9 ------- 6 files changed, 1 insertion(+), 62 deletions(-) diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index 263c7b76d..fe3b923b6 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -759,7 +759,7 @@ function __gc($expires = null) { $expires = time(); } - $return = $model->deleteAll(array("$alias.expires <" => $expires), false, false); + $return = $model->deleteAll(array($model->alias . ".expires <" => $expires), false, false); return $return; } } diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index 7f25a43cd..a50037de8 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -532,15 +532,6 @@ function tearDown() { Configure::write('viewPaths', $this->_viewPaths); Configure::write('debug', $this->_debug); } -/** - * tearDown method - * - * @access public - * @return void - */ - function tearDown() { - $_GET = $this->_get; - } /** * testParseParamsWithoutZerosAndEmptyPost method * diff --git a/cake/tests/cases/libs/cache/apc.test.php b/cake/tests/cases/libs/cache/apc.test.php index 5be124657..5dd30c502 100644 --- a/cake/tests/cases/libs/cache/apc.test.php +++ b/cake/tests/cases/libs/cache/apc.test.php @@ -68,15 +68,6 @@ function tearDown() { Configure::write('Cache.disable', $this->_cacheDisable); Cache::config('default'); } -/** - * tearDown method - * - * @access public - * @return void - */ - function tearDown() { - Cache::config('default'); - } /** * testReadAndWriteCache method * diff --git a/cake/tests/cases/libs/cache/xcache.test.php b/cake/tests/cases/libs/cache/xcache.test.php index f72d912be..842cbfa7b 100644 --- a/cake/tests/cases/libs/cache/xcache.test.php +++ b/cake/tests/cases/libs/cache/xcache.test.php @@ -68,15 +68,6 @@ function tearDown() { Configure::write('Cache.disable', $this->_cacheDisable); Cache::config('default'); } -/** - * tearDown method - * - * @access public - * @return void - */ - function tearDown() { - Cache::config('default'); - } /** * testSettings method * diff --git a/cake/tests/cases/libs/model/model.test.php b/cake/tests/cases/libs/model/model.test.php index 017072418..b16e28dd1 100644 --- a/cake/tests/cases/libs/model/model.test.php +++ b/cake/tests/cases/libs/model/model.test.php @@ -4822,31 +4822,6 @@ function testFindNeighbors() { $expected = array('prev' => $two, 'next' => null); $this->assertEqual($result, $expected); } -/** - * test findNeighbours() method - * - * @return void - * @access public - */ - function testFindNeighboursLegacy() { - $this->loadFixtures('User', 'Article'); - $TestModel =& new Article(); - - $result = $TestModel->findNeighbours(null, 'Article.id', '2'); - $expected = array('prev' => array('Article' => array('id' => 1)), 'next' => array('Article' => array('id' => 3))); - $this->assertEqual($result, $expected); - - $result = $TestModel->findNeighbours(null, 'Article.id', '3'); - $expected = array('prev' => array('Article' => array('id' => 2)), 'next' => array()); - $this->assertEqual($result, $expected); - - $result = $TestModel->findNeighbours(array('User.id' => 1), array('Article.id', 'Article.title'), 2); - $expected = array( - 'prev' => array('Article' => array('id' => 1, 'title' => 'First Article')), - 'next' => array('Article' => array('id' => 3, 'title' => 'Third Article')), - ); - $this->assertEqual($result, $expected); - } /** * testFindCombinedRelations method * diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/cake/tests/cases/libs/view/helpers/html.test.php index 149b64c2f..efdbdafcc 100644 --- a/cake/tests/cases/libs/view/helpers/html.test.php +++ b/cake/tests/cases/libs/view/helpers/html.test.php @@ -84,15 +84,6 @@ function tearDown() { Configure::write('App.encoding', $this->_appEncoding); ClassRegistry::flush(); } -/** - * tearDown method - * - * @access public - * @return void - */ - function tearDown() { - unset($this->Html); - } /** * testDocType method * From 91f90b5c052f7e699051e1881ee93087cbe037b3 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 3 Jun 2009 21:35:11 -0400 Subject: [PATCH 0228/2083] Fixing minor issues with tests. --- .../cases/console/libs/tasks/controller.test.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index cc7927952..da480f235 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -169,7 +169,7 @@ function testGetName() { * @return void **/ function testDoHelpers() { - $this->Task->setReturnValueAt(0, 'in', 'n'); + $this->Task->setReturnValue('in', 'n'); $result = $this->Task->doHelpers(); $this->assertEqual($result, array()); @@ -186,7 +186,7 @@ function testDoHelpers() { * @return void **/ function testDoComponents() { - $this->Task->setReturnValueAt(0, 'in', 'n'); + $this->Task->setReturnValue('in', 'n'); $result = $this->Task->doComponents(); $this->assertEqual($result, array()); @@ -325,7 +325,7 @@ function testBakeActionsWithNoSessions() { function testInteractive() { $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path'; - $this->Task->setReturnValueAt(0, 'in', '1'); + $this->Task->setReturnValue('in', '1'); $this->Task->setReturnValueAt(1, 'in', 'y'); // build interactive $this->Task->setReturnValueAt(2, 'in', 'n'); // build no scaffolds $this->Task->setReturnValueAt(3, 'in', 'y'); // build normal methods @@ -347,7 +347,7 @@ function testInteractive() { * @return void **/ function testExecuteIntoAll() { - $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), + $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Execute into all could not be run as an Article, Tag or Comment model was already loaded. %s'); if ($skip) { return; @@ -368,7 +368,7 @@ function testExecuteIntoAll() { * @return void **/ function testExecuteWithScaffoldParam() { - $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), + $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Execute with scaffold param requires no Article, Tag or Comment model to be defined. %s'); if ($skip) { return; @@ -396,12 +396,13 @@ function testExecuteWithAdminScaffoldParams() { if ($skip) { return; } + Configure::write('Routing.admin', 'admin'); $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; $this->Task->args = array('Articles', 'scaffold', 'admin'); $filename = '/my/path/articles_controller.php'; - $this->Task->expectAt(0, 'createFile', array( + $this->Task->expect('createFile', array( $filename, new PatternExpectation('/admin_index/') )); From 0a3af5b7924c7c5c2507f83a2130f2581e26e9db Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 3 Jun 2009 21:59:46 -0400 Subject: [PATCH 0229/2083] Refactoring out bakeActions Adding tests for bake() --- cake/console/libs/tasks/view.php | 29 +++++++++++----- .../cases/console/libs/tasks/view.test.php | 34 ++++++++++++++++++- 2 files changed, 53 insertions(+), 10 deletions(-) diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 438818885..30194517d 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -150,6 +150,7 @@ function execute() { } } } + /** * Bake All views for All controllers. * @@ -167,10 +168,7 @@ function all() { if (App::import('Model', $model)) { $vars = $this->__loadController(); if ($vars) { - foreach ($actions as $action) { - $content = $this->getContent($action, $vars); - $this->bake($action, $content); - } + $this->bakeActions($actions); } } } @@ -185,8 +183,10 @@ function __interactive() { $this->hr(); $this->out(sprintf("Bake View\nPath: %s", $this->path)); $this->hr(); + $wannaDoAdmin = 'n'; $wannaDoScaffold = 'y'; + $admin = false; $this->interactive = false; $this->controllerName = $this->Controller->getName(); @@ -203,7 +203,6 @@ function __interactive() { if (strtolower($wannaDoScaffold) == 'y') { $wannaDoAdmin = $this->in("Would you like to create the views for admin routing?", array('y','n'), 'y'); } - $admin = false; if (strtolower($wannaDoAdmin) == 'y') { $admin = $this->getAdmin(); @@ -218,10 +217,7 @@ function __interactive() { } $vars = $this->__loadController(); if ($vars) { - foreach ($actions as $action) { - $content = $this->getContent($action, $vars); - $this->bake($action, $content); - } + $this->bakeActions($actions); } $this->hr(); $this->out(''); @@ -251,6 +247,7 @@ function __interactive() { } } } + /** * Loads Controller and sets variables for the template * Available template variables @@ -307,6 +304,20 @@ function __loadController() { return compact('modelClass', 'schema', 'primaryKey', 'displayField', 'singularVar', 'pluralVar', 'singularHumanName', 'pluralHumanName', 'fields','associations'); } + +/** + * Bake a view file for each of the supplied actions + * + * @param array $actions Array of actions to make files for. + * @return void + **/ + function bakeActions($actions) { + foreach ($actions as $action) { + $content = $this->getContent($action, $vars); + $this->bake($action, $content); + } + } + /** * Assembles and writes bakes the view file. * diff --git a/cake/tests/cases/console/libs/tasks/view.test.php b/cake/tests/cases/console/libs/tasks/view.test.php index 5acf40f6e..9a7bf6cf5 100644 --- a/cake/tests/cases/console/libs/tasks/view.test.php +++ b/cake/tests/cases/console/libs/tasks/view.test.php @@ -52,6 +52,16 @@ array('in', '_stop', 'err', 'out', 'createFile') ); +class ViewTaskComment extends Model { + var $name = 'ViewTaskComment'; + var $useTable = 'comments'; +} + +class ViewTaskCommentsController extends Controller { + var $name = 'ViewTaskComments'; +} + + /** * ViewTaskTest class * @@ -111,8 +121,30 @@ function testGetContent() { $this->assertPattern('/New Test View Model/', $result); $this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'id\'\]/', $result); - $this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'name\'\]/', $result); + $this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'name\'\]/', $result); $this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'body\'\]/', $result); } + +/** + * test Bake method + * + * @return void + **/ + function testBake() { + $this->Task->path = TMP; + $this->Task->controllerName = 'ViewTaskComments'; + $this->Task->controllerPath = 'view_task_comments'; + + $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'view.ctp', '*')); + $this->Task->bake('view', true); + + $this->Task->expectAt(1, 'createFile', array(TMP . 'view_task_comments' . DS . 'edit.ctp', '*')); + $this->Task->bake('edit', true); + + $this->Task->expectAt(2, 'createFile', array(TMP . 'view_task_comments' . DS . 'index.ctp', '*')); + $this->Task->bake('index', true); + + @rmdir(TMP . 'view_task_comments'); + } } ?> \ No newline at end of file From 3c5e4a68fb369b0e56ffb2cf7d0fe704f5df8621 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 3 Jun 2009 22:03:57 -0400 Subject: [PATCH 0230/2083] Fixing notice errors. --- cake/console/libs/tasks/view.php | 8 +++++--- .../cases/console/libs/tasks/view.test.php | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 30194517d..eee1c733e 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -168,7 +168,7 @@ function all() { if (App::import('Model', $model)) { $vars = $this->__loadController(); if ($vars) { - $this->bakeActions($actions); + $this->bakeActions($actions, $vars); } } } @@ -217,7 +217,7 @@ function __interactive() { } $vars = $this->__loadController(); if ($vars) { - $this->bakeActions($actions); + $this->bakeActions($actions, $vars); } $this->hr(); $this->out(''); @@ -311,7 +311,7 @@ function __loadController() { * @param array $actions Array of actions to make files for. * @return void **/ - function bakeActions($actions) { + function bakeActions($actions, $vars) { foreach ($actions as $action) { $content = $this->getContent($action, $vars); $this->bake($action, $content); @@ -369,6 +369,8 @@ function getContent($template = null, $vars = null) { $vars = $this->__loadController(); } + $this->Template->set('action', $action); + $this->Template->set('plugin', $this->plugin); $this->Template->set($vars); $output = $this->Template->generate('views', $template); diff --git a/cake/tests/cases/console/libs/tasks/view.test.php b/cake/tests/cases/console/libs/tasks/view.test.php index 9a7bf6cf5..edc629fa2 100644 --- a/cake/tests/cases/console/libs/tasks/view.test.php +++ b/cake/tests/cases/console/libs/tasks/view.test.php @@ -146,5 +146,23 @@ function testBake() { @rmdir(TMP . 'view_task_comments'); } + +/** + * test bake actions baking multiple actions. + * + * @return void + **/ + function testBakeActions() { + $this->Task->path = TMP; + $this->Task->controllerName = 'ViewTaskComments'; + $this->Task->controllerPath = 'view_task_comments'; + + $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'view.ctp', '*')); + $this->Task->expectAt(1, 'createFile', array(TMP . 'view_task_comments' . DS . 'edit.ctp', '*')); + $this->Task->expectAt(2, 'createFile', array(TMP . 'view_task_comments' . DS . 'index.ctp', '*')); + + $this->Task->bakeActions(array('view', 'edit', 'index'), array()); + @rmdir(TMP . 'view_task_comments'); + } } ?> \ No newline at end of file From 8040cc31e5199a7e787e05c5f36a68595d232661 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 3 Jun 2009 23:18:14 -0400 Subject: [PATCH 0231/2083] Adding connection prompts. Fixing hard coded $ds Adding i18n Extracting customAction() Test cases added. --- cake/console/libs/tasks/view.php | 89 +++++++++++-------- .../cases/console/libs/tasks/view.test.php | 46 ++++++++++ 2 files changed, 100 insertions(+), 35 deletions(-) diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index eee1c733e..fc7237ab9 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -45,7 +45,7 @@ class ViewTask extends Shell { * @var array * @access public */ - var $tasks = array('Project', 'Controller', 'Template'); + var $tasks = array('Project', 'Controller', 'DbConfig', 'Template'); /** * path to VIEWS directory * @@ -88,6 +88,7 @@ class ViewTask extends Shell { */ function initialize() { } + /** * Execution method always used for tasks * @@ -99,6 +100,9 @@ function execute() { } if (isset($this->args[0])) { + if (!isset($this->connection)) { + $this->connection = 'default'; + } $controller = $action = $alias = null; $this->controllerName = Inflector::camelize($this->args[0]); $this->controllerPath = Inflector::underscore($this->controllerName); @@ -114,7 +118,7 @@ function execute() { if (!$action) { $action = $this->template; } - + if (strtolower($this->args[0]) == 'all') { return $this->all(); } @@ -157,9 +161,8 @@ function execute() { * @return void **/ function all() { - $ds = 'default'; $actions = $this->scaffoldActions; - $tables = $this->Controller->listAll($ds, false); + $tables = $this->Controller->listAll($this->connection, false); $this->interactive = false; foreach ($tables as $table) { $model = $this->_modelName($table); @@ -184,24 +187,31 @@ function __interactive() { $this->out(sprintf("Bake View\nPath: %s", $this->path)); $this->hr(); + if (empty($this->connection)) { + $this->connection = $this->DbConfig->getConfig(); + } + $wannaDoAdmin = 'n'; $wannaDoScaffold = 'y'; $admin = false; - $this->interactive = false; + $this->Controller->connection = $this->connection; $this->controllerName = $this->Controller->getName(); $this->controllerPath = strtolower(Inflector::underscore($this->controllerName)); - $interactive = $this->in("Would you like bake to build your views interactively?\nWarning: Choosing no will overwrite {$this->controllerName} views if it exist.", array('y','n'), 'y'); + $prompt = sprintf(__("Would you like bake to build your views interactively?\nWarning: Choosing no will overwrite %s views if it exist.", true), $this->controllerName); + $interactive = $this->in($prompt, array('y', 'n'), 'n'); - if (strtolower($interactive) == 'y') { - $this->interactive = true; - $wannaDoScaffold = $this->in("Would you like to create some scaffolded views (index, add, view, edit) for this controller?\nNOTE: Before doing so, you'll need to create your controller and model classes (including associated models).", array('y','n'), 'n'); + if (strtolower($interactive) == 'n') { + $this->interactive = false; } + $prompt = __("Would you like to create some CRUD views\n(index, add, view, edit) for this controller?\nNOTE: Before doing so, you'll need to create your controller\nand model classes (including associated models).", true); + $wannaDoScaffold = $this->in($prompt, array('y','n'), 'n'); + if (strtolower($wannaDoScaffold) == 'y') { - $wannaDoAdmin = $this->in("Would you like to create the views for admin routing?", array('y','n'), 'y'); + $wannaDoAdmin = $this->in(__("Would you like to create the views for admin routing?", true), array('y','n'), 'y'); } if (strtolower($wannaDoAdmin) == 'y') { @@ -221,30 +231,9 @@ function __interactive() { } $this->hr(); $this->out(''); - $this->out('View Scaffolding Complete.'."\n"); + $this->out(__("View Scaffolding Complete.\n", true)); } else { - $action = ''; - while ($action == '') { - $action = $this->in('Action Name? (use camelCased function name)'); - if ($action == '') { - $this->out('The action name you supplied was empty. Please try again.'); - } - } - $this->out(''); - $this->hr(); - $this->out('The following view will be created:'); - $this->hr(); - $this->out("Controller Name: {$this->controllerName}"); - $this->out("Action Name: {$action}"); - $this->out("Path: ".$this->params['app'] . DS . $this->controllerPath . DS . Inflector::underscore($action) . ".ctp"); - $this->hr(); - $looksGood = $this->in('Look okay?', array('y','n'), 'y'); - if (low($looksGood) == 'y' || low($looksGood) == 'yes') { - $this->bake($action); - $this->_stop(); - } else { - $this->out('Bake Aborted.'); - } + $this->customAction(); } } @@ -274,7 +263,7 @@ function __loadController() { $this->_stop(); } $controllerClassName = $this->controllerName . 'Controller'; - $controllerObj = & new $controllerClassName(); + $controllerObj =& new $controllerClassName(); $controllerObj->constructClasses(); $modelClass = $controllerObj->modelClass; $modelObj =& ClassRegistry::getObject($controllerObj->modelKey); @@ -318,6 +307,36 @@ function bakeActions($actions, $vars) { } } +/** + * handle creation of baking a custom action view file + * + * @return void + **/ + function customAction() { + $action = ''; + while ($action == '') { + $action = $this->in(__('Action Name? (use lowercase_underscored function name)', true)); + if ($action == '') { + $this->out(__('The action name you supplied was empty. Please try again.', true)); + } + } + $this->out(''); + $this->hr(); + $this->out(__('The following view will be created:', true)); + $this->hr(); + $this->out(sprintf(__('Controller Name: %s', true), $this->controllerName)); + $this->out(sprintf(__('Action Name: %s', true), $action)); + $this->out(sprintf(__('Path: %s', true), $this->params['app'] . DS . $this->controllerPath . DS . Inflector::underscore($action) . ".ctp")); + $this->hr(); + $looksGood = $this->in(__('Look okay?', true), array('y','n'), 'y'); + if (strtolower($looksGood) == 'y') { + $this->bake($action); + $this->_stop(); + } else { + $this->out(__('Bake Aborted.', true)); + } + } + /** * Assembles and writes bakes the view file. * @@ -334,7 +353,6 @@ function bake($action, $content = '') { $Folder =& new Folder($this->path . $this->controllerPath, true); $errors = $Folder->errors(); if (empty($errors)) { - $path = $Folder->slashTerm($Folder->pwd()); return $this->createFile($filename, $content); } else { foreach ($errors as $error) { @@ -343,6 +361,7 @@ function bake($action, $content = '') { } return false; } + /** * Builds content from template and variables * diff --git a/cake/tests/cases/console/libs/tasks/view.test.php b/cake/tests/cases/console/libs/tasks/view.test.php index edc629fa2..6e6b35a3e 100644 --- a/cake/tests/cases/console/libs/tasks/view.test.php +++ b/cake/tests/cases/console/libs/tasks/view.test.php @@ -40,6 +40,7 @@ if (!class_exists('TestTask')) { require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'view.php'; + require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'controller.php'; require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php'; } @@ -52,6 +53,8 @@ array('in', '_stop', 'err', 'out', 'createFile') ); +Mock::generate('ControllerTask', 'ViewTaskMockControllerTask'); + class ViewTaskComment extends Model { var $name = 'ViewTaskComment'; var $useTable = 'comments'; @@ -83,6 +86,7 @@ function startTest() { $this->Task =& new MockViewTask($this->Dispatcher); $this->Task->Dispatch =& $this->Dispatcher; $this->Task->Template =& new TemplateTask($this->Dispatcher); + $this->Task->Controller =& new ViewTaskMockControllerTask(); } /** @@ -164,5 +168,47 @@ function testBakeActions() { $this->Task->bakeActions(array('view', 'edit', 'index'), array()); @rmdir(TMP . 'view_task_comments'); } + +/** + * test baking a customAction (non crud) + * + * @return void + **/ + function testCustomAction() { + $this->Task->path = TMP; + $this->Task->controllerName = 'ViewTaskComments'; + $this->Task->controllerPath = 'view_task_comments'; + $this->Task->params['app'] = APP; + + $this->Task->setReturnValueAt(0, 'in', ''); + $this->Task->setReturnValueAt(1, 'in', 'my_action'); + $this->Task->setReturnValueAt(2, 'in', 'y'); + $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'my_action.ctp', '*')); + + $this->Task->customAction(); + @rmdir(TMP . 'view_task_comments'); + } + +/** + * Test all() + * + * @return void + **/ + function testExecuteIntoAll() { + $this->Task->path = TMP; + $this->Task->args[0] = 'all'; + + $this->Task->Controller->setReturnValue('listAll', array('view_task_comments')); + $this->Task->Controller->expectOnce('listAll'); + + $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'index.ctp', '*')); + $this->Task->expectAt(1, 'createFile', array(TMP . 'view_task_comments' . DS . 'view.ctp', '*')); + $this->Task->expectAt(2, 'createFile', array(TMP . 'view_task_comments' . DS . 'add.ctp', '*')); + $this->Task->expectAt(3, 'createFile', array(TMP . 'view_task_comments' . DS . 'edit.ctp', '*')); + + $this->Task->execute(); + @rmdir(TMP . 'view_task_comments'); + } + } ?> \ No newline at end of file From bb566c3841ce8b0011e754562a289c114a231453 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 4 Jun 2009 23:35:36 -0400 Subject: [PATCH 0232/2083] Adding test cases for various permutations of execute() Allowing admin methods to be baked separately of regular methods. --- cake/console/libs/tasks/view.php | 40 ++++---- .../cases/console/libs/tasks/view.test.php | 93 ++++++++++++++++++- 2 files changed, 108 insertions(+), 25 deletions(-) diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index fc7237ab9..b51829b82 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -130,7 +130,6 @@ function execute() { } else { $vars = $this->__loadController(); if ($vars) { - $methods = array_diff( array_map('strtolower', get_class_methods($this->controllerName . 'Controller')), array_map('strtolower', get_class_methods('appcontroller')) @@ -142,7 +141,7 @@ function execute() { $adminRoute = Configure::read('Routing.admin'); if (!empty($adminRoute)) { - $adminDelete = $adminRoute.'_delete'; + $adminDelete = $adminRoute . '_delete'; } foreach ($methods as $method) { if ($method{0} != '_' && !in_array($method, array('delete', $adminDelete))) { @@ -191,10 +190,6 @@ function __interactive() { $this->connection = $this->DbConfig->getConfig(); } - $wannaDoAdmin = 'n'; - $wannaDoScaffold = 'y'; - $admin = false; - $this->Controller->connection = $this->connection; $this->controllerName = $this->Controller->getName(); @@ -208,27 +203,25 @@ function __interactive() { } $prompt = __("Would you like to create some CRUD views\n(index, add, view, edit) for this controller?\nNOTE: Before doing so, you'll need to create your controller\nand model classes (including associated models).", true); - $wannaDoScaffold = $this->in($prompt, array('y','n'), 'n'); + $wannaDoScaffold = $this->in($prompt, array('y','n'), 'y'); - if (strtolower($wannaDoScaffold) == 'y') { - $wannaDoAdmin = $this->in(__("Would you like to create the views for admin routing?", true), array('y','n'), 'y'); - } - - if (strtolower($wannaDoAdmin) == 'y') { - $admin = $this->getAdmin(); - } + $wannaDoAdmin = $this->in(__("Would you like to create the views for admin routing?", true), array('y','n'), 'n'); - if (strtolower($wannaDoScaffold) == 'y') { - $actions = $this->scaffoldActions; - if ($admin) { - foreach ($actions as $action) { - $actions[] = $admin . $action; - } - } + if (strtolower($wannaDoScaffold) == 'y' || strtolower($wannaDoAdmin) == 'y') { $vars = $this->__loadController(); - if ($vars) { + if (strtolower($wannaDoScaffold) == 'y') { + $actions = $this->scaffoldActions; $this->bakeActions($actions, $vars); } + if (strtolower($wannaDoAdmin) == 'y') { + $admin = $this->getAdmin(); + $regularActions = $this->scaffoldActions; + $adminActions = array(); + foreach ($regularActions as $action) { + $adminActions[] = $admin . $action; + } + $this->bakeActions($adminActions, $vars); + } $this->hr(); $this->out(''); $this->out(__("View Scaffolding Complete.\n", true)); @@ -347,7 +340,7 @@ function customAction() { */ function bake($action, $content = '') { if ($content === true) { - $content = $this->getContent(); + $content = $this->getContent($action); } $filename = $this->path . $this->controllerPath . DS . Inflector::underscore($action) . '.ctp'; $Folder =& new Folder($this->path . $this->controllerPath, true); @@ -427,6 +420,7 @@ function help() { $this->out(""); $this->_stop(); } + /** * Returns associations for controllers models. * diff --git a/cake/tests/cases/console/libs/tasks/view.test.php b/cake/tests/cases/console/libs/tasks/view.test.php index 6e6b35a3e..aaae32239 100644 --- a/cake/tests/cases/console/libs/tasks/view.test.php +++ b/cake/tests/cases/console/libs/tasks/view.test.php @@ -58,10 +58,29 @@ class ViewTaskComment extends Model { var $name = 'ViewTaskComment'; var $useTable = 'comments'; + + var $belongsTo = array( + 'Article' => array( + 'className' => 'ViewTaskArticle', + 'foreignKey' => 'article_id' + ) + ); +} + +class ViewTaskArticle extends Model { + var $name = 'ViewTaskArticle'; + var $useTable = 'articles'; } class ViewTaskCommentsController extends Controller { var $name = 'ViewTaskComments'; + + function index() { + + } + function add() { + + } } @@ -139,13 +158,19 @@ function testBake() { $this->Task->controllerName = 'ViewTaskComments'; $this->Task->controllerPath = 'view_task_comments'; - $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'view.ctp', '*')); + $this->Task->expectAt(0, 'createFile', array( + TMP . 'view_task_comments' . DS . 'view.ctp', + new PatternExpectation('/View Task Articles/') + )); $this->Task->bake('view', true); $this->Task->expectAt(1, 'createFile', array(TMP . 'view_task_comments' . DS . 'edit.ctp', '*')); $this->Task->bake('edit', true); - $this->Task->expectAt(2, 'createFile', array(TMP . 'view_task_comments' . DS . 'index.ctp', '*')); + $this->Task->expectAt(2, 'createFile', array( + TMP . 'view_task_comments' . DS . 'index.ctp', + new PatternExpectation('/\$viewTaskComment\[\'Article\'\]\[\'title\'\]/') + )); $this->Task->bake('index', true); @rmdir(TMP . 'view_task_comments'); @@ -166,6 +191,7 @@ function testBakeActions() { $this->Task->expectAt(2, 'createFile', array(TMP . 'view_task_comments' . DS . 'index.ctp', '*')); $this->Task->bakeActions(array('view', 'edit', 'index'), array()); + @rmdir(TMP . 'view_task_comments'); } @@ -186,6 +212,7 @@ function testCustomAction() { $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'my_action.ctp', '*')); $this->Task->customAction(); + @rmdir(TMP . 'view_task_comments'); } @@ -201,14 +228,76 @@ function testExecuteIntoAll() { $this->Task->Controller->setReturnValue('listAll', array('view_task_comments')); $this->Task->Controller->expectOnce('listAll'); + $this->Task->expectCallCount('createFile', 4); $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'index.ctp', '*')); $this->Task->expectAt(1, 'createFile', array(TMP . 'view_task_comments' . DS . 'view.ctp', '*')); $this->Task->expectAt(2, 'createFile', array(TMP . 'view_task_comments' . DS . 'add.ctp', '*')); $this->Task->expectAt(3, 'createFile', array(TMP . 'view_task_comments' . DS . 'edit.ctp', '*')); $this->Task->execute(); + @rmdir(TMP . 'view_task_comments'); } +/** + * test `cake bake view $controller view` + * + * @return void + **/ + function testExecuteWithActionParam() { + $this->Task->path = TMP; + $this->Task->args[0] = 'ViewTaskComments'; + $this->Task->args[1] = 'view'; + + $this->Task->expectCallCount('createFile', 1); + $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'view.ctp', '*')); + $this->Task->execute(); + + @rmdir(TMP . 'view_task_comments'); + } + +/** + * test `cake bake view $controller` + * + * @return void + **/ + function testExecuteWithController() { + $this->Task->path = TMP; + $this->Task->args[0] = 'ViewTaskComments'; + + $this->Task->expectCallCount('createFile', 2); + $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'index.ctp', '*')); + $this->Task->expectAt(1, 'createFile', array(TMP . 'view_task_comments' . DS . 'add.ctp', '*')); + $this->Task->execute(); + + @rmdir(TMP . 'view_task_comments'); + } + +/** + * test execute into interactive. + * + * @return void + **/ + function testExecuteInteractive() { + $this->Task->path = TMP; + $this->Task->connection = 'test_suite'; + $this->Task->args = array(); + + $this->Task->Controller->setReturnValue('getName', 'ViewTaskComments'); + $this->Task->setReturnValue('in', 'y'); + $this->Task->setReturnValueAt(0, 'in', 'y'); + $this->Task->setReturnValueAt(1, 'in', 'y'); + $this->Task->setReturnValueAt(2, 'in', 'n'); + + $this->Task->expectCallCount('createFile', 4); + $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'index.ctp', '*')); + $this->Task->expectAt(1, 'createFile', array(TMP . 'view_task_comments' . DS . 'view.ctp', '*')); + $this->Task->expectAt(2, 'createFile', array(TMP . 'view_task_comments' . DS . 'add.ctp', '*')); + $this->Task->expectAt(3, 'createFile', array(TMP . 'view_task_comments' . DS . 'edit.ctp', '*')); + + $this->Task->execute(); + + @rmdir(TMP . 'view_task_comments'); + } } ?> \ No newline at end of file From 7cf7a0440c205e6390025acbcb78b517f18005dc Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 4 Jun 2009 23:40:03 -0400 Subject: [PATCH 0233/2083] Removing extra if() that are not needed as __loadController will stop() execution on error. --- cake/console/libs/tasks/view.php | 34 +++++++++++++++----------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index b51829b82..eba34ae4e 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -129,25 +129,23 @@ function execute() { $this->bake($action, true); } else { $vars = $this->__loadController(); - if ($vars) { - $methods = array_diff( - array_map('strtolower', get_class_methods($this->controllerName . 'Controller')), - array_map('strtolower', get_class_methods('appcontroller')) - ); - if (empty($methods)) { - $methods = $this->scaffoldActions; - } - $adminDelete = null; + $methods = array_diff( + array_map('strtolower', get_class_methods($this->controllerName . 'Controller')), + array_map('strtolower', get_class_methods('appcontroller')) + ); + if (empty($methods)) { + $methods = $this->scaffoldActions; + } + $adminDelete = null; - $adminRoute = Configure::read('Routing.admin'); - if (!empty($adminRoute)) { - $adminDelete = $adminRoute . '_delete'; - } - foreach ($methods as $method) { - if ($method{0} != '_' && !in_array($method, array('delete', $adminDelete))) { - $content = $this->getContent($method, $vars); - $this->bake($method, $content); - } + $adminRoute = Configure::read('Routing.admin'); + if (!empty($adminRoute)) { + $adminDelete = $adminRoute . '_delete'; + } + foreach ($methods as $method) { + if ($method{0} != '_' && !in_array($method, array('delete', $adminDelete))) { + $content = $this->getContent($method, $vars); + $this->bake($method, $content); } } } From 0099c8a4289cf9cb2560f87a05ab03e36c6d307f Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 4 Jun 2009 23:42:06 -0400 Subject: [PATCH 0234/2083] Removing more if() blocks Silencing Controller task in all() --- cake/console/libs/tasks/view.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index eba34ae4e..20f98bb8d 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -159,6 +159,7 @@ function execute() { **/ function all() { $actions = $this->scaffoldActions; + $this->Controller->interactive = false; $tables = $this->Controller->listAll($this->connection, false); $this->interactive = false; foreach ($tables as $table) { @@ -167,9 +168,7 @@ function all() { $this->controllerPath = Inflector::underscore($this->controllerName); if (App::import('Model', $model)) { $vars = $this->__loadController(); - if ($vars) { - $this->bakeActions($actions, $vars); - } + $this->bakeActions($actions, $vars); } } } From 3d39feeac918cd866009ef281c2349ed89c7dfd2 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 4 Jun 2009 23:43:59 -0400 Subject: [PATCH 0235/2083] Adding help() entry for bake view all --- cake/console/libs/tasks/view.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 20f98bb8d..67f5a1e12 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -405,7 +405,7 @@ function help() { $this->out("view <controller>"); $this->out("\twill read the given controller for methods"); $this->out("\tand bake corresponding views."); - $this->out("\tIf var scaffold is found it will bake the scaffolded actions"); + $this->out("\tIf var scaffold is found it will bake the CRUD actions"); $this->out("\t(index,view,add,edit)"); $this->out(''); $this->out("view <controller> <action>"); @@ -414,7 +414,10 @@ function help() { $this->out("view <controller> <template> <alias>"); $this->out("\twill use the template specified"); $this->out("\tbut name the file based on the alias"); - $this->out(""); + $this->out(''); + $this->out("view all"); + $this->out("\tBake all CRUD action views for all controllers."); + $this->out("\tRequires that models and controllers exist."); $this->_stop(); } From 928ec36acf29ad73290f2bc285abf721b20c2187 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 4 Jun 2009 23:48:58 -0400 Subject: [PATCH 0236/2083] Removing garbage methods. --- cake/console/libs/tasks/test.php | 112 ------------------------------- 1 file changed, 112 deletions(-) diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index fd0efbb12..10be9ff99 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -400,117 +400,5 @@ function generateConstructor($type, $fullClassName) { } return "new $fullClassName()\n"; } - -/** - * Handles the extra stuff needed - * - * @access private - */ - function __extras($class) { - $extras = null; - switch ($class) { - case 'Model': - $extras = "\n\tvar \$cacheSources = false;"; - $extras .= "\n\tvar \$useDbConfig = 'test_suite';\n"; - break; - } - return $extras; - } - -/** - * Create a test for a Model object. - * - * @return void - **/ - function bakeModelTest($className) { - $fixtureInc = 'app'; - if ($this->plugin) { - $fixtureInc = 'plugin.'.Inflector::underscore($this->plugin); - } - - $fixture[] = "'{$fixtureInc}." . Inflector::underscore($className) ."'"; - - if (!empty($associations)) { - $assoc[] = Set::extract($associations, 'belongsTo.{n}.className'); - $assoc[] = Set::extract($associations, 'hasOne.{n}.className'); - $assoc[] = Set::extract($associations, 'hasMany.{n}.className'); - foreach ($assoc as $key => $value) { - if (is_array($value)) { - foreach ($value as $class) { - $fixture[] = "'{$fixtureInc}." . Inflector::underscore($class) ."'"; - } - } - } - } - $fixture = join(", ", $fixture); - - $import = $className; - if (isset($this->plugin)) { - $import = $this->plugin . '.' . $className; - } - - $out = "App::import('Model', '$import');\n\n"; - $out .= "class {$className}TestCase extends CakeTestCase {\n"; - $out .= "\tvar \${$className} = null;\n"; - $out .= "\tvar \$fixtures = array($fixture);\n\n"; - $out .= "\tfunction startTest() {\n"; - $out .= "\t\t\$this->{$className} =& ClassRegistry::init('{$className}');\n"; - $out .= "\t}\n\n"; - $out .= "\tfunction endTest() {\n"; - $out .= "\t\tunset(\$this->{$className});\n"; - $out .= "\t}\n\n"; - $out .= "\tfunction test{$className}Instance() {\n"; - $out .= "\t\t\$this->assertTrue(is_a(\$this->{$className}, '{$className}'));\n"; - $out .= "\t}\n\n"; - $out .= "}\n"; - - $path = MODEL_TESTS; - if (isset($this->plugin)) { - $pluginPath = 'plugins' . DS . Inflector::underscore($this->plugin) . DS; - $path = APP . $pluginPath . 'tests' . DS . 'cases' . DS . 'models' . DS; - } - - $filename = Inflector::underscore($className).'.test.php'; - $this->out("\nBaking unit test for $className..."); - - $header = '$Id'; - $content = "<?php \n/* SVN FILE: $header$ */\n/* ". $className ." Test cases generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n{$out}?>"; - return $this->createFile($path . $filename, $content); - } - -/** - * Create a test case for a controller. - * - * @return void - **/ - function bakeControllerTest() { - $import = $className; - if ($this->plugin) { - $import = $this->plugin . '.' . $className; - } - $out = "App::import('Controller', '$import');\n\n"; - $out .= "class Test{$className} extends {$className}Controller {\n"; - $out .= "\tvar \$autoRender = false;\n}\n\n"; - $out .= "class {$className}ControllerTest extends CakeTestCase {\n"; - $out .= "\tvar \${$className} = null;\n\n"; - $out .= "\tfunction startTest() {\n\t\t\$this->{$className} = new Test{$className}();"; - $out .= "\n\t\t\$this->{$className}->constructClasses();\n\t}\n\n"; - $out .= "\tfunction test{$className}ControllerInstance() {\n"; - $out .= "\t\t\$this->assertTrue(is_a(\$this->{$className}, '{$className}Controller'));\n\t}\n\n"; - $out .= "\tfunction endTest() {\n\t\tunset(\$this->{$className});\n\t}\n}\n"; - - $path = CONTROLLER_TESTS; - if (isset($this->plugin)) { - $pluginPath = 'plugins' . DS . Inflector::underscore($this->plugin) . DS; - $path = APP . $pluginPath . 'tests' . DS . 'cases' . DS . 'controllers' . DS; - } - - $filename = Inflector::underscore($className).'_controller.test.php'; - $this->out("\nBaking unit test for $className..."); - - $header = '$Id'; - $content = "<?php \n/* SVN FILE: $header$ */\n/* ". $className ."Controller Test cases generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n{$out}?>"; - return $this->createFile($path . $filename, $content); - } } ?> \ No newline at end of file From f84ed697803ebee5026ca18a06ba6c452cb562ae Mon Sep 17 00:00:00 2001 From: gwoo <gwoo@cakephp.org> Date: Fri, 5 Jun 2009 19:05:05 -0700 Subject: [PATCH 0237/2083] fixing undefined variable when new project is baked from skel --- cake/console/libs/templates/skel/webroot/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/console/libs/templates/skel/webroot/index.php b/cake/console/libs/templates/skel/webroot/index.php index 01be9dd64..59484d983 100644 --- a/cake/console/libs/templates/skel/webroot/index.php +++ b/cake/console/libs/templates/skel/webroot/index.php @@ -85,7 +85,7 @@ return; } else { $Dispatcher = new Dispatcher(); - $Dispatcher->dispatch($url); + $Dispatcher->dispatch(); } if (Configure::read() > 0) { echo "<!-- " . round(getMicrotime() - $TIME_START, 4) . "s -->"; From d312cd3215248614a05df3a641ea46d3e21c7798 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 6 Jun 2009 19:59:58 -0400 Subject: [PATCH 0238/2083] Adding _pluginPath to Shell. provides one method to find plugins in shells. --- cake/console/libs/shell.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php index bac6c347b..94f2ded1b 100644 --- a/cake/console/libs/shell.php +++ b/cake/console/libs/shell.php @@ -611,5 +611,21 @@ function _singularHumanName($name) { function _pluralHumanName($name) { return Inflector::humanize(Inflector::underscore(Inflector::pluralize($name))); } +/** + * Find the correct path for a plugin. Scans $pluginPaths for the plugin you want. + * + * @param string $pluginName Name of the plugin you want ie. DebugKit + * @return string $path path to the correct plugin. + **/ + function _pluginPath($pluginName) { + $pluginPaths = Configure::read('pluginPaths'); + $pluginDirName = Inflector::underscore($pluginName); + foreach ($pluginPaths as $path) { + if (is_dir($path . $pluginDirName)) { + return $path . $pluginDirName . DS ; + } + } + return $pluginPaths[0] . $pluginDirName . DS; + } } ?> \ No newline at end of file From 84a496083fc324071014c282b1e2010642ced00b Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 6 Jun 2009 20:03:04 -0400 Subject: [PATCH 0239/2083] Adding proper -plugin parameter handling Fixtures can now be baked into plugins. Adding test cases. --- cake/console/libs/tasks/fixture.php | 9 ++++---- .../cases/console/libs/tasks/fixture.test.php | 22 +++++++++++++++---- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 056297041..6acb4b434 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -61,7 +61,8 @@ class FixtureTask extends Shell { * * @access public */ - function initialize() { + function __construct(&$dispatch) { + parent::__construct($dispatch); $this->path = $this->params['working'] . DS . 'tests' . DS . 'fixtures' . DS; if (!class_exists('CakeSchema')) { App::import('Model', 'Schema'); @@ -210,12 +211,10 @@ function bake($model, $useTable = false, $importOptions = array()) { function generateFixtureFile($model, $otherVars) { $defaults = array('table' => null, 'schema' => null, 'records' => null, 'import' => null, 'fields' => null); $vars = array_merge($defaults, $otherVars); - - //@todo fix plugin pathing. + $path = $this->path; if (isset($this->plugin)) { - $pluginPath = 'plugins' . DS . Inflector::underscore($this->plugin) . DS; - $path = APP . $pluginPath . 'tests' . DS . 'fixtures' . DS; + $path = $this->_pluginPath($this->plugin) . 'tests' . DS . 'fixtures' . DS; } $filename = Inflector::underscore($model) . '_fixture.php'; diff --git a/cake/tests/cases/console/libs/tasks/fixture.test.php b/cake/tests/cases/console/libs/tasks/fixture.test.php index f5f41f059..6f5b3cdf9 100644 --- a/cake/tests/cases/console/libs/tasks/fixture.test.php +++ b/cake/tests/cases/console/libs/tasks/fixture.test.php @@ -92,12 +92,12 @@ function endTest() { * * @return void **/ - function testInitialize() { - $this->Task->params['working'] = '/my/path'; - $this->Task->initialize(); + function testConstruct() { + $this->Dispatch->params['working'] = '/my/path'; + $Task =& new FixtureTask($this->Dispatch); $expected = '/my/path/tests/fixtures/'; - $this->assertEqual($this->Task->path, $expected); + $this->assertEqual($Task->path, $expected); } /** * test import option array generation @@ -219,5 +219,19 @@ function testGenerateFixtureFile() { $this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/\<\?php(.*)\?\>/ms'))); $result = $this->Task->generateFixtureFile('Article', array()); } +/** + * test generating files into plugins. + * + * @return void + **/ + function testGeneratePluginFixtureFile() { + $this->Task->connection = 'test_suite'; + $this->Task->path = '/my/path/'; + $this->Task->plugin = 'TestFixture'; + $filename = APP . 'plugins' . DS . 'test_fixture' . DS . 'tests' . DS . 'fixtures' . DS . 'article_fixture.php'; + + $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/Article/'))); + $result = $this->Task->generateFixtureFile('Article', array()); + } } ?> \ No newline at end of file From 375e175ac80db8caf75441b74ea9d9ad3bcf2d8c Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 6 Jun 2009 20:03:26 -0400 Subject: [PATCH 0240/2083] Updating path setting in bake, so paths are not overwritten. --- cake/console/libs/bake.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index 6277342d5..3ec061729 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -49,9 +49,11 @@ class BakeShell extends Shell { function loadTasks() { parent::loadTasks(); $task = Inflector::classify($this->command); - if (isset($this->{$task}) && !in_array($task, array('Project', 'DbConfig', 'Fixture'))) { - $path = Inflector::underscore(Inflector::pluralize($this->command)); - $this->{$task}->path = $this->params['working'] . DS . $path . DS; + if (isset($this->{$task}) && !in_array($task, array('Project', 'DbConfig'))) { + if (empty($this->{$task}->path)) { + $path = Inflector::underscore(Inflector::pluralize($this->command)); + $this->{$task}->path = $this->params['working'] . DS . $path . DS; + } if (isset($this->params['connection'])) { $this->{$task}->connection = $this->params['connection']; } From 4d89086146e8635535f4a690dcefbae0b5f716b0 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 6 Jun 2009 20:25:57 -0400 Subject: [PATCH 0241/2083] Adding -plugin support to Controller Task Test cases added. --- cake/console/libs/tasks/controller.php | 6 ++- .../console/libs/tasks/controller.test.php | 40 +++++++++++++++++-- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 856717c1b..1feffb840 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -310,7 +310,11 @@ function bake($controllerName, $actions = '', $helpers = null, $components = nul $this->Template->set(compact('controllerName', 'actions', 'helpers', 'components', 'isScaffold')); $contents = $this->Template->generate('objects', 'controller'); - $filename = $this->path . $this->_controllerPath($controllerName) . '_controller.php'; + $path = $this->path; + if (isset($this->plugin)) { + $path = $this->_pluginPath($this->plugin) . 'controllers' . DS; + } + $filename = $path . $this->_controllerPath($controllerName) . '_controller.php'; if ($this->createFile($filename, $contents)) { return $contents; } diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index da480f235..ce61a568e 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -34,6 +34,7 @@ require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'controller.php'; require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'model.php'; require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php'; +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'test.php'; Mock::generatePartial( @@ -51,6 +52,8 @@ array('in', 'out', 'err', 'createFile', '_stop', '_checkUnitTest') ); +Mock::generate('TestTask', 'ControllerMockTestTask'); + $imported = App::import('Model', 'Article'); $imported = $imported || App::import('Model', 'Comment'); $imported = $imported || App::import('Model', 'Tag'); @@ -223,22 +226,36 @@ function testConfirmController() { function testBake() { $helpers = array('Ajax', 'Time'); $components = array('Acl', 'Auth'); - $uses = array('Comment', 'User'); $this->Task->setReturnValue('createFile', true); - $result = $this->Task->bake('Articles', '--actions--', $helpers, $components, $uses); + $result = $this->Task->bake('Articles', '--actions--', $helpers, $components); $this->assertPattern('/class ArticlesController extends AppController/', $result); $this->assertPattern('/\$components \= array\(\'Acl\', \'Auth\'\)/', $result); $this->assertPattern('/\$helpers \= array\(\'Html\', \'Form\', \'Ajax\', \'Time\'\)/', $result); $this->assertPattern('/\-\-actions\-\-/', $result); - $result = $this->Task->bake('Articles', 'scaffold', $helpers, $components, $uses); + $result = $this->Task->bake('Articles', 'scaffold', $helpers, $components); $this->assertPattern('/class ArticlesController extends AppController/', $result); $this->assertPattern('/var \$scaffold/', $result); $this->assertNoPattern('/helpers/', $result); $this->assertNoPattern('/components/', $result); } +/** + * test bake() with a -plugin param + * + * @return void + **/ + function testBakeWithPlugin() { + $this->Task->plugin = 'ControllerTest'; + $helpers = array('Ajax', 'Time'); + $components = array('Acl', 'Auth'); + $uses = array('Comment', 'User'); + + $path = APP . 'plugins' . DS . 'controller_test' . DS . 'controllers' . DS . 'articles_controller.php'; + $this->Task->expectAt(0, 'createFile', array($path, '*')); + $this->Task->bake('Articles', '--actions--', array(), array(), array()); + } /** * test that bakeActions is creating the correct controller Code. (Using sessions) * @@ -317,6 +334,23 @@ function testBakeActionsWithNoSessions() { $this->assertTrue(strpos($result, "\$this->flash(__('Article deleted', true), array('action'=>'index'))") !== false); } +/** + * test baking a test + * + * @return void + **/ + function testBakeTest() { + $this->Task->plugin = 'ControllerTest'; + $this->Task->connection = 'test_suite'; + $this->Task->Test =& new ControllerMockTestTask(); + + $this->Task->Test->expectOnce('bake', array('Controller', 'Articles')); + $this->Task->bakeTest('Articles'); + + $this->assertEqual($this->Task->plugin, $this->Task->Test->plugin); + $this->assertEqual($this->Task->connection, $this->Task->Test->connection); + } + /** * test Interactive mode. * From 21818460a2e1ad29938ae6c132a27b4f70080bc4 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 6 Jun 2009 20:37:01 -0400 Subject: [PATCH 0242/2083] Additional tests for fixture baking to ensure parameters are passed from model to fixture task Adding -plugin support to ModelTask --- cake/console/libs/tasks/model.php | 10 +++++++--- .../cases/console/libs/tasks/model.test.php | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 4f11985f9..c45ec5054 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -706,9 +706,12 @@ function bake($name, $associations = array(), $validate = array(), $primaryKey = $this->Template->set(compact('name', 'useDbConfig', 'associations', 'validate', 'primaryKey', 'useTable')); $this->Template->set('plugin', $this->plugin); $out = $this->Template->generate('objects', 'model'); - - //@todo solve plugin model paths. - $filename = $this->path . Inflector::underscore($name) . '.php'; + + $path = $this->path; + if (isset($this->plugin)) { + $path = $this->_pluginPath($this->plugin) . 'models' . DS; + } + $filename = $path . Inflector::underscore($name) . '.php'; $this->out("\nBaking model class for $name..."); $this->createFile($filename, $out); return $out; @@ -866,6 +869,7 @@ function help() { **/ function bakeFixture($className, $useTable = null) { $this->Fixture->connection = $this->connection; + $this->Fixture->plugin = $this->plugin; $this->Fixture->bake($className, $useTable); } } diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index aec16157b..ed792f1de 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -458,6 +458,9 @@ function testDoAssociationsNonInteractive() { function testBakeFixture() { $this->Task->Fixture->expectAt(0, 'bake', array('Article', 'articles')); $this->Task->bakeFixture('Article', 'articles'); + + $this->assertEqual($this->Task->plugin, $this->Task->Fixture->plugin); + $this->assertEqual($this->Task->connection, $this->Task->Fixture->connection); } /** @@ -603,6 +606,19 @@ function testBakeRelations() { $this->assertPattern('/Comment/', $result); } +/** + * test bake() with a -plugin param + * + * @return void + **/ + function testBakeWithPlugin() { + $this->Task->plugin = 'ControllerTest'; + + $path = APP . 'plugins' . DS . 'controller_test' . DS . 'models' . DS . 'article.php'; + $this->Task->expectAt(0, 'createFile', array($path, '*')); + $this->Task->bake('Article', array(), array()); + } + /** * test that execute passes runs bake depending with named model. * From 44bffc5baebcf23a71f1554f85929ee6e52f8723 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 6 Jun 2009 21:03:26 -0400 Subject: [PATCH 0243/2083] Adding support for -plugin parameter to TestTask Test cases for plugin path generation added. --- cake/console/libs/tasks/test.php | 25 +++++++++++++++---- .../console/libs/tasks/controller.test.php | 1 + .../cases/console/libs/tasks/test.test.php | 13 ++++++++++ 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 10be9ff99..0e05f4220 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -156,16 +156,13 @@ function bake($type, $className) { $this->Template->set(compact('className', 'methods', 'type', 'fullClassName', 'mock', 'construction')); $out = $this->Template->generate('objects', 'test'); - if (strpos($this->path, $type) === false) { - $this->filePath = $this->path . 'cases' . DS . Inflector::tableize($type) . DS; - } - $made = $this->createFile($this->filePath . Inflector::underscore($fullClassName) . '.test.php', $out); + $filename = $this->testCaseFileName($type, $className); + $made = $this->createFile($filename, $out); if ($made) { return $out; } return false; } - /** * Interact with the user and get their chosen type. Can exit the script. * @@ -400,5 +397,23 @@ function generateConstructor($type, $fullClassName) { } return "new $fullClassName()\n"; } + +/** + * make the filename for the test case. resolve the suffixes for controllers + * 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)) { + $path = $this->_pluginPath($this->plugin) . 'tests' . DS; + } + $path .= 'cases' . DS . Inflector::tableize($type) . DS; + if (strtolower($type) == 'controller') { + $className = $this->getRealClassName($type, $className); + } + return $path . Inflector::underscore($className) . '.test.php'; + } } ?> \ No newline at end of file diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index ce61a568e..0efaedbec 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -256,6 +256,7 @@ function testBakeWithPlugin() { $this->Task->expectAt(0, 'createFile', array($path, '*')); $this->Task->bake('Articles', '--actions--', array(), array(), array()); } + /** * test that bakeActions is creating the correct controller Code. (Using sessions) * diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index 9dec56987..ebef26119 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -391,6 +391,19 @@ function testMockClassGeneration() { $this->assertTrue($result); } +/** + * test bake() with a -plugin param + * + * @return void + **/ + function testBakeWithPlugin() { + $this->Task->plugin = 'TestTest'; + + $path = APP . 'plugins' . DS . 'test_test' . DS . 'tests' . DS . 'cases' . DS . 'helpers' . DS . 'form.test.php'; + $this->Task->expectAt(0, 'createFile', array($path, '*')); + $this->Task->bake('Helper', 'Form'); + } + /** * test execute with a type defined * From 4141158f304504e6b0e11ac5be26d91d02afee2f Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 6 Jun 2009 21:09:56 -0400 Subject: [PATCH 0244/2083] Additional tests for filename generation. --- .../cases/console/libs/tasks/test.test.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index ebef26119..3c3c366be 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -404,6 +404,40 @@ function testBakeWithPlugin() { $this->Task->bake('Helper', 'Form'); } +/** + * Test filename generation for each type + plugins + * + * @return void + **/ + function testTestCaseFileName() { + $this->Task->path = '/my/path/tests/'; + + $result = $this->Task->testCaseFileName('Model', 'Post'); + $expected = $this->Task->path . 'cases' . DS . 'models' . DS . 'post.test.php'; + $this->assertEqual($result, $expected); + + $result = $this->Task->testCaseFileName('Helper', 'Form'); + $expected = $this->Task->path . 'cases' . DS . 'helpers' . DS . 'form.test.php'; + $this->assertEqual($result, $expected); + + $result = $this->Task->testCaseFileName('Controller', 'Posts'); + $expected = $this->Task->path . 'cases' . DS . 'controllers' . DS . 'posts_controller.test.php'; + $this->assertEqual($result, $expected); + + $result = $this->Task->testCaseFileName('Behavior', 'Containable'); + $expected = $this->Task->path . 'cases' . DS . 'behaviors' . DS . 'containable.test.php'; + $this->assertEqual($result, $expected); + + $result = $this->Task->testCaseFileName('Component', 'Auth'); + $expected = $this->Task->path . 'cases' . DS . 'components' . DS . 'auth.test.php'; + $this->assertEqual($result, $expected); + + $this->Task->plugin = 'TestTest'; + $result = $this->Task->testCaseFileName('Model', 'Post'); + $expected = APP . 'plugins' . DS . 'test_test' . DS . 'tests' . DS . 'cases' . DS . 'models' . DS . 'post.test.php'; + $this->assertEqual($result, $expected); + } + /** * test execute with a type defined * From 4d7f00504a6acc848d493349b1b3380658b95caa Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 6 Jun 2009 21:18:34 -0400 Subject: [PATCH 0245/2083] Making -plugin function with ViewTask Adding tests for -plugin parameter Removing extra Folder calls. --- cake/console/libs/tasks/view.php | 15 +++++---------- .../tests/cases/console/libs/tasks/view.test.php | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 67f5a1e12..700008a68 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -339,17 +339,12 @@ function bake($action, $content = '') { if ($content === true) { $content = $this->getContent($action); } - $filename = $this->path . $this->controllerPath . DS . Inflector::underscore($action) . '.ctp'; - $Folder =& new Folder($this->path . $this->controllerPath, true); - $errors = $Folder->errors(); - if (empty($errors)) { - return $this->createFile($filename, $content); - } else { - foreach ($errors as $error) { - $this->err($error); - } + $path = $this->path; + if (isset($this->plugin)) { + $path = $this->_pluginPath($this->plugin) . 'views' . DS; } - return false; + $filename = $path . $this->controllerPath . DS . Inflector::underscore($action) . '.ctp'; + return $this->createFile($filename, $content); } /** diff --git a/cake/tests/cases/console/libs/tasks/view.test.php b/cake/tests/cases/console/libs/tasks/view.test.php index aaae32239..f76229d7c 100644 --- a/cake/tests/cases/console/libs/tasks/view.test.php +++ b/cake/tests/cases/console/libs/tasks/view.test.php @@ -176,6 +176,22 @@ function testBake() { @rmdir(TMP . 'view_task_comments'); } +/** + * test bake() with a -plugin param + * + * @return void + **/ + function testBakeWithPlugin() { + $this->Task->path = TMP; + $this->Task->controllerName = 'ViewTaskComments'; + $this->Task->controllerPath = 'view_task_comments'; + $this->Task->plugin = 'TestTest'; + + $path = APP . 'plugins' . DS . 'test_test' . DS . 'views' . DS . 'view_task_comments' . DS . 'view.ctp'; + $this->Task->expectAt(0, 'createFile', array($path, '*')); + $this->Task->bake('view', true); + } + /** * test bake actions baking multiple actions. * From 5e5293a8666a86c5e11d3af545859503b6f78411 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 6 Jun 2009 21:38:22 -0400 Subject: [PATCH 0246/2083] Adding redirect() if deletion fails. Fixing formatting. --- .../templates/objects/controller_actions.ctp | 26 ++++++++++++------- .../console/libs/tasks/controller.test.php | 6 ++--- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/cake/console/libs/templates/objects/controller_actions.ctp b/cake/console/libs/templates/objects/controller_actions.ctp index c4b1ce935..99b18bd33 100644 --- a/cake/console/libs/templates/objects/controller_actions.ctp +++ b/cake/console/libs/templates/objects/controller_actions.ctp @@ -30,9 +30,9 @@ if (!$id) { <?php if ($wannaUseSession): ?> $this->Session->setFlash(__('Invalid <?php echo $singularHumanName ?>', true)); - $this->redirect(array('action'=>'index')); + $this->redirect(array('action' => 'index')); <?php else: ?> - $this->flash(__('Invalid <?php echo $singularHumanName; ?>', true), array('action'=>'index')); + $this->flash(__('Invalid <?php echo $singularHumanName; ?>', true), array('action' => 'index')); <?php endif; ?> } $this->set('<?php echo $singularName; ?>', $this-><?php echo $currentModelName; ?>->read(null, $id)); @@ -45,9 +45,9 @@ if ($this-><?php echo $currentModelName; ?>->save($this->data)) { <?php if ($wannaUseSession): ?> $this->Session->setFlash(__('The <?php echo $singularHumanName; ?> has been saved', true)); - $this->redirect(array('action'=>'index')); + $this->redirect(array('action' => 'index')); <?php else: ?> - $this->flash(__('<?php echo $currentModelName; ?> saved.', true), array('action'=>'index')); + $this->flash(__('<?php echo $currentModelName; ?> saved.', true), array('action' => 'index')); <?php endif; ?> } else { <?php if ($wannaUseSession): ?> @@ -77,18 +77,18 @@ if (!$id && empty($this->data)) { <?php if ($wannaUseSession): ?> $this->Session->setFlash(__('Invalid <?php echo $singularHumanName; ?>', true)); - $this->redirect(array('action'=>'index')); + $this->redirect(array('action' => 'index')); <?php else: ?> - $this->flash(__('Invalid <?php echo $singularHumanName; ?>', true), array('action'=>'index')); + $this->flash(__('Invalid <?php echo $singularHumanName; ?>', true), array('action' => 'index')); <?php endif; ?> } if (!empty($this->data)) { if ($this-><?php echo $currentModelName; ?>->save($this->data)) { <?php if ($wannaUseSession): ?> $this->Session->setFlash(__('The <?php echo $singularHumanName; ?> has been saved', true)); - $this->redirect(array('action'=>'index')); + $this->redirect(array('action' => 'index')); <?php else: ?> - $this->flash(__('The <?php echo $singularHumanName; ?> has been saved.', true), array('action'=>'index')); + $this->flash(__('The <?php echo $singularHumanName; ?> has been saved.', true), array('action' => 'index')); <?php endif; ?> } else { <?php if ($wannaUseSession): ?> @@ -122,7 +122,7 @@ $this->Session->setFlash(__('Invalid id for <?php echo $singularHumanName; ?>', true)); $this->redirect(array('action'=>'index')); <?php else: ?> - $this->flash(__('Invalid <?php echo $singularHumanName; ?>', true), array('action'=>'index')); + $this->flash(__('Invalid <?php echo $singularHumanName; ?>', true), array('action' => 'index')); <?php endif; ?> } if ($this-><?php echo $currentModelName; ?>->del($id)) { @@ -130,7 +130,13 @@ $this->Session->setFlash(__('<?php echo $singularHumanName; ?> deleted', true)); $this->redirect(array('action'=>'index')); <?php else: ?> - $this->flash(__('<?php echo $singularHumanName; ?> deleted', true), array('action'=>'index')); + $this->flash(__('<?php echo $singularHumanName; ?> deleted', true), array('action' => 'index')); <?php endif; ?> } +<?php if ($wannaUseSession): ?> + $this->Session->setFlash(__('<?php echo $singularHumanName; ?> was not deleted', true)); +<?php else: ?> + $this->flash(__('<?php echo $singularHumanName; ?> was not deleted', true), array('action' => 'index')); +<?php endif; ?> + $this->redirect(array('action' => 'index')); } diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 0efaedbec..0cd154c8c 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -318,13 +318,13 @@ function testBakeActionsWithNoSessions() { $this->assertTrue(strpos($result, "\$this->set('articles', \$this->paginate());") !== false); $this->assertTrue(strpos($result, 'function view($id = null)') !== false); - $this->assertTrue(strpos($result, "\$this->flash(__('Invalid Article', true), array('action'=>'index'))") !== false); + $this->assertTrue(strpos($result, "\$this->flash(__('Invalid Article', true), array('action' => 'index'))") !== false); $this->assertTrue(strpos($result, "\$this->set('article', \$this->Article->read(null, \$id)") !== false); $this->assertTrue(strpos($result, 'function add()') !== false); $this->assertTrue(strpos($result, 'if (!empty($this->data))') !== false); $this->assertTrue(strpos($result, 'if ($this->Article->save($this->data))') !== false); - $this->assertTrue(strpos($result, "\$this->flash(__('The Article has been saved.', true), array('action'=>'index'))") !== false); + $this->assertTrue(strpos($result, "\$this->flash(__('The Article has been saved.', true), array('action' => 'index'))") !== false); $this->assertTrue(strpos($result, 'function edit($id = null)') !== false); $this->assertTrue(strpos($result, "\$this->Article->Tag->find('list')") !== false); @@ -332,7 +332,7 @@ function testBakeActionsWithNoSessions() { $this->assertTrue(strpos($result, 'function delete($id = null)') !== false); $this->assertTrue(strpos($result, 'if ($this->Article->del($id))') !== false); - $this->assertTrue(strpos($result, "\$this->flash(__('Article deleted', true), array('action'=>'index'))") !== false); + $this->assertTrue(strpos($result, "\$this->flash(__('Article deleted', true), array('action' => 'index'))") !== false); } /** From d810b43e80376d7e8a80adb68e07446a00e5970e Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 7 Jun 2009 12:22:43 -0400 Subject: [PATCH 0247/2083] Adding tests so no empty helpers/components can be added. Refs #6383 --- cake/console/libs/tasks/controller.php | 2 +- .../cases/console/libs/tasks/controller.test.php | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 1feffb840..770a94cc8 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -373,7 +373,7 @@ function _doPropertyChoices($prompt, $example) { $propertyListTrimmed = str_replace(' ', '', $propertyList); $property = explode(',', $propertyListTrimmed); } - return $property; + return array_filter($property); } /** diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 0cd154c8c..48c125ce4 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -181,6 +181,12 @@ function testDoHelpers() { $result = $this->Task->doHelpers(); $expected = array('Javascript', 'Ajax', 'CustomOne'); $this->assertEqual($result, $expected); + + $this->Task->setReturnValueAt(3, 'in', 'y'); + $this->Task->setReturnValueAt(4, 'in', ' Javascript, Ajax, CustomOne, , '); + $result = $this->Task->doHelpers(); + $expected = array('Javascript', 'Ajax', 'CustomOne'); + $this->assertEqual($result, $expected); } /** @@ -198,6 +204,12 @@ function testDoComponents() { $result = $this->Task->doComponents(); $expected = array('RequestHandler', 'Security'); $this->assertEqual($result, $expected); + + $this->Task->setReturnValueAt(3, 'in', 'y'); + $this->Task->setReturnValueAt(4, 'in', ' RequestHandler, Security, , '); + $result = $this->Task->doComponents(); + $expected = array('RequestHandler', 'Security'); + $this->assertEqual($result, $expected); } /** From 24d78dd671b86b84c8e1fc377c689468c9ecf7a1 Mon Sep 17 00:00:00 2001 From: gwoo <gwoo@cakephp.org> Date: Sun, 7 Jun 2009 15:24:10 -0700 Subject: [PATCH 0248/2083] moving path configuration to App class --- cake/console/cake.php | 4 +- cake/console/libs/testsuite.php | 2 +- cake/dispatcher.php | 2 +- cake/libs/configure.php | 784 ++++++++++-------- cake/libs/i18n.php | 2 +- cake/libs/view/view.php | 6 +- cake/tests/cases/basics.test.php | 4 +- cake/tests/cases/console/cake.test.php | 6 +- cake/tests/cases/console/libs/shell.test.php | 8 +- cake/tests/cases/dispatcher.test.php | 28 +- cake/tests/cases/libs/cake_test_case.test.php | 28 +- cake/tests/cases/libs/configure.test.php | 32 +- .../cases/libs/controller/component.test.php | 6 +- .../libs/controller/components/auth.test.php | 2 +- .../libs/controller/components/email.test.php | 6 +- .../components/request_handler.test.php | 6 +- .../cases/libs/controller/controller.test.php | 6 +- .../libs/controller/pages_controller.test.php | 6 +- .../cases/libs/controller/scaffold.test.php | 61 +- cake/tests/cases/libs/i18n.test.php | 10 +- cake/tests/cases/libs/object.test.php | 20 +- .../cases/libs/view/helpers/cache.test.php | 6 +- .../cases/libs/view/helpers/session.test.php | 2 +- cake/tests/cases/libs/view/theme.test.php | 8 +- cake/tests/cases/libs/view/view.test.php | 8 +- cake/tests/lib/cake_test_case.php | 2 +- cake/tests/lib/code_coverage_manager.php | 7 +- cake/tests/lib/test_manager.php | 2 +- 28 files changed, 538 insertions(+), 526 deletions(-) diff --git a/cake/console/cake.php b/cake/console/cake.php index 823e6fc00..0a88cccaa 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -198,7 +198,7 @@ function _initEnvironment() { */ function __buildPaths() { $paths = array(); - $pluginPaths = Configure::read('pluginPaths'); + $pluginPaths = App::path('plugins'); if (!class_exists('Folder')) { require LIBS . 'folder.php'; } @@ -259,7 +259,7 @@ function __bootstrap() { Configure::getInstance(file_exists(CONFIGS . 'bootstrap.php')); if (!file_exists(APP_PATH . 'config' . DS . 'core.php')) { - include_once CORE_PATH . 'cake' . DS . 'console' . DS . 'libs' . DS . 'templates' . DS . 'skel' . DS . 'config' . DS . 'core.php'; + include_once CORE_PATH . 'cake' . DS . 'console' . DS . 'templates' . DS . 'skel' . DS . 'config' . DS . 'core.php'; Configure::buildPaths(array()); } diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php index b11a7ea11..99b34d82e 100644 --- a/cake/console/libs/testsuite.php +++ b/cake/console/libs/testsuite.php @@ -316,7 +316,7 @@ function __findFolderByCategory($category) { } else { $scoredCategory = Inflector::underscore($category); $folder = APP . 'plugins' . DS . $scoredCategory . DS; - $pluginPaths = Configure::read('pluginPaths'); + $pluginPaths = App::path('plugins'); foreach ($pluginPaths as $path) { if (file_exists($path . $scoredCategory . DS . 'tests')) { $folder = $path . $scoredCategory . DS . 'tests'; diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 9756c841a..581db44aa 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -620,7 +620,7 @@ function cached($url) { if ($pos > 0) { $plugin = substr($url, 0, $pos - 1); $url = str_replace($plugin . '/', '', $url); - $pluginPaths = Configure::read('pluginPaths'); + $pluginPaths = App::path('plugins'); $count = count($pluginPaths); for ($i = 0; $i < $count; $i++) { $paths[] = $pluginPaths[$i] . $plugin . DS . 'vendors' . DS; diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 753549478..5a5545027 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -32,76 +32,6 @@ * @link http://book.cakephp.org/view/42/The-Configuration-Class */ class Configure extends Object { -/** - * List of additional path(s) where model files reside. - * - * @var array - * @access public - */ - var $modelPaths = array(); -/** - * List of additional path(s) where behavior files reside. - * - * @var array - * @access public - */ - var $behaviorPaths = array(); -/** - * List of additional path(s) where controller files reside. - * - * @var array - * @access public - */ - var $controllerPaths = array(); -/** - * List of additional path(s) where component files reside. - * - * @var array - * @access public - */ - var $componentPaths = array(); -/** - * List of additional path(s) where view files reside. - * - * @var array - * @access public - */ - var $viewPaths = array(); -/** - * List of additional path(s) where helper files reside. - * - * @var array - * @access public - */ - var $helperPaths = array(); -/** - * List of additional path(s) where plugins reside. - * - * @var array - * @access public - */ - var $pluginPaths = array(); -/** - * List of additional path(s) where vendor packages reside. - * - * @var array - * @access public - */ - var $vendorPaths = array(); -/** - * List of additional path(s) where locale files reside. - * - * @var array - * @access public - */ - var $localePaths = array(); -/** - * List of additional path(s) where console shell files reside. - * - * @var array - * @access public - */ - var $shellPaths = array(); /** * Current debug level. * @@ -117,13 +47,6 @@ class Configure extends Object { * @access private */ var $__cache = false; -/** - * Holds and key => value array of objects' types. - * - * @var array - * @access private - */ - var $__objects = array(); /** * Returns a singleton instance of the Configure class. * @@ -138,111 +61,6 @@ function &getInstance($boot = true) { } return $instance[0]; } -/** - * Returns an index of objects of the given type, with the physical path to each object. - * - * @param string $type Type of object, i.e. 'model', 'controller', 'helper', or 'plugin' - * @param mixed $path Optional - * @return Configure instance - * @access public - */ - function listObjects($type, $path = null, $cache = true) { - $objects = array(); - $extension = false; - $name = $type; - - if ($type === 'file' && !$path) { - return false; - } elseif ($type === 'file') { - $extension = true; - $name = $type . str_replace(DS, '', $path); - } - $_this =& Configure::getInstance(); - - if (empty($_this->__objects) && $cache === true) { - $_this->__objects = Cache::read('object_map', '_cake_core_'); - } - - if (empty($_this->__objects) || !isset($_this->__objects[$type]) || $cache !== true) { - $types = array( - 'model' => array('suffix' => '.php', 'base' => 'AppModel', 'core' => false), - 'behavior' => array('suffix' => '.php', 'base' => 'ModelBehavior'), - 'controller' => array('suffix' => '_controller.php', 'base' => 'AppController'), - 'component' => array('suffix' => '.php', 'base' => null), - 'view' => array('suffix' => '.php', 'base' => null), - 'helper' => array('suffix' => '.php', 'base' => 'AppHelper'), - 'plugin' => array('suffix' => '', 'base' => null), - 'vendor' => array('suffix' => '', 'base' => null), - 'class' => array('suffix' => '.php', 'base' => null), - 'file' => array('suffix' => '.php', 'base' => null) - ); - - if (!isset($types[$type])) { - return false; - } - $objects = array(); - - if (empty($path)) { - $path = $_this->{$type . 'Paths'}; - if (isset($types[$type]['core']) && $types[$type]['core'] === false) { - array_pop($path); - } - } - $items = array(); - - foreach ((array)$path as $dir) { - if ($type === 'file' || $type === 'class' || strpos($dir, $type) !== false) { - $items = $_this->__list($dir, $types[$type]['suffix'], $extension); - $objects = array_merge($items, array_diff($objects, $items)); - } - } - - if ($type !== 'file') { - foreach ($objects as $key => $value) { - $objects[$key] = Inflector::camelize($value); - } - } - if ($cache === true && !empty($objects)) { - $_this->__objects[$name] = $objects; - $_this->__cache = true; - } else { - return $objects; - } - } - return $_this->__objects[$name]; - } -/** - * Returns an array of filenames of PHP files in the given directory. - * - * @param string $path Path to scan for files - * @param string $suffix if false, return only directories. if string, match and return files - * @return array List of directories or files in directory - */ - function __list($path, $suffix = false, $extension = false) { - if (!class_exists('Folder')) { - require LIBS . 'folder.php'; - } - $items = array(); - $Folder =& new Folder($path); - $contents = $Folder->read(false, true); - - if (is_array($contents)) { - if (!$suffix) { - return $contents[0]; - } else { - foreach ($contents[1] as $item) { - if (substr($item, - strlen($suffix)) === $suffix) { - if ($extension) { - $items[] = $item; - } else { - $items[] = substr($item, 0, strlen($item) - strlen($suffix)); - } - } - } - } - } - return $items; - } /** * Used to store a dynamic variable in the Configure instance. * @@ -254,7 +72,7 @@ function __list($path, $suffix = false, $extension = false) { * 'key1' => 'value of the Configure::One[key1]', * 'key2' => 'value of the Configure::One[key2]' * ); - * + * * Configure::write(array( * 'One.key1' => 'value of the Configure::One[key1]', * 'One.key2' => 'value of the Configure::One[key2]' @@ -403,7 +221,7 @@ function load($fileName) { include(CACHE . 'persistent' . DS . $fileName . '.php'); $found = true; } else { - foreach (Configure::corePaths('cake') as $key => $path) { + foreach (App::core('cake') as $key => $path) { if (file_exists($path . DS . 'config' . DS . $fileName . '.php')) { include($path . DS . 'config' . DS . $fileName . '.php'); $found = true; @@ -479,57 +297,6 @@ function store($type, $name, $data = array()) { } Configure::__writeConfig($content, $name, $write); } -/** - * Returns a key/value list of all paths where core libs are found. - * Passing $type only returns the values for a given value of $key. - * - * @param string $type valid values are: 'model', 'behavior', 'controller', 'component', - * 'view', 'helper', 'datasource', 'libs', and 'cake' - * @return array numeric keyed array of core lib paths - * @access public - */ - function corePaths($type = null) { - $paths = Cache::read('core_paths', '_cake_core_'); - if (!$paths) { - $paths = array(); - $openBasedir = ini_get('open_basedir'); - if ($openBasedir) { - $all = explode(PATH_SEPARATOR, $openBasedir); - $all = array_flip(array_flip((array_merge(array(CAKE_CORE_INCLUDE_PATH), $all)))); - } else { - $all = explode(PATH_SEPARATOR, ini_get('include_path')); - $all = array_flip(array_flip((array_merge(array(CAKE_CORE_INCLUDE_PATH), $all)))); - } - foreach ($all as $path) { - if ($path !== DS) { - $path = rtrim($path, DS); - } - if (empty($path) || $path === '.') { - continue; - } - $cake = $path . DS . 'cake' . DS; - $libs = $cake . 'libs' . DS; - if (is_dir($libs)) { - $paths['libs'][] = $libs; - $paths['model'][] = $libs . 'model' . DS; - $paths['behavior'][] = $libs . 'model' . DS . 'behaviors' . DS; - $paths['controller'][] = $libs . 'controller' . DS; - $paths['component'][] = $libs . 'controller' . DS . 'components' . DS; - $paths['view'][] = $libs . 'view' . DS; - $paths['helper'][] = $libs . 'view' . DS . 'helpers' . DS; - $paths['cake'][] = $cake; - $paths['vendor'][] = $path . DS . 'vendors' . DS; - $paths['shell'][] = $cake . 'console' . DS . 'libs' . DS; - break; - } - } - Cache::write('core_paths', array_filter($paths), '_cake_core_'); - } - if ($type && isset($paths[$type])) { - return $paths[$type]; - } - return $paths; - } /** * Creates a cached version of a configuration file. * Appends values passed from Configure::store() to the cached file @@ -566,20 +333,287 @@ function __writeConfig($content, $name, $write = true) { } } /** - * Checks $name for dot notation to create dynamic Configure::$var as an array when needed. + * Checks $name for dot notation to create dynamic Configure::$var as an array when needed. + * + * @param mixed $name Name to split + * @return array Name separated in items through dot notation + * @access private + */ + function __configVarNames($name) { + if (is_string($name)) { + if (strpos($name, ".")) { + return explode(".", $name); + } + return array($name); + } + return $name; + } +/** + * @deprecated + * @see App::objects() + */ + function listObjects($type, $path = null, $cache = true) { + return App::objects($type, $path, $cache); + } +/** + * @deprecated + * @see App::core() + */ + function corePaths($type = null) { + return App::core($type); + } +/** + * @deprecated + * @see App::build() + */ + function buildPaths($paths) { + return App::build($paths); + } +/** + * Loads app/config/bootstrap.php. + * If the alternative paths are set in this file + * they will be added to the paths vars. + * + * @param boolean $boot Load application bootstrap (if true) + * @return void + * @access private + */ + function __loadBootstrap($boot) { + $modelPaths = $behaviorPaths = $controllerPaths = $componentPaths = $viewPaths = $helperPaths = $pluginPaths = $vendorPaths = $localePaths = $shellPaths = null; + + if ($boot) { + Configure::write('App', array('base' => false, 'baseUrl' => false, 'dir' => APP_DIR, 'webroot' => WEBROOT_DIR)); + + if (!include(CONFIGS . 'core.php')) { + trigger_error(sprintf(__("Can't find application core file. Please create %score.php, and make sure it is readable by PHP.", true), CONFIGS), E_USER_ERROR); + } + + if (!include(CONFIGS . 'bootstrap.php')) { + trigger_error(sprintf(__("Can't find application bootstrap file. Please create %sbootstrap.php, and make sure it is readable by PHP.", true), CONFIGS), E_USER_ERROR); + } + + if (Configure::read('Cache.disable') !== true) { + $cache = Cache::config('default'); + + if (empty($cache['settings'])) { + trigger_error('Cache not configured properly. Please check Cache::config(); in APP/config/core.php', E_USER_WARNING); + $cache = Cache::config('default', array('engine' => 'File')); + } + $path = $prefix = $duration = null; + + if (!empty($cache['settings']['path'])) { + $path = realpath($cache['settings']['path']); + } else { + $prefix = $cache['settings']['prefix']; + } + + if (Configure::read() >= 1) { + $duration = '+10 seconds'; + } else { + $duration = '+999 days'; + } + + if (Cache::config('_cake_core_') === false) { + Cache::config('_cake_core_', array_merge($cache['settings'], array( + 'prefix' => $prefix . 'cake_core_', 'path' => $path . DS . 'persistent' . DS, + 'serialize' => true, 'duration' => $duration + ))); + } + + if (Cache::config('_cake_model_') === false) { + Cache::config('_cake_model_', array_merge($cache['settings'], array( + 'prefix' => $prefix . 'cake_model_', 'path' => $path . DS . 'models' . DS, + 'serialize' => true, 'duration' => $duration + ))); + } + Cache::config('default'); + } + App::build(compact( + 'models', 'views', 'controllers', 'helpers', 'components', + 'behaviors', 'plugins', 'vendors', 'locales', 'shells' + )); + } + } +/** + * Caches the object map when the instance of the Configure class is destroyed + * + * @access public + */ + function __destruct() { + if ($this->__cache) { + Cache::write('object_map', array_filter($this->__objects), '_cake_core_'); + } + } +} +/** + * Class and file loader. + * + * @link http://book.cakephp.org/view/499/The-App-Class + * @since CakePHP(tm) v 1.2.0.6001 + * @package cake + * @subpackage cake.cake.libs + */ +class App extends Object { +/** + * List of object types and their properties + * + * @var array + * @access public + */ + var $objects = array( + 'model' => array('suffix' => '.php', 'base' => 'AppModel', 'core' => false), + 'behavior' => array('suffix' => '.php', 'base' => 'ModelBehavior'), + 'controller' => array('suffix' => '_controller.php', 'base' => 'AppController'), + 'component' => array('suffix' => '.php', 'base' => null), + 'view' => array('suffix' => '.php', 'base' => null), + 'helper' => array('suffix' => '.php', 'base' => 'AppHelper'), + 'plugin' => array('suffix' => '', 'base' => null), + 'vendor' => array('suffix' => '', 'base' => null), + 'shell' => array('suffix' => 'Shell', 'base' => 'Shell'), + 'class' => array('suffix' => '.php', 'base' => null), + 'file' => array('suffix' => '.php', 'base' => null) + ); + +/** + * List of additional path(s) where model files reside. + * + * @var array + * @access protected + */ + var $_models = array(); +/** + * List of additional path(s) where behavior files reside. + * + * @var array + * @access protected + */ + var $_behaviors = array(); +/** + * List of additional path(s) where controller files reside. + * + * @var array + * @access protected + */ + var $_controllers = array(); +/** + * List of additional path(s) where component files reside. + * + * @var array + * @access protected + */ + var $_components = array(); +/** + * List of additional path(s) where view files reside. + * + * @var array + * @access protected + */ + var $_views = array(); +/** + * List of additional path(s) where helper files reside. + * + * @var array + * @access protected + */ + var $_helpers = array(); +/** + * List of additional path(s) where plugins reside. + * + * @var array + * @access protected + */ + var $_plugins = array(); +/** + * List of additional path(s) where vendor packages reside. + * + * @var array + * @access protected + */ + var $_vendors = array(); +/** + * List of additional path(s) where locale files reside. + * + * @var array + * @access protected + */ + var $_locales = array(); +/** + * List of additional path(s) where console shell files reside. + * + * @var array + * @access protected + */ + var $_shells = array(); +/** + * Paths to search for files. + * + * @var array + * @access public + */ + var $search = array(); +/** + * Whether or not to return the file that is loaded. + * + * @var boolean + * @access public + */ + var $return = false; +/** + * Determines if $__maps and $__paths cache should be written. + * + * @var boolean + * @access private + */ + var $__cache = false; +/** + * Holds key/value pairs of $type => file path. + * + * @var array + * @access private + */ + var $__map = array(); +/** + * Holds paths for deep searching of files. + * + * @var array + * @access private + */ + var $__paths = array(); +/** + * Holds loaded files. + * + * @var array + * @access private + */ + var $__loaded = array(); +/** + * Holds and key => value array of object types. * - * @param mixed $name Name to split - * @return array Name separated in items through dot notation + * @var array * @access private */ - function __configVarNames($name) { - if (is_string($name)) { - if (strpos($name, ".")) { - return explode(".", $name); - } - return array($name); + var $__objects = array(); +/** + * Used to read information stored path + * + * Usage + * App::path('models'); will return all paths for models + * + * @param string $type type of path + * @return string array + * @access public + */ + function path($type, $value = array()) { + $_this =& App::getInstance(); + if (!isset($_this->{"_{$type}"})) { + return array(); + } + if (empty($value)) { + return $_this->{"_{$type}"}; + } + if (!empty($value)) { + return $_this->{"_{$type}"} = (array)$value; } - return $name; } /** * Build path references. Merges the supplied $paths @@ -589,12 +623,13 @@ function __configVarNames($name) { * @return void * @access public */ - function buildPaths($paths) { - $_this =& Configure::getInstance(); - $core = $_this->corePaths(); + function build($paths = array()) { + $_this =& App::getInstance(); + $core = $_this->core(); $basePaths = array( 'model' => array(MODELS), 'behavior' => array(BEHAVIORS), + 'datasource' => array(MODELS . 'datasources'), 'controller' => array(CONTROLLERS), 'component' => array(COMPONENTS), 'view' => array(VIEWS), @@ -602,12 +637,11 @@ function buildPaths($paths) { 'plugin' => array(APP . 'plugins' . DS), 'vendor' => array(APP . 'vendors' . DS, VENDORS), 'locale' => array(APP . 'locale' . DS), - 'shell' => array(), - 'datasource' => array(MODELS . 'datasources') + 'shell' => array() ); foreach ($basePaths as $type => $default) { - $pathsVar = $type . 'Paths'; + $pathsVar = "_{$type}s"; $merge = array(); if (isset($core[$type])) { @@ -634,132 +668,118 @@ function buildPaths($paths) { } } /** - * Loads app/config/bootstrap.php. - * If the alternative paths are set in this file - * they will be added to the paths vars. + * Returns a key/value list of all paths where core libs are found. + * Passing $type only returns the values for a given value of $key. * - * @param boolean $boot Load application bootstrap (if true) - * @return void - * @access private + * @param string $type valid values are: 'model', 'behavior', 'controller', 'component', + * 'view', 'helper', 'datasource', 'libs', and 'cake' + * @return array numeric keyed array of core lib paths + * @access public */ - function __loadBootstrap($boot) { - $modelPaths = $behaviorPaths = $controllerPaths = $componentPaths = $viewPaths = $helperPaths = $pluginPaths = $vendorPaths = $localePaths = $shellPaths = null; - - if ($boot) { - Configure::write('App', array('base' => false, 'baseUrl' => false, 'dir' => APP_DIR, 'webroot' => WEBROOT_DIR)); - - if (!include(CONFIGS . 'core.php')) { - trigger_error(sprintf(__("Can't find application core file. Please create %score.php, and make sure it is readable by PHP.", true), CONFIGS), E_USER_ERROR); + function core($type = null) { + $paths = Cache::read('core_paths', '_cake_core_'); + if (!$paths) { + $paths = array(); + $openBasedir = ini_get('open_basedir'); + if ($openBasedir) { + $all = explode(PATH_SEPARATOR, $openBasedir); + $all = array_flip(array_flip((array_merge(array(CAKE_CORE_INCLUDE_PATH), $all)))); + } else { + $all = explode(PATH_SEPARATOR, ini_get('include_path')); + $all = array_flip(array_flip((array_merge(array(CAKE_CORE_INCLUDE_PATH), $all)))); } - - if (!include(CONFIGS . 'bootstrap.php')) { - trigger_error(sprintf(__("Can't find application bootstrap file. Please create %sbootstrap.php, and make sure it is readable by PHP.", true), CONFIGS), E_USER_ERROR); + foreach ($all as $path) { + if ($path !== DS) { + $path = rtrim($path, DS); + } + if (empty($path) || $path === '.') { + continue; + } + $cake = $path . DS . 'cake' . DS; + $libs = $cake . 'libs' . DS; + if (is_dir($libs)) { + $paths['libs'][] = $libs; + $paths['model'][] = $libs . 'model' . DS; + $paths['behavior'][] = $libs . 'model' . DS . 'behaviors' . DS; + $paths['controller'][] = $libs . 'controller' . DS; + $paths['component'][] = $libs . 'controller' . DS . 'components' . DS; + $paths['view'][] = $libs . 'view' . DS; + $paths['helper'][] = $libs . 'view' . DS . 'helpers' . DS; + $paths['cake'][] = $cake; + $paths['vendor'][] = $path . DS . 'vendors' . DS; + $paths['shell'][] = $cake . 'console' . DS . 'libs' . DS; + break; + } } + Cache::write('core_paths', array_filter($paths), '_cake_core_'); + } + if ($type && isset($paths[$type])) { + return $paths[$type]; + } + return $paths; + } +/** + * Returns an index of objects of the given type, with the physical path to each object. + * + * @param string $type Type of object, i.e. 'model', 'controller', 'helper', or 'plugin' + * @param mixed $path Optional + * @return Configure instance + * @access public + */ + function objects($type, $path = null, $cache = true) { + $objects = array(); + $extension = false; + $name = $type; - if (Configure::read('Cache.disable') !== true) { - $cache = Cache::config('default'); + if ($type === 'file' && !$path) { + return false; + } elseif ($type === 'file') { + $extension = true; + $name = $type . str_replace(DS, '', $path); + } + $_this =& App::getInstance(); - if (empty($cache['settings'])) { - trigger_error('Cache not configured properly. Please check Cache::config(); in APP/config/core.php', E_USER_WARNING); - $cache = Cache::config('default', array('engine' => 'File')); - } - $path = $prefix = $duration = null; + if (empty($_this->__objects) && $cache === true) { + $_this->__objects = Cache::read('object_map', '_cake_core_'); + } - if (!empty($cache['settings']['path'])) { - $path = realpath($cache['settings']['path']); - } else { - $prefix = $cache['settings']['prefix']; - } + if (empty($_this->__objects) || !isset($_this->__objects[$type]) || $cache !== true) { + $types = $_this->objects; - if (Configure::read() >= 1) { - $duration = '+10 seconds'; - } else { - $duration = '+999 days'; + if (!isset($types[$type])) { + return false; + } + $objects = array(); + + if (empty($path)) { + $path = $_this->{"_{$type}s"}; + if (isset($types[$type]['core']) && $types[$type]['core'] === false) { + array_pop($path); } + } + $items = array(); - if (Cache::config('_cake_core_') === false) { - Cache::config('_cake_core_', array_merge($cache['settings'], array( - 'prefix' => $prefix . 'cake_core_', 'path' => $path . DS . 'persistent' . DS, - 'serialize' => true, 'duration' => $duration - ))); + foreach ((array)$path as $dir) { + if ($type === 'file' || $type === 'class' || strpos($dir, $type) !== false) { + $items = $_this->__list($dir, $types[$type]['suffix'], $extension); + $objects = array_merge($items, array_diff($objects, $items)); } + } - if (Cache::config('_cake_model_') === false) { - Cache::config('_cake_model_', array_merge($cache['settings'], array( - 'prefix' => $prefix . 'cake_model_', 'path' => $path . DS . 'models' . DS, - 'serialize' => true, 'duration' => $duration - ))); + if ($type !== 'file') { + foreach ($objects as $key => $value) { + $objects[$key] = Inflector::camelize($value); } - Cache::config('default'); } - Configure::buildPaths(compact( - 'modelPaths', 'viewPaths', 'controllerPaths', 'helperPaths', 'componentPaths', - 'behaviorPaths', 'pluginPaths', 'vendorPaths', 'localePaths', 'shellPaths' - )); - } - } -/** - * Caches the object map when the instance of the Configure class is destroyed - * - * @access public - */ - function __destruct() { - if ($this->__cache) { - Cache::write('object_map', array_filter($this->__objects), '_cake_core_'); + if ($cache === true && !empty($objects)) { + $_this->__objects[$name] = $objects; + $_this->__cache = true; + } else { + return $objects; + } } + return $_this->__objects[$name]; } -} -/** - * Class and file loader. - * - * @link http://book.cakephp.org/view/499/The-App-Class - * @since CakePHP(tm) v 1.2.0.6001 - * @package cake - * @subpackage cake.cake.libs - */ -class App extends Object { -/** - * Paths to search for files. - * - * @var array - * @access public - */ - var $search = array(); -/** - * Whether or not to return the file that is loaded. - * - * @var boolean - * @access public - */ - var $return = false; -/** - * Determines if $__maps and $__paths cache should be written. - * - * @var boolean - * @access private - */ - var $__cache = false; -/** - * Holds key/value pairs of $type => file path. - * - * @var array - * @access private - */ - var $__map = array(); -/** - * Holds paths for deep searching of files. - * - * @var array - * @access private - */ - var $__paths = array(); -/** - * Holds loaded files. - * - * @var array - * @access private - */ - var $__loaded = array(); /** * Finds classes based on $name or specific file(s) to search. * @@ -1057,10 +1077,10 @@ function __settings($type, $plugin, $parent) { switch ($load) { case 'model': if (!class_exists('Model')) { - App::import('Core', 'Model', false, Configure::corePaths('model')); + App::import('Core', 'Model', false, App::core('model')); } if (!class_exists('AppModel')) { - App::import($type, 'AppModel', false, Configure::read('modelPaths')); + App::import($type, 'AppModel', false, App::path('models')); } if ($plugin) { if (!class_exists($name . 'AppModel')) { @@ -1128,7 +1148,7 @@ function __paths($type) { $type = strtolower($type); if ($type === 'core') { - $path = Configure::corePaths(); + $path = App::core(); $paths = array(); foreach ($path as $key => $value) { @@ -1140,7 +1160,7 @@ function __paths($type) { return $paths; } - if ($paths = Configure::read($type . 'Paths')) { + if ($paths = App::path($type .'s')) { return $paths; } @@ -1174,6 +1194,38 @@ function __remove($name, $type, $plugin) { unset($this->__map[$type][$name]); } } +/** + * Returns an array of filenames of PHP files in the given directory. + * + * @param string $path Path to scan for files + * @param string $suffix if false, return only directories. if string, match and return files + * @return array List of directories or files in directory + */ + function __list($path, $suffix = false, $extension = false) { + if (!class_exists('Folder')) { + require LIBS . 'folder.php'; + } + $items = array(); + $Folder =& new Folder($path); + $contents = $Folder->read(false, true); + + if (is_array($contents)) { + if (!$suffix) { + return $contents[0]; + } else { + foreach ($contents[1] as $item) { + if (substr($item, - strlen($suffix)) === $suffix) { + if ($extension) { + $items[] = $item; + } else { + $items[] = substr($item, 0, strlen($item) - strlen($suffix)); + } + } + } + } + } + return $items; + } /** * Object destructor. * @@ -1184,7 +1236,7 @@ function __remove($name, $type, $plugin) { */ function __destruct() { if ($this->__cache) { - $core = Configure::corePaths('cake'); + $core = App::core('cake'); unset($this->__paths[rtrim($core[0], DS)]); Cache::write('dir_map', array_filter($this->__paths), '_cake_core_'); Cache::write('file_map', array_filter($this->__map), '_cake_core_'); diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index 850ac5782..eb7cf2e44 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -255,7 +255,7 @@ function __bindTextDomain($domain) { $plugins = Configure::listObjects('plugin'); if (!empty($plugins)) { - $pluginPaths = Configure::read('pluginPaths'); + $pluginPaths = App::path('plugins'); foreach ($plugins as $plugin) { $plugin = Inflector::underscore($plugin); diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index a3c27b308..0dc2a02df 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -814,7 +814,7 @@ function _getViewFileName($name = null) { $defaultPath = $paths[0]; if ($this->plugin) { - $pluginPaths = Configure::read('pluginPaths'); + $pluginPaths = App::path('plugins'); foreach ($paths as $path) { if (strpos($path, $pluginPaths[0]) === 0) { $defaultPath = $path; @@ -890,14 +890,14 @@ function _paths($plugin = null, $cached = true) { return $this->__paths; } $paths = array(); - $viewPaths = Configure::read('viewPaths'); + $viewPaths = App::path('views'); if ($plugin !== null) { $count = count($viewPaths); for ($i = 0; $i < $count; $i++) { $paths[] = $viewPaths[$i] . 'plugins' . DS . $plugin . DS; } - $pluginPaths = Configure::read('pluginPaths'); + $pluginPaths = App::path('plugins'); $count = count($pluginPaths); for ($i = 0; $i < $count; $i++) { diff --git a/cake/tests/cases/basics.test.php b/cake/tests/cases/basics.test.php index 3526a7ca2..69ec59752 100644 --- a/cake/tests/cases/basics.test.php +++ b/cake/tests/cases/basics.test.php @@ -41,7 +41,7 @@ class BasicsTest extends CakeTestCase { */ function setUp() { $this->_localePaths = Configure::read('localePaths'); - Configure::write('localePaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale')); + App::path('locales', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale')); $this->_language = Configure::read('Config.language'); } /** @@ -51,7 +51,7 @@ function setUp() { * @return void */ function tearDown() { - Configure::write('localePaths', $this->_localePaths); + App::path('locales', $this->_localePaths); Configure::write('Config.language', $this->_language); } /** diff --git a/cake/tests/cases/console/cake.test.php b/cake/tests/cases/console/cake.test.php index 9ec2e57dd..7beeb1e4b 100644 --- a/cake/tests/cases/console/cake.test.php +++ b/cake/tests/cases/console/cake.test.php @@ -123,10 +123,10 @@ class ShellDispatcherTest extends UnitTestCase { * @return void */ function setUp() { - $this->_pluginPaths = Configure::read('pluginPaths'); + $this->_pluginPaths = App::path('plugins'); $this->_shellPaths = Configure::read('shellPaths'); - Configure::write('pluginPaths', array( + App::path('plugins', array( TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS )); Configure::write('shellPaths', array( @@ -141,7 +141,7 @@ function setUp() { * @return void */ function tearDown() { - Configure::write('pluginPaths', $this->_pluginPaths); + App::path('plugins', $this->_pluginPaths); Configure::write('shellPaths', $this->_shellPaths); } /** diff --git a/cake/tests/cases/console/libs/shell.test.php b/cake/tests/cases/console/libs/shell.test.php index bfd15a95b..76bfe3c22 100644 --- a/cake/tests/cases/console/libs/shell.test.php +++ b/cake/tests/cases/console/libs/shell.test.php @@ -124,8 +124,8 @@ function testInitialize() { 'pluginPaths' => Configure::read('pluginPaths'), 'viewPaths' => Configure::read('viewPaths'), ); - Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); - Configure::write('modelPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS)); + App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); + App::path('models', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS)); $this->Shell->uses = array('TestPlugin.TestPluginPost'); $this->Shell->initialize(); @@ -144,8 +144,8 @@ function testInitialize() { $this->assertTrue(isset($this->Shell->AppModel)); $this->assertIsA($this->Shell->AppModel, 'AppModel'); - Configure::write('pluginPaths', $_back['pluginPaths']); - Configure::write('modelPaths', $_back['modelPaths']); + App::path('plugins', $_back['pluginPaths']); + App::path('models', $_back['modelPaths']); } /** * testOut method diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index fd0fff3b9..fdc6491b6 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -509,14 +509,14 @@ function startTest() { $this->_cache = Configure::read('Cache'); Configure::write('Cache.disable', true); - $this->_vendorPaths = Configure::read('vendorPaths'); - $this->_pluginPaths = Configure::read('pluginPaths'); - $this->_viewPaths = Configure::read('viewPaths'); - $this->_controllerPaths = Configure::read('controllerPaths'); + $this->_vendorPaths = App::path('vendors'); + $this->_pluginPaths = App::path('plugins'); + $this->_viewPaths = App::path('views'); + $this->_controllerPaths = App::path('controllers'); $this->_debug = Configure::read('debug'); - Configure::write('controllerPaths', Configure::corePaths('controller')); - Configure::write('viewPaths', Configure::corePaths('view')); + App::path('controllers', Configure::corePaths('controller')); + App::path('views', Configure::corePaths('view')); } /** * tearDown method @@ -532,9 +532,9 @@ function endTest() { Configure::write('App', $this->_app); Configure::write('Cache', $this->_cache); Configure::write('vendorPaths', $this->_vendorPaths); - Configure::write('pluginPaths', $this->_pluginPaths); - Configure::write('viewPaths', $this->_viewPaths); - Configure::write('controllerPaths', $this->_controllerPaths); + App::path('plugins', $this->_pluginPaths); + App::path('views', $this->_viewPaths); + App::path('controllers', $this->_controllerPaths); Configure::write('debug', $this->_debug); } /** @@ -1623,8 +1623,8 @@ function testPrefixProtection() { **/ function testTestPluginDispatch() { $Dispatcher =& new TestDispatcher(); - $_back = Configure::read('pluginPaths'); - Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); + $_back = App::path('plugins'); + App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); $url = '/test_plugin/tests/index'; $result = $Dispatcher->dispatch($url, array('return' => 1)); $this->assertTrue(class_exists('TestsController')); @@ -1632,7 +1632,7 @@ function testTestPluginDispatch() { $this->assertTrue(class_exists('OtherComponentComponent')); $this->assertTrue(class_exists('PluginsComponentComponent')); - Configure::write('pluginPaths', $_back); + App::path('plugins', $_back); } /** * testChangingParamsFromBeforeFilter method @@ -1678,7 +1678,7 @@ function testStaticAssets() { $Configure = Configure::getInstance(); $Configure->__objects = null; - Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); + App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); Configure::write('vendorPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors'. DS)); $Dispatcher =& new TestDispatcher(); @@ -1734,7 +1734,7 @@ function testFullPageCachingDispatch() { Router::reload(); Router::connect('/', array('controller' => 'test_cached_pages', 'action' => 'index')); - Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); + App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); $dispatcher =& new Dispatcher(); $dispatcher->base = false; diff --git a/cake/tests/cases/libs/cake_test_case.test.php b/cake/tests/cases/libs/cake_test_case.test.php index 399106bc6..6b8dce1f3 100644 --- a/cake/tests/cases/libs/cake_test_case.test.php +++ b/cake/tests/cases/libs/cake_test_case.test.php @@ -244,10 +244,10 @@ function testTestAction() { 'model' => Configure::read('modelPaths'), 'plugin' => Configure::read('pluginPaths') ); - Configure::write('controllerPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)); - Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)); - Configure::write('modelPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS)); - Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); + App::path('controllers', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)); + App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)); + App::path('models', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS)); + App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); $result = $this->Case->testAction('/tests_apps/index', array('return' => 'view')); $this->assertPattern('/This is the TestsAppsController index view/', $result); @@ -367,10 +367,10 @@ function testTestAction() { $fixture->drop($db); - Configure::write('modelPaths', $_back['model']); - Configure::write('controllerPaths', $_back['controller']); - Configure::write('viewPaths', $_back['view']); - Configure::write('pluginPaths', $_back['plugin']); + App::path('models', $_back['model']); + App::path('controllers', $_back['controller']); + App::path('views', $_back['view']); + App::path('plugins', $_back['plugin']); } /** * testSkipIf @@ -393,9 +393,9 @@ function testTestDispatcher() { 'view' => Configure::read('viewPaths'), 'plugin' => Configure::read('pluginPaths') ); - Configure::write('controllerPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)); - Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)); - Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); + App::path('controllers', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)); + App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)); + App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); $Dispatcher =& new CakeTestDispatcher(); $Case =& new CakeDispatcherMockTestCase(); @@ -408,9 +408,9 @@ function testTestDispatcher() { $return = $Dispatcher->dispatch('/tests_apps/index', array('autoRender' => 0, 'return' => 1, 'requested' => 1)); - Configure::write('controllerPaths', $_back['controller']); - Configure::write('viewPaths', $_back['view']); - Configure::write('pluginPaths', $_back['plugin']); + App::path('controllers', $_back['controller']); + App::path('views', $_back['view']); + App::path('plugins', $_back['plugin']); } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/configure.test.php b/cake/tests/cases/libs/configure.test.php index 10eea816a..63fd1e87f 100644 --- a/cake/tests/cases/libs/configure.test.php +++ b/cake/tests/cases/libs/configure.test.php @@ -248,17 +248,6 @@ function testVersion() { $result = Configure::version(); $this->assertTrue(version_compare($result, '1.2', '>=')); } -/** - * testBuildPaths method - * - * @access public - * @return void - */ - function testBuildPaths() { - Configure::buildPaths(array()); - $models = Configure::read('modelPaths'); - $this->assertTrue(!empty($models)); - } } /** * AppImportTest class @@ -267,6 +256,17 @@ function testBuildPaths() { * @subpackage cake.tests.cases.libs */ class AppImportTest extends UnitTestCase { +/** + * testBuildPaths method + * + * @access public + * @return void + */ + function testBuild() { + App::build(); + $models = App::path('models'); + $this->assertTrue(!empty($models)); + } /** * testClassLoading method * @@ -341,8 +341,8 @@ function testClassLoading() { $this->assertFalse($file); } - $_back = Configure::read('pluginPaths'); - Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); + $_back = App::path('plugins'); + App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); $result = App::import('Controller', 'TestPlugin.Tests'); $this->assertTrue($result); @@ -353,7 +353,7 @@ function testClassLoading() { $this->assertTrue($result); $this->assertTrue(class_exists('OtherHelperHelper')); - Configure::write('pluginPaths', $_back); + App::path('plugins', $_back); } /** * testFileLoading method @@ -483,8 +483,8 @@ function testMultipleLoadingByType() { } */ function testLoadingVendor() { - Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); - Configure::write('vendorPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors'. DS)); + App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); + App::path('vendors', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors'. DS)); ob_start(); $result = App::import('Vendor', 'TestPlugin.TestPluginAsset', array('ext' => 'css')); diff --git a/cake/tests/cases/libs/controller/component.test.php b/cake/tests/cases/libs/controller/component.test.php index cd99ec02c..e893c92a6 100644 --- a/cake/tests/cases/libs/controller/component.test.php +++ b/cake/tests/cases/libs/controller/component.test.php @@ -280,8 +280,8 @@ class ComponentTest extends CakeTestCase { * @return void */ function setUp() { - $this->_pluginPaths = Configure::read('pluginPaths'); - Configure::write('pluginPaths', array( + $this->_pluginPaths = App::path('plugins'); + App::path('plugins', array( TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS )); } @@ -292,7 +292,7 @@ function setUp() { * @return void */ function tearDown() { - Configure::write('pluginPaths', $this->_pluginPaths); + App::path('plugins', $this->_pluginPaths); ClassRegistry::flush(); } /** diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php index 00bf8a9c6..101900096 100644 --- a/cake/tests/cases/libs/controller/components/auth.test.php +++ b/cake/tests/cases/libs/controller/components/auth.test.php @@ -1171,7 +1171,7 @@ function testAdminRoute() { * @return void */ function testAjaxLogin() { - Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); + App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); $_SERVER['HTTP_X_REQUESTED_WITH'] = "XMLHttpRequest"; if (!class_exists('dispatcher')) { diff --git a/cake/tests/cases/libs/controller/components/email.test.php b/cake/tests/cases/libs/controller/components/email.test.php index 08f033aac..ba779dc02 100644 --- a/cake/tests/cases/libs/controller/components/email.test.php +++ b/cake/tests/cases/libs/controller/components/email.test.php @@ -181,8 +181,8 @@ function setUp() { $this->Controller->EmailTest->initialize($this->Controller, array()); ClassRegistry::addObject('view', new View($this->Controller)); - $this->_viewPaths = Configure::read('viewPaths'); - Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); + $this->_viewPaths = App::path('views'); + App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); } /** @@ -193,7 +193,7 @@ function setUp() { */ function tearDown() { Configure::write('App.encoding', $this->_appEncoding); - Configure::write('viewPaths', $this->_viewPaths); + App::path('views', $this->_viewPaths); $this->Controller->Session->del('Message'); restore_error_handler(); ClassRegistry::flush(); diff --git a/cake/tests/cases/libs/controller/components/request_handler.test.php b/cake/tests/cases/libs/controller/components/request_handler.test.php index 0af25da9c..68c30bd00 100644 --- a/cake/tests/cases/libs/controller/components/request_handler.test.php +++ b/cake/tests/cases/libs/controller/components/request_handler.test.php @@ -485,9 +485,9 @@ function testClientProperties() { function testAjaxRedirectAsRequestAction() { $_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'; $this->_init(); - $_paths = Configure::read('viewPaths'); + $_paths = App::path('views'); $testDir = array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS); - Configure::write('viewPaths', array_merge($testDir, $_paths)); + App::path('views', array_merge($testDir, $_paths)); $this->Controller->RequestHandler = new NoStopRequestHandler($this); $this->Controller->RequestHandler->expectOnce('_stop'); @@ -499,7 +499,7 @@ function testAjaxRedirectAsRequestAction() { $result = ob_get_clean(); $this->assertPattern('/posts index/', $result, 'RequestAction redirect failed.'); - Configure::write('viewPaths', $_paths); + App::path('views', $_paths); unset($_SERVER['HTTP_X_REQUESTED_WITH']); } /** diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index 27ef1da67..4ea98cbc7 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -397,7 +397,7 @@ function testConstructClasses() { $_back = array( 'pluginPaths' => Configure::read('pluginPaths'), ); - Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); + App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); $Controller =& new Controller(); $Controller->uses = array('TestPlugin.TestPluginPost'); @@ -407,7 +407,7 @@ function testConstructClasses() { $this->assertTrue(isset($Controller->TestPluginPost)); $this->assertTrue(is_a($Controller->TestPluginPost, 'TestPluginPost')); - Configure::write('pluginPaths', $_back['pluginPaths']); + App::path('plugins', $_back['pluginPaths']); unset($Controller); } /** @@ -706,7 +706,7 @@ function testControllerSet() { * @return void */ function testRender() { - Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS)); + App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS)); $Controller =& new Controller(); $Controller->viewPath = 'posts'; diff --git a/cake/tests/cases/libs/controller/pages_controller.test.php b/cake/tests/cases/libs/controller/pages_controller.test.php index 66980e744..fd92a4651 100644 --- a/cake/tests/cases/libs/controller/pages_controller.test.php +++ b/cake/tests/cases/libs/controller/pages_controller.test.php @@ -44,7 +44,7 @@ class PagesControllerTest extends CakeTestCase { * @return void */ function setUp() { - $this->_viewPaths = Configure::read('viewPaths'); + $this->_viewPaths = App::path('views'); } /** * tearDown method @@ -53,7 +53,7 @@ function setUp() { * @return void */ function tearDown() { - Configure::write('viewPaths', $this->_viewPaths); + App::path('views', $this->_viewPaths); } /** * testDisplay method @@ -66,7 +66,7 @@ function testDisplay() { return; } - Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS)); + App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS)); $Pages =& new PagesController(); $Pages->viewPath = 'posts'; diff --git a/cake/tests/cases/libs/controller/scaffold.test.php b/cake/tests/cases/libs/controller/scaffold.test.php index 78dca4ee3..07a4d35b8 100644 --- a/cake/tests/cases/libs/controller/scaffold.test.php +++ b/cake/tests/cases/libs/controller/scaffold.test.php @@ -266,8 +266,8 @@ function testGetViewFilename() { 'viewPaths' => Configure::read('viewPaths'), 'pluginPaths' => Configure::read('pluginPaths'), ); - Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)); - Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); + App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)); + App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); $Controller =& new ScaffoldMockController(); $Controller->scaffold = 'admin'; @@ -298,8 +298,8 @@ function testGetViewFilename() { . DS .'test_plugin' . DS . 'views' . DS . 'tests' . DS . 'scaffold.edit.ctp'; $this->assertEqual($result, $expected); - Configure::write('viewPaths', $_back['viewPaths']); - Configure::write('pluginPaths', $_back['pluginPaths']); + App::path('views', $_back['viewPaths']); + App::path('plugins', $_back['pluginPaths']); Configure::write('Routing.admin', $_admin); } /** @@ -332,11 +332,11 @@ function testIndexScaffold() { new Scaffold($this->Controller, $params); $result = ob_get_clean(); - $this->assertPattern('#<h2>Scaffold Mock</h2>#', $result); + $this->assertPattern('#<h2>ScaffoldMock</h2>#', $result); $this->assertPattern('#<table cellpadding="0" cellspacing="0">#', $result); //TODO: add testing for table generation $this->assertPattern('#<a href="/scaffold_users/view/1">1</a>#', $result); //belongsTo links - $this->assertPattern('#<li><a href="/scaffold_mock/add/">New Scaffold Mock</a></li>#', $result); + $this->assertPattern('#<li><a href="/scaffold_mock/add/">New ScaffoldMock</a></li>#', $result); $this->assertPattern('#<li><a href="/scaffold_users/">List Scaffold Users</a></li>#', $result); $this->assertPattern('#<li><a href="/scaffold_comments/add/">New Comment</a></li>#', $result); } @@ -371,12 +371,12 @@ function testViewScaffold() { new Scaffold($this->Controller, $params); $result = ob_get_clean(); - $this->assertPattern('/<h2>View Scaffold Mock<\/h2>/', $result); + $this->assertPattern('/<h2>View ScaffoldMock<\/h2>/', $result); $this->assertPattern('/<dl>/', $result); //TODO: add specific tests for fields. $this->assertPattern('/<a href="\/scaffold_users\/view\/1">1<\/a>/', $result); //belongsTo links - $this->assertPattern('/<li><a href="\/scaffold_mock\/edit\/1">Edit Scaffold Mock<\/a>\s<\/li>/', $result); - $this->assertPattern('/<li><a href="\/scaffold_mock\/delete\/1"[^>]*>Delete Scaffold Mock<\/a>\s*<\/li>/', $result); + $this->assertPattern('/<li><a href="\/scaffold_mock\/edit\/1">Edit ScaffoldMock<\/a>\s<\/li>/', $result); + $this->assertPattern('/<li><a href="\/scaffold_mock\/delete\/1"[^>]*>Delete ScaffoldMock<\/a>\s*<\/li>/', $result); //check related table $this->assertPattern('/<div class="related">\s*<h3>Related Scaffold Comments<\/h3>\s*<table cellpadding="0" cellspacing="0">/', $result); $this->assertPattern('/<li><a href="\/scaffold_comments\/add\/">New Comment<\/a><\/li>/', $result); @@ -459,10 +459,10 @@ function testAdminIndexScaffold() { $Scaffold = new Scaffold($this->Controller, $params); $result = ob_get_clean(); - $this->assertPattern('/<h2>Scaffold Mock<\/h2>/', $result); + $this->assertPattern('/<h2>ScaffoldMock<\/h2>/', $result); $this->assertPattern('/<table cellpadding="0" cellspacing="0">/', $result); //TODO: add testing for table generation - $this->assertPattern('/<li><a href="\/admin\/scaffold_mock\/add\/">New Scaffold Mock<\/a><\/li>/', $result); + $this->assertPattern('/<li><a href="\/admin\/scaffold_mock\/add\/">New ScaffoldMock<\/a><\/li>/', $result); Configure::write('Routing.admin', $_backAdmin); } @@ -580,44 +580,5 @@ function testScaffoldParams() { $result = $Scaffold->getParams(); $this->assertEqual($result['action'], 'admin_edit'); } - -/** - * 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'; - $this->Controller->webroot = '/'; - $params = array( - 'plugin' => null, - 'pass' => array(), - 'form' => array(), - 'named' => array(), - 'url' => array('url' =>'admin/scaffold_mock/edit'), - 'controller' => 'scaffold_mock', - 'action' => 'admin_edit', - 'admin' => true, - ); - //set router. - Router::setRequestInfo(array($params, array('base' => '/', 'here' => 'admin/scaffold_mock', 'webroot' => '/'))); - - $this->Controller->params = $params; - $this->Controller->controller = 'scaffold_mock'; - $this->Controller->base = '/'; - $this->Controller->constructClasses(); - $Scaffold =& new TestScaffoldMock($this->Controller, $params); - $result = $this->Controller->viewVars; - - $this->assertEqual($result['singularHumanName'], 'Scaffold Mock'); - $this->assertEqual($result['pluralHumanName'], 'Scaffold Mock'); - $this->assertEqual($result['modelClass'], 'ScaffoldMock'); - $this->assertEqual($result['primaryKey'], 'id'); - $this->assertEqual($result['displayField'], 'title'); - $this->assertEqual($result['singularVar'], 'scaffoldMock'); - $this->assertEqual($result['pluralVar'], 'scaffoldMock'); - $this->assertEqual($result['scaffoldFields'], array('id', 'user_id', 'title', 'body', 'published', 'created', 'updated')); - } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/i18n.test.php b/cake/tests/cases/libs/i18n.test.php index 4a1183036..5e6d0f33b 100644 --- a/cake/tests/cases/libs/i18n.test.php +++ b/cake/tests/cases/libs/i18n.test.php @@ -40,7 +40,7 @@ class I18nTest extends CakeTestCase { */ function setUp() { $this->_localePaths = Configure::read('localePaths'); - Configure::write('localePaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale')); + App::path('locales', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale')); } /** * tearDown method @@ -49,7 +49,7 @@ function setUp() { * @return void */ function tearDown() { - Configure::write('localePaths', $this->_localePaths); + App::path('locales', $this->_localePaths); } /** * testDefaultStrings method @@ -2353,8 +2353,8 @@ function testNoCoreTranslation () { * @return void */ function testPluginTranslation() { - $pluginPaths = Configure::read('pluginPaths'); - Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins')); + $pluginPaths = App::path('plugins'); + App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins')); Configure::write('Config.language', 'po'); $singular = $this->__domainSingular(); @@ -2388,7 +2388,7 @@ function testPluginTranslation() { $this->assertTrue(in_array('24 = 0 or > 1 (from plugin)', $plurals)); $this->assertTrue(in_array('25 = 0 or > 1 (from plugin)', $plurals)); - Configure::write('pluginPaths', $pluginPaths); + App::path('plugins', $pluginPaths); } /** * testPoMultipleLineTranslation method diff --git a/cake/tests/cases/libs/object.test.php b/cake/tests/cases/libs/object.test.php index 743d88da1..8dd11e6fc 100644 --- a/cake/tests/cases/libs/object.test.php +++ b/cake/tests/cases/libs/object.test.php @@ -424,8 +424,8 @@ function testPersistWithBehavior() { $cacheDisable = Configure::read('Cache.disable'); Configure::write('Cache.disable', false); - Configure::write('modelPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS)); - Configure::write('behaviorPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS . 'behaviors' . DS)); + App::path('models', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS)); + App::path('behaviors', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS . 'behaviors' . DS)); $this->assertFalse(class_exists('PersisterOneBehaviorBehavior')); $this->assertFalse(class_exists('PersisterTwoBehaviorBehavior')); @@ -470,8 +470,8 @@ function testPersistWithBehaviorAndRequestAction() { $this->assertFalse(class_exists('ContainableBehavior')); - Configure::write('modelPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS)); - Configure::write('behaviorPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS . 'behaviors' . DS)); + App::path('models', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS)); + App::path('behaviors', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS . 'behaviors' . DS)); $this->assertFalse(class_exists('PersistOneBehaviorBehavior')); $this->assertFalse(class_exists('PersistTwoBehaviorBehavior')); @@ -617,9 +617,9 @@ function testRequestAction() { 'view' => Configure::read('viewPaths'), 'plugin' => Configure::read('pluginPaths') ); - Configure::write('controllerPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)); - Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)); - Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); + App::path('controllers', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)); + App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)); + App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); $result = $this->object->requestAction('/tests_apps/index', array('return')); $expected = 'This is the TestsAppsController index view'; @@ -674,9 +674,9 @@ function testRequestAction() { $result = $this->object->requestAction(array('controller'=>'request_action', 'action'=>'paginate_request_action'), array('pass' => array(5), 'named' => array('param' => 'value'))); $this->assertTrue($result); - Configure::write('controllerPaths', $_back['controller']); - Configure::write('viewPaths', $_back['view']); - Configure::write('pluginPaths', $_back['plugin']); + App::path('controllers', $_back['controller']); + App::path('views', $_back['view']); + App::path('plugins', $_back['plugin']); } /** * Test that requestAction() is populating $this->params properly diff --git a/cake/tests/cases/libs/view/helpers/cache.test.php b/cake/tests/cases/libs/view/helpers/cache.test.php index f6e9b081e..62fe593b2 100644 --- a/cake/tests/cases/libs/view/helpers/cache.test.php +++ b/cake/tests/cases/libs/view/helpers/cache.test.php @@ -90,8 +90,8 @@ function setUp() { * @return void */ function startCase() { - $this->_viewPaths = Configure::read('viewPaths'); - Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); + $this->_viewPaths = App::path('views'); + App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); } /** * End Case - restore view Paths @@ -100,7 +100,7 @@ function startCase() { * @return void */ function endCase() { - Configure::write('viewPaths', $this->_viewPaths); + App::path('views', $this->_viewPaths); } /** * tearDown method diff --git a/cake/tests/cases/libs/view/helpers/session.test.php b/cake/tests/cases/libs/view/helpers/session.test.php index 270194bd3..5cf97a8d4 100644 --- a/cake/tests/cases/libs/view/helpers/session.test.php +++ b/cake/tests/cases/libs/view/helpers/session.test.php @@ -143,7 +143,7 @@ function testFlash() { $result = ob_get_clean(); $this->assertEqual($result, $expected); - Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); + App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); $controller = new Controller(); $this->Session->view = new View($controller); diff --git a/cake/tests/cases/libs/view/theme.test.php b/cake/tests/cases/libs/view/theme.test.php index eeb5dd883..f4c65cf32 100644 --- a/cake/tests/cases/libs/view/theme.test.php +++ b/cake/tests/cases/libs/view/theme.test.php @@ -173,8 +173,8 @@ function testPluginGetTemplate() { $this->Controller->theme = 'test_plugin_theme'; $ThemeView = new TestThemeView($this->Controller); - Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); - Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); + App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); + App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS . 'themed' . DS . 'test_plugin_theme' . DS .'tests' . DS .'index.ctp'; $result = $ThemeView->getViewFileName('index'); @@ -200,8 +200,8 @@ function testGetTemplate() { $ThemeView = new TestThemeView($this->Controller); $ThemeView->theme = 'test_theme'; - Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); - Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS)); + App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); + App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS)); $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS .'pages' . DS .'home.ctp'; $result = $ThemeView->getViewFileName('home'); diff --git a/cake/tests/cases/libs/view/view.test.php b/cake/tests/cases/libs/view/view.test.php index a3bc87803..2377959c1 100644 --- a/cake/tests/cases/libs/view/view.test.php +++ b/cake/tests/cases/libs/view/view.test.php @@ -236,8 +236,8 @@ function testPluginGetTemplate() { $this->Controller->action = 'index'; $View = new TestView($this->Controller); - Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); - Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); + App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); + App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS .'tests' . DS .'index.ctp'; $result = $View->getViewFileName('index'); @@ -261,8 +261,8 @@ function testGetTemplate() { $this->Controller->params['pass'] = array('home'); $View = new TestView($this->Controller); - Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); - Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS)); + App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); + App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS)); $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS .'pages' . DS .'home.ctp'; $result = $View->getViewFileName('home'); diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index f2a5fb442..795be9311 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -744,7 +744,7 @@ function _loadFixtures() { TESTS . 'fixtures', VENDORS . 'tests' . DS . 'fixtures' ); - $pluginPaths = Configure::read('pluginPaths'); + $pluginPaths = App::path('plugins'); foreach ($pluginPaths as $path) { if (file_exists($path . $pluginName . DS . 'tests' . DS. 'fixtures')) { $fixturePaths[0] = $path . $pluginName . DS . 'tests' . DS. 'fixtures'; diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index 1000c675c..1914b72bf 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -467,8 +467,7 @@ function __testObjectFileFromCaseFile($file, $isApp = true) { $folderPrefixMap = array( 'behaviors' => 'models', 'components' => 'controllers', - 'helpers' => 'views', - 'datasources' => 'models' + 'helpers' => 'views' ); foreach ($folderPrefixMap as $dir => $prefix) { @@ -517,7 +516,7 @@ function __testObjectFilesFromGroupFile($groupFile, $isApp = true) { if (!!$manager->pluginTest) { $path = APP . 'plugins' . DS . $manager->pluginTest . DS . 'tests' . DS . 'groups'; - $pluginPaths = Configure::read('pluginPaths'); + $pluginPaths = App::path('plugins'); foreach ($pluginPaths as $pluginPath) { $tmpPath = $pluginPath . $manager->pluginTest . DS . 'tests' . DS. 'groups'; if (file_exists($tmpPath)) { @@ -721,7 +720,7 @@ function __getTestFilesPath($isApp = true) { } elseif (!!$manager->pluginTest) { $pluginPath = APP . 'plugins' . DS . $manager->pluginTest . DS; - $pluginPaths = Configure::read('pluginPaths'); + $pluginPaths = App::path('plugins'); foreach ($pluginPaths as $tmpPath) { $tmpPath = $tmpPath . $manager->pluginTest . DS; if (file_exists($tmpPath)) { diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index d614ed6d0..2f6fa2e11 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -335,7 +335,7 @@ function _getTestsPath($type = 'cases') { } } else if (!empty($this->pluginTest)) { $_pluginBasePath = APP . 'plugins' . DS . $this->pluginTest . DS . 'tests'; - $pluginPaths = Configure::read('pluginPaths'); + $pluginPaths = App::path('plugins'); foreach ($pluginPaths as $path) { if (file_exists($path . $this->pluginTest . DS . 'tests')) { $_pluginBasePath = $path . $this->pluginTest . DS . 'tests'; From ea0d5c84bef26b44663f1810d417ff499afe7b66 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 8 Jun 2009 23:13:29 -0400 Subject: [PATCH 0249/2083] Removing dead comparisons, extra uses() call. --- cake/console/libs/tasks/project.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php index 898bf285c..5104925c6 100644 --- a/cake/console/libs/tasks/project.php +++ b/cake/console/libs/tasks/project.php @@ -24,9 +24,7 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ -if (!class_exists('File')) { - uses('file'); -} + /** * Task class for creating new project apps and plugins * @@ -144,7 +142,7 @@ function bake($path, $skel = null, $skip = array('empty')) { $looksGood = $this->in('Look okay?', array('y', 'n', 'q'), 'y'); - if (low($looksGood) == 'y' || low($looksGood) == 'yes') { + if (low($looksGood) == 'y') { $verbose = $this->in(__('Do you want verbose output?', true), array('y', 'n'), 'n'); $Folder = new Folder($skel); @@ -157,14 +155,14 @@ function bake($path, $skel = null, $skip = array('empty')) { return false; } - if (low($verbose) == 'y' || low($verbose) == 'yes') { + if (low($verbose) == 'y') { foreach ($Folder->messages() as $message) { $this->out($message); } } return true; - } elseif (low($looksGood) == 'q' || low($looksGood) == 'quit') { + } elseif (low($looksGood) == 'q') { $this->out('Bake Aborted.'); } else { $this->execute(false); From fd7ad7e861bbbeb7f0279752a001d8ce79b47d76 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 8 Jun 2009 23:15:05 -0400 Subject: [PATCH 0250/2083] Removing dead options. Removing extra uses() --- cake/console/libs/tasks/plugin.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index a5e880853..935d773f9 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -24,9 +24,7 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ -if (!class_exists('File')) { - uses('file'); -} + /** * Task class for creating a plugin * @@ -136,7 +134,7 @@ function bake($plugin) { $looksGood = $this->in('Look okay?', array('y', 'n', 'q'), 'y'); - if (low($looksGood) == 'y' || low($looksGood) == 'yes') { + if (low($looksGood) == 'y') { $verbose = $this->in(__('Do you want verbose output?', true), array('y', 'n'), 'n'); $Folder = new Folder($this->path . $pluginPath); @@ -146,7 +144,7 @@ function bake($plugin) { $Folder->create($this->path . $pluginPath . DS . $directory); } - if (low($verbose) == 'y' || low($verbose) == 'yes') { + if (low($verbose) == 'y') { foreach ($Folder->messages() as $message) { $this->out($message); } From c3643767bff712cad343740aa94def74c7ac7386 Mon Sep 17 00:00:00 2001 From: gwoo <gwoo@cakephp.org> Date: Wed, 10 Jun 2009 16:13:39 -0700 Subject: [PATCH 0251/2083] some more updates to path handling --- cake/console/cake.php | 6 +- cake/console/libs/api.php | 2 +- cake/console/libs/console.php | 2 +- cake/console/libs/testsuite.php | 2 +- cake/dispatcher.php | 2 +- cake/libs/configure.php | 45 +++++---- cake/libs/i18n.php | 4 +- cake/libs/model/cake_schema.php | 2 +- cake/libs/router.php | 2 +- cake/tests/cases/basics.test.php | 2 +- cake/tests/cases/console/cake.test.php | 2 +- cake/tests/cases/console/libs/shell.test.php | 6 +- cake/tests/cases/dispatcher.test.php | 4 +- cake/tests/cases/libs/cake_test_case.test.php | 14 +-- cake/tests/cases/libs/configure.test.php | 98 ++++++++++--------- .../cases/libs/controller/controller.test.php | 2 +- .../cases/libs/controller/scaffold.test.php | 4 +- cake/tests/cases/libs/i18n.test.php | 2 +- cake/tests/cases/libs/object.test.php | 6 +- cake/tests/lib/test_manager.php | 2 +- 20 files changed, 113 insertions(+), 96 deletions(-) diff --git a/cake/console/cake.php b/cake/console/cake.php index 0a88cccaa..1c234e23a 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -214,7 +214,7 @@ function __buildPaths() { } } - $vendorPaths = array_values(Configure::read('vendorPaths')); + $vendorPaths = array_values(App::path('vendors')); foreach ($vendorPaths as $vendorPath) { $path = rtrim($vendorPath, DS) . DS . 'shells' . DS; if (file_exists($path)) { @@ -222,7 +222,7 @@ function __buildPaths() { } } - $this->shellPaths = array_values(array_unique(array_merge($paths, Configure::read('shellPaths')))); + $this->shellPaths = array_values(array_unique(array_merge($paths, App::path('shells')))); } /** * Initializes the environment and loads the Cake core. @@ -548,7 +548,7 @@ function help() { foreach ($this->shellPaths as $path) { if (is_dir($path)) { - $shells = Configure::listObjects('file', $path); + $shells = App::objects('file', $path); $path = str_replace(CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS, 'CORE' . DS, $path); $path = str_replace(APP, 'APP' . DS, $path); $path = str_replace(ROOT, 'ROOT', $path); diff --git a/cake/console/libs/api.php b/cake/console/libs/api.php index 741f2f66f..63a5d2f7a 100644 --- a/cake/console/libs/api.php +++ b/cake/console/libs/api.php @@ -82,7 +82,7 @@ function main() { $class = Inflector::camelize($file); } - $objects = Configure::listObjects('class', $path); + $objects = App::objects('class', $path); if (in_array($class, $objects)) { if (in_array($type, array('behavior', 'component', 'helper')) && $type !== $file) { if (!preg_match('/' . Inflector::camelize($type) . '$/', $class)) { diff --git a/cake/console/libs/console.php b/cake/console/libs/console.php index e04ba782c..b9f2e6e96 100644 --- a/cake/console/libs/console.php +++ b/cake/console/libs/console.php @@ -58,7 +58,7 @@ class ConsoleShell extends Shell { function initialize() { require_once CAKE . 'dispatcher.php'; $this->Dispatcher = new Dispatcher(); - $this->models = Configure::listObjects('model'); + $this->models = App::objects('model'); App::import('Model', $this->models); foreach ($this->models as $model) { diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php index 99b34d82e..caf760609 100644 --- a/cake/console/libs/testsuite.php +++ b/cake/console/libs/testsuite.php @@ -93,7 +93,7 @@ function initialize() { require_once CAKE . 'tests' . DS . 'lib' . DS . 'test_manager.php'; require_once CAKE . 'tests' . DS . 'lib' . DS . 'cli_reporter.php'; - $plugins = Configure::listObjects('plugin'); + $plugins = App::objects('plugin'); foreach ($plugins as $p) { $this->plugins[] = Inflector::underscore($p); } diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 581db44aa..3752fdcd8 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -626,7 +626,7 @@ function cached($url) { $paths[] = $pluginPaths[$i] . $plugin . DS . 'vendors' . DS; } } - $paths = array_merge($paths, Configure::read('vendorPaths')); + $paths = array_merge($paths, App::path('vendors')); foreach ($paths as $path) { if (is_file($path . $url) && file_exists($path . $url)) { diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 5a5545027..907fb5f78 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -460,18 +460,18 @@ class App extends Object { * @var array * @access public */ - var $objects = array( - 'model' => array('suffix' => '.php', 'base' => 'AppModel', 'core' => false), - 'behavior' => array('suffix' => '.php', 'base' => 'ModelBehavior'), - 'controller' => array('suffix' => '_controller.php', 'base' => 'AppController'), - 'component' => array('suffix' => '.php', 'base' => null), - 'view' => array('suffix' => '.php', 'base' => null), - 'helper' => array('suffix' => '.php', 'base' => 'AppHelper'), - 'plugin' => array('suffix' => '', 'base' => null), - 'vendor' => array('suffix' => '', 'base' => null), - 'shell' => array('suffix' => 'Shell', 'base' => 'Shell'), - 'class' => array('suffix' => '.php', 'base' => null), - 'file' => array('suffix' => '.php', 'base' => null) + var $types = array( + 'model' => array('suffix' => '.php', 'extends' => 'AppModel'), + 'behavior' => array('suffix' => '.php', 'extends' => 'ModelBehavior'), + 'controller' => array('suffix' => '_controller.php', 'extends' => 'AppController'), + 'component' => array('suffix' => '.php', 'extends' => null), + 'view' => array('suffix' => '.php', 'extends' => null), + 'helper' => array('suffix' => '.php', 'extends' => 'AppHelper'), + 'plugin' => array('suffix' => '', 'extends' => null), + 'vendor' => array('suffix' => '', 'extends' => null), + 'shell' => array('suffix' => '.php', 'extends' => 'Shell'), + 'class' => array('suffix' => '.php', 'extends' => null), + 'file' => array('suffix' => '.php', 'extends' => null) ); /** @@ -598,6 +598,9 @@ class App extends Object { * * Usage * App::path('models'); will return all paths for models + * App::path('models', array('/path/to/models')); will set and return all paths for models + * App::path(array('models' => array('/path/to/models')); will set and return all paths for models + * * * @param string $type type of path * @return string array @@ -605,15 +608,19 @@ class App extends Object { */ function path($type, $value = array()) { $_this =& App::getInstance(); - if (!isset($_this->{"_{$type}"})) { - return array(); - } if (empty($value)) { + if (is_array($type)) { + foreach ($type as $object => $value) { + $_this->{"_{$type}"} = (array)$value; + } + return $value; + } + if (!isset($_this->{"_{$type}"})) { + return array(); + } return $_this->{"_{$type}"}; } - if (!empty($value)) { - return $_this->{"_{$type}"} = (array)$value; - } + return $_this->{"_{$type}"} = (array)$value; } /** * Build path references. Merges the supplied $paths @@ -744,7 +751,7 @@ function objects($type, $path = null, $cache = true) { } if (empty($_this->__objects) || !isset($_this->__objects[$type]) || $cache !== true) { - $types = $_this->objects; + $types = $_this->types; if (!isset($types[$type])) { return false; diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index eb7cf2e44..ae814a890 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -251,8 +251,8 @@ function __bindTextDomain($domain) { $this->__noLocale = true; $core = true; $merge = array(); - $searchPaths = Configure::read('localePaths'); - $plugins = Configure::listObjects('plugin'); + $searchPaths = App::path('locales');; + $plugins = App::objects('plugin'); if (!empty($plugins)) { $pluginPaths = App::path('plugins'); diff --git a/cake/libs/model/cake_schema.php b/cake/libs/model/cake_schema.php index d3e2811ab..31e7e9cfe 100644 --- a/cake/libs/model/cake_schema.php +++ b/cake/libs/model/cake_schema.php @@ -198,7 +198,7 @@ function read($options = array()) { } if (!is_array($models) && $models !== false) { - $models = Configure::listObjects('model'); + $models = App::objects('model'); } if (is_array($models)) { diff --git a/cake/libs/router.php b/cake/libs/router.php index 4071c6f12..868e553cb 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -593,7 +593,7 @@ function __connectDefaultRoutes() { $params = array('prefix' => $this->__admin, $this->__admin => true); } - if ($plugins = Configure::listObjects('plugin')) { + if ($plugins = App::objects('plugin')) { foreach ($plugins as $key => $value) { $plugins[$key] = Inflector::underscore($value); } diff --git a/cake/tests/cases/basics.test.php b/cake/tests/cases/basics.test.php index 69ec59752..970bd32cc 100644 --- a/cake/tests/cases/basics.test.php +++ b/cake/tests/cases/basics.test.php @@ -40,7 +40,7 @@ class BasicsTest extends CakeTestCase { * @return void */ function setUp() { - $this->_localePaths = Configure::read('localePaths'); + $this->_localePaths = App::path('locales');; App::path('locales', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale')); $this->_language = Configure::read('Config.language'); } diff --git a/cake/tests/cases/console/cake.test.php b/cake/tests/cases/console/cake.test.php index 7beeb1e4b..dd24a73ea 100644 --- a/cake/tests/cases/console/cake.test.php +++ b/cake/tests/cases/console/cake.test.php @@ -124,7 +124,7 @@ class ShellDispatcherTest extends UnitTestCase { */ function setUp() { $this->_pluginPaths = App::path('plugins'); - $this->_shellPaths = Configure::read('shellPaths'); + $this->_shellPaths = App::path('shells'); App::path('plugins', array( TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS diff --git a/cake/tests/cases/console/libs/shell.test.php b/cake/tests/cases/console/libs/shell.test.php index 76bfe3c22..77ac26e68 100644 --- a/cake/tests/cases/console/libs/shell.test.php +++ b/cake/tests/cases/console/libs/shell.test.php @@ -120,9 +120,9 @@ function testConstruct() { */ function testInitialize() { $_back = array( - 'modelPaths' => Configure::read('modelPaths'), - 'pluginPaths' => Configure::read('pluginPaths'), - 'viewPaths' => Configure::read('viewPaths'), + 'modelPaths' => App::path('models'), + 'pluginPaths' => App::path('plugins'), + 'viewPaths' => App::path('views'), ); App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); App::path('models', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS)); diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index fdc6491b6..d2c0ed94b 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -531,7 +531,7 @@ function endTest() { $_SERVER = $this->_server; Configure::write('App', $this->_app); Configure::write('Cache', $this->_cache); - Configure::write('vendorPaths', $this->_vendorPaths); + App::path('vendors', $this->_vendorPaths); App::path('plugins', $this->_pluginPaths); App::path('views', $this->_viewPaths); App::path('controllers', $this->_controllerPaths); @@ -1679,7 +1679,7 @@ function testStaticAssets() { $Configure->__objects = null; App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); - Configure::write('vendorPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors'. DS)); + App::path('vendors', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors'. DS)); $Dispatcher =& new TestDispatcher(); diff --git a/cake/tests/cases/libs/cake_test_case.test.php b/cake/tests/cases/libs/cake_test_case.test.php index 6b8dce1f3..8f4b888db 100644 --- a/cake/tests/cases/libs/cake_test_case.test.php +++ b/cake/tests/cases/libs/cake_test_case.test.php @@ -239,10 +239,10 @@ function testGetTests() { **/ function testTestAction() { $_back = array( - 'controller' => Configure::read('controllerPaths'), - 'view' => Configure::read('viewPaths'), - 'model' => Configure::read('modelPaths'), - 'plugin' => Configure::read('pluginPaths') + 'controller' => App::path('controllers'), + 'view' => App::path('views'), + 'model' => App::path('models'), + 'plugin' => App::path('plugins') ); App::path('controllers', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)); App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)); @@ -389,9 +389,9 @@ function testSkipIf() { */ function testTestDispatcher() { $_back = array( - 'controller' => Configure::read('controllerPaths'), - 'view' => Configure::read('viewPaths'), - 'plugin' => Configure::read('pluginPaths') + 'controller' => App::path('controllers'), + 'view' => App::path('views'), + 'plugin' => App::path('plugins') ); App::path('controllers', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)); App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)); diff --git a/cake/tests/cases/libs/configure.test.php b/cake/tests/cases/libs/configure.test.php index 63fd1e87f..53d1a01ed 100644 --- a/cake/tests/cases/libs/configure.test.php +++ b/cake/tests/cases/libs/configure.test.php @@ -72,50 +72,6 @@ function tearDown() { Configure::write('debug', $this->_debug); Configure::write('Cache.disable', $this->_cacheDisable); } -/** - * testListObjects method - * - * @access public - * @return void - */ - function testListObjects() { - $result = Configure::listObjects('class', TEST_CAKE_CORE_INCLUDE_PATH . 'libs'); - $this->assertTrue(in_array('Xml', $result)); - $this->assertTrue(in_array('Cache', $result)); - $this->assertTrue(in_array('HttpSocket', $result)); - - $result = Configure::listObjects('behavior'); - $this->assertTrue(in_array('Tree', $result)); - - $result = Configure::listObjects('controller'); - $this->assertTrue(in_array('Pages', $result)); - - $result = Configure::listObjects('component'); - $this->assertTrue(in_array('Auth', $result)); - - $result = Configure::listObjects('view'); - $this->assertTrue(in_array('Media', $result)); - - $result = Configure::listObjects('helper'); - $this->assertTrue(in_array('Html', $result)); - - $result = Configure::listObjects('model'); - $notExpected = array('AppModel', 'Behavior', 'ConnectionManager', 'DbAcl', 'Model', 'Schema'); - - foreach ($notExpected as $class) { - $this->assertFalse(in_array($class, $result)); - } - - $result = Configure::listObjects('file'); - $this->assertFalse($result); - - $result = Configure::listObjects('file', 'non_existing_configure'); - $expected = array(); - $this->assertEqual($result, $expected); - - $result = Configure::listObjects('NonExistingType'); - $this->assertFalse($result); - } /** * testRead method * @@ -266,7 +222,61 @@ function testBuild() { App::build(); $models = App::path('models'); $this->assertTrue(!empty($models)); + } +/** + * testBuildPaths method + * + * @access public + * @return void + */ + function testCore() { + $model = App::core('model'); + $this->assertTrue(!empty($models)); } +/** + * testListObjects method + * + * @access public + * @return void + */ + function testListObjects() { + $result = App::objects('class', TEST_CAKE_CORE_INCLUDE_PATH . 'libs'); + $this->assertTrue(in_array('Xml', $result)); + $this->assertTrue(in_array('Cache', $result)); + $this->assertTrue(in_array('HttpSocket', $result)); + + $result = App::objects('behavior'); + $this->assertTrue(in_array('Tree', $result)); + + $result = App::objects('controller'); + $this->assertTrue(in_array('Pages', $result)); + + $result = App::objects('component'); + $this->assertTrue(in_array('Auth', $result)); + + $result = App::objects('view'); + $this->assertTrue(in_array('Media', $result)); + + $result = App::objects('helper'); + $this->assertTrue(in_array('Html', $result)); + + $result = App::objects('model'); + $notExpected = array('AppModel', 'Behavior', 'ConnectionManager', 'DbAcl', 'Model', 'Schema'); + + foreach ($notExpected as $class) { + $this->assertFalse(in_array($class, $result)); + } + + $result = App::objects('file'); + $this->assertFalse($result); + + $result = App::objects('file', 'non_existing_configure'); + $expected = array(); + $this->assertEqual($result, $expected); + + $result = App::objects('NonExistingType'); + $this->assertFalse($result); + } /** * testClassLoading method * diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index 4ea98cbc7..82d935551 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -395,7 +395,7 @@ function testConstructClasses() { unset($Controller); $_back = array( - 'pluginPaths' => Configure::read('pluginPaths'), + 'pluginPaths' => App::path('plugins'), ); App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); diff --git a/cake/tests/cases/libs/controller/scaffold.test.php b/cake/tests/cases/libs/controller/scaffold.test.php index 07a4d35b8..d33470c55 100644 --- a/cake/tests/cases/libs/controller/scaffold.test.php +++ b/cake/tests/cases/libs/controller/scaffold.test.php @@ -263,8 +263,8 @@ function testGetViewFilename() { $this->assertEqual($result, $expected); $_back = array( - 'viewPaths' => Configure::read('viewPaths'), - 'pluginPaths' => Configure::read('pluginPaths'), + 'viewPaths' => App::path('views'), + 'pluginPaths' => App::path('plugins'), ); App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)); App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); diff --git a/cake/tests/cases/libs/i18n.test.php b/cake/tests/cases/libs/i18n.test.php index 5e6d0f33b..c6c7f1215 100644 --- a/cake/tests/cases/libs/i18n.test.php +++ b/cake/tests/cases/libs/i18n.test.php @@ -39,7 +39,7 @@ class I18nTest extends CakeTestCase { * @return void */ function setUp() { - $this->_localePaths = Configure::read('localePaths'); + $this->_localePaths = App::path('locales');; App::path('locales', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale')); } /** diff --git a/cake/tests/cases/libs/object.test.php b/cake/tests/cases/libs/object.test.php index 8dd11e6fc..fc7abc1ec 100644 --- a/cake/tests/cases/libs/object.test.php +++ b/cake/tests/cases/libs/object.test.php @@ -613,9 +613,9 @@ function testRequestAction() { $this->assertEqual($result, $expected); $_back = array( - 'controller' => Configure::read('controllerPaths'), - 'view' => Configure::read('viewPaths'), - 'plugin' => Configure::read('pluginPaths') + 'controller' => App::path('controllers'), + 'view' => App::path('views'), + 'plugin' => App::path('plugins') ); App::path('controllers', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)); App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)); diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index 2f6fa2e11..d4fe657f8 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -758,7 +758,7 @@ function CakePHPTestSuiteHeader() { ob_start(); $groups = $_SERVER['PHP_SELF'].'?show=groups'; $cases = $_SERVER['PHP_SELF'].'?show=cases'; - $plugins = Configure::listObjects('plugin'); + $plugins = App::objects('plugin'); include CAKE_TESTS_LIB . 'content.php'; break; } From 2f5711c095d681086890caffabc8a3f006f56440 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 10 Jun 2009 21:43:55 -0400 Subject: [PATCH 0252/2083] Adding test case for PluginTask --- .../cases/console/libs/tasks/plugin.test.php | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 cake/tests/cases/console/libs/tasks/plugin.test.php diff --git a/cake/tests/cases/console/libs/tasks/plugin.test.php b/cake/tests/cases/console/libs/tasks/plugin.test.php new file mode 100644 index 000000000..af5150f76 --- /dev/null +++ b/cake/tests/cases/console/libs/tasks/plugin.test.php @@ -0,0 +1,95 @@ +<?php +/* SVN FILE: $Id$ */ +/** + * PluginTask Test file + * + * Test Case for plugin generation shell task + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2006-2008, Cake Software Foundation, Inc. + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @package cake + * @subpackage cake.tests.cases.console.libs.tasks + * @since CakePHP v 1.2.0.7726 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +App::import('Core', 'Shell'); + +if (!defined('DISABLE_AUTO_DISPATCH')) { + define('DISABLE_AUTO_DISPATCH', true); +} + +if (!class_exists('ShellDispatcher')) { + ob_start(); + $argv = false; + require CAKE . 'console' . DS . 'cake.php'; + ob_end_clean(); +} + +if (!class_exists('PluginTask')) { + require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'plugin.php'; + require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php'; +} + +Mock::generatePartial( + 'ShellDispatcher', 'TestPluginTaskMockShellDispatcher', + array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment') +); +Mock::generatePartial( + 'PluginTask', 'MockPluginTask', + array('in', '_stop', 'err', 'out', 'createFile', 'isLoadableClass') +); + +/** + * PluginTaskPlugin class + * + * @package cake + * @subpackage cake.tests.cases.console.libs.tasks + */ +class PluginTaskTest extends CakeTestCase { + + var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag'); +/** + * setUp method + * + * @return void + * @access public + */ + function startTest() { + $this->Dispatcher =& new TestPluginTaskMockShellDispatcher(); + $this->Dispatcher->shellPaths = Configure::read('shellPaths'); + $this->Task =& new MockPluginTask($this->Dispatcher); + $this->Task->Dispatch =& $this->Dispatcher; + } + +/** + * tearDown method + * + * @return void + * @access public + */ + function endTest() { + ClassRegistry::flush(); + } + +/** + * test bake() + * + * @return void + **/ + function testBake() { + + } +} +?> \ No newline at end of file From 5eae9fcba5653b907c0f9142e3484e2d24d14a25 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 10 Jun 2009 22:19:14 -0400 Subject: [PATCH 0253/2083] Adding test case for PluginTask::bake() --- cake/console/libs/tasks/plugin.php | 10 ++++------ .../cases/console/libs/tasks/plugin.test.php | 20 ++++++++++++++++++- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index 935d773f9..187b12971 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -123,18 +123,16 @@ function __interactive($plugin = null) { * @return bool */ function bake($plugin) { - $pluginPath = Inflector::underscore($plugin); $this->hr(); - $this->out("Plugin Name: $plugin"); - $this->out("Plugin Directory: {$this->path}{$pluginPath}"); + $this->out(__("Plugin Name: ", true) . $plugin); + $this->out(__("Plugin Directory: ", true) . $this->path . $pluginPath); $this->hr(); - $looksGood = $this->in('Look okay?', array('y', 'n', 'q'), 'y'); - if (low($looksGood) == 'y') { + if (strtolower($looksGood) == 'y') { $verbose = $this->in(__('Do you want verbose output?', true), array('y', 'n'), 'n'); $Folder = new Folder($this->path . $pluginPath); @@ -144,7 +142,7 @@ function bake($plugin) { $Folder->create($this->path . $pluginPath . DS . $directory); } - if (low($verbose) == 'y') { + if (strtolower($verbose) == 'y') { foreach ($Folder->messages() as $message) { $this->out($message); } diff --git a/cake/tests/cases/console/libs/tasks/plugin.test.php b/cake/tests/cases/console/libs/tasks/plugin.test.php index af5150f76..8b10d109e 100644 --- a/cake/tests/cases/console/libs/tasks/plugin.test.php +++ b/cake/tests/cases/console/libs/tasks/plugin.test.php @@ -71,6 +71,7 @@ function startTest() { $this->Dispatcher->shellPaths = Configure::read('shellPaths'); $this->Task =& new MockPluginTask($this->Dispatcher); $this->Task->Dispatch =& $this->Dispatcher; + $this->Task->path = TMP; } /** @@ -88,8 +89,25 @@ function endTest() { * * @return void **/ - function testBake() { + function testBakeFoldersAndFiles() { + $this->Task->setReturnValueAt(0, 'in', 'y'); + $this->Task->bake('BakeTestPlugin'); + $path = TMP . 'bake_test_plugin'; + $this->assertTrue(is_dir($path), 'No plugin dir %s'); + $this->assertTrue(is_dir($path . DS . 'controllers'), 'No controllers dir %s'); + $this->assertTrue(is_dir($path . DS . 'controllers' . DS .'components'), 'No components dir %s'); + $this->assertTrue(is_dir($path . DS . 'models'), 'No models dir %s'); + $this->assertTrue(is_dir($path . DS . 'views'), 'No views dir %s'); + $this->assertTrue(is_dir($path . DS . 'views' . DS . 'helpers'), 'No helpers dir %s'); + + $file = $path . DS . 'bake_test_plugin_app_controller.php'; + $this->Task->expectAt(0, 'createFile', array($file, '*'), 'No AppController %s'); + + $file = $path . DS . 'bake_test_plugin_app_model.php'; + $this->Task->expectAt(1, 'createFile', array($file, '*'), 'No AppModel %s'); + + @rmdir(TMP . 'bake_test_plugin'); } } ?> \ No newline at end of file From 8ca30f2d22becccbdc1238d2c3e852cf3ee451c4 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 10 Jun 2009 22:22:06 -0400 Subject: [PATCH 0254/2083] Adding test folder structure to PluginTask creation --- cake/console/libs/tasks/plugin.php | 4 +++- cake/tests/cases/console/libs/tasks/plugin.test.php | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index 187b12971..db9c7bf75 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -136,7 +136,9 @@ function bake($plugin) { $verbose = $this->in(__('Do you want verbose output?', true), array('y', 'n'), 'n'); $Folder = new Folder($this->path . $pluginPath); - $directories = array('models' . DS . 'behaviors', 'controllers' . DS . 'components', 'views' . DS . 'helpers'); + $directories = array('models' . DS . 'behaviors', 'controllers' . DS . 'components', + 'views' . DS . 'helpers', 'tests' . DS . 'cases', 'tests' . DS . 'groups', + 'tests' . DS . 'fixtures'); foreach ($directories as $directory) { $Folder->create($this->path . $pluginPath . DS . $directory); diff --git a/cake/tests/cases/console/libs/tasks/plugin.test.php b/cake/tests/cases/console/libs/tasks/plugin.test.php index 8b10d109e..feb11d965 100644 --- a/cake/tests/cases/console/libs/tasks/plugin.test.php +++ b/cake/tests/cases/console/libs/tasks/plugin.test.php @@ -100,6 +100,10 @@ function testBakeFoldersAndFiles() { $this->assertTrue(is_dir($path . DS . 'models'), 'No models dir %s'); $this->assertTrue(is_dir($path . DS . 'views'), 'No views dir %s'); $this->assertTrue(is_dir($path . DS . 'views' . DS . 'helpers'), 'No helpers dir %s'); + $this->assertTrue(is_dir($path . DS . 'tests'), 'No tests dir %s'); + $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'cases'), 'No cases dir %s'); + $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'groups'), 'No groups dir %s'); + $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'fixtures'), 'No fixtures dir %s'); $file = $path . DS . 'bake_test_plugin_app_controller.php'; $this->Task->expectAt(0, 'createFile', array($file, '*'), 'No AppController %s'); From 62199dba59abbc4b4aa1a7ec0ebe24920363e593 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 10 Jun 2009 22:52:38 -0400 Subject: [PATCH 0255/2083] Adding $pluginPaths support to PluginTask --- cake/console/libs/tasks/plugin.php | 35 +++++++++++++++++-- .../cases/console/libs/tasks/plugin.test.php | 26 ++++++++++++-- 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index db9c7bf75..3da7fbf51 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -37,6 +37,7 @@ class PluginTask extends Shell { * */ var $tasks = array('Model', 'Controller', 'View'); + /** * path to CONTROLLERS directory * @@ -44,6 +45,7 @@ class PluginTask extends Shell { * @access public */ var $path = null; + /** * initialize * @@ -52,6 +54,7 @@ class PluginTask extends Shell { function initialize() { $this->path = APP . 'plugins' . DS; } + /** * Execution method always used for tasks * @@ -79,7 +82,7 @@ function execute() { $this->err(sprintf('%s in path %s not found.', $plugin, $this->path . $pluginPath)); $this->_stop(); } else { - $this->__interactive($plugin); + return $this->__interactive($plugin); } } @@ -94,9 +97,10 @@ function execute() { $this->err(sprintf(__("%s directory could not be found.\nBe sure you have created %s", true), $task, $this->{$task}->path)); } $this->{$task}->loadTasks(); - $this->{$task}->execute(); + return $this->{$task}->execute(); } } + $this->help(); } /** @@ -125,6 +129,11 @@ function __interactive($plugin = null) { function bake($plugin) { $pluginPath = Inflector::underscore($plugin); + $pathOptions = Configure::read('pluginPaths'); + if (count($pathOptions) > 1) { + $this->findPath($pathOptions); + } + $this->hr(); $this->out(__("Plugin Name: ", true) . $plugin); $this->out(__("Plugin Directory: ", true) . $this->path . $pluginPath); @@ -178,6 +187,28 @@ function bake($plugin) { return true; } + +/** + * find and change $this->path to the user selection + * + * @return void + **/ + function findPath($pathOptions) { + $valid = false; + $max = count($pathOptions); + while (!$valid) { + foreach ($pathOptions as $i => $option) { + $this->out($i + 1 .'. ' . $option); + } + $prompt = __('Choose a plugin path from the paths above.', true); + $choice = $this->in($prompt); + if (intval($choice) > 0 && intval($choice) <= $max) { + $valid = true; + } + } + $this->path = $pathOptions[$choice - 1]; + } + /** * Help * diff --git a/cake/tests/cases/console/libs/tasks/plugin.test.php b/cake/tests/cases/console/libs/tasks/plugin.test.php index feb11d965..4cb8b3d2a 100644 --- a/cake/tests/cases/console/libs/tasks/plugin.test.php +++ b/cake/tests/cases/console/libs/tasks/plugin.test.php @@ -74,6 +74,26 @@ function startTest() { $this->Task->path = TMP; } +/** + * startCase methods + * + * @return void + **/ + function startCase() { + $this->_paths = $paths = Configure::read('pluginPaths'); + $this->_testPath = array_push($paths, TMP); + Configure::write('pluginPaths', $paths); + } + +/** + * endCase + * + * @return void + **/ + function endCase() { + Configure::write('pluginPaths', $this->_paths); + } + /** * tearDown method * @@ -90,9 +110,10 @@ function endTest() { * @return void **/ function testBakeFoldersAndFiles() { - $this->Task->setReturnValueAt(0, 'in', 'y'); + $this->Task->setReturnValueAt(0, 'in', $this->_testPath); + $this->Task->setReturnValueAt(1, 'in', 'y'); $this->Task->bake('BakeTestPlugin'); - + $path = TMP . 'bake_test_plugin'; $this->assertTrue(is_dir($path), 'No plugin dir %s'); $this->assertTrue(is_dir($path . DS . 'controllers'), 'No controllers dir %s'); @@ -113,5 +134,6 @@ function testBakeFoldersAndFiles() { @rmdir(TMP . 'bake_test_plugin'); } + } ?> \ No newline at end of file From 22c575595dac4874496bfb8e4c933bd37a65a735 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 10 Jun 2009 22:56:26 -0400 Subject: [PATCH 0256/2083] Using more constants in paths. --- cake/console/libs/tasks/plugin.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index 3da7fbf51..2868fb1ff 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -63,13 +63,11 @@ function initialize() { function execute() { if (empty($this->params['skel'])) { $this->params['skel'] = ''; - if (is_dir(CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'console'.DS.'libs'.DS.'templates'.DS.'skel') === true) { - $this->params['skel'] = CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'console'.DS.'libs'.DS.'templates'.DS.'skel'; + if (is_dir(CAKE_CORE_INCLUDE_PATH . DS . CONSOLE_LIBS . 'templates' . DS . 'skel') === true) { + $this->params['skel'] = CAKE_CORE_INCLUDE_PATH . DS . CONSOLE_LIBS . 'templates' . DS . 'skel'; } } - $plugin = null; - if (isset($this->args[0])) { $plugin = Inflector::camelize($this->args[0]); $pluginPath = Inflector::underscore($plugin) . DS; From 701d93c61c65c6a1cceddb58b722bf29e025fbac Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 10 Jun 2009 23:21:42 -0400 Subject: [PATCH 0257/2083] Adding test cases for execute() Adding more i18n Fixing issues with folders being left behind by tests. --- cake/console/libs/tasks/plugin.php | 16 +++++------ .../cases/console/libs/tasks/plugin.test.php | 27 ++++++++++++++++++- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index 2868fb1ff..7be18e37a 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -73,14 +73,13 @@ function execute() { $pluginPath = Inflector::underscore($plugin) . DS; $this->Dispatch->shiftArgs(); if (is_dir($this->path . $pluginPath)) { - $this->out(sprintf('Plugin: %s', $plugin)); - $this->out(sprintf('Path: %s', $this->path . $pluginPath)); - $this->hr(); + $this->out(sprintf(__('Plugin: %s', true), $plugin)); + $this->out(sprintf(__('Path: %s', true), $this->path . $pluginPath)); } elseif (isset($this->args[0])) { - $this->err(sprintf('%s in path %s not found.', $plugin, $this->path . $pluginPath)); + $this->err(sprintf(__('%s in path %s not found.', true), $plugin, $this->path . $pluginPath)); $this->_stop(); } else { - return $this->__interactive($plugin); + $this->__interactive($plugin); } } @@ -98,7 +97,6 @@ function execute() { return $this->{$task}->execute(); } } - $this->help(); } /** @@ -133,11 +131,11 @@ function bake($plugin) { } $this->hr(); - $this->out(__("Plugin Name: ", true) . $plugin); - $this->out(__("Plugin Directory: ", true) . $this->path . $pluginPath); + $this->out(sprintf(__("Plugin Name: %s", true) . $plugin)); + $this->out(sprintf(__("Plugin Directory: %s", true) . $this->path . $pluginPath)); $this->hr(); - $looksGood = $this->in('Look okay?', array('y', 'n', 'q'), 'y'); + $looksGood = $this->in(__('Look okay?', true), array('y', 'n', 'q'), 'y'); if (strtolower($looksGood) == 'y') { $verbose = $this->in(__('Do you want verbose output?', true), array('y', 'n'), 'n'); diff --git a/cake/tests/cases/console/libs/tasks/plugin.test.php b/cake/tests/cases/console/libs/tasks/plugin.test.php index 4cb8b3d2a..b5f639d65 100644 --- a/cake/tests/cases/console/libs/tasks/plugin.test.php +++ b/cake/tests/cases/console/libs/tasks/plugin.test.php @@ -83,6 +83,7 @@ function startCase() { $this->_paths = $paths = Configure::read('pluginPaths'); $this->_testPath = array_push($paths, TMP); Configure::write('pluginPaths', $paths); + clearstatcache(); } /** @@ -132,7 +133,31 @@ function testBakeFoldersAndFiles() { $file = $path . DS . 'bake_test_plugin_app_model.php'; $this->Task->expectAt(1, 'createFile', array($file, '*'), 'No AppModel %s'); - @rmdir(TMP . 'bake_test_plugin'); + $Folder =& new Folder(TMP . 'bake_test_plugin'); + $Folder->delete(); + } + +/** + * Test Execute + * + * @return void + **/ + function testExecuteWithOneArg() { + $this->Task->setReturnValueAt(0, 'in', $this->_testPath); + $this->Task->setReturnValueAt(1, 'in', 'y'); + $this->Task->Dispatch->args = array('BakeTestPlugin'); + $this->Task->args =& $this->Task->Dispatch->args; + + $path = TMP . 'bake_test_plugin'; + $file = $path . DS . 'bake_test_plugin_app_controller.php'; + $this->Task->expectAt(0, 'createFile', array($file, '*'), 'No AppController %s'); + + $file = $path . DS . 'bake_test_plugin_app_model.php'; + $this->Task->expectAt(1, 'createFile', array($file, '*'), 'No AppModel %s'); + + $this->Task->execute(); + $Folder =& new Folder(TMP . 'bake_test_plugin'); + $Folder->delete(); } } From 88f95bc0c4c14f2884ad3faa84bc3335112e41a6 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 11 Jun 2009 00:04:22 -0400 Subject: [PATCH 0258/2083] Making plugin task find plugins on $pluginPaths Fixing i18n. Adding tests for execute with 2 params. --- cake/console/libs/tasks/plugin.php | 15 +++++----- .../cases/console/libs/tasks/plugin.test.php | 28 ++++++++++++++++--- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index 7be18e37a..4f6d52363 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -68,15 +68,16 @@ function execute() { } } $plugin = null; + if (isset($this->args[0])) { $plugin = Inflector::camelize($this->args[0]); - $pluginPath = Inflector::underscore($plugin) . DS; + $pluginPath = $this->_pluginPath($plugin); $this->Dispatch->shiftArgs(); - if (is_dir($this->path . $pluginPath)) { + if (is_dir($pluginPath)) { $this->out(sprintf(__('Plugin: %s', true), $plugin)); - $this->out(sprintf(__('Path: %s', true), $this->path . $pluginPath)); + $this->out(sprintf(__('Path: %s', true), $pluginPath)); } elseif (isset($this->args[0])) { - $this->err(sprintf(__('%s in path %s not found.', true), $plugin, $this->path . $pluginPath)); + $this->err(sprintf(__('%s in path %s not found.', true), $plugin, $pluginPath)); $this->_stop(); } else { $this->__interactive($plugin); @@ -88,7 +89,7 @@ function execute() { $this->Dispatch->shiftArgs(); if (in_array($task, $this->tasks)) { $this->{$task}->plugin = $plugin; - $this->{$task}->path = $this->path . $pluginPath . Inflector::underscore(Inflector::pluralize($task)) . DS; + $this->{$task}->path = $pluginPath . Inflector::underscore(Inflector::pluralize($task)) . DS; if (!is_dir($this->{$task}->path)) { $this->err(sprintf(__("%s directory could not be found.\nBe sure you have created %s", true), $task, $this->{$task}->path)); @@ -131,8 +132,8 @@ function bake($plugin) { } $this->hr(); - $this->out(sprintf(__("Plugin Name: %s", true) . $plugin)); - $this->out(sprintf(__("Plugin Directory: %s", true) . $this->path . $pluginPath)); + $this->out(sprintf(__("Plugin Name: %s", true), $plugin)); + $this->out(sprintf(__("Plugin Directory: %s", true), $this->path . $pluginPath)); $this->hr(); $looksGood = $this->in(__('Look okay?', true), array('y', 'n', 'q'), 'y'); diff --git a/cake/tests/cases/console/libs/tasks/plugin.test.php b/cake/tests/cases/console/libs/tasks/plugin.test.php index b5f639d65..de8bb4746 100644 --- a/cake/tests/cases/console/libs/tasks/plugin.test.php +++ b/cake/tests/cases/console/libs/tasks/plugin.test.php @@ -39,7 +39,7 @@ if (!class_exists('PluginTask')) { require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'plugin.php'; - require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php'; + require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'model.php'; } Mock::generatePartial( @@ -48,9 +48,11 @@ ); Mock::generatePartial( 'PluginTask', 'MockPluginTask', - array('in', '_stop', 'err', 'out', 'createFile', 'isLoadableClass') + array('in', '_stop', 'err', 'out', 'createFile') ); +Mock::generate('ModelTask', 'PluginTestMockModelTask'); + /** * PluginTaskPlugin class * @@ -59,7 +61,6 @@ */ class PluginTaskTest extends CakeTestCase { - var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag'); /** * setUp method * @@ -83,7 +84,6 @@ function startCase() { $this->_paths = $paths = Configure::read('pluginPaths'); $this->_testPath = array_push($paths, TMP); Configure::write('pluginPaths', $paths); - clearstatcache(); } /** @@ -160,5 +160,25 @@ function testExecuteWithOneArg() { $Folder->delete(); } +/** + * test execute chaining into MVC parts + * + * @return void + **/ + function testExecuteWithTwoArgs() { + $this->Task->Model =& new PluginTestMockModelTask(); + $this->Task->setReturnValueAt(0, 'in', $this->_testPath); + $this->Task->setReturnValueAt(1, 'in', 'y'); + + $Folder =& new Folder(TMP . 'bake_test_plugin', true); + + $this->Task->Dispatch->args = array('BakeTestPlugin', 'model'); + $this->Task->args =& $this->Task->Dispatch->args; + + $this->Task->Model->expectOnce('loadTasks'); + $this->Task->Model->expectOnce('execute'); + $this->Task->execute(); + $Folder->delete(); + } } ?> \ No newline at end of file From f9339e3c81978aab45788f38a0a1fa9a48b3bd23 Mon Sep 17 00:00:00 2001 From: gwoo <gwoo@cakephp.org> Date: Thu, 11 Jun 2009 09:13:16 -0700 Subject: [PATCH 0259/2083] simplified App::path(). Changed App::build() to handle all paths. tests passing. --- cake/libs/configure.php | 211 +++++++++--------- cake/tests/cases/basics.test.php | 7 +- cake/tests/cases/console/cake.test.php | 23 +- cake/tests/cases/console/libs/shell.test.php | 15 +- cake/tests/cases/dispatcher.test.php | 29 ++- cake/tests/cases/libs/cake_test_case.test.php | 49 ++-- .../cases/libs/code_coverage_manager.test.php | 2 +- cake/tests/cases/libs/configure.test.php | 104 +++++++-- .../cases/libs/controller/component.test.php | 6 +- .../libs/controller/components/auth.test.php | 2 +- .../libs/controller/components/email.test.php | 8 +- .../components/request_handler.test.php | 6 +- .../cases/libs/controller/controller.test.php | 17 +- .../libs/controller/pages_controller.test.php | 17 +- .../cases/libs/controller/scaffold.test.php | 37 +-- cake/tests/cases/libs/i18n.test.php | 13 +- cake/tests/cases/libs/object.test.php | 39 ++-- .../cases/libs/view/helpers/cache.test.php | 7 +- .../cases/libs/view/helpers/session.test.php | 13 +- cake/tests/cases/libs/view/theme.test.php | 21 +- cake/tests/cases/libs/view/view.test.php | 27 ++- 21 files changed, 373 insertions(+), 280 deletions(-) diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 907fb5f78..d71b15d75 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -461,89 +461,89 @@ class App extends Object { * @access public */ var $types = array( - 'model' => array('suffix' => '.php', 'extends' => 'AppModel'), - 'behavior' => array('suffix' => '.php', 'extends' => 'ModelBehavior'), - 'controller' => array('suffix' => '_controller.php', 'extends' => 'AppController'), - 'component' => array('suffix' => '.php', 'extends' => null), - 'view' => array('suffix' => '.php', 'extends' => null), - 'helper' => array('suffix' => '.php', 'extends' => 'AppHelper'), - 'plugin' => array('suffix' => '', 'extends' => null), - 'vendor' => array('suffix' => '', 'extends' => null), - 'shell' => array('suffix' => '.php', 'extends' => 'Shell'), - 'class' => array('suffix' => '.php', 'extends' => null), - 'file' => array('suffix' => '.php', 'extends' => null) + 'class' => array('suffix' => '.php', 'extends' => null, 'core' => true), + 'file' => array('suffix' => '.php', 'extends' => null, 'core' => true), + 'model' => array('suffix' => '.php', 'extends' => 'AppModel', 'core' => false), + 'behavior' => array('suffix' => '.php', 'extends' => 'ModelBehavior', 'core' => true), + 'controller' => array('suffix' => '_controller.php', 'extends' => 'AppController', 'core' => true), + 'component' => array('suffix' => '.php', 'extends' => null, 'core' => true), + 'view' => array('suffix' => '.php', 'extends' => null, 'core' => true), + 'helper' => array('suffix' => '.php', 'extends' => 'AppHelper', 'core' => true), + 'vendor' => array('suffix' => '', 'extends' => null, 'core' => true), + 'shell' => array('suffix' => '.php', 'extends' => 'Shell', 'core' => true), + 'plugin' => array('suffix' => '', 'extends' => null, 'core' => true) ); /** * List of additional path(s) where model files reside. * * @var array - * @access protected + * @access public */ - var $_models = array(); + var $models = array(); /** * List of additional path(s) where behavior files reside. * * @var array - * @access protected + * @access public */ - var $_behaviors = array(); + var $behaviors = array(); /** * List of additional path(s) where controller files reside. * * @var array - * @access protected + * @access public */ - var $_controllers = array(); + var $controllers = array(); /** * List of additional path(s) where component files reside. * * @var array - * @access protected + * @access public */ - var $_components = array(); + var $components = array(); /** * List of additional path(s) where view files reside. * * @var array - * @access protected + * @access public */ - var $_views = array(); + var $views = array(); /** * List of additional path(s) where helper files reside. * * @var array - * @access protected + * @access public */ - var $_helpers = array(); + var $helpers = array(); /** * List of additional path(s) where plugins reside. * * @var array - * @access protected + * @access public */ - var $_plugins = array(); + var $plugins = array(); /** * List of additional path(s) where vendor packages reside. * * @var array - * @access protected + * @access public */ - var $_vendors = array(); + var $vendors = array(); /** * List of additional path(s) where locale files reside. * * @var array - * @access protected + * @access public */ - var $_locales = array(); + var $locales = array(); /** * List of additional path(s) where console shell files reside. * * @var array - * @access protected + * @access public */ - var $_shells = array(); + var $shells = array(); /** * Paths to search for files. * @@ -598,79 +598,73 @@ class App extends Object { * * Usage * App::path('models'); will return all paths for models - * App::path('models', array('/path/to/models')); will set and return all paths for models - * App::path(array('models' => array('/path/to/models')); will set and return all paths for models - * * * @param string $type type of path * @return string array * @access public */ - function path($type, $value = array()) { + function path($type) { $_this =& App::getInstance(); - if (empty($value)) { - if (is_array($type)) { - foreach ($type as $object => $value) { - $_this->{"_{$type}"} = (array)$value; - } - return $value; - } - if (!isset($_this->{"_{$type}"})) { - return array(); - } - return $_this->{"_{$type}"}; + if (!isset($_this->{$type})) { + return array(); } - return $_this->{"_{$type}"} = (array)$value; + return $_this->{$type}; } /** * Build path references. Merges the supplied $paths * with the base paths and the default core paths. * * @param array $paths paths defines in config/bootstrap.php + * @param boolean $reset true will set paths, false merges paths [default] false * @return void * @access public */ - function build($paths = array()) { + function build($paths = array(), $reset = false) { $_this =& App::getInstance(); - $core = $_this->core(); - $basePaths = array( - 'model' => array(MODELS), - 'behavior' => array(BEHAVIORS), - 'datasource' => array(MODELS . 'datasources'), - 'controller' => array(CONTROLLERS), - 'component' => array(COMPONENTS), - 'view' => array(VIEWS), - 'helper' => array(HELPERS), - 'plugin' => array(APP . 'plugins' . DS), - 'vendor' => array(APP . 'vendors' . DS, VENDORS), - 'locale' => array(APP . 'locale' . DS), - 'shell' => array() + $defaults = array( + 'models' => array(MODELS), + 'behaviors' => array(BEHAVIORS), + 'datasources' => array(MODELS . 'datasources'), + 'controllers' => array(CONTROLLERS), + 'components' => array(COMPONENTS), + 'views' => array(VIEWS), + 'helpers' => array(HELPERS), + 'locales' => array(APP . 'locale' . DS), + 'shells' => array(APP . 'vendors' . DS . 'shells', VENDORS . 'shells'), + 'vendors' => array(APP . 'vendors' . DS, VENDORS), + 'plugins' => array(APP . 'plugins' . DS), ); - foreach ($basePaths as $type => $default) { - $pathsVar = "_{$type}s"; + if ($reset == true) { + foreach ($paths as $type => $new) { + $_this->{$type} = (array)$new; + } + return $paths; + } + + $core = $_this->core(); + $app = array('models' => true, 'controllers' => true, 'helpers' => true); + + foreach ($defaults as $type => $default) { $merge = array(); - if (isset($core[$type])) { - $merge = $core[$type]; + if (isset($app[$type])) { + $merge = array(APP); } - if ($type === 'model' || $type === 'controller' || $type === 'helper') { - $merge = array_merge(array(APP), $merge); + if (isset($core[$type])) { + $merge = array_merge($merge, (array)$core[$type]); } - if (!is_array($default)) { - $default = array($default); - } - $_this->{$pathsVar} = $default; + $_this->{$type} = $default; - if (isset($paths[$pathsVar]) && !empty($paths[$pathsVar])) { + if (!empty($paths[$type])) { $path = array_flip(array_flip((array_merge( - $_this->{$pathsVar}, (array)$paths[$pathsVar], $merge + $_this->{$type}, (array)$paths[$type], $merge )))); - $_this->{$pathsVar} = array_values($path); + $_this->{$type} = array_values($path); } else { - $path = array_flip(array_flip((array_merge($_this->{$pathsVar}, $merge)))); - $_this->{$pathsVar} = array_values($path); + $path = array_flip(array_flip((array_merge($_this->{$type}, $merge)))); + $_this->{$type} = array_values($path); } } } @@ -705,16 +699,16 @@ function core($type = null) { $cake = $path . DS . 'cake' . DS; $libs = $cake . 'libs' . DS; if (is_dir($libs)) { - $paths['libs'][] = $libs; - $paths['model'][] = $libs . 'model' . DS; - $paths['behavior'][] = $libs . 'model' . DS . 'behaviors' . DS; - $paths['controller'][] = $libs . 'controller' . DS; - $paths['component'][] = $libs . 'controller' . DS . 'components' . DS; - $paths['view'][] = $libs . 'view' . DS; - $paths['helper'][] = $libs . 'view' . DS . 'helpers' . DS; $paths['cake'][] = $cake; - $paths['vendor'][] = $path . DS . 'vendors' . DS; - $paths['shell'][] = $cake . 'console' . DS . 'libs' . DS; + $paths['libs'][] = $libs; + $paths['models'][] = $libs . 'model' . DS; + $paths['behaviors'][] = $libs . 'model' . DS . 'behaviors' . DS; + $paths['controllers'][] = $libs . 'controller' . DS; + $paths['components'][] = $libs . 'controller' . DS . 'components' . DS; + $paths['views'][] = $libs . 'view' . DS; + $paths['helpers'][] = $libs . 'view' . DS . 'helpers' . DS; + $paths['vendors'][] = $path . DS . 'vendors' . DS; + $paths['shells'][] = $cake . 'console' . DS . 'libs' . DS; break; } } @@ -759,7 +753,7 @@ function objects($type, $path = null, $cache = true) { $objects = array(); if (empty($path)) { - $path = $_this->{"_{$type}s"}; + $path = $_this->{"{$type}s"}; if (isset($types[$type]['core']) && $types[$type]['core'] === false) { array_pop($path); } @@ -806,6 +800,7 @@ function objects($type, $path = null, $cache = true) { * @access public */ function import($type = null, $name = null, $parent = true, $search = array(), $file = null, $return = false) { + $_this =& App::getInstance(); $plugin = $directory = null; if (is_array($type)) { @@ -854,12 +849,13 @@ function import($type = null, $name = null, $parent = true, $search = array(), $ if ($name != null && strpos($name, '.') !== false) { list($plugin, $name) = explode('.', $name); + $plugin = Inflector::camelize($plugin); } - $_this =& App::getInstance(); + $_this->return = $return; if (isset($ext)) { - $file = Inflector::underscore($name) . ".$ext"; + $file = Inflector::underscore($name) . ".{$ext}"; } $ext = $_this->__settings($type, $plugin, $parent); @@ -895,7 +891,6 @@ function import($type = null, $name = null, $parent = true, $search = array(), $ foreach ($paths as $key => $value) { $_this->search[$key] = $value . $ext['path']; } - $plugin = Inflector::camelize($plugin); } } @@ -1012,12 +1007,11 @@ function __load($file) { * @param string $file full path to file * @param string $name unique name for this map * @param string $type type object being mapped - * @param string $plugin if object is from a plugin, the name of the plugin + * @param string $plugin camelized if object is from a plugin, the name of the plugin * @access private */ function __map($file, $name, $type, $plugin) { if ($plugin) { - $plugin = Inflector::camelize($plugin); $this->__map['Plugin'][$plugin][$type][$name] = $file; } else { $this->__map[$type][$name] = $file; @@ -1028,14 +1022,12 @@ function __map($file, $name, $type, $plugin) { * * @param string $name unique name * @param string $type type object - * @param string $plugin if object is from a plugin, the name of the plugin + * @param string $plugin camelized if object is from a plugin, the name of the plugin * @return mixed, file path if found, false otherwise * @access private */ function __mapped($name, $type, $plugin) { if ($plugin) { - $plugin = Inflector::camelize($plugin); - if (isset($this->__map['Plugin'][$plugin][$type]) && isset($this->__map['Plugin'][$plugin][$type][$name])) { return $this->__map['Plugin'][$plugin][$type][$name]; } @@ -1064,7 +1056,7 @@ function __overload($type, $name) { * Returns a prefix or suffix needed for loading files. * * @param string $type type of object - * @param string $plugin name of plugin + * @param string $plugin camelized name of plugin * @param boolean $parent false will not attempt to load parent * @return array * @access private @@ -1075,8 +1067,7 @@ function __settings($type, $plugin, $parent) { } if ($plugin) { - $plugin = Inflector::underscore($plugin); - $name = Inflector::camelize($plugin); + $pluginPath = Inflector::underscore($plugin); } $path = null; $load = strtolower($type); @@ -1084,42 +1075,42 @@ function __settings($type, $plugin, $parent) { switch ($load) { case 'model': if (!class_exists('Model')) { - App::import('Core', 'Model', false, App::core('model')); + App::import('Core', 'Model', false, App::core('models')); } if (!class_exists('AppModel')) { App::import($type, 'AppModel', false, App::path('models')); } if ($plugin) { - if (!class_exists($name . 'AppModel')) { - App::import($type, $plugin . '.' . $name . 'AppModel', false, array(), $plugin . DS . $plugin . '_app_model.php'); + if (!class_exists($plugin . 'AppModel')) { + App::import($type, $plugin . '.' . $plugin . 'AppModel', false, array(), $pluginPath . DS . $pluginPath . '_app_model.php'); } - $path = $plugin . DS . 'models' . DS; + $path = $pluginPath . DS . 'models' . DS; } return array('class' => null, 'suffix' => null, 'path' => $path); break; case 'behavior': if ($plugin) { - $path = $plugin . DS . 'models' . DS . 'behaviors' . DS; + $path = $pluginPath . DS . 'models' . DS . 'behaviors' . DS; } return array('class' => $type, 'suffix' => null, 'path' => $path); break; case 'controller': App::import($type, 'AppController', false); if ($plugin) { - App::import($type, $plugin . '.' . $name . 'AppController', false, array(), $plugin . DS . $plugin . '_app_controller.php'); - $path = $plugin . DS . 'controllers' . DS; + App::import($type, $plugin . '.' . $plugin . 'AppController', false, array(), $pluginPath . DS . $pluginPath . '_app_controller.php'); + $path = $pluginPath . DS . 'controllers' . DS; } return array('class' => $type, 'suffix' => $type, 'path' => $path); break; case 'component': if ($plugin) { - $path = $plugin . DS . 'controllers' . DS . 'components' . DS; + $path = $pluginPath . DS . 'controllers' . DS . 'components' . DS; } return array('class' => $type, 'suffix' => null, 'path' => $path); break; case 'view': if ($plugin) { - $path = $plugin . DS . 'views' . DS; + $path = $pluginPath . DS . 'views' . DS; } return array('class' => $type, 'suffix' => null, 'path' => $path); break; @@ -1128,13 +1119,13 @@ function __settings($type, $plugin, $parent) { App::import($type, 'AppHelper', false); } if ($plugin) { - $path = $plugin . DS . 'views' . DS . 'helpers' . DS; + $path = $pluginPath . DS . 'views' . DS . 'helpers' . DS; } return array('class' => $type, 'suffix' => null, 'path' => $path); break; case 'vendor': if ($plugin) { - $path = $plugin . DS . 'vendors' . DS; + $path = $pluginPath . DS . 'vendors' . DS; } return array('class' => null, 'suffix' => null, 'path' => $path); break; @@ -1166,7 +1157,6 @@ function __paths($type) { } return $paths; } - if ($paths = App::path($type .'s')) { return $paths; } @@ -1189,13 +1179,12 @@ function __paths($type) { * * @param string $name name of object * @param string $type type of object - * @param string $plugin name of plugin + * @param string $plugin camelized name of plugin * @return void * @access private */ function __remove($name, $type, $plugin) { if ($plugin) { - $plugin = Inflector::camelize($plugin); unset($this->__map['Plugin'][$plugin][$type][$name]); } else { unset($this->__map[$type][$name]); diff --git a/cake/tests/cases/basics.test.php b/cake/tests/cases/basics.test.php index 970bd32cc..1f277e5f2 100644 --- a/cake/tests/cases/basics.test.php +++ b/cake/tests/cases/basics.test.php @@ -40,8 +40,9 @@ class BasicsTest extends CakeTestCase { * @return void */ function setUp() { - $this->_localePaths = App::path('locales');; - App::path('locales', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale')); + App::build(array( + 'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale') + )); $this->_language = Configure::read('Config.language'); } /** @@ -51,7 +52,7 @@ function setUp() { * @return void */ function tearDown() { - App::path('locales', $this->_localePaths); + App::build(); Configure::write('Config.language', $this->_language); } /** diff --git a/cake/tests/cases/console/cake.test.php b/cake/tests/cases/console/cake.test.php index dd24a73ea..901dfc685 100644 --- a/cake/tests/cases/console/cake.test.php +++ b/cake/tests/cases/console/cake.test.php @@ -123,16 +123,15 @@ class ShellDispatcherTest extends UnitTestCase { * @return void */ function setUp() { - $this->_pluginPaths = App::path('plugins'); - $this->_shellPaths = App::path('shells'); - - App::path('plugins', array( - TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS - )); - Configure::write('shellPaths', array( - CORE_PATH ? CONSOLE_LIBS : ROOT . DS . CONSOLE_LIBS, - TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS . 'shells' . DS - )); + App::build(array( + 'plugins' => array( + TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS + ), + 'shells' => array( + CORE_PATH ? CONSOLE_LIBS : ROOT . DS . CONSOLE_LIBS, + TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS . 'shells' . DS + ) + ), true); } /** * tearDown method @@ -141,8 +140,7 @@ function setUp() { * @return void */ function tearDown() { - App::path('plugins', $this->_pluginPaths); - Configure::write('shellPaths', $this->_shellPaths); + App::build(); } /** * testParseParams method @@ -407,6 +405,7 @@ function testBuildPaths() { $Dispatcher =& new TestShellDispatcher(); $result = $Dispatcher->shellPaths; + $expected = array( TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'vendors' . DS . 'shells' . DS, TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin_two' . DS . 'vendors' . DS . 'shells' . DS, diff --git a/cake/tests/cases/console/libs/shell.test.php b/cake/tests/cases/console/libs/shell.test.php index 77ac26e68..d622cda54 100644 --- a/cake/tests/cases/console/libs/shell.test.php +++ b/cake/tests/cases/console/libs/shell.test.php @@ -119,13 +119,11 @@ function testConstruct() { * @access public */ function testInitialize() { - $_back = array( - 'modelPaths' => App::path('models'), - 'pluginPaths' => App::path('plugins'), - 'viewPaths' => App::path('views'), - ); - App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); - App::path('models', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS)); + App::build(array( + 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), + 'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS) + ), true); + $this->Shell->uses = array('TestPlugin.TestPluginPost'); $this->Shell->initialize(); @@ -144,8 +142,7 @@ function testInitialize() { $this->assertTrue(isset($this->Shell->AppModel)); $this->assertIsA($this->Shell->AppModel, 'AppModel'); - App::path('plugins', $_back['pluginPaths']); - App::path('models', $_back['modelPaths']); + App::build(); } /** * testOut method diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index d2c0ed94b..e0c08aa60 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -509,14 +509,9 @@ function startTest() { $this->_cache = Configure::read('Cache'); Configure::write('Cache.disable', true); - $this->_vendorPaths = App::path('vendors'); - $this->_pluginPaths = App::path('plugins'); - $this->_viewPaths = App::path('views'); - $this->_controllerPaths = App::path('controllers'); $this->_debug = Configure::read('debug'); - App::path('controllers', Configure::corePaths('controller')); - App::path('views', Configure::corePaths('view')); + App::build(App::core()); } /** * tearDown method @@ -529,12 +524,9 @@ function endTest() { $_POST = $this->_post; $_FILES = $this->_files; $_SERVER = $this->_server; + App::build(); Configure::write('App', $this->_app); Configure::write('Cache', $this->_cache); - App::path('vendors', $this->_vendorPaths); - App::path('plugins', $this->_pluginPaths); - App::path('views', $this->_viewPaths); - App::path('controllers', $this->_controllerPaths); Configure::write('debug', $this->_debug); } /** @@ -1623,8 +1615,9 @@ function testPrefixProtection() { **/ function testTestPluginDispatch() { $Dispatcher =& new TestDispatcher(); - $_back = App::path('plugins'); - App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); + App::build(array( + 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) + )); $url = '/test_plugin/tests/index'; $result = $Dispatcher->dispatch($url, array('return' => 1)); $this->assertTrue(class_exists('TestsController')); @@ -1632,7 +1625,7 @@ function testTestPluginDispatch() { $this->assertTrue(class_exists('OtherComponentComponent')); $this->assertTrue(class_exists('PluginsComponentComponent')); - App::path('plugins', $_back); + App::build(); } /** * testChangingParamsFromBeforeFilter method @@ -1678,8 +1671,10 @@ function testStaticAssets() { $Configure = Configure::getInstance(); $Configure->__objects = null; - App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); - App::path('vendors', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors'. DS)); + App::build(array( + 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), + 'vendors' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors'. DS) + )); $Dispatcher =& new TestDispatcher(); @@ -1734,7 +1729,9 @@ function testFullPageCachingDispatch() { Router::reload(); Router::connect('/', array('controller' => 'test_cached_pages', 'action' => 'index')); - App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); + App::build(array( + 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS), + ), true); $dispatcher =& new Dispatcher(); $dispatcher->base = false; diff --git a/cake/tests/cases/libs/cake_test_case.test.php b/cake/tests/cases/libs/cake_test_case.test.php index 8f4b888db..f29f04c48 100644 --- a/cake/tests/cases/libs/cake_test_case.test.php +++ b/cake/tests/cases/libs/cake_test_case.test.php @@ -93,6 +93,15 @@ function tearDown() { unset($this->Case); unset($this->Reporter); } +/** + * endTest + * + * @access public + * @return void + */ + function endTest() { + App::build(); + } /** * testAssertGoodTags * @@ -238,16 +247,12 @@ function testGetTests() { * @return void **/ function testTestAction() { - $_back = array( - 'controller' => App::path('controllers'), - 'view' => App::path('views'), - 'model' => App::path('models'), - 'plugin' => App::path('plugins') - ); - App::path('controllers', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)); - App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)); - App::path('models', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS)); - App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); + App::build(array( + 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), + 'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS), + 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS), + 'controllers' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS) + ), true); $result = $this->Case->testAction('/tests_apps/index', array('return' => 'view')); $this->assertPattern('/This is the TestsAppsController index view/', $result); @@ -365,12 +370,6 @@ function testTestAction() { $db =& ConnectionManager::getDataSource('test_suite'); $db->config['prefix'] = $_backPrefix; $fixture->drop($db); - - - App::path('models', $_back['model']); - App::path('controllers', $_back['controller']); - App::path('views', $_back['view']); - App::path('plugins', $_back['plugin']); } /** * testSkipIf @@ -388,14 +387,12 @@ function testSkipIf() { * @return void */ function testTestDispatcher() { - $_back = array( - 'controller' => App::path('controllers'), - 'view' => App::path('views'), - 'plugin' => App::path('plugins') - ); - App::path('controllers', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)); - App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)); - App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); + App::build(array( + 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), + 'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS), + 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS), + 'controllers' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS) + ), true); $Dispatcher =& new CakeTestDispatcher(); $Case =& new CakeDispatcherMockTestCase(); @@ -407,10 +404,6 @@ function testTestDispatcher() { $this->assertTrue(isset($Dispatcher->testCase)); $return = $Dispatcher->dispatch('/tests_apps/index', array('autoRender' => 0, 'return' => 1, 'requested' => 1)); - - App::path('controllers', $_back['controller']); - App::path('views', $_back['view']); - App::path('plugins', $_back['plugin']); } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/code_coverage_manager.test.php b/cake/tests/cases/libs/code_coverage_manager.test.php index 9a1e6c41e..8ef083aba 100644 --- a/cake/tests/cases/libs/code_coverage_manager.test.php +++ b/cake/tests/cases/libs/code_coverage_manager.test.php @@ -116,7 +116,7 @@ function testGetTestObjectFileNameFromTestCaseFile() { $expected = $manager->__testObjectFileFromCaseFile('models/some_file.test.php', true); $this->assertIdentical(APP.'models'.DS.'some_file.php', $expected); - $expected = $manager->__testObjectFileFromCaseFile('datasources/some_file.test.php', true); + $expected = $manager->__testObjectFileFromCaseFile('models/datasources/some_file.test.php', true); $this->assertIdentical(APP.'models'.DS.'datasources'.DS.'some_file.php', $expected); $expected = $manager->__testObjectFileFromCaseFile('controllers/some_file.test.php', true); diff --git a/cake/tests/cases/libs/configure.test.php b/cake/tests/cases/libs/configure.test.php index 53d1a01ed..534992e26 100644 --- a/cake/tests/cases/libs/configure.test.php +++ b/cake/tests/cases/libs/configure.test.php @@ -40,10 +40,19 @@ class ConfigureTest extends CakeTestCase { */ function setUp() { $this->_cacheDisable = Configure::read('Cache.disable'); - Configure::write('Cache.disable', true); - $this->_debug = Configure::read('debug'); + + Configure::write('Cache.disable', true); } +/** + * endTest + * + * @access public + * @return void + */ + function endTest() { + App::build(); + } /** * tearDown method * @@ -213,26 +222,81 @@ function testVersion() { */ class AppImportTest extends UnitTestCase { /** - * testBuildPaths method + * testBuild method * * @access public * @return void */ function testBuild() { - App::build(); - $models = App::path('models'); - $this->assertTrue(!empty($models)); + $old = App::path('models'); + $expected = array( + APP . 'models' . DS, + APP, + ROOT . DS . LIBS . 'model' . DS + ); + $this->assertEqual($expected, $old); + + App::build(array('models' => array('/path/to/models/'))); + + $new = App::path('models'); + + $expected = array( + APP . 'models' . DS, + '/path/to/models/', + APP, + ROOT . DS . LIBS . 'model' . DS + ); + $this->assertEqual($expected, $new); + + App::build(); //reset defaults + $defaults = App::path('models'); + $this->assertEqual($old, $defaults); + } +/** + * testBuildWithReset method + * + * @access public + * @return void + */ + function testBuildWithReset() { + $old = App::path('models'); + $expected = array( + APP . 'models' . DS, + APP, + ROOT . DS . LIBS . 'model' . DS + ); + $this->assertEqual($expected, $old); + + App::build(array('models' => array('/path/to/models/')), true); + + $new = App::path('models'); + + $expected = array( + '/path/to/models/' + ); + $this->assertEqual($expected, $new); + + App::build(); //reset defaults + $defaults = App::path('models'); + $this->assertEqual($old, $defaults); } /** - * testBuildPaths method + * testCore method * * @access public * @return void */ function testCore() { - $model = App::core('model'); - $this->assertTrue(!empty($models)); - } + $model = App::core('models'); + $this->assertEqual(array(ROOT . DS . LIBS . 'model' . DS), $model); + + $view = App::core('views'); + $this->assertEqual(array(ROOT . DS . LIBS . 'view' . DS), $view); + + $controller = App::core('controllers'); + $this->assertEqual(array(ROOT . DS . LIBS . 'controller' . DS), $controller); + + } /** * testListObjects method * @@ -261,8 +325,7 @@ function testListObjects() { $this->assertTrue(in_array('Html', $result)); $result = App::objects('model'); - $notExpected = array('AppModel', 'Behavior', 'ConnectionManager', 'DbAcl', 'Model', 'Schema'); - + $notExpected = array('AppModel', 'ModelBehavior', 'ConnectionManager', 'DbAcl', 'Model', 'CakeSchema'); foreach ($notExpected as $class) { $this->assertFalse(in_array($class, $result)); } @@ -276,7 +339,7 @@ function testListObjects() { $result = App::objects('NonExistingType'); $this->assertFalse($result); - } + } /** * testClassLoading method * @@ -351,8 +414,9 @@ function testClassLoading() { $this->assertFalse($file); } - $_back = App::path('plugins'); - App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); + App::build(array( + 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) + )); $result = App::import('Controller', 'TestPlugin.Tests'); $this->assertTrue($result); @@ -363,7 +427,7 @@ function testClassLoading() { $this->assertTrue($result); $this->assertTrue(class_exists('OtherHelperHelper')); - App::path('plugins', $_back); + App::build(); } /** * testFileLoading method @@ -493,9 +557,11 @@ function testMultipleLoadingByType() { } */ function testLoadingVendor() { - App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); - App::path('vendors', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors'. DS)); - + App::build(array( + 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), + 'vendors' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors'. DS), + ), true); + ob_start(); $result = App::import('Vendor', 'TestPlugin.TestPluginAsset', array('ext' => 'css')); $text = ob_get_clean(); diff --git a/cake/tests/cases/libs/controller/component.test.php b/cake/tests/cases/libs/controller/component.test.php index e893c92a6..163f41ce1 100644 --- a/cake/tests/cases/libs/controller/component.test.php +++ b/cake/tests/cases/libs/controller/component.test.php @@ -281,8 +281,8 @@ class ComponentTest extends CakeTestCase { */ function setUp() { $this->_pluginPaths = App::path('plugins'); - App::path('plugins', array( - TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS + App::build(array( + 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) )); } /** @@ -292,7 +292,7 @@ function setUp() { * @return void */ function tearDown() { - App::path('plugins', $this->_pluginPaths); + App::build(); ClassRegistry::flush(); } /** diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php index 101900096..d4fb6749c 100644 --- a/cake/tests/cases/libs/controller/components/auth.test.php +++ b/cake/tests/cases/libs/controller/components/auth.test.php @@ -1171,7 +1171,7 @@ function testAdminRoute() { * @return void */ function testAjaxLogin() { - App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); + App::build(array('views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS))); $_SERVER['HTTP_X_REQUESTED_WITH'] = "XMLHttpRequest"; if (!class_exists('dispatcher')) { diff --git a/cake/tests/cases/libs/controller/components/email.test.php b/cake/tests/cases/libs/controller/components/email.test.php index ba779dc02..c2a0b00b1 100644 --- a/cake/tests/cases/libs/controller/components/email.test.php +++ b/cake/tests/cases/libs/controller/components/email.test.php @@ -181,9 +181,9 @@ function setUp() { $this->Controller->EmailTest->initialize($this->Controller, array()); ClassRegistry::addObject('view', new View($this->Controller)); - $this->_viewPaths = App::path('views'); - App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); - + App::build(array( + 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS) + )); } /** * tearDown method @@ -193,7 +193,7 @@ function setUp() { */ function tearDown() { Configure::write('App.encoding', $this->_appEncoding); - App::path('views', $this->_viewPaths); + App::build(); $this->Controller->Session->del('Message'); restore_error_handler(); ClassRegistry::flush(); diff --git a/cake/tests/cases/libs/controller/components/request_handler.test.php b/cake/tests/cases/libs/controller/components/request_handler.test.php index 68c30bd00..f81f63a8f 100644 --- a/cake/tests/cases/libs/controller/components/request_handler.test.php +++ b/cake/tests/cases/libs/controller/components/request_handler.test.php @@ -144,6 +144,7 @@ function tearDown() { if (!headers_sent()) { header('Content-type: text/html'); //reset content type. } + App::build(); } /** * testInitializeCallback method @@ -485,9 +486,7 @@ function testClientProperties() { function testAjaxRedirectAsRequestAction() { $_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'; $this->_init(); - $_paths = App::path('views'); - $testDir = array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS); - App::path('views', array_merge($testDir, $_paths)); + App::build(array('views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS))); $this->Controller->RequestHandler = new NoStopRequestHandler($this); $this->Controller->RequestHandler->expectOnce('_stop'); @@ -499,7 +498,6 @@ function testAjaxRedirectAsRequestAction() { $result = ob_get_clean(); $this->assertPattern('/posts index/', $result, 'RequestAction redirect failed.'); - App::path('views', $_paths); unset($_SERVER['HTTP_X_REQUESTED_WITH']); } /** diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index 82d935551..35fc7843d 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -368,6 +368,15 @@ class ControllerTest extends CakeTestCase { * @access public */ var $fixtures = array('core.post', 'core.comment', 'core.name'); +/** + * endTest + * + * @access public + * @return void + */ + function endTest() { + App::build(); + } /** * testConstructClasses method * @@ -394,10 +403,7 @@ function testConstructClasses() { unset($Controller); - $_back = array( - 'pluginPaths' => App::path('plugins'), - ); - App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); + App::build(array('plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS))); $Controller =& new Controller(); $Controller->uses = array('TestPlugin.TestPluginPost'); @@ -407,7 +413,6 @@ function testConstructClasses() { $this->assertTrue(isset($Controller->TestPluginPost)); $this->assertTrue(is_a($Controller->TestPluginPost, 'TestPluginPost')); - App::path('plugins', $_back['pluginPaths']); unset($Controller); } /** @@ -706,7 +711,7 @@ function testControllerSet() { * @return void */ function testRender() { - App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS)); + App::build(array('views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS))); $Controller =& new Controller(); $Controller->viewPath = 'posts'; diff --git a/cake/tests/cases/libs/controller/pages_controller.test.php b/cake/tests/cases/libs/controller/pages_controller.test.php index fd92a4651..805199b7a 100644 --- a/cake/tests/cases/libs/controller/pages_controller.test.php +++ b/cake/tests/cases/libs/controller/pages_controller.test.php @@ -38,22 +38,13 @@ */ class PagesControllerTest extends CakeTestCase { /** - * setUp method + * endTest method * * @access public * @return void */ - function setUp() { - $this->_viewPaths = App::path('views'); - } -/** - * tearDown method - * - * @access public - * @return void - */ - function tearDown() { - App::path('views', $this->_viewPaths); + function endTest() { + App::build(); } /** * testDisplay method @@ -66,7 +57,7 @@ function testDisplay() { return; } - App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS)); + App::build(array('views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS))); $Pages =& new PagesController(); $Pages->viewPath = 'posts'; diff --git a/cake/tests/cases/libs/controller/scaffold.test.php b/cake/tests/cases/libs/controller/scaffold.test.php index d33470c55..2e272544a 100644 --- a/cake/tests/cases/libs/controller/scaffold.test.php +++ b/cake/tests/cases/libs/controller/scaffold.test.php @@ -214,6 +214,15 @@ function setUp() { function tearDown() { unset($this->Controller); } +/** + * endTest + * + * @access public + * @return void + */ + function endTest() { + App::build(); + } /** * testGetViewFilename method * @@ -262,13 +271,11 @@ function testGetViewFilename() { $expected = 'cake' . DS . 'libs' . DS . 'view' . DS . 'errors' . DS . 'scaffold_error.ctp'; $this->assertEqual($result, $expected); - $_back = array( - 'viewPaths' => App::path('views'), - 'pluginPaths' => App::path('plugins'), - ); - App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)); - App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); - + App::build(array( + 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), + 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS) + )); + $Controller =& new ScaffoldMockController(); $Controller->scaffold = 'admin'; $Controller->viewPath = 'posts'; @@ -298,8 +305,6 @@ function testGetViewFilename() { . DS .'test_plugin' . DS . 'views' . DS . 'tests' . DS . 'scaffold.edit.ctp'; $this->assertEqual($result, $expected); - App::path('views', $_back['viewPaths']); - App::path('plugins', $_back['pluginPaths']); Configure::write('Routing.admin', $_admin); } /** @@ -332,11 +337,11 @@ function testIndexScaffold() { new Scaffold($this->Controller, $params); $result = ob_get_clean(); - $this->assertPattern('#<h2>ScaffoldMock</h2>#', $result); + $this->assertPattern('#<h2>Scaffold Mock</h2>#', $result); $this->assertPattern('#<table cellpadding="0" cellspacing="0">#', $result); //TODO: add testing for table generation $this->assertPattern('#<a href="/scaffold_users/view/1">1</a>#', $result); //belongsTo links - $this->assertPattern('#<li><a href="/scaffold_mock/add/">New ScaffoldMock</a></li>#', $result); + $this->assertPattern('#<li><a href="/scaffold_mock/add/">New Scaffold Mock</a></li>#', $result); $this->assertPattern('#<li><a href="/scaffold_users/">List Scaffold Users</a></li>#', $result); $this->assertPattern('#<li><a href="/scaffold_comments/add/">New Comment</a></li>#', $result); } @@ -371,12 +376,12 @@ function testViewScaffold() { new Scaffold($this->Controller, $params); $result = ob_get_clean(); - $this->assertPattern('/<h2>View ScaffoldMock<\/h2>/', $result); + $this->assertPattern('/<h2>View Scaffold Mock<\/h2>/', $result); $this->assertPattern('/<dl>/', $result); //TODO: add specific tests for fields. $this->assertPattern('/<a href="\/scaffold_users\/view\/1">1<\/a>/', $result); //belongsTo links - $this->assertPattern('/<li><a href="\/scaffold_mock\/edit\/1">Edit ScaffoldMock<\/a>\s<\/li>/', $result); - $this->assertPattern('/<li><a href="\/scaffold_mock\/delete\/1"[^>]*>Delete ScaffoldMock<\/a>\s*<\/li>/', $result); + $this->assertPattern('/<li><a href="\/scaffold_mock\/edit\/1">Edit Scaffold Mock<\/a>\s<\/li>/', $result); + $this->assertPattern('/<li><a href="\/scaffold_mock\/delete\/1"[^>]*>Delete Scaffold Mock<\/a>\s*<\/li>/', $result); //check related table $this->assertPattern('/<div class="related">\s*<h3>Related Scaffold Comments<\/h3>\s*<table cellpadding="0" cellspacing="0">/', $result); $this->assertPattern('/<li><a href="\/scaffold_comments\/add\/">New Comment<\/a><\/li>/', $result); @@ -459,10 +464,10 @@ function testAdminIndexScaffold() { $Scaffold = new Scaffold($this->Controller, $params); $result = ob_get_clean(); - $this->assertPattern('/<h2>ScaffoldMock<\/h2>/', $result); + $this->assertPattern('/<h2>Scaffold Mock<\/h2>/', $result); $this->assertPattern('/<table cellpadding="0" cellspacing="0">/', $result); //TODO: add testing for table generation - $this->assertPattern('/<li><a href="\/admin\/scaffold_mock\/add\/">New ScaffoldMock<\/a><\/li>/', $result); + $this->assertPattern('/<li><a href="\/admin\/scaffold_mock\/add\/">New Scaffold Mock<\/a><\/li>/', $result); Configure::write('Routing.admin', $_backAdmin); } diff --git a/cake/tests/cases/libs/i18n.test.php b/cake/tests/cases/libs/i18n.test.php index c6c7f1215..567a53b46 100644 --- a/cake/tests/cases/libs/i18n.test.php +++ b/cake/tests/cases/libs/i18n.test.php @@ -40,7 +40,9 @@ class I18nTest extends CakeTestCase { */ function setUp() { $this->_localePaths = App::path('locales');; - App::path('locales', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale')); + App::build(array( + 'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale') + )); } /** * tearDown method @@ -49,7 +51,7 @@ function setUp() { * @return void */ function tearDown() { - App::path('locales', $this->_localePaths); + App::build(); } /** * testDefaultStrings method @@ -2353,8 +2355,9 @@ function testNoCoreTranslation () { * @return void */ function testPluginTranslation() { - $pluginPaths = App::path('plugins'); - App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins')); + App::build(array( + 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins') + )); Configure::write('Config.language', 'po'); $singular = $this->__domainSingular(); @@ -2388,7 +2391,7 @@ function testPluginTranslation() { $this->assertTrue(in_array('24 = 0 or > 1 (from plugin)', $plurals)); $this->assertTrue(in_array('25 = 0 or > 1 (from plugin)', $plurals)); - App::path('plugins', $pluginPaths); + App::build(); } /** * testPoMultipleLineTranslation method diff --git a/cake/tests/cases/libs/object.test.php b/cake/tests/cases/libs/object.test.php index fc7abc1ec..8ed9adec3 100644 --- a/cake/tests/cases/libs/object.test.php +++ b/cake/tests/cases/libs/object.test.php @@ -321,6 +321,15 @@ function setUp() { function tearDown() { unset($this->object); } +/** + * endTest + * + * @access public + * @return void + */ + function endTest() { + App::build(); + } /** * testLog method * @@ -424,8 +433,10 @@ function testPersistWithBehavior() { $cacheDisable = Configure::read('Cache.disable'); Configure::write('Cache.disable', false); - App::path('models', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS)); - App::path('behaviors', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS . 'behaviors' . DS)); + App::build(array( + 'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS), + 'behaviors' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS . 'behaviors' . DS), + ), true); $this->assertFalse(class_exists('PersisterOneBehaviorBehavior')); $this->assertFalse(class_exists('PersisterTwoBehaviorBehavior')); @@ -470,8 +481,10 @@ function testPersistWithBehaviorAndRequestAction() { $this->assertFalse(class_exists('ContainableBehavior')); - App::path('models', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS)); - App::path('behaviors', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS . 'behaviors' . DS)); + App::build(array( + 'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS), + 'behaviors' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS . 'behaviors' . DS), + ), true); $this->assertFalse(class_exists('PersistOneBehaviorBehavior')); $this->assertFalse(class_exists('PersistTwoBehaviorBehavior')); @@ -612,14 +625,12 @@ function testRequestAction() { $expected = 12; $this->assertEqual($result, $expected); - $_back = array( - 'controller' => App::path('controllers'), - 'view' => App::path('views'), - 'plugin' => App::path('plugins') - ); - App::path('controllers', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS)); - App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)); - App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); + App::build(array( + 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), + 'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS), + 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS), + 'controllers' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS) + ), true); $result = $this->object->requestAction('/tests_apps/index', array('return')); $expected = 'This is the TestsAppsController index view'; @@ -673,10 +684,6 @@ function testRequestAction() { $result = $this->object->requestAction(array('controller'=>'request_action', 'action'=>'paginate_request_action'), array('pass' => array(5), 'named' => array('param' => 'value'))); $this->assertTrue($result); - - App::path('controllers', $_back['controller']); - App::path('views', $_back['view']); - App::path('plugins', $_back['plugin']); } /** * Test that requestAction() is populating $this->params properly diff --git a/cake/tests/cases/libs/view/helpers/cache.test.php b/cake/tests/cases/libs/view/helpers/cache.test.php index 62fe593b2..907146e24 100644 --- a/cake/tests/cases/libs/view/helpers/cache.test.php +++ b/cake/tests/cases/libs/view/helpers/cache.test.php @@ -90,8 +90,9 @@ function setUp() { * @return void */ function startCase() { - $this->_viewPaths = App::path('views'); - App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); + App::build(array( + 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS) + )); } /** * End Case - restore view Paths @@ -100,7 +101,7 @@ function startCase() { * @return void */ function endCase() { - App::path('views', $this->_viewPaths); + App::build(); } /** * tearDown method diff --git a/cake/tests/cases/libs/view/helpers/session.test.php b/cake/tests/cases/libs/view/helpers/session.test.php index 5cf97a8d4..fb4d9d984 100644 --- a/cake/tests/cases/libs/view/helpers/session.test.php +++ b/cake/tests/cases/libs/view/helpers/session.test.php @@ -83,6 +83,15 @@ function tearDown() { $_SESSION = array(); unset($this->Session); } +/** + * endTest + * + * @access public + * @return void + */ + function endTest() { + App::build(); + } /** * testRead method * @@ -143,7 +152,9 @@ function testFlash() { $result = ob_get_clean(); $this->assertEqual($result, $expected); - App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); + App::build(array( + 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS) + )); $controller = new Controller(); $this->Session->view = new View($controller); diff --git a/cake/tests/cases/libs/view/theme.test.php b/cake/tests/cases/libs/view/theme.test.php index f4c65cf32..4644bf11c 100644 --- a/cake/tests/cases/libs/view/theme.test.php +++ b/cake/tests/cases/libs/view/theme.test.php @@ -159,6 +159,15 @@ function tearDown() { unset($this->PostsController); unset($this->Controller); } +/** + * endTest + * + * @access public + * @return void + */ + function endTest() { + App::build(); + } /** * testPluginGetTemplate method * @@ -173,8 +182,10 @@ function testPluginGetTemplate() { $this->Controller->theme = 'test_plugin_theme'; $ThemeView = new TestThemeView($this->Controller); - App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); - App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); + App::build(array( + 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), + 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS) + )); $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS . 'themed' . DS . 'test_plugin_theme' . DS .'tests' . DS .'index.ctp'; $result = $ThemeView->getViewFileName('index'); @@ -200,8 +211,10 @@ function testGetTemplate() { $ThemeView = new TestThemeView($this->Controller); $ThemeView->theme = 'test_theme'; - App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); - App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS)); + App::build(array( + 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), + 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS) + )); $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS .'pages' . DS .'home.ctp'; $result = $ThemeView->getViewFileName('home'); diff --git a/cake/tests/cases/libs/view/view.test.php b/cake/tests/cases/libs/view/view.test.php index 2377959c1..5c9998bdf 100644 --- a/cake/tests/cases/libs/view/view.test.php +++ b/cake/tests/cases/libs/view/view.test.php @@ -223,6 +223,27 @@ function tearDown() { unset($this->PostsController); unset($this->Controller); } +/** + * endTest + * + * @access public + * @return void + */ + function startTest() { + App::build(array( + 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), + 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS) + )); + } +/** + * endTest + * + * @access public + * @return void + */ + function endTest() { + App::build(); + } /** * testPluginGetTemplate method * @@ -236,8 +257,6 @@ function testPluginGetTemplate() { $this->Controller->action = 'index'; $View = new TestView($this->Controller); - App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); - App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS)); $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS .'tests' . DS .'index.ctp'; $result = $View->getViewFileName('index'); @@ -261,9 +280,7 @@ function testGetTemplate() { $this->Controller->params['pass'] = array('home'); $View = new TestView($this->Controller); - App::path('plugins', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); - App::path('views', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS)); - + $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS .'pages' . DS .'home.ctp'; $result = $View->getViewFileName('home'); $this->assertEqual($result, $expected); From 9b4e08e93b24325f5ba4bc163edc5e638e3922c6 Mon Sep 17 00:00:00 2001 From: gwoo <gwoo@cakephp.org> Date: Sun, 14 Jun 2009 10:28:30 -0700 Subject: [PATCH 0260/2083] fixing error in import map when cache is empty --- cake/libs/configure.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/configure.php b/cake/libs/configure.php index d71b15d75..f73499d22 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -926,7 +926,7 @@ function &getInstance() { static $instance = array(); if (!$instance) { $instance[0] =& new App(); - $instance[0]->__map = Cache::read('file_map', '_cake_core_'); + $instance[0]->__map = (array)Cache::read('file_map', '_cake_core_'); } return $instance[0]; } From 981503755ec55c9929c07feabbaac2d9af4b859b Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 16 Jun 2009 22:29:48 -0400 Subject: [PATCH 0261/2083] Fixing camelCasing of plugin name for single word plugin names. tests added. --- cake/console/libs/tasks/controller.php | 2 +- cake/console/libs/tasks/model.php | 2 +- cake/tests/cases/console/libs/tasks/controller.test.php | 6 ++++++ cake/tests/cases/console/libs/tasks/model.test.php | 7 +++++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 770a94cc8..c6895b8b4 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -306,7 +306,7 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) { function bake($controllerName, $actions = '', $helpers = null, $components = null) { $isScaffold = ($actions === 'scaffold') ? true : false; - $this->Template->set('plugin', $this->plugin); + $this->Template->set('plugin', Inflector::camelize($this->plugin)); $this->Template->set(compact('controllerName', 'actions', 'helpers', 'components', 'isScaffold')); $contents = $this->Template->generate('objects', 'controller'); diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index c45ec5054..6906aba8c 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -704,7 +704,7 @@ function bake($name, $associations = array(), $validate = array(), $primaryKey = } $this->Template->set(compact('name', 'useDbConfig', 'associations', 'validate', 'primaryKey', 'useTable')); - $this->Template->set('plugin', $this->plugin); + $this->Template->set('plugin', Inflector::camelize($this->plugin)); $out = $this->Template->generate('objects', 'model'); $path = $this->path; diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 48c125ce4..1a9dd68b0 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -267,6 +267,12 @@ function testBakeWithPlugin() { $path = APP . 'plugins' . DS . 'controller_test' . DS . 'controllers' . DS . 'articles_controller.php'; $this->Task->expectAt(0, 'createFile', array($path, '*')); $this->Task->bake('Articles', '--actions--', array(), array(), array()); + + $this->Task->plugin = 'controllerTest'; + $path = APP . 'plugins' . DS . 'controller_test' . DS . 'controllers' . DS . 'articles_controller.php'; + $this->Task->expectAt(1, 'createFile', array( + $path, new PatternExpectation('/ArticlesController extends ControllerTestAppController/'))); + $this->Task->bake('Articles', '--actions--', array(), array(), array()); } /** diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index ed792f1de..07182085a 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -617,6 +617,13 @@ function testBakeWithPlugin() { $path = APP . 'plugins' . DS . 'controller_test' . DS . 'models' . DS . 'article.php'; $this->Task->expectAt(0, 'createFile', array($path, '*')); $this->Task->bake('Article', array(), array()); + + $this->Task->plugin = 'controllerTest'; + + $path = APP . 'plugins' . DS . 'controller_test' . DS . 'models' . DS . 'article.php'; + $this->Task->expectAt(1, 'createFile', array( + $path, new PatternExpectation('/Article extends ControllerTestAppModel/'))); + $this->Task->bake('Article', array(), array()); } /** From bf7fcdfd37b304d1913e773960afc2467bb69aa3 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 16 Jun 2009 22:34:16 -0400 Subject: [PATCH 0262/2083] Updating dates in PluginTask headers Adding ProjectTask test case. --- .../cases/console/libs/tasks/plugin.test.php | 9 +- .../cases/console/libs/tasks/project.test.php | 84 +++++++++++++++++++ 2 files changed, 87 insertions(+), 6 deletions(-) create mode 100644 cake/tests/cases/console/libs/tasks/project.test.php diff --git a/cake/tests/cases/console/libs/tasks/plugin.test.php b/cake/tests/cases/console/libs/tasks/plugin.test.php index de8bb4746..ee602757c 100644 --- a/cake/tests/cases/console/libs/tasks/plugin.test.php +++ b/cake/tests/cases/console/libs/tasks/plugin.test.php @@ -8,20 +8,17 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2009, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2009, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.cases.console.libs.tasks - * @since CakePHP v 1.2.0.7726 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ + * @since CakePHP v 1.3.0 * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ App::import('Core', 'Shell'); diff --git a/cake/tests/cases/console/libs/tasks/project.test.php b/cake/tests/cases/console/libs/tasks/project.test.php new file mode 100644 index 000000000..28a81eed1 --- /dev/null +++ b/cake/tests/cases/console/libs/tasks/project.test.php @@ -0,0 +1,84 @@ +<?php +/* SVN FILE: $Id$ */ +/** + * ProjectTask Test file + * + * Test Case for project generation shell task + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2006-2009, Cake Software Foundation, Inc. + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2006-2009, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @package cake + * @subpackage cake.tests.cases.console.libs.tasks + * @since CakePHP v 1.3.0 + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +App::import('Core', 'Shell'); + +if (!defined('DISABLE_AUTO_DISPATCH')) { + define('DISABLE_AUTO_DISPATCH', true); +} + +if (!class_exists('ShellDispatcher')) { + ob_start(); + $argv = false; + require CAKE . 'console' . DS . 'cake.php'; + ob_end_clean(); +} + +if (!class_exists('PluginTask')) { + require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'project.php'; +} + +Mock::generatePartial( + 'ShellDispatcher', 'TestProjectTaskMockShellDispatcher', + array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment') +); +Mock::generatePartial( + 'ProjectTask', 'MockProjectTask', + array('in', '_stop', 'err', 'out', 'createFile') +); + +/** + * ProjectTask Test class + * + * @package cake + * @subpackage cake.tests.cases.console.libs.tasks + */ +class ProjectTaskTest extends CakeTestCase { + +/** + * setUp method + * + * @return void + * @access public + */ + function startTest() { + $this->Dispatcher =& new TestProjectTaskMockShellDispatcher(); + $this->Dispatcher->shellPaths = Configure::read('shellPaths'); + $this->Task =& new MockProjectTask($this->Dispatcher); + $this->Task->Dispatch =& $this->Dispatcher; + $this->Task->path = TMP; + } + +/** + * tearDown method + * + * @return void + * @access public + */ + function endTest() { + ClassRegistry::flush(); + } + + +} +?> \ No newline at end of file From 8c2a027842167509f2683d723c4d9e3d05a4b3c6 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 16 Jun 2009 23:05:48 -0400 Subject: [PATCH 0263/2083] Pointing test directory creation to TMP/tests/ Adding tests for ProjectTask::bake() --- cake/console/libs/tasks/project.php | 17 ++++------ .../cases/console/libs/tasks/plugin.test.php | 14 ++++----- .../cases/console/libs/tasks/project.test.php | 31 +++++++++++++++++-- 3 files changed, 41 insertions(+), 21 deletions(-) diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php index 5104925c6..a0e63e8ea 100644 --- a/cake/console/libs/tasks/project.php +++ b/cake/console/libs/tasks/project.php @@ -1,27 +1,22 @@ <?php -/* SVN FILE: $Id$ */ /** * The Project Task handles creating the base application * - * Long description for file * * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake - * @subpackage cake.cake.scripts.bake + * @subpackage cake.cake.console.bake * @since CakePHP(tm) v 1.2 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ @@ -142,7 +137,7 @@ function bake($path, $skel = null, $skip = array('empty')) { $looksGood = $this->in('Look okay?', array('y', 'n', 'q'), 'y'); - if (low($looksGood) == 'y') { + if (strtolower($looksGood) == 'y') { $verbose = $this->in(__('Do you want verbose output?', true), array('y', 'n'), 'n'); $Folder = new Folder($skel); @@ -155,14 +150,14 @@ function bake($path, $skel = null, $skip = array('empty')) { return false; } - if (low($verbose) == 'y') { + if (strtolower($verbose) == 'y') { foreach ($Folder->messages() as $message) { $this->out($message); } } return true; - } elseif (low($looksGood) == 'q') { + } elseif (strtolower($looksGood) == 'q') { $this->out('Bake Aborted.'); } else { $this->execute(false); diff --git a/cake/tests/cases/console/libs/tasks/plugin.test.php b/cake/tests/cases/console/libs/tasks/plugin.test.php index ee602757c..441aac2b5 100644 --- a/cake/tests/cases/console/libs/tasks/plugin.test.php +++ b/cake/tests/cases/console/libs/tasks/plugin.test.php @@ -69,7 +69,7 @@ function startTest() { $this->Dispatcher->shellPaths = Configure::read('shellPaths'); $this->Task =& new MockPluginTask($this->Dispatcher); $this->Task->Dispatch =& $this->Dispatcher; - $this->Task->path = TMP; + $this->Task->path = TMP . 'tests' . DS; } /** @@ -79,7 +79,7 @@ function startTest() { **/ function startCase() { $this->_paths = $paths = Configure::read('pluginPaths'); - $this->_testPath = array_push($paths, TMP); + $this->_testPath = array_push($paths, TMP . 'tests' . DS); Configure::write('pluginPaths', $paths); } @@ -112,7 +112,7 @@ function testBakeFoldersAndFiles() { $this->Task->setReturnValueAt(1, 'in', 'y'); $this->Task->bake('BakeTestPlugin'); - $path = TMP . 'bake_test_plugin'; + $path = $this->Task->path . 'bake_test_plugin'; $this->assertTrue(is_dir($path), 'No plugin dir %s'); $this->assertTrue(is_dir($path . DS . 'controllers'), 'No controllers dir %s'); $this->assertTrue(is_dir($path . DS . 'controllers' . DS .'components'), 'No components dir %s'); @@ -130,7 +130,7 @@ function testBakeFoldersAndFiles() { $file = $path . DS . 'bake_test_plugin_app_model.php'; $this->Task->expectAt(1, 'createFile', array($file, '*'), 'No AppModel %s'); - $Folder =& new Folder(TMP . 'bake_test_plugin'); + $Folder =& new Folder($this->Task->path . 'bake_test_plugin'); $Folder->delete(); } @@ -145,7 +145,7 @@ function testExecuteWithOneArg() { $this->Task->Dispatch->args = array('BakeTestPlugin'); $this->Task->args =& $this->Task->Dispatch->args; - $path = TMP . 'bake_test_plugin'; + $path = $this->Task->path . 'bake_test_plugin'; $file = $path . DS . 'bake_test_plugin_app_controller.php'; $this->Task->expectAt(0, 'createFile', array($file, '*'), 'No AppController %s'); @@ -153,7 +153,7 @@ function testExecuteWithOneArg() { $this->Task->expectAt(1, 'createFile', array($file, '*'), 'No AppModel %s'); $this->Task->execute(); - $Folder =& new Folder(TMP . 'bake_test_plugin'); + $Folder =& new Folder($this->Task->path . 'bake_test_plugin'); $Folder->delete(); } @@ -167,7 +167,7 @@ function testExecuteWithTwoArgs() { $this->Task->setReturnValueAt(0, 'in', $this->_testPath); $this->Task->setReturnValueAt(1, 'in', 'y'); - $Folder =& new Folder(TMP . 'bake_test_plugin', true); + $Folder =& new Folder($this->Task->path . 'bake_test_plugin', true); $this->Task->Dispatch->args = array('BakeTestPlugin', 'model'); $this->Task->args =& $this->Task->Dispatch->args; diff --git a/cake/tests/cases/console/libs/tasks/project.test.php b/cake/tests/cases/console/libs/tasks/project.test.php index 28a81eed1..06886cf78 100644 --- a/cake/tests/cases/console/libs/tasks/project.test.php +++ b/cake/tests/cases/console/libs/tasks/project.test.php @@ -1,5 +1,4 @@ <?php -/* SVN FILE: $Id$ */ /** * ProjectTask Test file * @@ -34,7 +33,7 @@ ob_end_clean(); } -if (!class_exists('PluginTask')) { +if (!class_exists('ProjectTask')) { require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'project.php'; } @@ -66,7 +65,7 @@ function startTest() { $this->Dispatcher->shellPaths = Configure::read('shellPaths'); $this->Task =& new MockProjectTask($this->Dispatcher); $this->Task->Dispatch =& $this->Dispatcher; - $this->Task->path = TMP; + $this->Task->path = TMP . 'tests' . DS; } /** @@ -79,6 +78,32 @@ function endTest() { ClassRegistry::flush(); } +/** + * test bake() method and directory creation. + * + * @return void + **/ + function testBake() { + $skel = CAKE_CORE_INCLUDE_PATH . DS . CONSOLE_LIBS . 'templates' . DS . 'skel'; + $this->Task->setReturnValueAt(0, 'in', 'y'); + $this->Task->setReturnValueAt(1, 'in', 'n'); + $this->Task->bake($this->Task->path . 'bake_test_app', $skel); + + $path = $this->Task->path . 'bake_test_app'; + $this->assertTrue(is_dir($path), 'No project dir %s'); + $this->assertTrue(is_dir($path . DS . 'controllers'), 'No controllers dir %s'); + $this->assertTrue(is_dir($path . DS . 'controllers' . DS .'components'), 'No components dir %s'); + $this->assertTrue(is_dir($path . DS . 'models'), 'No models dir %s'); + $this->assertTrue(is_dir($path . DS . 'views'), 'No views dir %s'); + $this->assertTrue(is_dir($path . DS . 'views' . DS . 'helpers'), 'No helpers dir %s'); + $this->assertTrue(is_dir($path . DS . 'tests'), 'No tests dir %s'); + $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'cases'), 'No cases dir %s'); + $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'groups'), 'No groups dir %s'); + $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'fixtures'), 'No fixtures dir %s'); + + $Folder =& new Folder($this->Task->path . 'bake_test_app'); + $Folder->delete(); + } } ?> \ No newline at end of file From 13550a140a2552b23ec225da98f1a5ca6bd808f4 Mon Sep 17 00:00:00 2001 From: gwoo <gwoo@cakephp.org> Date: Wed, 24 Jun 2009 15:05:08 -0700 Subject: [PATCH 0264/2083] fixing require cake_session in session component --- cake/libs/controller/components/session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/controller/components/session.php b/cake/libs/controller/components/session.php index f5164d4a6..f97312553 100644 --- a/cake/libs/controller/components/session.php +++ b/cake/libs/controller/components/session.php @@ -25,7 +25,7 @@ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ if (!class_exists('cakesession')) { - require LIBS . 'session.php'; + require LIBS . 'cake_session.php'; } /** * Session Component. From 198511f6397d6712900bb09b1388eac1012f472f Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 30 Jun 2009 18:30:39 -0400 Subject: [PATCH 0265/2083] Adding tests for security salt generation. --- cake/console/libs/tasks/project.php | 2 +- .../cases/console/libs/tasks/project.test.php | 25 ++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php index a0e63e8ea..40d9086d3 100644 --- a/cake/console/libs/tasks/project.php +++ b/cake/console/libs/tasks/project.php @@ -61,7 +61,7 @@ function execute($project = null) { if ($project) { $response = false; while ($response == false && is_dir($project) === true && file_exists($project . 'config' . 'core.php')) { - $response = $this->in('A project already exists in this location: '.$project.' Overwrite?', array('y','n'), 'n'); + $response = $this->in('A project already exists in this location: ' . $project . ' Overwrite?', array('y','n'), 'n'); if (strtolower($response) === 'n') { $response = $project = false; } diff --git a/cake/tests/cases/console/libs/tasks/project.test.php b/cake/tests/cases/console/libs/tasks/project.test.php index 06886cf78..be1988562 100644 --- a/cake/tests/cases/console/libs/tasks/project.test.php +++ b/cake/tests/cases/console/libs/tasks/project.test.php @@ -76,6 +76,9 @@ function startTest() { */ function endTest() { ClassRegistry::flush(); + + $Folder =& new Folder($this->Task->path . 'bake_test_app'); + $Folder->delete(); } /** @@ -100,10 +103,26 @@ function testBake() { $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'cases'), 'No cases dir %s'); $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'groups'), 'No groups dir %s'); $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'fixtures'), 'No fixtures dir %s'); - - $Folder =& new Folder($this->Task->path . 'bake_test_app'); - $Folder->delete(); } +/** + * test generation of Security.salt + * + * @return void + **/ + function testSecuritySaltGeneration() { + $skel = CAKE_CORE_INCLUDE_PATH . DS . CONSOLE_LIBS . 'templates' . DS . 'skel'; + $this->Task->setReturnValueAt(0, 'in', 'y'); + $this->Task->setReturnValueAt(1, 'in', 'n'); + $this->Task->bake($this->Task->path . 'bake_test_app', $skel); + + $path = $this->Task->path . 'bake_test_app' . DS; + $result = $this->Task->securitySalt($path); + $this->assertTrue($result); + + $file =& new File($path . 'config' . DS . 'core.php'); + $contents = $file->read(); + $this->assertNoPattern('/DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi/', $contents, 'Default Salt left behind. %s'); + } } ?> \ No newline at end of file From 90b7f7f0ee48d98bd6e2fda646a52e3aac1ee30a Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 30 Jun 2009 20:19:00 -0400 Subject: [PATCH 0266/2083] Removing getAdmin from Shell. --- cake/console/libs/shell.php | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php index 94f2ded1b..1084331a7 100644 --- a/cake/console/libs/shell.php +++ b/cake/console/libs/shell.php @@ -491,35 +491,6 @@ function shortPath($file) { $shortPath = str_replace('..'.DS, '', $shortPath); return r(DS.DS, DS, $shortPath); } -/** - * Checks for Configure::read('Routing.admin') and forces user to input it if not enabled - * - * @return string Admin route to use - * @access public - */ - function getAdmin() { - $admin = ''; - $cakeAdmin = null; - $adminRoute = Configure::read('Routing.admin'); - if (!empty($adminRoute)) { - $cakeAdmin = $adminRoute . '_'; - } else { - $this->out('You need to enable Configure::write(\'Routing.admin\',\'admin\') in /app/config/core.php to use admin routing.'); - $this->out('What would you like the admin route to be?'); - $this->out('Example: www.example.com/admin/controller'); - while ($admin == '') { - $admin = $this->in("What would you like the admin route to be?", null, 'admin'); - } - if ($this->Project->cakeAdmin($admin) !== true) { - $this->out('Unable to write to /app/config/core.php.'); - $this->out('You need to enable Configure::write(\'Routing.admin\',\'admin\') in /app/config/core.php to use admin routing.'); - $this->_stop(); - } else { - $cakeAdmin = $admin . '_'; - } - } - return $cakeAdmin; - } /** * Creates the proper controller path for the specified controller class name * From da99aa1c6af099ae3a1dd7186716a07409dfca52 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 30 Jun 2009 20:44:09 -0400 Subject: [PATCH 0267/2083] Moved Shell::getAdmin() to ProjectTask --- cake/console/libs/tasks/project.php | 35 +++++++++++++++- .../cases/console/libs/tasks/project.test.php | 40 ++++++++++++++----- 2 files changed, 65 insertions(+), 10 deletions(-) diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php index 40d9086d3..2d6d64380 100644 --- a/cake/console/libs/tasks/project.php +++ b/cake/console/libs/tasks/project.php @@ -27,6 +27,12 @@ * @subpackage cake.cake.console.libs.tasks */ class ProjectTask extends Shell { +/** + * configs path (used in testing). + * + * @var string + **/ + var $configPath = null; /** * Checks that given project path does not already exist, and * finds the app directory in it. Then it calls bake() with that information. @@ -241,7 +247,8 @@ function corePath($path) { * @access public */ function cakeAdmin($name) { - $File =& new File(CONFIGS . 'core.php'); + $path = (empty($this->configPath)) ? CONFIGS : $this->configPath; + $File =& new File($path . 'core.php'); $contents = $File->read(); if (preg_match('%([/\\t\\x20]*Configure::write\(\'Routing.admin\',[\\t\\x20\'a-z]*\\);)%', $contents, $match)) { $result = str_replace($match[0], "\t" . 'Configure::write(\'Routing.admin\', \''.$name.'\');', $contents); @@ -255,6 +262,32 @@ function cakeAdmin($name) { return false; } } +/** + * Checks for Configure::read('Routing.admin') and forces user to input it if not enabled + * + * @return string Admin route to use + * @access public + */ + function getAdmin() { + $admin = ''; + $cakeAdmin = null; + $adminRoute = Configure::read('Routing.admin'); + if (!empty($adminRoute)) { + return $adminRoute . '_'; + } + $this->out('You need to enable Configure::write(\'Routing.admin\',\'admin\') in /app/config/core.php to use admin routing.'); + $this->out('What would you like the admin route to be?'); + $this->out('Example: www.example.com/admin/controller'); + while ($admin == '') { + $admin = $this->in("What would you like the admin route to be?", null, 'admin'); + } + if ($this->cakeAdmin($admin) !== true) { + $this->out('Unable to write to /app/config/core.php.'); + $this->out('You need to enable Configure::write(\'Routing.admin\',\'admin\') in /app/config/core.php to use admin routing.'); + $this->_stop(); + } + return $admin . '_'; + } /** * Help * diff --git a/cake/tests/cases/console/libs/tasks/project.test.php b/cake/tests/cases/console/libs/tasks/project.test.php index be1988562..8c987b349 100644 --- a/cake/tests/cases/console/libs/tasks/project.test.php +++ b/cake/tests/cases/console/libs/tasks/project.test.php @@ -80,17 +80,24 @@ function endTest() { $Folder =& new Folder($this->Task->path . 'bake_test_app'); $Folder->delete(); } - /** - * test bake() method and directory creation. + * creates a test project that is used for testing project task. * * @return void **/ - function testBake() { + function _setupTestProject() { $skel = CAKE_CORE_INCLUDE_PATH . DS . CONSOLE_LIBS . 'templates' . DS . 'skel'; $this->Task->setReturnValueAt(0, 'in', 'y'); $this->Task->setReturnValueAt(1, 'in', 'n'); $this->Task->bake($this->Task->path . 'bake_test_app', $skel); + } +/** + * test bake() method and directory creation. + * + * @return void + **/ + function testBake() { + $this->_setupTestProject(); $path = $this->Task->path . 'bake_test_app'; $this->assertTrue(is_dir($path), 'No project dir %s'); @@ -111,18 +118,33 @@ function testBake() { * @return void **/ function testSecuritySaltGeneration() { - $skel = CAKE_CORE_INCLUDE_PATH . DS . CONSOLE_LIBS . 'templates' . DS . 'skel'; - $this->Task->setReturnValueAt(0, 'in', 'y'); - $this->Task->setReturnValueAt(1, 'in', 'n'); - $this->Task->bake($this->Task->path . 'bake_test_app', $skel); - + $this->_setupTestProject(); + $path = $this->Task->path . 'bake_test_app' . DS; $result = $this->Task->securitySalt($path); $this->assertTrue($result); - + $file =& new File($path . 'config' . DS . 'core.php'); $contents = $file->read(); $this->assertNoPattern('/DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi/', $contents, 'Default Salt left behind. %s'); } +/** + * test getAdmin method, and that it returns Routing.admin or writes to config file. + * + * @return void + **/ + function testGetAdmin() { + Configure::write('Routing.admin', 'admin'); + $result = $this->Task->getAdmin(); + $this->assertEqual($result, 'admin_'); + + Configure::write('Routing.admin', null); + $this->_setupTestProject(); + $this->Task->configPath = $this->Task->path . 'bake_test_app' . DS . 'config' . DS; + $this->Task->setReturnValue('in', 'super_duper_admin'); + + $result = $this->Task->getAdmin(); + $this->assertEqual($result, 'super_duper_admin_'); + } } ?> \ No newline at end of file From ddc341e4de518e817496d1a7dfd8e4b28ae87f15 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 30 Jun 2009 20:49:58 -0400 Subject: [PATCH 0268/2083] Updating ControllerTask to use ProjectTask. --- cake/console/libs/tasks/controller.php | 4 ++-- .../tests/cases/console/libs/tasks/controller.test.php | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index c6895b8b4..1b499ff26 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -44,7 +44,7 @@ class ControllerTask extends Shell { * @var array * @access public */ - var $tasks = array('Model', 'Test', 'Template', 'DbConfig'); + var $tasks = array('Model', 'Test', 'Template', 'DbConfig', 'Project'); /** * path to CONTROLLERS directory * @@ -86,7 +86,7 @@ function execute() { $actions = 'scaffold'; } if ((isset($this->args[1]) && $this->args[1] == 'admin') || (isset($this->args[2]) && $this->args[2] == 'admin')) { - if ($admin = $this->getAdmin()) { + if ($admin = $this->Project->getAdmin()) { $this->out('Adding ' . Configure::read('Routing.admin') .' methods'); if ($actions == 'scaffold') { $actions = $this->bakeActions($controller, $admin); diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 1a9dd68b0..897043e05 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -31,12 +31,12 @@ ob_end_clean(); } +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'project.php'; require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'controller.php'; require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'model.php'; require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php'; require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'test.php'; - Mock::generatePartial( 'ShellDispatcher', 'TestControllerTaskMockShellDispatcher', array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment') @@ -52,6 +52,11 @@ array('in', 'out', 'err', 'createFile', '_stop', '_checkUnitTest') ); +Mock::generatePartial( + 'ProjectTask', 'ControllerMockProjectTask', + array('in', 'out', 'err', 'createFile', '_stop', '_checkUnitTest', 'getAdmin') +); + Mock::generate('TestTask', 'ControllerMockTestTask'); $imported = App::import('Model', 'Article'); @@ -97,6 +102,7 @@ function startTest() { $this->Task->Dispatch->shellPaths = Configure::read('shellPaths'); $this->Task->Template =& new TemplateTask($this->Task->Dispatch); $this->Task->Model =& new ControllerMockModelTask($this->Task->Dispatch); + $this->Task->Project =& new ControllerMockProjectTask($this->Task->Dispatch); } /** @@ -449,7 +455,7 @@ function testExecuteWithAdminScaffoldParams() { if ($skip) { return; } - Configure::write('Routing.admin', 'admin'); + $this->Task->Project->setReturnValue('getAdmin', 'admin_'); $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; $this->Task->args = array('Articles', 'scaffold', 'admin'); From 0eef6577e2b58b154f347e2d181f75e86fffefca Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 30 Jun 2009 21:22:10 -0400 Subject: [PATCH 0269/2083] Fixing test that failed when no models were found in app. --- cake/tests/cases/console/libs/tasks/test.test.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index 3c3c366be..b69f98697 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -258,6 +258,11 @@ function testRegistryClearWhenBuildingTestObjects() { * @return void **/ function testGetClassName() { + $objects = Configure::listObjects('model'); + $skip = $this->skipIf(empty($objects), 'No models in app, this test will fail. %s'); + if ($skip) { + return; + } $this->Task->setReturnValueAt(0, 'in', 'MyCustomClass'); $result = $this->Task->getClassName('Model'); $this->assertEqual($result, 'MyCustomClass'); From 11ecde194d4af25cd49309f8ecb12d210585a0c7 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 30 Jun 2009 21:50:28 -0400 Subject: [PATCH 0270/2083] Updating ViewTask to use the ProjectTask. Adding tests for previously missed code branch. --- cake/console/libs/tasks/view.php | 2 +- .../cases/console/libs/tasks/view.test.php | 58 ++++++++++--------- 2 files changed, 33 insertions(+), 27 deletions(-) diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 700008a68..e9ff8e9c0 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -211,7 +211,7 @@ function __interactive() { $this->bakeActions($actions, $vars); } if (strtolower($wannaDoAdmin) == 'y') { - $admin = $this->getAdmin(); + $admin = $this->Project->getAdmin(); $regularActions = $this->scaffoldActions; $adminActions = array(); foreach ($regularActions as $action) { diff --git a/cake/tests/cases/console/libs/tasks/view.test.php b/cake/tests/cases/console/libs/tasks/view.test.php index f76229d7c..4ab397ace 100644 --- a/cake/tests/cases/console/libs/tasks/view.test.php +++ b/cake/tests/cases/console/libs/tasks/view.test.php @@ -38,11 +38,12 @@ ob_end_clean(); } -if (!class_exists('TestTask')) { - require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'view.php'; - require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'controller.php'; - require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php'; -} + +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'view.php'; +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'controller.php'; +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php'; +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'project.php'; + Mock::generatePartial( 'ShellDispatcher', 'TestTestTaskMockShellDispatcher', @@ -54,6 +55,7 @@ ); Mock::generate('ControllerTask', 'ViewTaskMockControllerTask'); +Mock::generate('ProjectTask', 'ViewTaskMockProjectTask'); class ViewTaskComment extends Model { var $name = 'ViewTaskComment'; @@ -106,6 +108,8 @@ function startTest() { $this->Task->Dispatch =& $this->Dispatcher; $this->Task->Template =& new TemplateTask($this->Dispatcher); $this->Task->Controller =& new ViewTaskMockControllerTask(); + $this->Task->Project =& new ViewTaskMockProjectTask(); + $this->Task->path = TMP; } /** @@ -154,7 +158,6 @@ function testGetContent() { * @return void **/ function testBake() { - $this->Task->path = TMP; $this->Task->controllerName = 'ViewTaskComments'; $this->Task->controllerPath = 'view_task_comments'; @@ -172,8 +175,6 @@ function testBake() { new PatternExpectation('/\$viewTaskComment\[\'Article\'\]\[\'title\'\]/') )); $this->Task->bake('index', true); - - @rmdir(TMP . 'view_task_comments'); } /** @@ -182,7 +183,6 @@ function testBake() { * @return void **/ function testBakeWithPlugin() { - $this->Task->path = TMP; $this->Task->controllerName = 'ViewTaskComments'; $this->Task->controllerPath = 'view_task_comments'; $this->Task->plugin = 'TestTest'; @@ -198,7 +198,6 @@ function testBakeWithPlugin() { * @return void **/ function testBakeActions() { - $this->Task->path = TMP; $this->Task->controllerName = 'ViewTaskComments'; $this->Task->controllerPath = 'view_task_comments'; @@ -207,8 +206,6 @@ function testBakeActions() { $this->Task->expectAt(2, 'createFile', array(TMP . 'view_task_comments' . DS . 'index.ctp', '*')); $this->Task->bakeActions(array('view', 'edit', 'index'), array()); - - @rmdir(TMP . 'view_task_comments'); } /** @@ -217,7 +214,6 @@ function testBakeActions() { * @return void **/ function testCustomAction() { - $this->Task->path = TMP; $this->Task->controllerName = 'ViewTaskComments'; $this->Task->controllerPath = 'view_task_comments'; $this->Task->params['app'] = APP; @@ -228,8 +224,6 @@ function testCustomAction() { $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'my_action.ctp', '*')); $this->Task->customAction(); - - @rmdir(TMP . 'view_task_comments'); } /** @@ -238,7 +232,6 @@ function testCustomAction() { * @return void **/ function testExecuteIntoAll() { - $this->Task->path = TMP; $this->Task->args[0] = 'all'; $this->Task->Controller->setReturnValue('listAll', array('view_task_comments')); @@ -251,8 +244,6 @@ function testExecuteIntoAll() { $this->Task->expectAt(3, 'createFile', array(TMP . 'view_task_comments' . DS . 'edit.ctp', '*')); $this->Task->execute(); - - @rmdir(TMP . 'view_task_comments'); } /** @@ -261,15 +252,12 @@ function testExecuteIntoAll() { * @return void **/ function testExecuteWithActionParam() { - $this->Task->path = TMP; $this->Task->args[0] = 'ViewTaskComments'; $this->Task->args[1] = 'view'; $this->Task->expectCallCount('createFile', 1); $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'view.ctp', '*')); $this->Task->execute(); - - @rmdir(TMP . 'view_task_comments'); } /** @@ -278,15 +266,12 @@ function testExecuteWithActionParam() { * @return void **/ function testExecuteWithController() { - $this->Task->path = TMP; $this->Task->args[0] = 'ViewTaskComments'; $this->Task->expectCallCount('createFile', 2); $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'index.ctp', '*')); $this->Task->expectAt(1, 'createFile', array(TMP . 'view_task_comments' . DS . 'add.ctp', '*')); $this->Task->execute(); - - @rmdir(TMP . 'view_task_comments'); } /** @@ -295,7 +280,6 @@ function testExecuteWithController() { * @return void **/ function testExecuteInteractive() { - $this->Task->path = TMP; $this->Task->connection = 'test_suite'; $this->Task->args = array(); @@ -312,8 +296,30 @@ function testExecuteInteractive() { $this->Task->expectAt(3, 'createFile', array(TMP . 'view_task_comments' . DS . 'edit.ctp', '*')); $this->Task->execute(); + } - @rmdir(TMP . 'view_task_comments'); +/** + * test execute into interactive() with admin methods. + * + * @return void + **/ + function testExecuteInteractiveWithAdmin() { + $this->Task->connection = 'test_suite'; + $this->Task->args = array(); + + $this->Task->Controller->setReturnValue('getName', 'ViewTaskComments'); + $this->Task->Project->setReturnValue('getAdmin', 'admin_'); + $this->Task->setReturnValueAt(0, 'in', 'y'); + $this->Task->setReturnValueAt(1, 'in', 'n'); + $this->Task->setReturnValueAt(2, 'in', 'y'); + + $this->Task->expectCallCount('createFile', 4); + $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'admin_index.ctp', '*')); + $this->Task->expectAt(1, 'createFile', array(TMP . 'view_task_comments' . DS . 'admin_view.ctp', '*')); + $this->Task->expectAt(2, 'createFile', array(TMP . 'view_task_comments' . DS . 'admin_add.ctp', '*')); + $this->Task->expectAt(3, 'createFile', array(TMP . 'view_task_comments' . DS . 'admin_edit.ctp', '*')); + + $this->Task->execute(); } } ?> \ No newline at end of file From f2031385c12f1f5d9e808c62bd36eb12739eee6a Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 30 Jun 2009 21:59:37 -0400 Subject: [PATCH 0271/2083] Fixing ViewTask test case in Group context. Adding Group test for bake tasks --- .../cases/console/libs/tasks/view.test.php | 4 +- cake/tests/groups/bake.group.php | 60 +++++++++++++++++++ 2 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 cake/tests/groups/bake.group.php diff --git a/cake/tests/cases/console/libs/tasks/view.test.php b/cake/tests/cases/console/libs/tasks/view.test.php index 4ab397ace..cea2a6838 100644 --- a/cake/tests/cases/console/libs/tasks/view.test.php +++ b/cake/tests/cases/console/libs/tasks/view.test.php @@ -46,7 +46,7 @@ Mock::generatePartial( - 'ShellDispatcher', 'TestTestTaskMockShellDispatcher', + 'ShellDispatcher', 'TestViewTaskMockShellDispatcher', array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment') ); Mock::generatePartial( @@ -102,7 +102,7 @@ class ViewTaskTest extends CakeTestCase { * @access public */ function startTest() { - $this->Dispatcher =& new TestTestTaskMockShellDispatcher(); + $this->Dispatcher =& new TestViewTaskMockShellDispatcher(); $this->Dispatcher->shellPaths = Configure::read('shellPaths'); $this->Task =& new MockViewTask($this->Dispatcher); $this->Task->Dispatch =& $this->Dispatcher; diff --git a/cake/tests/groups/bake.group.php b/cake/tests/groups/bake.group.php new file mode 100644 index 000000000..cdfadc3c2 --- /dev/null +++ b/cake/tests/groups/bake.group.php @@ -0,0 +1,60 @@ +<?php +/* SVN FILE: $Id$ */ +/** + * Bake Group test file + * + * Run all the test cases related to bake. + * + * PHP versions 4 and 5 + * + * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> + * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests + * @package cake + * @subpackage cake.tests.groups + * @since CakePHP(tm) v 1.2.0.4206 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ +/** + * BakeGroupTest class + * + * This test group will run all bake tests + * + * @package cake + * @subpackage cake.tests.groups + */ +class BakeGroupTest extends GroupTest { +/** + * label property + * + * @var string 'All core cache engines' + * @access public + */ + var $label = 'All Tasks related to bake.'; +/** + * BakeGroupTest method + * + * @access public + * @return void + */ + function BakeGroupTest() { + $path = CORE_TEST_CASES . DS . 'console' . DS . 'libs' . DS . 'tasks' . DS; + TestManager::addTestFile($this, $path . 'controller'); + TestManager::addTestFile($this, $path . 'model'); + TestManager::addTestFile($this, $path . 'view'); + TestManager::addTestFile($this, $path . 'fixture'); + TestManager::addTestFile($this, $path . 'test'); + TestManager::addTestFile($this, $path . 'db_config'); + TestManager::addTestFile($this, $path . 'project'); + } +} +?> \ No newline at end of file From a364e37b780d0f435a78a8e57932d00b2d64ebc8 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 30 Jun 2009 22:01:10 -0400 Subject: [PATCH 0272/2083] Updating file headers. --- cake/tests/groups/bake.group.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cake/tests/groups/bake.group.php b/cake/tests/groups/bake.group.php index cdfadc3c2..35fedec36 100644 --- a/cake/tests/groups/bake.group.php +++ b/cake/tests/groups/bake.group.php @@ -1,5 +1,4 @@ -<?php -/* SVN FILE: $Id$ */ +<?phpÃ¥ /** * Bake Group test file * @@ -18,10 +17,7 @@ * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups - * @since CakePHP(tm) v 1.2.0.4206 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ + * @since CakePHP(tm) v 1.3Ã¥ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ /** From 9627af2050a3552ee2930d395cc101aba5ac0701 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Tue, 30 Jun 2009 22:23:48 -0400 Subject: [PATCH 0273/2083] Adding tests for ProjectTask::execute(). --- .../cases/console/libs/tasks/project.test.php | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/cake/tests/cases/console/libs/tasks/project.test.php b/cake/tests/cases/console/libs/tasks/project.test.php index 8c987b349..41e4a3d9e 100644 --- a/cake/tests/cases/console/libs/tasks/project.test.php +++ b/cake/tests/cases/console/libs/tasks/project.test.php @@ -80,6 +80,7 @@ function endTest() { $Folder =& new Folder($this->Task->path . 'bake_test_app'); $Folder->delete(); } + /** * creates a test project that is used for testing project task. * @@ -91,6 +92,7 @@ function _setupTestProject() { $this->Task->setReturnValueAt(1, 'in', 'n'); $this->Task->bake($this->Task->path . 'bake_test_app', $skel); } + /** * test bake() method and directory creation. * @@ -128,6 +130,7 @@ function testSecuritySaltGeneration() { $contents = $file->read(); $this->assertNoPattern('/DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi/', $contents, 'Default Salt left behind. %s'); } + /** * test getAdmin method, and that it returns Routing.admin or writes to config file. * @@ -146,5 +149,31 @@ function testGetAdmin() { $result = $this->Task->getAdmin(); $this->assertEqual($result, 'super_duper_admin_'); } + +/** + * Test execute method with one param to destination folder. + * + * @return void + **/ + function testExecute() { + $this->Task->params['skel'] = CAKE_CORE_INCLUDE_PATH . DS . CONSOLE_LIBS . 'templates' . DS . 'skel'; + $this->Task->params['working'] = TMP . 'tests' . DS; + + $path = $this->Task->path . 'bake_test_app'; + $this->Task->setReturnValue('in', 'y'); + $this->Task->setReturnValueAt(0, 'in', $path); + + $this->Task->execute(); + $this->assertTrue(is_dir($path), 'No project dir %s'); + $this->assertTrue(is_dir($path . DS . 'controllers'), 'No controllers dir %s'); + $this->assertTrue(is_dir($path . DS . 'controllers' . DS .'components'), 'No components dir %s'); + $this->assertTrue(is_dir($path . DS . 'models'), 'No models dir %s'); + $this->assertTrue(is_dir($path . DS . 'views'), 'No views dir %s'); + $this->assertTrue(is_dir($path . DS . 'views' . DS . 'helpers'), 'No helpers dir %s'); + $this->assertTrue(is_dir($path . DS . 'tests'), 'No tests dir %s'); + $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'cases'), 'No cases dir %s'); + $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'groups'), 'No groups dir %s'); + $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'fixtures'), 'No fixtures dir %s'); + } } ?> \ No newline at end of file From 58b5c0d77dd7a5002046a05dadd46902016ed1d5 Mon Sep 17 00:00:00 2001 From: gwoo <gwoo@cakephp.org> Date: Tue, 30 Jun 2009 19:56:15 -0700 Subject: [PATCH 0274/2083] cleaning up some ;; --- cake/libs/i18n.php | 2 +- cake/tests/cases/dispatcher.test.php | 6 +++--- cake/tests/cases/libs/controller/controller.test.php | 2 +- cake/tests/cases/libs/i18n.test.php | 2 +- cake/tests/lib/code_coverage_manager.php | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index ae814a890..3693bf35d 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -251,7 +251,7 @@ function __bindTextDomain($domain) { $this->__noLocale = true; $core = true; $merge = array(); - $searchPaths = App::path('locales');; + $searchPaths = App::path('locales'); $plugins = App::objects('plugin'); if (!empty($plugins)) { diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index e0c08aa60..5afb17481 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -954,7 +954,7 @@ function testBaseUrlAndWebrootWithModRewrite() { $expectedWebroot = '/'; $this->assertEqual($expectedWebroot, $Dispatcher->webroot); - $Dispatcher->base = false;; + $Dispatcher->base = false; $_SERVER['DOCUMENT_ROOT'] = '/some/apps/where'; $_SERVER['SCRIPT_FILENAME'] = '/some/apps/where/app/webroot/index.php'; $_SERVER['PHP_SELF'] = '/some/apps/where/app/webroot/index.php'; @@ -967,7 +967,7 @@ function testBaseUrlAndWebrootWithModRewrite() { Configure::write('App.dir', 'auth'); - $Dispatcher->base = false;; + $Dispatcher->base = false; $_SERVER['DOCUMENT_ROOT'] = '/cake/repo/branches'; $_SERVER['SCRIPT_FILENAME'] = '/cake/repo/branches/demos/auth/webroot/index.php'; $_SERVER['PHP_SELF'] = '/demos/auth/webroot/index.php'; @@ -980,7 +980,7 @@ function testBaseUrlAndWebrootWithModRewrite() { Configure::write('App.dir', 'code'); - $Dispatcher->base = false;; + $Dispatcher->base = false; $_SERVER['DOCUMENT_ROOT'] = '/Library/WebServer/Documents'; $_SERVER['SCRIPT_FILENAME'] = '/Library/WebServer/Documents/clients/PewterReport/code/webroot/index.php'; $_SERVER['PHP_SELF'] = '/clients/PewterReport/code/webroot/index.php'; diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index 35fc7843d..dce75b632 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -995,7 +995,7 @@ function testReferer() { 'home' ); $result = $Controller->referer($referer, false); - $expected = 'http://' . env('HTTP_HOST') . '/pages/display/home';; + $expected = 'http://' . env('HTTP_HOST') . '/pages/display/home'; $this->assertIdentical($result, $expected); $_SERVER['HTTP_REFERER'] = ''; diff --git a/cake/tests/cases/libs/i18n.test.php b/cake/tests/cases/libs/i18n.test.php index 567a53b46..dc475c8a4 100644 --- a/cake/tests/cases/libs/i18n.test.php +++ b/cake/tests/cases/libs/i18n.test.php @@ -39,7 +39,7 @@ class I18nTest extends CakeTestCase { * @return void */ function setUp() { - $this->_localePaths = App::path('locales');; + $this->_localePaths = App::path('locales'); App::build(array( 'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale') )); diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index 1914b72bf..070fe5b17 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -229,7 +229,7 @@ function reportCaseHtml($testObjectFile, $coverageData, $execCodeLines) { } else { $class = 'ignored'; } - $report .= $manager->__paintCodeline($class, $num, $line);; + $report .= $manager->__paintCodeline($class, $num, $line); } return $manager->__paintHeader($lineCount, $coveredCount, $report); } From ad98139e35b46f17ed742d7985523ca550210b0b Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 1 Jul 2009 00:24:20 -0400 Subject: [PATCH 0275/2083] Moving bake templates into templates/default. Adding 'console template themes' to TemplateTask. Adding test cases for console themes. Moving files around. --- cake/console/libs/tasks/template.php | 94 +++++++++-- .../default/actions/controller_actions.ctp | 142 +++++++++++++++++ .../templates/default/classes/controller.ctp | 57 +++++++ .../templates/default/classes/fixture.ctp | 42 +++++ .../libs/templates/default/classes/model.ctp | 127 +++++++++++++++ .../libs/templates/default/classes/test.ctp | 57 +++++++ .../libs/templates/default/views/form.ctp | 69 ++++++++ .../libs/templates/default/views/home.ctp | 82 ++++++++++ .../libs/templates/default/views/index.ctp | 99 ++++++++++++ .../libs/templates/default/views/view.ctp | 150 ++++++++++++++++++ .../console/libs/tasks/template.test.php | 66 +++++++- .../test_app/vendors/shells/templates/empty | 0 .../templates/test/classes/test_object.ctp | 2 + 13 files changed, 963 insertions(+), 24 deletions(-) create mode 100644 cake/console/libs/templates/default/actions/controller_actions.ctp create mode 100644 cake/console/libs/templates/default/classes/controller.ctp create mode 100644 cake/console/libs/templates/default/classes/fixture.ctp create mode 100644 cake/console/libs/templates/default/classes/model.ctp create mode 100644 cake/console/libs/templates/default/classes/test.ctp create mode 100644 cake/console/libs/templates/default/views/form.ctp create mode 100644 cake/console/libs/templates/default/views/home.ctp create mode 100644 cake/console/libs/templates/default/views/index.ctp create mode 100644 cake/console/libs/templates/default/views/view.ctp delete mode 100644 cake/tests/test_app/vendors/shells/templates/empty create mode 100644 cake/tests/test_app/vendors/shells/templates/test/classes/test_object.ctp diff --git a/cake/console/libs/tasks/template.php b/cake/console/libs/tasks/template.php index d68ba61fe..00a611e66 100644 --- a/cake/console/libs/tasks/template.php +++ b/cake/console/libs/tasks/template.php @@ -2,7 +2,6 @@ /** * Template Task can generate templated output Used in other Tasks * - * * * PHP versions 4 and 5 * @@ -26,39 +25,48 @@ class TemplateTask extends Shell { * @var array **/ var $templateVars = array(); - + /** * Paths to look for templates on. + * Contains a list of $theme => $path * * @var array **/ var $templatePaths = array(); + /** - * Initialize callback + * Initialize callback. Setup paths for the template task. * * @access public * @return void **/ function initialize() { - $this->templatePaths = $this->Dispatch->shellPaths; + $this->templatePaths = $this->_findThemes(); } /** - * Find a template + * Find the paths to all the installed shell themes in the app. * - * @param string $directory Subdirectory to look for ie. 'views', 'objects' - * @param string $filename lower_case_underscored filename you want. - * @access public - * @return string filename or false if scan failed. + * Bake themes are directories not named `skel` inside a `vendors/shells/templates` path. + * + * @return array Array of bake themes that are installed. **/ - function _findTemplate($directory, $filename) { - foreach ($this->templatePaths as $path) { - $templatePath = $path . 'templates' . DS . $directory . DS . $filename . '.ctp'; - if (file_exists($templatePath) && is_file($templatePath)) { - return $templatePath; + function _findThemes() { + $paths = $this->Dispatch->shellPaths; + $themes = array(); + foreach ($paths as $path) { + $Folder =& new Folder($path . 'templates', false); + $contents = $Folder->read(); + $subDirs = $contents[0]; + foreach ($subDirs as $dir) { + if (empty($dir) || $dir == 'skel') { + continue; + } + $templateDir = $path . 'templates' . DS . $dir . DS; + $themes[$dir] = $templateDir; } } - return false; + return $themes; } /** @@ -106,7 +114,8 @@ function generate($directory, $filename, $vars = null) { if (empty($this->templatePaths)) { $this->initialize(); } - $templateFile = $this->_findTemplate($directory, $filename); + $themePath = $this->getThemePath(); + $templateFile = $this->_findTemplate($themePath, $directory, $filename); if ($templateFile) { extract($this->templateVars); ob_start(); @@ -117,4 +126,57 @@ function generate($directory, $filename, $vars = null) { } return ''; } + +/** + * Find the theme name for the current operation. + * If there is only one theme in $templatePaths it will be used. + * If there is a -theme param in the cli args, it will be used. + * 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); + return $paths[0]; + } + if (!empty($this->params['theme']) && isset($this->templatePaths[$this->params['theme']])) { + return $this->templatePaths[$this->params['theme']]; + } + $i = 1; + $indexedPaths = array(); + foreach ($this->templatePaths as $key => $path) { + $this->out($i . '. ' . $key); + $indexedPaths[$i] = $path; + $i++; + } + $index = $this->in(__('Which bake theme would you like to use?', true), range(1, $i), 1); + return $indexedPaths[$index]; + } + +/** + * Find a template inside a directory inside a path. + * Will scan all other theme dirs if the template is not found in the first directory. + * + * @param string $path The initial path to look for the file on. If it is not found fallbacks will be used. + * @param string $directory Subdirectory to look for ie. 'views', 'objects' + * @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)) { + return $themeFile; + } + foreach ($this->templatePaths as $path) { + $templatePath = $path . $directory . DS . $filename . '.ctp'; + if (file_exists($templatePath)) { + return $templatePath; + } + } + $this->err(sprintf(__('Could not find template for %s, exiting.'), $filename)); + $this->_stop(); + } + } \ No newline at end of file diff --git a/cake/console/libs/templates/default/actions/controller_actions.ctp b/cake/console/libs/templates/default/actions/controller_actions.ctp new file mode 100644 index 000000000..99b18bd33 --- /dev/null +++ b/cake/console/libs/templates/default/actions/controller_actions.ctp @@ -0,0 +1,142 @@ +<?php +/** + * Bake Template for Controller action generation. + * + * + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org + * @package cake + * @subpackage cake.console.libs.template.objects + * @since CakePHP(tm) v 1.3 + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + */ +?> + + function <?php echo $admin ?>index() { + $this-><?php echo $currentModelName ?>->recursive = 0; + $this->set('<?php echo $pluralName ?>', $this->paginate()); + } + + function <?php echo $admin ?>view($id = null) { + if (!$id) { +<?php if ($wannaUseSession): ?> + $this->Session->setFlash(__('Invalid <?php echo $singularHumanName ?>', true)); + $this->redirect(array('action' => 'index')); +<?php else: ?> + $this->flash(__('Invalid <?php echo $singularHumanName; ?>', true), array('action' => 'index')); +<?php endif; ?> + } + $this->set('<?php echo $singularName; ?>', $this-><?php echo $currentModelName; ?>->read(null, $id)); + } + +<?php $compact = array(); ?> + function <?php echo $admin ?>add() { + if (!empty($this->data)) { + $this-><?php echo $currentModelName; ?>->create(); + if ($this-><?php echo $currentModelName; ?>->save($this->data)) { +<?php if ($wannaUseSession): ?> + $this->Session->setFlash(__('The <?php echo $singularHumanName; ?> has been saved', true)); + $this->redirect(array('action' => 'index')); +<?php else: ?> + $this->flash(__('<?php echo $currentModelName; ?> saved.', true), array('action' => 'index')); +<?php endif; ?> + } else { +<?php if ($wannaUseSession): ?> + $this->Session->setFlash(__('The <?php echo $singularHumanName; ?> could not be saved. Please, try again.', true)); +<?php endif; ?> + } + } +<?php + foreach (array('belongsTo', 'hasAndBelongsToMany') as $assoc): + foreach ($modelObj->{$assoc} as $associationName => $relation): + if (!empty($associationName)): + $otherModelName = $this->_modelName($associationName); + $otherPluralName = $this->_pluralName($associationName); + echo "\t\t\${$otherPluralName} = \$this->{$currentModelName}->{$otherModelName}->find('list');\n"; + $compact[] = "'{$otherPluralName}'"; + endif; + endforeach; + endforeach; + if (!empty($compact)): + echo "\t\t\$this->set(compact(".join(', ', $compact)."));\n"; + endif; +?> + } + +<?php $compact = array(); ?> + function <?php echo $admin; ?>edit($id = null) { + if (!$id && empty($this->data)) { +<?php if ($wannaUseSession): ?> + $this->Session->setFlash(__('Invalid <?php echo $singularHumanName; ?>', true)); + $this->redirect(array('action' => 'index')); +<?php else: ?> + $this->flash(__('Invalid <?php echo $singularHumanName; ?>', true), array('action' => 'index')); +<?php endif; ?> + } + if (!empty($this->data)) { + if ($this-><?php echo $currentModelName; ?>->save($this->data)) { +<?php if ($wannaUseSession): ?> + $this->Session->setFlash(__('The <?php echo $singularHumanName; ?> has been saved', true)); + $this->redirect(array('action' => 'index')); +<?php else: ?> + $this->flash(__('The <?php echo $singularHumanName; ?> has been saved.', true), array('action' => 'index')); +<?php endif; ?> + } else { +<?php if ($wannaUseSession): ?> + $this->Session->setFlash(__('The <?php echo $singularHumanName; ?> could not be saved. Please, try again.', true)); +<?php endif; ?> + } + } + if (empty($this->data)) { + $this->data = $this-><?php echo $currentModelName; ?>->read(null, $id); + } +<?php + foreach (array('belongsTo', 'hasAndBelongsToMany') as $assoc): + foreach ($modelObj->{$assoc} as $associationName => $relation): + if (!empty($associationName)): + $otherModelName = $this->_modelName($associationName); + $otherPluralName = $this->_pluralName($associationName); + echo "\t\t\${$otherPluralName} = \$this->{$currentModelName}->{$otherModelName}->find('list');\n"; + $compact[] = "'{$otherPluralName}'"; + endif; + endforeach; + endforeach; + if (!empty($compact)): + echo "\t\t\$this->set(compact(".join(', ', $compact)."));\n"; + endif; + ?> + } + + function <?php echo $admin; ?>delete($id = null) { + if (!$id) { +<?php if ($wannaUseSession): ?> + $this->Session->setFlash(__('Invalid id for <?php echo $singularHumanName; ?>', true)); + $this->redirect(array('action'=>'index')); +<?php else: ?> + $this->flash(__('Invalid <?php echo $singularHumanName; ?>', true), array('action' => 'index')); +<?php endif; ?> + } + if ($this-><?php echo $currentModelName; ?>->del($id)) { +<?php if ($wannaUseSession): ?> + $this->Session->setFlash(__('<?php echo $singularHumanName; ?> deleted', true)); + $this->redirect(array('action'=>'index')); +<?php else: ?> + $this->flash(__('<?php echo $singularHumanName; ?> deleted', true), array('action' => 'index')); +<?php endif; ?> + } +<?php if ($wannaUseSession): ?> + $this->Session->setFlash(__('<?php echo $singularHumanName; ?> was not deleted', true)); +<?php else: ?> + $this->flash(__('<?php echo $singularHumanName; ?> was not deleted', true), array('action' => 'index')); +<?php endif; ?> + $this->redirect(array('action' => 'index')); + } diff --git a/cake/console/libs/templates/default/classes/controller.ctp b/cake/console/libs/templates/default/classes/controller.ctp new file mode 100644 index 000000000..539210d2e --- /dev/null +++ b/cake/console/libs/templates/default/classes/controller.ctp @@ -0,0 +1,57 @@ +<?php +/** + * Controller bake template file + * + * Allows templating of Controllers generated from bake. + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org + * @package cake + * @subpackage cake. + * @since CakePHP(tm) v 1.3 + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + */ + +echo "<?php\n"; +?> +class <?php echo $controllerName; ?>Controller extends <?php echo $plugin; ?>AppController { + + var $name = '<?php echo $controllerName; ?>'; +<?php if ($isScaffold): ?> + var $scaffold; +<?php else: ?> +<?php + +echo "\tvar \$helpers = array('Html', 'Form'"; +if (count($helpers)): + foreach ($helpers as $help): + echo ", '" . Inflector::camelize($help) . "'"; + endforeach; +endif; +echo ");\n"; + +if (count($components)): + echo "\tvar \$components = array("; + for ($i = 0, $len = count($components); $i < $len; $i++): + if ($i != $len - 1): + echo "'" . Inflector::camelize($components[$i]) . "', "; + else: + echo "'" . Inflector::camelize($components[$i]) . "'"; + endif; + endfor; + echo ");\n"; +endif; + +echo $actions; + +endif; ?> +} +<?php echo "?>"; ?> \ No newline at end of file diff --git a/cake/console/libs/templates/default/classes/fixture.ctp b/cake/console/libs/templates/default/classes/fixture.ctp new file mode 100644 index 000000000..34d84bf4a --- /dev/null +++ b/cake/console/libs/templates/default/classes/fixture.ctp @@ -0,0 +1,42 @@ +<?php +/** + * Fixture Template file + * + * Fixture Template used when baking fixtures with bake + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org + * @package cake + * @subpackage cake. + * @since CakePHP(tm) v 1.3 + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + */ +?> +<?php echo '<?php' . "\n"; ?> +/* <?php echo $model; ?> Fixture generated on: <?php echo date('Y-m-d H:m:s') . " : ". time(); ?> */ +class <?php echo $model; ?>Fixture extends CakeTestFixture { + var $name = '<?php echo $model; ?>'; +<?php if ($table): ?> + var $table = '<?php echo $table; ?>'; +<?php endif; ?> +<?php if ($import): ?> + var $import = <?php echo $import; ?>; +<?php endif;?> + +<?php if ($schema): ?> + var $fields = <?php echo $schema; ?>; +<?php endif;?> + +<?php if ($records): ?> + var $records = <?php echo $records; ?>; +<?php endif;?> +} +<?php echo '?>'; ?> \ No newline at end of file diff --git a/cake/console/libs/templates/default/classes/model.ctp b/cake/console/libs/templates/default/classes/model.ctp new file mode 100644 index 000000000..849be35b3 --- /dev/null +++ b/cake/console/libs/templates/default/classes/model.ctp @@ -0,0 +1,127 @@ +<?php +/** + * Model template file. + * + * Used by bake to create new Model files. + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org + * @package cake + * @subpackage cake.console.libs.templates.objects + * @since CakePHP(tm) v 1.3 + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + */ + +echo "<?php\n"; ?> +class <?php echo $name ?> extends <?php echo $plugin; ?>AppModel { + var $name = '<?php echo $name; ?>'; +<?php if ($useDbConfig != 'default'): ?> + var $useDbConfig = '<?php echo $useDbConfig; ?>'; +<?php endif;?> +<?php if ($useTable && $useTable !== Inflector::tableize($name)): + $table = "'$useTable'"; + echo "\tvar \$useTable = $table;\n"; +endif; +if ($primaryKey !== 'id'): ?> + var $primaryKey = '<?php echo $primaryKey; ?>'; +<?php endif; + +if (!empty($validate)): + echo "\tvar \$validate = array(\n"; + foreach ($validate as $field => $validations): + echo "\t\t'$field' => array(\n"; + foreach ($validations as $key => $validator): + echo "\t\t\t'$key' => array('rule' => array('$validator')),\n"; + endforeach; + echo "\t\t),\n"; + endforeach; + echo "\t);\n"; +endif; + +?> + //The Associations below have been created with all possible keys, those that are not needed can be removed +<?php + +foreach (array('hasOne', 'belongsTo') as $assocType): + if (!empty($associations[$assocType])): + $typeCount = count($associations[$assocType]); + echo "\n\tvar \$$assocType = array("; + foreach ($associations[$assocType] as $i => $relation): + $out = "\n\t\t'{$relation['alias']}' => array(\n"; + $out .= "\t\t\t'className' => '{$relation['className']}',\n"; + $out .= "\t\t\t'foreignKey' => '{$relation['foreignKey']}',\n"; + $out .= "\t\t\t'conditions' => '',\n"; + $out .= "\t\t\t'fields' => '',\n"; + $out .= "\t\t\t'order' => ''\n"; + $out .= "\t\t)"; + if ($i + 1 < $typeCount) { + $out .= ","; + } + echo $out; + endforeach; + echo "\n\t);\n"; + endif; +endforeach; + +if (!empty($associations['hasMany'])): + $belongsToCount = count($associations['hasMany']); + echo "\n\tvar \$hasMany = array("; + foreach ($associations['hasMany'] as $i => $relation): + $out = "\n\t\t'{$relation['alias']}' => array(\n"; + $out .= "\t\t\t'className' => '{$relation['className']}',\n"; + $out .= "\t\t\t'foreignKey' => '{$relation['foreignKey']}',\n"; + $out .= "\t\t\t'dependent' => false,\n"; + $out .= "\t\t\t'conditions' => '',\n"; + $out .= "\t\t\t'fields' => '',\n"; + $out .= "\t\t\t'order' => '',\n"; + $out .= "\t\t\t'limit' => '',\n"; + $out .= "\t\t\t'offset' => '',\n"; + $out .= "\t\t\t'exclusive' => '',\n"; + $out .= "\t\t\t'finderQuery' => '',\n"; + $out .= "\t\t\t'counterQuery' => ''\n"; + $out .= "\t\t)"; + if ($i + 1 < $belongsToCount) { + $out .= ","; + } + echo $out; + endforeach; + echo "\n\t);\n\n"; +endif; + +if (!empty($associations['hasAndBelongsToMany'])): + $habtmCount = count($associations['hasAndBelongsToMany']); + echo "\n\tvar \$hasAndBelongsToMany = array("; + foreach ($associations['hasAndBelongsToMany'] as $i => $relation): + $out = "\n\t\t'{$relation['alias']}' => array(\n"; + $out .= "\t\t\t'className' => '{$relation['className']}',\n"; + $out .= "\t\t\t'joinTable' => '{$relation['joinTable']}',\n"; + $out .= "\t\t\t'foreignKey' => '{$relation['foreignKey']}',\n"; + $out .= "\t\t\t'associationForeignKey' => '{$relation['associationForeignKey']}',\n"; + $out .= "\t\t\t'unique' => true,\n"; + $out .= "\t\t\t'conditions' => '',\n"; + $out .= "\t\t\t'fields' => '',\n"; + $out .= "\t\t\t'order' => '',\n"; + $out .= "\t\t\t'limit' => '',\n"; + $out .= "\t\t\t'offset' => '',\n"; + $out .= "\t\t\t'finderQuery' => '',\n"; + $out .= "\t\t\t'deleteQuery' => '',\n"; + $out .= "\t\t\t'insertQuery' => ''\n"; + $out .= "\t\t)"; + if ($i + 1 < $habtmCount) { + $out .= ","; + } + echo $out; + endforeach; + echo "\n\t);\n\n"; +endif; +?> +} +<?php echo '?>'; ?> diff --git a/cake/console/libs/templates/default/classes/test.ctp b/cake/console/libs/templates/default/classes/test.ctp new file mode 100644 index 000000000..b19b89793 --- /dev/null +++ b/cake/console/libs/templates/default/classes/test.ctp @@ -0,0 +1,57 @@ +<?php +/** + * Test Case bake template + * + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org + * @package cake + * @subpackage cake.console.libs.templates.objects + * @since CakePHP(tm) v 1.3 + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + */ +echo "<?php\n"; +echo "/* ". $className ." Test cases generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n"; +?> +App::import('<?php echo $type; ?>', '<?php echo $plugin . $className;?>'); + +<?php if ($mock and strtolower($type) == 'controller'): ?> +class Test<?php echo $fullClassName; ?> extends <?php echo $fullClassName; ?> { + var $autoRender = false; + + function redirect($url, $status = null, $exit = true) { + $this->redirectUrl = $url; + } +} + +<?php endif; ?> +class <?php echo $fullClassName; ?>TestCase extends CakeTestCase { +<?php if (!empty($fixtures)): ?> + var $fixtures = array('<?php echo join("', '", $fixtures); ?>'); + +<?php endif; ?> + function startTest() { + $this-><?php echo $className . ' =& ' . $construction; ?> + } + + function endTest() { + unset($this-><?php echo $className;?>); + ClassRegistry::flush(); + } + +<?php foreach ($methods as $method): ?> + function test<?php echo Inflector::classify($method); ?>() { + + } + +<?php endforeach;?> +} +<?php echo '?>'; ?> \ No newline at end of file diff --git a/cake/console/libs/templates/default/views/form.ctp b/cake/console/libs/templates/default/views/form.ctp new file mode 100644 index 000000000..961d653a3 --- /dev/null +++ b/cake/console/libs/templates/default/views/form.ctp @@ -0,0 +1,69 @@ +<?php +/* SVN FILE: $Id$ */ +/** + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console.libs.templates.views + * @since CakePHP(tm) v 1.2.0.5234 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +?> +<div class="<?php echo $pluralVar;?> form"> +<?php echo "<?php echo \$form->create('{$modelClass}');?>\n";?> + <fieldset> + <legend><?php echo "<?php __('".Inflector::humanize($action)." {$singularHumanName}');?>";?></legend> +<?php + echo "\t<?php\n"; + foreach ($fields as $field) { + if ($action == 'add' && $field == $primaryKey) { + continue; + } elseif (!in_array($field, array('created', 'modified', 'updated'))) { + echo "\t\techo \$form->input('{$field}');\n"; + } + } + if (!empty($associations['hasAndBelongsToMany'])) { + foreach ($associations['hasAndBelongsToMany'] as $assocName => $assocData) { + echo "\t\techo \$form->input('{$assocName}');\n"; + } + } + echo "\t?>\n"; +?> + </fieldset> +<?php + echo "<?php echo \$form->end('Submit');?>\n"; +?> +</div> +<div class="actions"> + <ul> +<?php if ($action != 'add'):?> + <li><?php echo "<?php echo \$html->link(__('Delete', true), array('action'=>'delete', \$form->value('{$modelClass}.{$primaryKey}')), null, sprintf(__('Are you sure you want to delete # %s?', true), \$form->value('{$modelClass}.{$primaryKey}'))); ?>";?></li> +<?php endif;?> + <li><?php echo "<?php echo \$html->link(__('List {$pluralHumanName}', true), array('action'=>'index'));?>";?></li> +<?php + $done = array(); + foreach ($associations as $type => $data) { + foreach ($data as $alias => $details) { + if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) { + echo "\t\t<li><?php echo \$html->link(__('List ".Inflector::humanize($details['controller'])."', true), array('controller'=> '{$details['controller']}', 'action'=>'index')); ?> </li>\n"; + echo "\t\t<li><?php echo \$html->link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller'=> '{$details['controller']}', 'action'=>'add')); ?> </li>\n"; + $done[] = $details['controller']; + } + } + } +?> + </ul> +</div> diff --git a/cake/console/libs/templates/default/views/home.ctp b/cake/console/libs/templates/default/views/home.ctp new file mode 100644 index 000000000..39020d488 --- /dev/null +++ b/cake/console/libs/templates/default/views/home.ctp @@ -0,0 +1,82 @@ +<?php +$output = "<h2>Sweet, \"".Inflector::humanize($app)."\" got Baked by CakePHP!</h2>\n"; +$output .=" +<?php +if (Configure::read() > 0): + Debugger::checkSessionKey(); +endif; +?> +<p> +<?php + if (is_writable(TMP)): + echo '<span class=\"notice success\">'; + __('Your tmp directory is writable.'); + echo '</span>'; + else: + echo '<span class=\"notice\">'; + __('Your tmp directory is NOT writable.'); + echo '</span>'; + endif; +?> +</p> +<p> +<?php + \$settings = Cache::settings(); + if (!empty(\$settings)): + echo '<span class=\"notice success\">'; + echo sprintf(__('The %s is being used for caching. To change the config edit APP/config/core.php ', true), '<em>'. \$settings['engine'] . 'Engine</em>'); + echo '</span>'; + else: + echo '<span class=\"notice\">'; + __('Your cache is NOT working. Please check the settings in APP/config/core.php'); + echo '</span>'; + endif; +?> +</p> +<p> +<?php + \$filePresent = null; + if (file_exists(CONFIGS . 'database.php')): + echo '<span class=\"notice success\">'; + __('Your database configuration file is present.'); + \$filePresent = true; + echo '</span>'; + else: + echo '<span class=\"notice\">'; + __('Your database configuration file is NOT present.'); + echo '<br/>'; + __('Rename config/database.php.default to config/database.php'); + echo '</span>'; + endif; +?> +</p> +<?php +if (!empty(\$filePresent)): + uses('model' . DS . 'connection_manager'); + \$db = ConnectionManager::getInstance(); + \$connected = \$db->getDataSource('default'); +?> +<p> +<?php + if (\$connected->isConnected()): + echo '<span class=\"notice success\">'; + __('Cake is able to connect to the database.'); + echo '</span>'; + else: + echo '<span class=\"notice\">'; + __('Cake is NOT able to connect to the database.'); + echo '</span>'; + endif; +?> +</p>\n"; +$output .= "<?php endif;?>\n"; +$output .= "<h3><?php __('Editing this Page') ?></h3>\n"; +$output .= "<p>\n"; +$output .= "<?php\n"; +$output .= "\techo sprintf(__('To change the content of this page, edit: %s\n"; +$output .= "\t\tTo change its layout, edit: %s\n"; +$output .= "\t\tYou can also add some CSS styles for your pages at: %s', true),\n"; +$output .= "\t\tAPP . 'views' . DS . 'pages' . DS . 'home.ctp.<br />', APP . 'views' . DS . 'layouts' . DS . 'default.ctp.<br />', APP . 'webroot' . DS . 'css');\n"; +$output .= "?>\n"; +$output .= "</p>\n"; +?> diff --git a/cake/console/libs/templates/default/views/index.ctp b/cake/console/libs/templates/default/views/index.ctp new file mode 100644 index 000000000..ea864c17d --- /dev/null +++ b/cake/console/libs/templates/default/views/index.ctp @@ -0,0 +1,99 @@ +<?php +/* SVN FILE: $Id$ */ +/** + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console.libs.templates.views + * @since CakePHP(tm) v 1.2.0.5234 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +?> +<div class="<?php echo $pluralVar;?> index"> +<h2><?php echo "<?php __('{$pluralHumanName}');?>";?></h2> +<p> +<?php echo "<?php +echo \$paginator->counter(array( +'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true) +)); +?>";?> +</p> +<table cellpadding="0" cellspacing="0"> +<tr> +<?php foreach ($fields as $field):?> + <th><?php echo "<?php echo \$paginator->sort('{$field}');?>";?></th> +<?php endforeach;?> + <th class="actions"><?php echo "<?php __('Actions');?>";?></th> +</tr> +<?php +echo "<?php +\$i = 0; +foreach (\${$pluralVar} as \${$singularVar}): + \$class = null; + if (\$i++ % 2 == 0) { + \$class = ' class=\"altrow\"'; + } +?>\n"; + echo "\t<tr<?php echo \$class;?>>\n"; + foreach ($fields as $field) { + $isKey = false; + if (!empty($associations['belongsTo'])) { + foreach ($associations['belongsTo'] as $alias => $details) { + if ($field === $details['foreignKey']) { + $isKey = true; + echo "\t\t<td>\n\t\t\t<?php echo \$html->link(\${$singularVar}['{$alias}']['{$details['displayField']}'], array('controller'=> '{$details['controller']}', 'action'=>'view', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?>\n\t\t</td>\n"; + break; + } + } + } + if ($isKey !== true) { + echo "\t\t<td>\n\t\t\t<?php echo \${$singularVar}['{$modelClass}']['{$field}']; ?>\n\t\t</td>\n"; + } + } + + echo "\t\t<td class=\"actions\">\n"; + echo "\t\t\t<?php echo \$html->link(__('View', true), array('action'=>'view', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n"; + echo "\t\t\t<?php echo \$html->link(__('Edit', true), array('action'=>'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n"; + echo "\t\t\t<?php echo \$html->link(__('Delete', true), array('action'=>'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), null, sprintf(__('Are you sure you want to delete # %s?', true), \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n"; + echo "\t\t</td>\n"; + echo "\t</tr>\n"; + +echo "<?php endforeach; ?>\n"; +?> +</table> +</div> +<div class="paging"> +<?php echo "\t<?php echo \$paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>\n";?> + | <?php echo "\t<?php echo \$paginator->numbers();?>\n"?> +<?php echo "\t<?php echo \$paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?>\n";?> +</div> +<div class="actions"> + <ul> + <li><?php echo "<?php echo \$html->link(__('New {$singularHumanName}', true), array('action'=>'add')); ?>";?></li> +<?php + $done = array(); + foreach ($associations as $type => $data) { + foreach ($data as $alias => $details) { + if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) { + echo "\t\t<li><?php echo \$html->link(__('List ".Inflector::humanize($details['controller'])."', true), array('controller'=> '{$details['controller']}', 'action'=>'index')); ?> </li>\n"; + echo "\t\t<li><?php echo \$html->link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller'=> '{$details['controller']}', 'action'=>'add')); ?> </li>\n"; + $done[] = $details['controller']; + } + } + } +?> + </ul> +</div> diff --git a/cake/console/libs/templates/default/views/view.ctp b/cake/console/libs/templates/default/views/view.ctp new file mode 100644 index 000000000..24de7d1e8 --- /dev/null +++ b/cake/console/libs/templates/default/views/view.ctp @@ -0,0 +1,150 @@ +<?php +/* SVN FILE: $Id$ */ +/** + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console.libs.templates.views + * @since CakePHP(tm) v 1.2.0.5234 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +?> +<div class="<?php echo $pluralVar;?> view"> +<h2><?php echo "<?php __('{$singularHumanName}');?>";?></h2> + <dl><?php echo "<?php \$i = 0; \$class = ' class=\"altrow\"';?>\n";?> +<?php +foreach ($fields as $field) { + $isKey = false; + if (!empty($associations['belongsTo'])) { + foreach ($associations['belongsTo'] as $alias => $details) { + if ($field === $details['foreignKey']) { + $isKey = true; + echo "\t\t<dt<?php if (\$i % 2 == 0) echo \$class;?>><?php __('".Inflector::humanize(Inflector::underscore($alias))."'); ?></dt>\n"; + echo "\t\t<dd<?php if (\$i++ % 2 == 0) echo \$class;?>>\n\t\t\t<?php echo \$html->link(\${$singularVar}['{$alias}']['{$details['displayField']}'], array('controller'=> '{$details['controller']}', 'action'=>'view', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?>\n\t\t\t \n\t\t</dd>\n"; + break; + } + } + } + if ($isKey !== true) { + echo "\t\t<dt<?php if (\$i % 2 == 0) echo \$class;?>><?php __('".Inflector::humanize($field)."'); ?></dt>\n"; + echo "\t\t<dd<?php if (\$i++ % 2 == 0) echo \$class;?>>\n\t\t\t<?php echo \${$singularVar}['{$modelClass}']['{$field}']; ?>\n\t\t\t \n\t\t</dd>\n"; + } +} +?> + </dl> +</div> +<div class="actions"> + <ul> +<?php + echo "\t\t<li><?php echo \$html->link(__('Edit {$singularHumanName}', true), array('action'=>'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> </li>\n"; + echo "\t\t<li><?php echo \$html->link(__('Delete {$singularHumanName}', true), array('action'=>'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), null, sprintf(__('Are you sure you want to delete # %s?', true), \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> </li>\n"; + echo "\t\t<li><?php echo \$html->link(__('List {$pluralHumanName}', true), array('action'=>'index')); ?> </li>\n"; + echo "\t\t<li><?php echo \$html->link(__('New {$singularHumanName}', true), array('action'=>'add')); ?> </li>\n"; + + $done = array(); + foreach ($associations as $type => $data) { + foreach ($data as $alias => $details) { + if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) { + echo "\t\t<li><?php echo \$html->link(__('List ".Inflector::humanize($details['controller'])."', true), array('controller'=> '{$details['controller']}', 'action'=>'index')); ?> </li>\n"; + echo "\t\t<li><?php echo \$html->link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller'=> '{$details['controller']}', 'action'=>'add')); ?> </li>\n"; + $done[] = $details['controller']; + } + } + } +?> + </ul> +</div> +<?php +if (!empty($associations['hasOne'])) : + foreach ($associations['hasOne'] as $alias => $details): ?> + <div class="related"> + <h3><?php echo "<?php __('Related ".Inflector::humanize($details['controller'])."');?>";?></h3> + <?php echo "<?php if (!empty(\${$singularVar}['{$alias}'])):?>\n";?> + <dl><?php echo "\t<?php \$i = 0; \$class = ' class=\"altrow\"';?>\n";?> + <?php + foreach ($details['fields'] as $field) { + echo "\t\t<dt<?php if (\$i % 2 == 0) echo \$class;?>><?php __('".Inflector::humanize($field)."');?></dt>\n"; + echo "\t\t<dd<?php if (\$i++ % 2 == 0) echo \$class;?>>\n\t<?php echo \${$singularVar}['{$alias}']['{$field}'];?>\n </dd>\n"; + } + ?> + </dl> + <?php echo "<?php endif; ?>\n";?> + <div class="actions"> + <ul> + <li><?php echo "<?php echo \$html->link(__('Edit ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller'=> '{$details['controller']}', 'action'=>'edit', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?></li>\n";?> + </ul> + </div> + </div> + <?php + endforeach; +endif; +if (empty($associations['hasMany'])) { + $associations['hasMany'] = array(); +} +if (empty($associations['hasAndBelongsToMany'])) { + $associations['hasAndBelongsToMany'] = array(); +} +$relations = array_merge($associations['hasMany'], $associations['hasAndBelongsToMany']); +$i = 0; +foreach ($relations as $alias => $details): + $otherSingularVar = Inflector::variable($alias); + $otherPluralHumanName = Inflector::humanize($details['controller']); + ?> +<div class="related"> + <h3><?php echo "<?php __('Related {$otherPluralHumanName}');?>";?></h3> + <?php echo "<?php if (!empty(\${$singularVar}['{$alias}'])):?>\n";?> + <table cellpadding = "0" cellspacing = "0"> + <tr> +<?php + foreach ($details['fields'] as $field) { + echo "\t\t<th><?php __('".Inflector::humanize($field)."'); ?></th>\n"; + } +?> + <th class="actions"><?php echo "<?php __('Actions');?>";?></th> + </tr> +<?php +echo "\t<?php + \$i = 0; + foreach (\${$singularVar}['{$alias}'] as \${$otherSingularVar}): + \$class = null; + if (\$i++ % 2 == 0) { + \$class = ' class=\"altrow\"'; + } + ?>\n"; + echo "\t\t<tr<?php echo \$class;?>>\n"; + + foreach ($details['fields'] as $field) { + echo "\t\t\t<td><?php echo \${$otherSingularVar}['{$field}'];?></td>\n"; + } + + echo "\t\t\t<td class=\"actions\">\n"; + echo "\t\t\t\t<?php echo \$html->link(__('View', true), array('controller'=> '{$details['controller']}', 'action'=>'view', \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n"; + echo "\t\t\t\t<?php echo \$html->link(__('Edit', true), array('controller'=> '{$details['controller']}', 'action'=>'edit', \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n"; + echo "\t\t\t\t<?php echo \$html->link(__('Delete', true), array('controller'=> '{$details['controller']}', 'action'=>'delete', \${$otherSingularVar}['{$details['primaryKey']}']), null, sprintf(__('Are you sure you want to delete # %s?', true), \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n"; + echo "\t\t\t</td>\n"; + echo "\t\t</tr>\n"; + +echo "\t<?php endforeach; ?>\n"; +?> + </table> +<?php echo "<?php endif; ?>\n\n";?> + <div class="actions"> + <ul> + <li><?php echo "<?php echo \$html->link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller'=> '{$details['controller']}', 'action'=>'add'));?>";?> </li> + </ul> + </div> +</div> +<?php endforeach;?> \ No newline at end of file diff --git a/cake/tests/cases/console/libs/tasks/template.test.php b/cake/tests/cases/console/libs/tasks/template.test.php index f12656436..fbbf605ed 100644 --- a/cake/tests/cases/console/libs/tasks/template.test.php +++ b/cake/tests/cases/console/libs/tasks/template.test.php @@ -33,9 +33,7 @@ ob_end_clean(); } -if (!class_exists('TemplateTask')) { - require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php'; -} +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php'; Mock::generatePartial( 'ShellDispatcher', 'TestTemplateTaskMockShellDispatcher', @@ -96,13 +94,40 @@ function testSet() { } /** - * test Initialize + * test finding themes installed in * * @return void **/ - function testInitialize() { + function testFindingInstalledThemesForBake() { + $consoleLibs = CAKE_CORE_INCLUDE_PATH . DS . CONSOLE_LIBS; + $this->Task->Dispatch->shellPaths = array($consoleLibs); $this->Task->initialize(); - $this->assertEqual($this->Task->templatePaths, $this->Task->Dispatch->shellPaths); + $this->assertEqual($this->Task->templatePaths, array('default' => $consoleLibs . 'templates' . DS . 'default' . DS)); + } + +/** + * test getting the correct theme name. Ensure that with only one theme, or a theme param + * that the user is not bugged. If there are more, find and return the correct theme name + * + * @return void + **/ + function testGetThemePath() { + $defaultTheme = CAKE_CORE_INCLUDE_PATH . DS . CONSOLE_LIBS . 'templates' . DS . 'default' .DS; + $this->Task->templatePaths = array('default' => $defaultTheme); + $this->Task->expectCallCount('in', 1); + + $result = $this->Task->getThemePath(); + $this->assertEqual($result, $defaultTheme); + + $this->Task->templatePaths = array('default' => $defaultTheme, 'other' => '/some/path'); + $this->Task->params['theme'] = 'other'; + $result = $this->Task->getThemePath(); + $this->assertEqual($result, '/some/path'); + + $this->Task->params = array(); + $this->Task->setReturnValueAt(0, 'in', '1'); + $result = $this->Task->getThemePath(); + $this->assertEqual($result, $defaultTheme); } /** @@ -111,12 +136,37 @@ function testInitialize() { * @return void **/ function testGenerate() { - $this->Task->templatePaths = array( + $this->Task->Dispatch->shellPaths = array( TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS . 'shells' . DS ); - $result = $this->Task->generate('objects', 'test_object', array('test' => 'foo')); + $this->Task->initialize(); + $result = $this->Task->generate('classes', 'test_object', array('test' => 'foo')); $expected = "I got rendered\nfoo"; $this->assertEqual($result, $expected); } + +/** + * test generate with a missing template in the chosen theme. + * ensure fallback to default works. + * + * @return void + **/ + function testGenerateWithTemplateFallbacks() { + $this->Task->Dispatch->shellPaths = array( + TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS . 'shells' . DS, + CAKE_CORE_INCLUDE_PATH . DS . CONSOLE_LIBS + ); + $this->Task->initialize(); + $this->Task->params['theme'] = 'test'; + $this->Task->set(array( + 'model' => 'Article', + 'table' => 'articles', + 'import' => false, + 'records' => false, + 'schema' => '' + )); + $result = $this->Task->generate('classes', 'fixture'); + $this->assertPattern('/ArticleFixture extends CakeTestFixture/', $result); + } } ?> \ No newline at end of file diff --git a/cake/tests/test_app/vendors/shells/templates/empty b/cake/tests/test_app/vendors/shells/templates/empty deleted file mode 100644 index e69de29bb..000000000 diff --git a/cake/tests/test_app/vendors/shells/templates/test/classes/test_object.ctp b/cake/tests/test_app/vendors/shells/templates/test/classes/test_object.ctp new file mode 100644 index 000000000..c524b8231 --- /dev/null +++ b/cake/tests/test_app/vendors/shells/templates/test/classes/test_object.ctp @@ -0,0 +1,2 @@ +I got rendered +<?php echo $test; ?> \ No newline at end of file From 1c6d0d5642483c0e1b53602d9592bc4c7acdd6d2 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 1 Jul 2009 00:48:53 -0400 Subject: [PATCH 0276/2083] Removing old files. --- .../libs/templates/objects/controller.ctp | 57 ------- .../templates/objects/controller_actions.ctp | 142 ----------------- .../libs/templates/objects/fixture.ctp | 42 ----- cake/console/libs/templates/objects/model.ctp | 127 --------------- cake/console/libs/templates/objects/test.ctp | 57 ------- cake/console/libs/templates/views/form.ctp | 69 -------- cake/console/libs/templates/views/home.ctp | 82 ---------- cake/console/libs/templates/views/index.ctp | 99 ------------ cake/console/libs/templates/views/view.ctp | 150 ------------------ .../shells/templates/objects/test_object.ctp | 2 - 10 files changed, 827 deletions(-) delete mode 100644 cake/console/libs/templates/objects/controller.ctp delete mode 100644 cake/console/libs/templates/objects/controller_actions.ctp delete mode 100644 cake/console/libs/templates/objects/fixture.ctp delete mode 100644 cake/console/libs/templates/objects/model.ctp delete mode 100644 cake/console/libs/templates/objects/test.ctp delete mode 100644 cake/console/libs/templates/views/form.ctp delete mode 100644 cake/console/libs/templates/views/home.ctp delete mode 100644 cake/console/libs/templates/views/index.ctp delete mode 100644 cake/console/libs/templates/views/view.ctp delete mode 100644 cake/tests/test_app/vendors/shells/templates/objects/test_object.ctp diff --git a/cake/console/libs/templates/objects/controller.ctp b/cake/console/libs/templates/objects/controller.ctp deleted file mode 100644 index 539210d2e..000000000 --- a/cake/console/libs/templates/objects/controller.ctp +++ /dev/null @@ -1,57 +0,0 @@ -<?php -/** - * Controller bake template file - * - * Allows templating of Controllers generated from bake. - * - * PHP versions 4 and 5 - * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org - * @package cake - * @subpackage cake. - * @since CakePHP(tm) v 1.3 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) - */ - -echo "<?php\n"; -?> -class <?php echo $controllerName; ?>Controller extends <?php echo $plugin; ?>AppController { - - var $name = '<?php echo $controllerName; ?>'; -<?php if ($isScaffold): ?> - var $scaffold; -<?php else: ?> -<?php - -echo "\tvar \$helpers = array('Html', 'Form'"; -if (count($helpers)): - foreach ($helpers as $help): - echo ", '" . Inflector::camelize($help) . "'"; - endforeach; -endif; -echo ");\n"; - -if (count($components)): - echo "\tvar \$components = array("; - for ($i = 0, $len = count($components); $i < $len; $i++): - if ($i != $len - 1): - echo "'" . Inflector::camelize($components[$i]) . "', "; - else: - echo "'" . Inflector::camelize($components[$i]) . "'"; - endif; - endfor; - echo ");\n"; -endif; - -echo $actions; - -endif; ?> -} -<?php echo "?>"; ?> \ No newline at end of file diff --git a/cake/console/libs/templates/objects/controller_actions.ctp b/cake/console/libs/templates/objects/controller_actions.ctp deleted file mode 100644 index 99b18bd33..000000000 --- a/cake/console/libs/templates/objects/controller_actions.ctp +++ /dev/null @@ -1,142 +0,0 @@ -<?php -/** - * Bake Template for Controller action generation. - * - * - * - * PHP versions 4 and 5 - * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org - * @package cake - * @subpackage cake.console.libs.template.objects - * @since CakePHP(tm) v 1.3 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) - */ -?> - - function <?php echo $admin ?>index() { - $this-><?php echo $currentModelName ?>->recursive = 0; - $this->set('<?php echo $pluralName ?>', $this->paginate()); - } - - function <?php echo $admin ?>view($id = null) { - if (!$id) { -<?php if ($wannaUseSession): ?> - $this->Session->setFlash(__('Invalid <?php echo $singularHumanName ?>', true)); - $this->redirect(array('action' => 'index')); -<?php else: ?> - $this->flash(__('Invalid <?php echo $singularHumanName; ?>', true), array('action' => 'index')); -<?php endif; ?> - } - $this->set('<?php echo $singularName; ?>', $this-><?php echo $currentModelName; ?>->read(null, $id)); - } - -<?php $compact = array(); ?> - function <?php echo $admin ?>add() { - if (!empty($this->data)) { - $this-><?php echo $currentModelName; ?>->create(); - if ($this-><?php echo $currentModelName; ?>->save($this->data)) { -<?php if ($wannaUseSession): ?> - $this->Session->setFlash(__('The <?php echo $singularHumanName; ?> has been saved', true)); - $this->redirect(array('action' => 'index')); -<?php else: ?> - $this->flash(__('<?php echo $currentModelName; ?> saved.', true), array('action' => 'index')); -<?php endif; ?> - } else { -<?php if ($wannaUseSession): ?> - $this->Session->setFlash(__('The <?php echo $singularHumanName; ?> could not be saved. Please, try again.', true)); -<?php endif; ?> - } - } -<?php - foreach (array('belongsTo', 'hasAndBelongsToMany') as $assoc): - foreach ($modelObj->{$assoc} as $associationName => $relation): - if (!empty($associationName)): - $otherModelName = $this->_modelName($associationName); - $otherPluralName = $this->_pluralName($associationName); - echo "\t\t\${$otherPluralName} = \$this->{$currentModelName}->{$otherModelName}->find('list');\n"; - $compact[] = "'{$otherPluralName}'"; - endif; - endforeach; - endforeach; - if (!empty($compact)): - echo "\t\t\$this->set(compact(".join(', ', $compact)."));\n"; - endif; -?> - } - -<?php $compact = array(); ?> - function <?php echo $admin; ?>edit($id = null) { - if (!$id && empty($this->data)) { -<?php if ($wannaUseSession): ?> - $this->Session->setFlash(__('Invalid <?php echo $singularHumanName; ?>', true)); - $this->redirect(array('action' => 'index')); -<?php else: ?> - $this->flash(__('Invalid <?php echo $singularHumanName; ?>', true), array('action' => 'index')); -<?php endif; ?> - } - if (!empty($this->data)) { - if ($this-><?php echo $currentModelName; ?>->save($this->data)) { -<?php if ($wannaUseSession): ?> - $this->Session->setFlash(__('The <?php echo $singularHumanName; ?> has been saved', true)); - $this->redirect(array('action' => 'index')); -<?php else: ?> - $this->flash(__('The <?php echo $singularHumanName; ?> has been saved.', true), array('action' => 'index')); -<?php endif; ?> - } else { -<?php if ($wannaUseSession): ?> - $this->Session->setFlash(__('The <?php echo $singularHumanName; ?> could not be saved. Please, try again.', true)); -<?php endif; ?> - } - } - if (empty($this->data)) { - $this->data = $this-><?php echo $currentModelName; ?>->read(null, $id); - } -<?php - foreach (array('belongsTo', 'hasAndBelongsToMany') as $assoc): - foreach ($modelObj->{$assoc} as $associationName => $relation): - if (!empty($associationName)): - $otherModelName = $this->_modelName($associationName); - $otherPluralName = $this->_pluralName($associationName); - echo "\t\t\${$otherPluralName} = \$this->{$currentModelName}->{$otherModelName}->find('list');\n"; - $compact[] = "'{$otherPluralName}'"; - endif; - endforeach; - endforeach; - if (!empty($compact)): - echo "\t\t\$this->set(compact(".join(', ', $compact)."));\n"; - endif; - ?> - } - - function <?php echo $admin; ?>delete($id = null) { - if (!$id) { -<?php if ($wannaUseSession): ?> - $this->Session->setFlash(__('Invalid id for <?php echo $singularHumanName; ?>', true)); - $this->redirect(array('action'=>'index')); -<?php else: ?> - $this->flash(__('Invalid <?php echo $singularHumanName; ?>', true), array('action' => 'index')); -<?php endif; ?> - } - if ($this-><?php echo $currentModelName; ?>->del($id)) { -<?php if ($wannaUseSession): ?> - $this->Session->setFlash(__('<?php echo $singularHumanName; ?> deleted', true)); - $this->redirect(array('action'=>'index')); -<?php else: ?> - $this->flash(__('<?php echo $singularHumanName; ?> deleted', true), array('action' => 'index')); -<?php endif; ?> - } -<?php if ($wannaUseSession): ?> - $this->Session->setFlash(__('<?php echo $singularHumanName; ?> was not deleted', true)); -<?php else: ?> - $this->flash(__('<?php echo $singularHumanName; ?> was not deleted', true), array('action' => 'index')); -<?php endif; ?> - $this->redirect(array('action' => 'index')); - } diff --git a/cake/console/libs/templates/objects/fixture.ctp b/cake/console/libs/templates/objects/fixture.ctp deleted file mode 100644 index 34d84bf4a..000000000 --- a/cake/console/libs/templates/objects/fixture.ctp +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * Fixture Template file - * - * Fixture Template used when baking fixtures with bake - * - * PHP versions 4 and 5 - * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org - * @package cake - * @subpackage cake. - * @since CakePHP(tm) v 1.3 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) - */ -?> -<?php echo '<?php' . "\n"; ?> -/* <?php echo $model; ?> Fixture generated on: <?php echo date('Y-m-d H:m:s') . " : ". time(); ?> */ -class <?php echo $model; ?>Fixture extends CakeTestFixture { - var $name = '<?php echo $model; ?>'; -<?php if ($table): ?> - var $table = '<?php echo $table; ?>'; -<?php endif; ?> -<?php if ($import): ?> - var $import = <?php echo $import; ?>; -<?php endif;?> - -<?php if ($schema): ?> - var $fields = <?php echo $schema; ?>; -<?php endif;?> - -<?php if ($records): ?> - var $records = <?php echo $records; ?>; -<?php endif;?> -} -<?php echo '?>'; ?> \ No newline at end of file diff --git a/cake/console/libs/templates/objects/model.ctp b/cake/console/libs/templates/objects/model.ctp deleted file mode 100644 index 849be35b3..000000000 --- a/cake/console/libs/templates/objects/model.ctp +++ /dev/null @@ -1,127 +0,0 @@ -<?php -/** - * Model template file. - * - * Used by bake to create new Model files. - * - * PHP versions 4 and 5 - * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org - * @package cake - * @subpackage cake.console.libs.templates.objects - * @since CakePHP(tm) v 1.3 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) - */ - -echo "<?php\n"; ?> -class <?php echo $name ?> extends <?php echo $plugin; ?>AppModel { - var $name = '<?php echo $name; ?>'; -<?php if ($useDbConfig != 'default'): ?> - var $useDbConfig = '<?php echo $useDbConfig; ?>'; -<?php endif;?> -<?php if ($useTable && $useTable !== Inflector::tableize($name)): - $table = "'$useTable'"; - echo "\tvar \$useTable = $table;\n"; -endif; -if ($primaryKey !== 'id'): ?> - var $primaryKey = '<?php echo $primaryKey; ?>'; -<?php endif; - -if (!empty($validate)): - echo "\tvar \$validate = array(\n"; - foreach ($validate as $field => $validations): - echo "\t\t'$field' => array(\n"; - foreach ($validations as $key => $validator): - echo "\t\t\t'$key' => array('rule' => array('$validator')),\n"; - endforeach; - echo "\t\t),\n"; - endforeach; - echo "\t);\n"; -endif; - -?> - //The Associations below have been created with all possible keys, those that are not needed can be removed -<?php - -foreach (array('hasOne', 'belongsTo') as $assocType): - if (!empty($associations[$assocType])): - $typeCount = count($associations[$assocType]); - echo "\n\tvar \$$assocType = array("; - foreach ($associations[$assocType] as $i => $relation): - $out = "\n\t\t'{$relation['alias']}' => array(\n"; - $out .= "\t\t\t'className' => '{$relation['className']}',\n"; - $out .= "\t\t\t'foreignKey' => '{$relation['foreignKey']}',\n"; - $out .= "\t\t\t'conditions' => '',\n"; - $out .= "\t\t\t'fields' => '',\n"; - $out .= "\t\t\t'order' => ''\n"; - $out .= "\t\t)"; - if ($i + 1 < $typeCount) { - $out .= ","; - } - echo $out; - endforeach; - echo "\n\t);\n"; - endif; -endforeach; - -if (!empty($associations['hasMany'])): - $belongsToCount = count($associations['hasMany']); - echo "\n\tvar \$hasMany = array("; - foreach ($associations['hasMany'] as $i => $relation): - $out = "\n\t\t'{$relation['alias']}' => array(\n"; - $out .= "\t\t\t'className' => '{$relation['className']}',\n"; - $out .= "\t\t\t'foreignKey' => '{$relation['foreignKey']}',\n"; - $out .= "\t\t\t'dependent' => false,\n"; - $out .= "\t\t\t'conditions' => '',\n"; - $out .= "\t\t\t'fields' => '',\n"; - $out .= "\t\t\t'order' => '',\n"; - $out .= "\t\t\t'limit' => '',\n"; - $out .= "\t\t\t'offset' => '',\n"; - $out .= "\t\t\t'exclusive' => '',\n"; - $out .= "\t\t\t'finderQuery' => '',\n"; - $out .= "\t\t\t'counterQuery' => ''\n"; - $out .= "\t\t)"; - if ($i + 1 < $belongsToCount) { - $out .= ","; - } - echo $out; - endforeach; - echo "\n\t);\n\n"; -endif; - -if (!empty($associations['hasAndBelongsToMany'])): - $habtmCount = count($associations['hasAndBelongsToMany']); - echo "\n\tvar \$hasAndBelongsToMany = array("; - foreach ($associations['hasAndBelongsToMany'] as $i => $relation): - $out = "\n\t\t'{$relation['alias']}' => array(\n"; - $out .= "\t\t\t'className' => '{$relation['className']}',\n"; - $out .= "\t\t\t'joinTable' => '{$relation['joinTable']}',\n"; - $out .= "\t\t\t'foreignKey' => '{$relation['foreignKey']}',\n"; - $out .= "\t\t\t'associationForeignKey' => '{$relation['associationForeignKey']}',\n"; - $out .= "\t\t\t'unique' => true,\n"; - $out .= "\t\t\t'conditions' => '',\n"; - $out .= "\t\t\t'fields' => '',\n"; - $out .= "\t\t\t'order' => '',\n"; - $out .= "\t\t\t'limit' => '',\n"; - $out .= "\t\t\t'offset' => '',\n"; - $out .= "\t\t\t'finderQuery' => '',\n"; - $out .= "\t\t\t'deleteQuery' => '',\n"; - $out .= "\t\t\t'insertQuery' => ''\n"; - $out .= "\t\t)"; - if ($i + 1 < $habtmCount) { - $out .= ","; - } - echo $out; - endforeach; - echo "\n\t);\n\n"; -endif; -?> -} -<?php echo '?>'; ?> diff --git a/cake/console/libs/templates/objects/test.ctp b/cake/console/libs/templates/objects/test.ctp deleted file mode 100644 index b19b89793..000000000 --- a/cake/console/libs/templates/objects/test.ctp +++ /dev/null @@ -1,57 +0,0 @@ -<?php -/** - * Test Case bake template - * - * - * PHP versions 4 and 5 - * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org - * @package cake - * @subpackage cake.console.libs.templates.objects - * @since CakePHP(tm) v 1.3 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) - */ -echo "<?php\n"; -echo "/* ". $className ." Test cases generated on: " . date('Y-m-d H:m:s') . " : ". time() . "*/\n"; -?> -App::import('<?php echo $type; ?>', '<?php echo $plugin . $className;?>'); - -<?php if ($mock and strtolower($type) == 'controller'): ?> -class Test<?php echo $fullClassName; ?> extends <?php echo $fullClassName; ?> { - var $autoRender = false; - - function redirect($url, $status = null, $exit = true) { - $this->redirectUrl = $url; - } -} - -<?php endif; ?> -class <?php echo $fullClassName; ?>TestCase extends CakeTestCase { -<?php if (!empty($fixtures)): ?> - var $fixtures = array('<?php echo join("', '", $fixtures); ?>'); - -<?php endif; ?> - function startTest() { - $this-><?php echo $className . ' =& ' . $construction; ?> - } - - function endTest() { - unset($this-><?php echo $className;?>); - ClassRegistry::flush(); - } - -<?php foreach ($methods as $method): ?> - function test<?php echo Inflector::classify($method); ?>() { - - } - -<?php endforeach;?> -} -<?php echo '?>'; ?> \ No newline at end of file diff --git a/cake/console/libs/templates/views/form.ctp b/cake/console/libs/templates/views/form.ctp deleted file mode 100644 index 961d653a3..000000000 --- a/cake/console/libs/templates/views/form.ctp +++ /dev/null @@ -1,69 +0,0 @@ -<?php -/* SVN FILE: $Id$ */ -/** - * - * PHP versions 4 and 5 - * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * - * Licensed under The MIT License - * Redistributions of files must retain the above copyright notice. - * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project - * @package cake - * @subpackage cake.cake.console.libs.templates.views - * @since CakePHP(tm) v 1.2.0.5234 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - */ -?> -<div class="<?php echo $pluralVar;?> form"> -<?php echo "<?php echo \$form->create('{$modelClass}');?>\n";?> - <fieldset> - <legend><?php echo "<?php __('".Inflector::humanize($action)." {$singularHumanName}');?>";?></legend> -<?php - echo "\t<?php\n"; - foreach ($fields as $field) { - if ($action == 'add' && $field == $primaryKey) { - continue; - } elseif (!in_array($field, array('created', 'modified', 'updated'))) { - echo "\t\techo \$form->input('{$field}');\n"; - } - } - if (!empty($associations['hasAndBelongsToMany'])) { - foreach ($associations['hasAndBelongsToMany'] as $assocName => $assocData) { - echo "\t\techo \$form->input('{$assocName}');\n"; - } - } - echo "\t?>\n"; -?> - </fieldset> -<?php - echo "<?php echo \$form->end('Submit');?>\n"; -?> -</div> -<div class="actions"> - <ul> -<?php if ($action != 'add'):?> - <li><?php echo "<?php echo \$html->link(__('Delete', true), array('action'=>'delete', \$form->value('{$modelClass}.{$primaryKey}')), null, sprintf(__('Are you sure you want to delete # %s?', true), \$form->value('{$modelClass}.{$primaryKey}'))); ?>";?></li> -<?php endif;?> - <li><?php echo "<?php echo \$html->link(__('List {$pluralHumanName}', true), array('action'=>'index'));?>";?></li> -<?php - $done = array(); - foreach ($associations as $type => $data) { - foreach ($data as $alias => $details) { - if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) { - echo "\t\t<li><?php echo \$html->link(__('List ".Inflector::humanize($details['controller'])."', true), array('controller'=> '{$details['controller']}', 'action'=>'index')); ?> </li>\n"; - echo "\t\t<li><?php echo \$html->link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller'=> '{$details['controller']}', 'action'=>'add')); ?> </li>\n"; - $done[] = $details['controller']; - } - } - } -?> - </ul> -</div> diff --git a/cake/console/libs/templates/views/home.ctp b/cake/console/libs/templates/views/home.ctp deleted file mode 100644 index 39020d488..000000000 --- a/cake/console/libs/templates/views/home.ctp +++ /dev/null @@ -1,82 +0,0 @@ -<?php -$output = "<h2>Sweet, \"".Inflector::humanize($app)."\" got Baked by CakePHP!</h2>\n"; -$output .=" -<?php -if (Configure::read() > 0): - Debugger::checkSessionKey(); -endif; -?> -<p> -<?php - if (is_writable(TMP)): - echo '<span class=\"notice success\">'; - __('Your tmp directory is writable.'); - echo '</span>'; - else: - echo '<span class=\"notice\">'; - __('Your tmp directory is NOT writable.'); - echo '</span>'; - endif; -?> -</p> -<p> -<?php - \$settings = Cache::settings(); - if (!empty(\$settings)): - echo '<span class=\"notice success\">'; - echo sprintf(__('The %s is being used for caching. To change the config edit APP/config/core.php ', true), '<em>'. \$settings['engine'] . 'Engine</em>'); - echo '</span>'; - else: - echo '<span class=\"notice\">'; - __('Your cache is NOT working. Please check the settings in APP/config/core.php'); - echo '</span>'; - endif; -?> -</p> -<p> -<?php - \$filePresent = null; - if (file_exists(CONFIGS . 'database.php')): - echo '<span class=\"notice success\">'; - __('Your database configuration file is present.'); - \$filePresent = true; - echo '</span>'; - else: - echo '<span class=\"notice\">'; - __('Your database configuration file is NOT present.'); - echo '<br/>'; - __('Rename config/database.php.default to config/database.php'); - echo '</span>'; - endif; -?> -</p> -<?php -if (!empty(\$filePresent)): - uses('model' . DS . 'connection_manager'); - \$db = ConnectionManager::getInstance(); - \$connected = \$db->getDataSource('default'); -?> -<p> -<?php - if (\$connected->isConnected()): - echo '<span class=\"notice success\">'; - __('Cake is able to connect to the database.'); - echo '</span>'; - else: - echo '<span class=\"notice\">'; - __('Cake is NOT able to connect to the database.'); - echo '</span>'; - endif; -?> -</p>\n"; -$output .= "<?php endif;?>\n"; -$output .= "<h3><?php __('Editing this Page') ?></h3>\n"; -$output .= "<p>\n"; -$output .= "<?php\n"; -$output .= "\techo sprintf(__('To change the content of this page, edit: %s\n"; -$output .= "\t\tTo change its layout, edit: %s\n"; -$output .= "\t\tYou can also add some CSS styles for your pages at: %s', true),\n"; -$output .= "\t\tAPP . 'views' . DS . 'pages' . DS . 'home.ctp.<br />', APP . 'views' . DS . 'layouts' . DS . 'default.ctp.<br />', APP . 'webroot' . DS . 'css');\n"; -$output .= "?>\n"; -$output .= "</p>\n"; -?> diff --git a/cake/console/libs/templates/views/index.ctp b/cake/console/libs/templates/views/index.ctp deleted file mode 100644 index ea864c17d..000000000 --- a/cake/console/libs/templates/views/index.ctp +++ /dev/null @@ -1,99 +0,0 @@ -<?php -/* SVN FILE: $Id$ */ -/** - * - * PHP versions 4 and 5 - * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * - * Licensed under The MIT License - * Redistributions of files must retain the above copyright notice. - * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project - * @package cake - * @subpackage cake.cake.console.libs.templates.views - * @since CakePHP(tm) v 1.2.0.5234 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - */ -?> -<div class="<?php echo $pluralVar;?> index"> -<h2><?php echo "<?php __('{$pluralHumanName}');?>";?></h2> -<p> -<?php echo "<?php -echo \$paginator->counter(array( -'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true) -)); -?>";?> -</p> -<table cellpadding="0" cellspacing="0"> -<tr> -<?php foreach ($fields as $field):?> - <th><?php echo "<?php echo \$paginator->sort('{$field}');?>";?></th> -<?php endforeach;?> - <th class="actions"><?php echo "<?php __('Actions');?>";?></th> -</tr> -<?php -echo "<?php -\$i = 0; -foreach (\${$pluralVar} as \${$singularVar}): - \$class = null; - if (\$i++ % 2 == 0) { - \$class = ' class=\"altrow\"'; - } -?>\n"; - echo "\t<tr<?php echo \$class;?>>\n"; - foreach ($fields as $field) { - $isKey = false; - if (!empty($associations['belongsTo'])) { - foreach ($associations['belongsTo'] as $alias => $details) { - if ($field === $details['foreignKey']) { - $isKey = true; - echo "\t\t<td>\n\t\t\t<?php echo \$html->link(\${$singularVar}['{$alias}']['{$details['displayField']}'], array('controller'=> '{$details['controller']}', 'action'=>'view', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?>\n\t\t</td>\n"; - break; - } - } - } - if ($isKey !== true) { - echo "\t\t<td>\n\t\t\t<?php echo \${$singularVar}['{$modelClass}']['{$field}']; ?>\n\t\t</td>\n"; - } - } - - echo "\t\t<td class=\"actions\">\n"; - echo "\t\t\t<?php echo \$html->link(__('View', true), array('action'=>'view', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n"; - echo "\t\t\t<?php echo \$html->link(__('Edit', true), array('action'=>'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n"; - echo "\t\t\t<?php echo \$html->link(__('Delete', true), array('action'=>'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), null, sprintf(__('Are you sure you want to delete # %s?', true), \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n"; - echo "\t\t</td>\n"; - echo "\t</tr>\n"; - -echo "<?php endforeach; ?>\n"; -?> -</table> -</div> -<div class="paging"> -<?php echo "\t<?php echo \$paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>\n";?> - | <?php echo "\t<?php echo \$paginator->numbers();?>\n"?> -<?php echo "\t<?php echo \$paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?>\n";?> -</div> -<div class="actions"> - <ul> - <li><?php echo "<?php echo \$html->link(__('New {$singularHumanName}', true), array('action'=>'add')); ?>";?></li> -<?php - $done = array(); - foreach ($associations as $type => $data) { - foreach ($data as $alias => $details) { - if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) { - echo "\t\t<li><?php echo \$html->link(__('List ".Inflector::humanize($details['controller'])."', true), array('controller'=> '{$details['controller']}', 'action'=>'index')); ?> </li>\n"; - echo "\t\t<li><?php echo \$html->link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller'=> '{$details['controller']}', 'action'=>'add')); ?> </li>\n"; - $done[] = $details['controller']; - } - } - } -?> - </ul> -</div> diff --git a/cake/console/libs/templates/views/view.ctp b/cake/console/libs/templates/views/view.ctp deleted file mode 100644 index 24de7d1e8..000000000 --- a/cake/console/libs/templates/views/view.ctp +++ /dev/null @@ -1,150 +0,0 @@ -<?php -/* SVN FILE: $Id$ */ -/** - * - * PHP versions 4 and 5 - * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * - * Licensed under The MIT License - * Redistributions of files must retain the above copyright notice. - * - * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project - * @package cake - * @subpackage cake.cake.console.libs.templates.views - * @since CakePHP(tm) v 1.2.0.5234 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - */ -?> -<div class="<?php echo $pluralVar;?> view"> -<h2><?php echo "<?php __('{$singularHumanName}');?>";?></h2> - <dl><?php echo "<?php \$i = 0; \$class = ' class=\"altrow\"';?>\n";?> -<?php -foreach ($fields as $field) { - $isKey = false; - if (!empty($associations['belongsTo'])) { - foreach ($associations['belongsTo'] as $alias => $details) { - if ($field === $details['foreignKey']) { - $isKey = true; - echo "\t\t<dt<?php if (\$i % 2 == 0) echo \$class;?>><?php __('".Inflector::humanize(Inflector::underscore($alias))."'); ?></dt>\n"; - echo "\t\t<dd<?php if (\$i++ % 2 == 0) echo \$class;?>>\n\t\t\t<?php echo \$html->link(\${$singularVar}['{$alias}']['{$details['displayField']}'], array('controller'=> '{$details['controller']}', 'action'=>'view', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?>\n\t\t\t \n\t\t</dd>\n"; - break; - } - } - } - if ($isKey !== true) { - echo "\t\t<dt<?php if (\$i % 2 == 0) echo \$class;?>><?php __('".Inflector::humanize($field)."'); ?></dt>\n"; - echo "\t\t<dd<?php if (\$i++ % 2 == 0) echo \$class;?>>\n\t\t\t<?php echo \${$singularVar}['{$modelClass}']['{$field}']; ?>\n\t\t\t \n\t\t</dd>\n"; - } -} -?> - </dl> -</div> -<div class="actions"> - <ul> -<?php - echo "\t\t<li><?php echo \$html->link(__('Edit {$singularHumanName}', true), array('action'=>'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> </li>\n"; - echo "\t\t<li><?php echo \$html->link(__('Delete {$singularHumanName}', true), array('action'=>'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), null, sprintf(__('Are you sure you want to delete # %s?', true), \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> </li>\n"; - echo "\t\t<li><?php echo \$html->link(__('List {$pluralHumanName}', true), array('action'=>'index')); ?> </li>\n"; - echo "\t\t<li><?php echo \$html->link(__('New {$singularHumanName}', true), array('action'=>'add')); ?> </li>\n"; - - $done = array(); - foreach ($associations as $type => $data) { - foreach ($data as $alias => $details) { - if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) { - echo "\t\t<li><?php echo \$html->link(__('List ".Inflector::humanize($details['controller'])."', true), array('controller'=> '{$details['controller']}', 'action'=>'index')); ?> </li>\n"; - echo "\t\t<li><?php echo \$html->link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller'=> '{$details['controller']}', 'action'=>'add')); ?> </li>\n"; - $done[] = $details['controller']; - } - } - } -?> - </ul> -</div> -<?php -if (!empty($associations['hasOne'])) : - foreach ($associations['hasOne'] as $alias => $details): ?> - <div class="related"> - <h3><?php echo "<?php __('Related ".Inflector::humanize($details['controller'])."');?>";?></h3> - <?php echo "<?php if (!empty(\${$singularVar}['{$alias}'])):?>\n";?> - <dl><?php echo "\t<?php \$i = 0; \$class = ' class=\"altrow\"';?>\n";?> - <?php - foreach ($details['fields'] as $field) { - echo "\t\t<dt<?php if (\$i % 2 == 0) echo \$class;?>><?php __('".Inflector::humanize($field)."');?></dt>\n"; - echo "\t\t<dd<?php if (\$i++ % 2 == 0) echo \$class;?>>\n\t<?php echo \${$singularVar}['{$alias}']['{$field}'];?>\n </dd>\n"; - } - ?> - </dl> - <?php echo "<?php endif; ?>\n";?> - <div class="actions"> - <ul> - <li><?php echo "<?php echo \$html->link(__('Edit ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller'=> '{$details['controller']}', 'action'=>'edit', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?></li>\n";?> - </ul> - </div> - </div> - <?php - endforeach; -endif; -if (empty($associations['hasMany'])) { - $associations['hasMany'] = array(); -} -if (empty($associations['hasAndBelongsToMany'])) { - $associations['hasAndBelongsToMany'] = array(); -} -$relations = array_merge($associations['hasMany'], $associations['hasAndBelongsToMany']); -$i = 0; -foreach ($relations as $alias => $details): - $otherSingularVar = Inflector::variable($alias); - $otherPluralHumanName = Inflector::humanize($details['controller']); - ?> -<div class="related"> - <h3><?php echo "<?php __('Related {$otherPluralHumanName}');?>";?></h3> - <?php echo "<?php if (!empty(\${$singularVar}['{$alias}'])):?>\n";?> - <table cellpadding = "0" cellspacing = "0"> - <tr> -<?php - foreach ($details['fields'] as $field) { - echo "\t\t<th><?php __('".Inflector::humanize($field)."'); ?></th>\n"; - } -?> - <th class="actions"><?php echo "<?php __('Actions');?>";?></th> - </tr> -<?php -echo "\t<?php - \$i = 0; - foreach (\${$singularVar}['{$alias}'] as \${$otherSingularVar}): - \$class = null; - if (\$i++ % 2 == 0) { - \$class = ' class=\"altrow\"'; - } - ?>\n"; - echo "\t\t<tr<?php echo \$class;?>>\n"; - - foreach ($details['fields'] as $field) { - echo "\t\t\t<td><?php echo \${$otherSingularVar}['{$field}'];?></td>\n"; - } - - echo "\t\t\t<td class=\"actions\">\n"; - echo "\t\t\t\t<?php echo \$html->link(__('View', true), array('controller'=> '{$details['controller']}', 'action'=>'view', \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n"; - echo "\t\t\t\t<?php echo \$html->link(__('Edit', true), array('controller'=> '{$details['controller']}', 'action'=>'edit', \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n"; - echo "\t\t\t\t<?php echo \$html->link(__('Delete', true), array('controller'=> '{$details['controller']}', 'action'=>'delete', \${$otherSingularVar}['{$details['primaryKey']}']), null, sprintf(__('Are you sure you want to delete # %s?', true), \${$otherSingularVar}['{$details['primaryKey']}'])); ?>\n"; - echo "\t\t\t</td>\n"; - echo "\t\t</tr>\n"; - -echo "\t<?php endforeach; ?>\n"; -?> - </table> -<?php echo "<?php endif; ?>\n\n";?> - <div class="actions"> - <ul> - <li><?php echo "<?php echo \$html->link(__('New ".Inflector::humanize(Inflector::underscore($alias))."', true), array('controller'=> '{$details['controller']}', 'action'=>'add'));?>";?> </li> - </ul> - </div> -</div> -<?php endforeach;?> \ No newline at end of file diff --git a/cake/tests/test_app/vendors/shells/templates/objects/test_object.ctp b/cake/tests/test_app/vendors/shells/templates/objects/test_object.ctp deleted file mode 100644 index c524b8231..000000000 --- a/cake/tests/test_app/vendors/shells/templates/objects/test_object.ctp +++ /dev/null @@ -1,2 +0,0 @@ -I got rendered -<?php echo $test; ?> \ No newline at end of file From 544188197d10eb7949745f5e507e648c4c5f5388 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 1 Jul 2009 00:50:38 -0400 Subject: [PATCH 0277/2083] Fixing use of TemplateTask in other Tasks. Updating bake.group. --- cake/console/libs/tasks/controller.php | 4 ++-- cake/console/libs/tasks/fixture.php | 2 +- cake/console/libs/tasks/model.php | 2 +- cake/console/libs/tasks/template.php | 4 ++-- cake/console/libs/tasks/test.php | 2 +- cake/tests/groups/bake.group.php | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 1b499ff26..db40bdcf5 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -287,7 +287,7 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) { $this->Template->set(compact('admin', 'controllerPath', 'pluralName', 'singularName', 'singularHumanName', 'pluralHumanName', 'modelObj', 'wannaUseSession', 'currentModelName')); - $actions = $this->Template->generate('objects', 'controller_actions'); + $actions = $this->Template->generate('actions', 'controller_actions'); return $actions; } @@ -308,7 +308,7 @@ function bake($controllerName, $actions = '', $helpers = null, $components = nul $this->Template->set('plugin', Inflector::camelize($this->plugin)); $this->Template->set(compact('controllerName', 'actions', 'helpers', 'components', 'isScaffold')); - $contents = $this->Template->generate('objects', 'controller'); + $contents = $this->Template->generate('classes', 'controller'); $path = $this->path; if (isset($this->plugin)) { diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 6acb4b434..464dfd0dd 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -220,7 +220,7 @@ function generateFixtureFile($model, $otherVars) { $this->Template->set('model', $model); $this->Template->set($vars); - $content = $this->Template->generate('objects', 'fixture'); + $content = $this->Template->generate('classes', 'fixture'); $this->out("\nBaking test fixture for $model..."); $this->createFile($path . $filename, $content); diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 6906aba8c..5b18e7675 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -705,7 +705,7 @@ function bake($name, $associations = array(), $validate = array(), $primaryKey = $this->Template->set(compact('name', 'useDbConfig', 'associations', 'validate', 'primaryKey', 'useTable')); $this->Template->set('plugin', Inflector::camelize($this->plugin)); - $out = $this->Template->generate('objects', 'model'); + $out = $this->Template->generate('classes', 'model'); $path = $this->path; if (isset($this->plugin)) { diff --git a/cake/console/libs/tasks/template.php b/cake/console/libs/tasks/template.php index 00a611e66..105c58767 100644 --- a/cake/console/libs/tasks/template.php +++ b/cake/console/libs/tasks/template.php @@ -175,8 +175,8 @@ function _findTemplate($path, $directory, $filename) { return $templatePath; } } - $this->err(sprintf(__('Could not find template for %s, exiting.'), $filename)); - $this->_stop(); + $this->err(sprintf(__('Could not find template for %s', true), $filename)); + return false; } } \ No newline at end of file diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 0e05f4220..6a7b6e732 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -154,7 +154,7 @@ function bake($type, $className) { $this->Template->set('fixtures', $this->_fixtures); $this->Template->set('plugin', $plugin); $this->Template->set(compact('className', 'methods', 'type', 'fullClassName', 'mock', 'construction')); - $out = $this->Template->generate('objects', 'test'); + $out = $this->Template->generate('classes', 'test'); $filename = $this->testCaseFileName($type, $className); $made = $this->createFile($filename, $out); diff --git a/cake/tests/groups/bake.group.php b/cake/tests/groups/bake.group.php index 35fedec36..16d063300 100644 --- a/cake/tests/groups/bake.group.php +++ b/cake/tests/groups/bake.group.php @@ -1,4 +1,4 @@ -<?phpÃ¥ +<?php /** * Bake Group test file * From 4cb70580a20a179038f70889a65dac6574a45100 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 1 Jul 2009 23:21:41 -0400 Subject: [PATCH 0278/2083] Expanding test cases for ViewTask to be more specific and finer tests for admin_ methods. --- cake/console/libs/tasks/view.php | 2 +- .../cases/console/libs/tasks/view.test.php | 87 ++++++++++++++++--- 2 files changed, 77 insertions(+), 12 deletions(-) diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index e9ff8e9c0..40a81ea69 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -363,7 +363,7 @@ function getContent($template = null, $vars = null) { $adminRoute = Configure::read('Routing.admin'); if (!empty($adminRoute) && strpos($template, $adminRoute) !== false) { - $template = str_replace($adminRoute.'_', '', $template); + $template = str_replace($adminRoute . '_', '', $template); } if (in_array($template, array('add', 'edit'))) { $action = $template; diff --git a/cake/tests/cases/console/libs/tasks/view.test.php b/cake/tests/cases/console/libs/tasks/view.test.php index cea2a6838..1af29bd15 100644 --- a/cake/tests/cases/console/libs/tasks/view.test.php +++ b/cake/tests/cases/console/libs/tasks/view.test.php @@ -152,6 +152,37 @@ function testGetContent() { $this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'body\'\]/', $result); } +/** + * test getContent() using an admin_prefixed action. + * + * @return void + **/ + function testGetContentWithAdminAction() { + Configure::write('Routing.admin', 'admin'); + $vars = array( + 'modelClass' => 'TestViewModel', + 'schema' => array(), + 'primaryKey' => 'id', + 'displayField' => 'name', + 'singularVar' => 'testViewModel', + 'pluralVar' => 'testViewModels', + 'singularHumanName' => 'Test View Model', + 'pluralHumanName' => 'Test View Models', + 'fields' => array('id', 'name', 'body'), + 'associations' => array() + ); + $result = $this->Task->getContent('admin_view', $vars); + + $this->assertPattern('/Delete Test View Model/', $result); + $this->assertPattern('/Edit Test View Model/', $result); + $this->assertPattern('/List Test View Models/', $result); + $this->assertPattern('/New Test View Model/', $result); + + $this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'id\'\]/', $result); + $this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'name\'\]/', $result); + $this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'body\'\]/', $result); + } + /** * test Bake method * @@ -201,9 +232,18 @@ function testBakeActions() { $this->Task->controllerName = 'ViewTaskComments'; $this->Task->controllerPath = 'view_task_comments'; - $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'view.ctp', '*')); - $this->Task->expectAt(1, 'createFile', array(TMP . 'view_task_comments' . DS . 'edit.ctp', '*')); - $this->Task->expectAt(2, 'createFile', array(TMP . 'view_task_comments' . DS . 'index.ctp', '*')); + $this->Task->expectAt(0, 'createFile', array( + TMP . 'view_task_comments' . DS . 'view.ctp', + new PatternExpectation('/ViewTaskComments/') + )); + $this->Task->expectAt(1, 'createFile', array( + TMP . 'view_task_comments' . DS . 'edit.ctp', + new PatternExpectation('/Edit ViewTaskComment/') + )); + $this->Task->expectAt(2, 'createFile', array( + TMP . 'view_task_comments' . DS . 'index.ctp', + new PatternExpectation('/ViewTaskComment/') + )); $this->Task->bakeActions(array('view', 'edit', 'index'), array()); } @@ -290,10 +330,22 @@ function testExecuteInteractive() { $this->Task->setReturnValueAt(2, 'in', 'n'); $this->Task->expectCallCount('createFile', 4); - $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'index.ctp', '*')); - $this->Task->expectAt(1, 'createFile', array(TMP . 'view_task_comments' . DS . 'view.ctp', '*')); - $this->Task->expectAt(2, 'createFile', array(TMP . 'view_task_comments' . DS . 'add.ctp', '*')); - $this->Task->expectAt(3, 'createFile', array(TMP . 'view_task_comments' . DS . 'edit.ctp', '*')); + $this->Task->expectAt(0, 'createFile', array( + TMP . 'view_task_comments' . DS . 'index.ctp', + new PatternExpectation('/ViewTaskComment/') + )); + $this->Task->expectAt(1, 'createFile', array( + TMP . 'view_task_comments' . DS . 'view.ctp', + new PatternExpectation('/ViewTaskComment/') + )); + $this->Task->expectAt(2, 'createFile', array( + TMP . 'view_task_comments' . DS . 'add.ctp', + new PatternExpectation('/Add ViewTaskComment/') + )); + $this->Task->expectAt(3, 'createFile', array( + TMP . 'view_task_comments' . DS . 'edit.ctp', + new PatternExpectation('/Edit ViewTaskComment/') + )); $this->Task->execute(); } @@ -304,6 +356,7 @@ function testExecuteInteractive() { * @return void **/ function testExecuteInteractiveWithAdmin() { + Configure::write('Routing.admin', 'admin'); $this->Task->connection = 'test_suite'; $this->Task->args = array(); @@ -314,10 +367,22 @@ function testExecuteInteractiveWithAdmin() { $this->Task->setReturnValueAt(2, 'in', 'y'); $this->Task->expectCallCount('createFile', 4); - $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'admin_index.ctp', '*')); - $this->Task->expectAt(1, 'createFile', array(TMP . 'view_task_comments' . DS . 'admin_view.ctp', '*')); - $this->Task->expectAt(2, 'createFile', array(TMP . 'view_task_comments' . DS . 'admin_add.ctp', '*')); - $this->Task->expectAt(3, 'createFile', array(TMP . 'view_task_comments' . DS . 'admin_edit.ctp', '*')); + $this->Task->expectAt(0, 'createFile', array( + TMP . 'view_task_comments' . DS . 'admin_index.ctp', + new PatternExpectation('/ViewTaskComment/') + )); + $this->Task->expectAt(1, 'createFile', array( + TMP . 'view_task_comments' . DS . 'admin_view.ctp', + new PatternExpectation('/ViewTaskComment/') + )); + $this->Task->expectAt(2, 'createFile', array( + TMP . 'view_task_comments' . DS . 'admin_add.ctp', + new PatternExpectation('/Add ViewTaskComment/') + )); + $this->Task->expectAt(3, 'createFile', array( + TMP . 'view_task_comments' . DS . 'admin_edit.ctp', + new PatternExpectation('/Edit ViewTaskComment/') + )); $this->Task->execute(); } From 659414f04f003e27e488fd022c5588e46cd78801 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 1 Jul 2009 23:48:51 -0400 Subject: [PATCH 0279/2083] Fixing template location in Project task. --- cake/console/libs/tasks/project.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php index 2d6d64380..7cc635cf5 100644 --- a/cake/console/libs/tasks/project.php +++ b/cake/console/libs/tasks/project.php @@ -180,7 +180,7 @@ function bake($path, $skel = null, $skip = array('empty')) { function createHome($dir) { $app = basename($dir); $path = $dir . 'views' . DS . 'pages' . DS; - include(CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'console'.DS.'libs'.DS.'templates'.DS.'views'.DS.'home.ctp'); + include(CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'console'.DS.'libs'.DS.'templates'.DS.'default'.DS.'views'.DS.'home.ctp'); return $this->createFile($path.'home.ctp', $output); } /** From 1a7965fde04befead3c8e3cb7f520a2355084ab7 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 1 Jul 2009 23:49:50 -0400 Subject: [PATCH 0280/2083] Adding output to getThemePath() Adding param setting to getThemePath() as well so template choice is saved between file generations in the same session. Test cases added. --- cake/console/libs/tasks/template.php | 10 +++++++++- cake/tests/cases/console/libs/tasks/template.test.php | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cake/console/libs/tasks/template.php b/cake/console/libs/tasks/template.php index 105c58767..4da677c00 100644 --- a/cake/console/libs/tasks/template.php +++ b/cake/console/libs/tasks/template.php @@ -143,6 +143,12 @@ function getThemePath() { if (!empty($this->params['theme']) && isset($this->templatePaths[$this->params['theme']])) { return $this->templatePaths[$this->params['theme']]; } + + $this->hr(); + $this->out(__('You have more than one set of templates installed.', true)); + $this->out(__('Please choose the template set you wish to use:', true)); + $this->hr(); + $i = 1; $indexedPaths = array(); foreach ($this->templatePaths as $key => $path) { @@ -150,7 +156,9 @@ function getThemePath() { $indexedPaths[$i] = $path; $i++; } - $index = $this->in(__('Which bake theme would you like to use?', true), range(1, $i), 1); + $index = $this->in(__('Which bake theme would you like to use?', true), range(1, $i - 1), 1); + $themeNames = array_keys($this->templatePaths); + $this->Dispatch->params['theme'] = $themeNames[$index - 1]; return $indexedPaths[$index]; } diff --git a/cake/tests/cases/console/libs/tasks/template.test.php b/cake/tests/cases/console/libs/tasks/template.test.php index fbbf605ed..cfd139870 100644 --- a/cake/tests/cases/console/libs/tasks/template.test.php +++ b/cake/tests/cases/console/libs/tasks/template.test.php @@ -128,6 +128,7 @@ function testGetThemePath() { $this->Task->setReturnValueAt(0, 'in', '1'); $result = $this->Task->getThemePath(); $this->assertEqual($result, $defaultTheme); + $this->assertEqual($this->Dispatch->params['theme'], 'default'); } /** From 3c76f173f796a3a705d644a4925a99fa16f2d65d Mon Sep 17 00:00:00 2001 From: gwoo <gwoo@cakephp.org> Date: Thu, 2 Jul 2009 10:24:42 -0700 Subject: [PATCH 0281/2083] removing deprecated model methods --- cake/libs/model/model.php | 49 --------------------- cake/tests/cases/libs/model/model.test.php | 50 ---------------------- 2 files changed, 99 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 64c36efc9..a57235137 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -2865,55 +2865,6 @@ function __sleep() { */ function __wakeup() { } -/** - * @deprecated - * @see Model::find('all') - */ - function findAll($conditions = null, $fields = null, $order = null, $limit = null, $page = 1, $recursive = null) { - trigger_error( - __('(Model::findAll) Deprecated, use Model::find("all")', true), - E_USER_WARNING - ); - return $this->find('all', compact('conditions', 'fields', 'order', 'limit', 'page', 'recursive')); - } -/** - * @deprecated - * @see Model::find('count') - */ - function findCount($conditions = null, $recursive = 0) { - trigger_error( - __('(Model::findCount) Deprecated, use Model::find("count")', true), - E_USER_WARNING - ); - return $this->find('count', compact('conditions', 'recursive')); - } -/** - * @deprecated - * @see Model::find('threaded') - */ - function findAllThreaded($conditions = null, $fields = null, $order = null) { - trigger_error( - __('(Model::findAllThreaded) Deprecated, use Model::find("threaded")', true), - E_USER_WARNING - ); - return $this->find('threaded', compact('conditions', 'fields', 'order')); - } -/** - * @deprecated - * @see Model::find('neighbors') - */ - function findNeighbours($conditions = null, $field, $value) { - trigger_error( - __('(Model::findNeighbours) Deprecated, use Model::find("neighbors")', true), - E_USER_WARNING - ); - $query = compact('conditions', 'field', 'value'); - $query['fields'] = $field; - if (is_array($field)) { - $query['field'] = $field[0]; - } - return $this->find('neighbors', $query); - } } if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) { Overloadable::overload('Model'); diff --git a/cake/tests/cases/libs/model/model.test.php b/cake/tests/cases/libs/model/model.test.php index a4b75847b..ae2d7f2b6 100644 --- a/cake/tests/cases/libs/model/model.test.php +++ b/cake/tests/cases/libs/model/model.test.php @@ -8217,56 +8217,6 @@ function testFindNeighbors() { $expected = array('prev' => $two, 'next' => null); $this->assertEqual($result, $expected); } -/** - * test findNeighbours() method - * - * @return void - * @access public - */ - function testFindNeighboursLegacy() { - $this->loadFixtures('User', 'Article'); - $TestModel =& new Article(); - - $result = $TestModel->findNeighbours(null, 'Article.id', '2'); - $expected = array( - 'prev' => array( - 'Article' => array( - 'id' => 1 - )), - 'next' => array( - 'Article' => array( - 'id' => 3 - ))); - $this->assertEqual($result, $expected); - - $result = $TestModel->findNeighbours(null, 'Article.id', '3'); - $expected = array( - 'prev' => array( - 'Article' => array( - 'id' => 2 - )), - 'next' => array() - ); - $this->assertEqual($result, $expected); - - $result = $TestModel->findNeighbours( - array('User.id' => 1), - array('Article.id', 'Article.title'), - 2 - ); - $expected = array( - 'prev' => array( - 'Article' => array( - 'id' => 1, - 'title' => 'First Article' - )), - 'next' => array( - 'Article' => array( - 'id' => 3, - 'title' => 'Third Article' - ))); - $this->assertEqual($result, $expected); - } /** * testFindCombinedRelations method * From dc981840860d3fa706c2f4dea4bd8a101b4953e6 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 6 Jul 2009 23:11:57 -0400 Subject: [PATCH 0282/2083] Updating Shell and Bake tasks to use App::path() instead of Configure::read(). --- cake/console/libs/shell.php | 2 +- cake/console/libs/tasks/fixture.php | 2 +- cake/console/libs/tasks/template.php | 1 + cake/tests/cases/console/libs/tasks/controller.test.php | 3 ++- cake/tests/cases/console/libs/tasks/db_config.test.php | 3 +-- cake/tests/cases/console/libs/tasks/fixture.test.php | 2 +- cake/tests/cases/console/libs/tasks/model.test.php | 2 +- cake/tests/cases/console/libs/tasks/plugin.test.php | 2 +- cake/tests/cases/console/libs/tasks/project.test.php | 2 +- cake/tests/cases/console/libs/tasks/template.test.php | 2 +- cake/tests/cases/console/libs/tasks/test.test.php | 2 +- cake/tests/cases/console/libs/tasks/view.test.php | 2 +- 12 files changed, 13 insertions(+), 12 deletions(-) diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php index 1084331a7..9c22a8468 100644 --- a/cake/console/libs/shell.php +++ b/cake/console/libs/shell.php @@ -589,7 +589,7 @@ function _pluralHumanName($name) { * @return string $path path to the correct plugin. **/ function _pluginPath($pluginName) { - $pluginPaths = Configure::read('pluginPaths'); + $pluginPaths = App::path('plugins'); $pluginDirName = Inflector::underscore($pluginName); foreach ($pluginPaths as $path) { if (is_dir($path . $pluginDirName)) { diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 464dfd0dd..8a67edb4a 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -65,7 +65,7 @@ function __construct(&$dispatch) { parent::__construct($dispatch); $this->path = $this->params['working'] . DS . 'tests' . DS . 'fixtures' . DS; if (!class_exists('CakeSchema')) { - App::import('Model', 'Schema'); + App::import('Model', 'CakeSchema'); } } /** diff --git a/cake/console/libs/tasks/template.php b/cake/console/libs/tasks/template.php index 4da677c00..ac01e9e30 100644 --- a/cake/console/libs/tasks/template.php +++ b/cake/console/libs/tasks/template.php @@ -184,6 +184,7 @@ function _findTemplate($path, $directory, $filename) { } } $this->err(sprintf(__('Could not find template for %s', true), $filename)); + $this->_stop(); return false; } diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 897043e05..204cccaa5 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -99,8 +99,9 @@ function startTest() { $this->Dispatcher =& new TestControllerTaskMockShellDispatcher(); $this->Task =& new MockControllerTask($this->Dispatcher); $this->Task->Dispatch =& new $this->Dispatcher; - $this->Task->Dispatch->shellPaths = Configure::read('shellPaths'); + $this->Task->Dispatch->shellPaths = App::path('shells'); $this->Task->Template =& new TemplateTask($this->Task->Dispatch); + $this->Task->Template->params['theme'] = 'default'; $this->Task->Model =& new ControllerMockModelTask($this->Task->Dispatch); $this->Task->Project =& new ControllerMockProjectTask($this->Task->Dispatch); } diff --git a/cake/tests/cases/console/libs/tasks/db_config.test.php b/cake/tests/cases/console/libs/tasks/db_config.test.php index 27a4f820e..45dde61a7 100644 --- a/cake/tests/cases/console/libs/tasks/db_config.test.php +++ b/cake/tests/cases/console/libs/tasks/db_config.test.php @@ -85,8 +85,7 @@ function startTest() { $this->Dispatcher =& new TestDbConfigTaskMockShellDispatcher(); $this->Task =& new MockDbConfigTask($this->Dispatcher); $this->Task->Dispatch =& new $this->Dispatcher; - $this->Task->Dispatch->shellPaths = Configure::read('shellPaths'); - //$this->Task->Template =& new TemplateTask($this->Task->Dispatch); + $this->Task->Dispatch->shellPaths = App::path('shells'); $this->Task->params['working'] = rtrim(APP, '/'); $this->Task->databaseClassName = 'TEST_DATABASE_CONFIG'; diff --git a/cake/tests/cases/console/libs/tasks/fixture.test.php b/cake/tests/cases/console/libs/tasks/fixture.test.php index 6f5b3cdf9..9f4a540a9 100644 --- a/cake/tests/cases/console/libs/tasks/fixture.test.php +++ b/cake/tests/cases/console/libs/tasks/fixture.test.php @@ -74,7 +74,7 @@ function startTest() { $this->Task->Model =& new MockFixtureModelTask(); $this->Task->Dispatch = new $this->Dispatcher; $this->Task->Template =& new TemplateTask($this->Task->Dispatch); - $this->Task->Dispatch->shellPaths = Configure::read('shellPaths'); + $this->Task->Dispatch->shellPaths = App::path('shells'); $this->Task->Template->initialize(); } /** diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index 07182085a..abf1b05a9 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -83,7 +83,7 @@ function startTest() { $this->Dispatcher =& new TestModelTaskMockShellDispatcher(); $this->Task =& new MockModelTask($this->Dispatcher); $this->Task->Dispatch =& new $this->Dispatcher; - $this->Task->Dispatch->shellPaths = Configure::read('shellPaths'); + $this->Task->Dispatch->shellPaths = App::path('shells'); $this->Task->Template =& new TemplateTask($this->Task->Dispatch); $this->Task->Fixture =& new MockModelTaskFixtureTask(); $this->Task->Test =& new MockModelTaskFixtureTask(); diff --git a/cake/tests/cases/console/libs/tasks/plugin.test.php b/cake/tests/cases/console/libs/tasks/plugin.test.php index 441aac2b5..b82c805b8 100644 --- a/cake/tests/cases/console/libs/tasks/plugin.test.php +++ b/cake/tests/cases/console/libs/tasks/plugin.test.php @@ -66,7 +66,7 @@ class PluginTaskTest extends CakeTestCase { */ function startTest() { $this->Dispatcher =& new TestPluginTaskMockShellDispatcher(); - $this->Dispatcher->shellPaths = Configure::read('shellPaths'); + $this->Dispatcher->shellPaths = App::path('shells'); $this->Task =& new MockPluginTask($this->Dispatcher); $this->Task->Dispatch =& $this->Dispatcher; $this->Task->path = TMP . 'tests' . DS; diff --git a/cake/tests/cases/console/libs/tasks/project.test.php b/cake/tests/cases/console/libs/tasks/project.test.php index 41e4a3d9e..a78f97659 100644 --- a/cake/tests/cases/console/libs/tasks/project.test.php +++ b/cake/tests/cases/console/libs/tasks/project.test.php @@ -62,7 +62,7 @@ class ProjectTaskTest extends CakeTestCase { */ function startTest() { $this->Dispatcher =& new TestProjectTaskMockShellDispatcher(); - $this->Dispatcher->shellPaths = Configure::read('shellPaths'); + $this->Dispatcher->shellPaths = App::path('shells'); $this->Task =& new MockProjectTask($this->Dispatcher); $this->Task->Dispatch =& $this->Dispatcher; $this->Task->path = TMP . 'tests' . DS; diff --git a/cake/tests/cases/console/libs/tasks/template.test.php b/cake/tests/cases/console/libs/tasks/template.test.php index cfd139870..fbb6a439c 100644 --- a/cake/tests/cases/console/libs/tasks/template.test.php +++ b/cake/tests/cases/console/libs/tasks/template.test.php @@ -62,7 +62,7 @@ function startTest() { $this->Dispatcher =& new TestTemplateTaskMockShellDispatcher(); $this->Task =& new MockTemplateTask($this->Dispatcher); $this->Task->Dispatch = new $this->Dispatcher; - $this->Task->Dispatch->shellPaths = Configure::read('shellPaths'); + $this->Task->Dispatch->shellPaths = App::path('shells'); } /** diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index b69f98697..8b695329d 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -133,7 +133,7 @@ class TestTaskTest extends CakeTestCase { */ function startTest() { $this->Dispatcher =& new TestTestTaskMockShellDispatcher(); - $this->Dispatcher->shellPaths = Configure::read('shellPaths'); + $this->Dispatcher->shellPaths = App::path('shells'); $this->Task =& new MockTestTask($this->Dispatcher); $this->Task->Dispatch =& $this->Dispatcher; $this->Task->Template =& new TemplateTask($this->Dispatcher); diff --git a/cake/tests/cases/console/libs/tasks/view.test.php b/cake/tests/cases/console/libs/tasks/view.test.php index 1af29bd15..22769075b 100644 --- a/cake/tests/cases/console/libs/tasks/view.test.php +++ b/cake/tests/cases/console/libs/tasks/view.test.php @@ -103,7 +103,7 @@ class ViewTaskTest extends CakeTestCase { */ function startTest() { $this->Dispatcher =& new TestViewTaskMockShellDispatcher(); - $this->Dispatcher->shellPaths = Configure::read('shellPaths'); + $this->Dispatcher->shellPaths = App::path('shells'); $this->Task =& new MockViewTask($this->Dispatcher); $this->Task->Dispatch =& $this->Dispatcher; $this->Task->Template =& new TemplateTask($this->Dispatcher); From d671056044ae65b713625c578a99a565867f110d Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 8 Jul 2009 09:10:18 -0400 Subject: [PATCH 0283/2083] Adding displayField detection and interaction to ModelTask. Test Cases added. --- cake/console/libs/tasks/model.php | 27 ++++++++++++++++--- .../cases/console/libs/tasks/model.test.php | 21 +++++++++++++++ 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 1725b077a..ea507ba6a 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -198,6 +198,10 @@ function __interactive() { $primaryKey = $this->findPrimaryKey($fields); } } + $displayField = $tempModel->hasField(array('name', 'title')); + if (!$displayField) { + $displayField = $this->findDisplayField($tempModel->schema()); + } $prompt = __("Would you like to supply validation criteria \nfor the fields in your model?", true); $wannaDoValidation = $this->in($prompt, array('y','n'), 'y'); @@ -285,13 +289,28 @@ function findPrimaryKey($fields) { } return $this->in(__('What is the primaryKey?', true), null, $name); } - +/** + * interact with the user to find the displayField value for a model. + * + * @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); + $continue = $this->in($prompt, array('y', 'n')); + if (strtolower($continue) == 'n') { + return false; + } + $prompt = __('Choose a field from the options above:', true); + $choice = $this->inOptions($fieldNames, $prompt); + return $fieldNames[$choice]; + } /** * Handles Generation and user interaction for creating validation. * - * @param object $model - * @param boolean $interactive - * @return array $validate + * @param object $model Model to have validations generated for. + * @return array $validate Array of user selected validations. * @access public */ function doValidation(&$model) { diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index abf1b05a9..f7e65c673 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -307,6 +307,26 @@ function testFindPrimaryKey() { $this->assertEqual($result, $expected); } +/** + * test finding Display field + * + * @return void + **/ + function testFindDisplayField() { + $fields = array('id' => array(), 'tagname' => array(), 'body' => array(), + 'created' => array(), 'modified' => array()); + + $this->Task->setReturnValue('in', 'n'); + $this->Task->setReturnValueAt(0, 'in', 'n'); + $result = $this->Task->findDisplayField($fields); + $this->assertFalse($result); + + $this->Task->setReturnValueAt(1, 'in', 'y'); + $this->Task->setReturnValueAt(2, 'in', 2); + $result = $this->Task->findDisplayField($fields); + $this->assertEqual($result, 'tagname'); + } + /** * test that belongsTo generation works. * @@ -680,6 +700,7 @@ function testExecuteIntoInteractive() { $this->Task->path = '/my/path/'; $this->Task->setReturnValueAt(0, 'in', '1'); //choose article + // $this->Task->setReturnValueAt(2, 'in', 'n'); //no validation $this->Task->setReturnValueAt(1, 'in', 'n'); //no validation $this->Task->setReturnValueAt(2, 'in', 'y'); //yes to associations $this->Task->setReturnValueAt(3, 'in', 'y'); //yes to comment relation From 41eecdaa91ee006d9f8086f14097f63d10533091 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 8 Jul 2009 22:06:42 -0400 Subject: [PATCH 0284/2083] Adding the ability to set $displayField from bake. Refactoring ModelTask::bake() Fixes #4438. --- cake/console/libs/tasks/model.php | 37 ++++++++++--------- .../libs/templates/default/classes/model.ctp | 3 ++ .../cases/console/libs/tasks/model.test.php | 7 ++-- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index ea507ba6a..ab4b73147 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -245,7 +245,9 @@ function __interactive() { $looksGood = $this->in(__('Look okay?', true), array('y','n'), 'y'); if (strtolower($looksGood) == 'y') { - if ($this->bake($currentModelName, $associations, $validate, $primaryKey, $useTable, $this->connection)) { + $vars = compact('associations', 'validate', 'primaryKey', 'useTable', 'displayField'); + $vars['useDbConfig'] = $this->connection; + if ($this->bake($currentModelName, $vars)) { if ($this->_checkUnitTest()) { $this->bakeFixture($currentModelName, $useTable); $this->bakeTest($currentModelName, $useTable, $associations); @@ -702,27 +704,28 @@ function _generatePossibleKeys() { * Assembles and writes a Model file. * * @param mixed $name Model name or object - * @param mixed $associations if array and $name is not an object assume Model associations array otherwise boolean interactive - * @param array $validate Validation rules - * @param string $primaryKey Primary key to use - * @param string $useTable Table to use - * @param string $useDbConfig Database configuration setting to use + * @param mixed $data if array and $name is not an object assume bake data, otherwise boolean. * @access private */ - function bake($name, $associations = array(), $validate = array(), $primaryKey = 'id', $useTable = null, $useDbConfig = 'default') { - + function bake($name, $data = array()) { if (is_object($name)) { - if (!is_array($associations)) { - $associations = $this->doAssociations($name, $associations); - $validate = $this->doValidation($name); - } - $primaryKey = $name->primaryKey; - $useTable = $name->table; - $useDbConfig = $name->useDbConfig; - $name = $name->name; + if ($data == false) { + $data = $associations = array(); + $data['associations'] = $this->doAssociations($name, $associations); + $data['validate'] = $this->doValidation($name); + } + $data['primaryKey'] = $name->primaryKey; + $data['useTable'] = $name->table; + $data['useDbConfig'] = $name->useDbConfig; + $data['name'] = $name = $name->name; + } else { + $data['name'] = $name; } + $defaults = array('associations' => array(), 'validate' => array(), 'primaryKey' => 'id', + 'useTable' => null, 'useDbConfig' => 'default', 'displayField' => null); + $data = array_merge($defaults, $data); - $this->Template->set(compact('name', 'useDbConfig', 'associations', 'validate', 'primaryKey', 'useTable')); + $this->Template->set($data); $this->Template->set('plugin', Inflector::camelize($this->plugin)); $out = $this->Template->generate('classes', 'model'); diff --git a/cake/console/libs/templates/default/classes/model.ctp b/cake/console/libs/templates/default/classes/model.ctp index 849be35b3..2e131b809 100644 --- a/cake/console/libs/templates/default/classes/model.ctp +++ b/cake/console/libs/templates/default/classes/model.ctp @@ -33,6 +33,9 @@ endif; if ($primaryKey !== 'id'): ?> var $primaryKey = '<?php echo $primaryKey; ?>'; <?php endif; +if ($displayField): ?> + var $displayField = '<?php echo $displayField; ?>'; +<?php endif; if (!empty($validate)): echo "\tvar \$validate = array(\n"; diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index f7e65c673..51bcf5424 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -564,7 +564,7 @@ function testBakeValidation() { 'time' => 'time' ) ); - $result = $this->Task->bake('Article', array(), $validate); + $result = $this->Task->bake('Article', compact('validate')); $this->assertPattern('/class Article extends AppModel \{/', $result); $this->assertPattern('/\$name \= \'Article\'/', $result); $this->assertPattern('/\$validate \= array\(/', $result); @@ -615,7 +615,7 @@ function testBakeRelations() { ), ) ); - $result = $this->Task->bake('Article', $associations, array()); + $result = $this->Task->bake('Article', compact('associations')); $this->assertPattern('/\$hasAndBelongsToMany \= array\(/', $result); $this->assertPattern('/\$hasMany \= array\(/', $result); $this->assertPattern('/\$belongsTo \= array\(/', $result); @@ -642,7 +642,7 @@ function testBakeWithPlugin() { $path = APP . 'plugins' . DS . 'controller_test' . DS . 'models' . DS . 'article.php'; $this->Task->expectAt(1, 'createFile', array( - $path, new PatternExpectation('/Article extends ControllerTestAppModel/'))); + $path, new PatternExpectation('/Article extends ControllerTestAppModel/'))); $this->Task->bake('Article', array(), array()); } @@ -700,7 +700,6 @@ function testExecuteIntoInteractive() { $this->Task->path = '/my/path/'; $this->Task->setReturnValueAt(0, 'in', '1'); //choose article - // $this->Task->setReturnValueAt(2, 'in', 'n'); //no validation $this->Task->setReturnValueAt(1, 'in', 'n'); //no validation $this->Task->setReturnValueAt(2, 'in', 'y'); //yes to associations $this->Task->setReturnValueAt(3, 'in', 'y'); //yes to comment relation From 9bbb33ef2f9dd247b92256cda866c882abbe2e1d Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 8 Jul 2009 22:25:27 -0400 Subject: [PATCH 0285/2083] Fixing Configure::read() use in PluginTask. Adding PluginTask to the bake group test. Adding vendors directory generation to baked plugins. Fixes #5200. --- cake/console/libs/tasks/plugin.php | 17 ++++++++++---- .../cases/console/libs/tasks/plugin.test.php | 23 +++++++++++-------- cake/tests/groups/bake.group.php | 1 + 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index 4f6d52363..76803849d 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -126,7 +126,7 @@ function __interactive($plugin = null) { function bake($plugin) { $pluginPath = Inflector::underscore($plugin); - $pathOptions = Configure::read('pluginPaths'); + $pathOptions = App::path('plugins'); if (count($pathOptions) > 1) { $this->findPath($pathOptions); } @@ -142,9 +142,18 @@ function bake($plugin) { $verbose = $this->in(__('Do you want verbose output?', true), array('y', 'n'), 'n'); $Folder = new Folder($this->path . $pluginPath); - $directories = array('models' . DS . 'behaviors', 'controllers' . DS . 'components', - 'views' . DS . 'helpers', 'tests' . DS . 'cases', 'tests' . DS . 'groups', - 'tests' . DS . 'fixtures'); + $directories = array( + 'models' . DS . 'behaviors', + 'controllers' . DS . 'components', + 'views' . DS . 'helpers', + 'tests' . DS . 'cases', + 'tests' . DS . 'groups', + 'tests' . DS . 'fixtures', + 'vendors' . DS . 'img', + 'vendors' . DS . 'js', + 'vendors' . DS . 'css', + 'vendors' . DS . 'shells' + ); foreach ($directories as $directory) { $Folder->create($this->path . $pluginPath . DS . $directory); diff --git a/cake/tests/cases/console/libs/tasks/plugin.test.php b/cake/tests/cases/console/libs/tasks/plugin.test.php index b82c805b8..06973bae0 100644 --- a/cake/tests/cases/console/libs/tasks/plugin.test.php +++ b/cake/tests/cases/console/libs/tasks/plugin.test.php @@ -34,10 +34,9 @@ ob_end_clean(); } -if (!class_exists('PluginTask')) { - require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'plugin.php'; - require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'model.php'; -} +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'plugin.php'; +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'model.php'; + Mock::generatePartial( 'ShellDispatcher', 'TestPluginTaskMockShellDispatcher', @@ -78,9 +77,9 @@ function startTest() { * @return void **/ function startCase() { - $this->_paths = $paths = Configure::read('pluginPaths'); + $this->_paths = $paths = App::path('plugins'); $this->_testPath = array_push($paths, TMP . 'tests' . DS); - Configure::write('pluginPaths', $paths); + App::build(array('plugins' => $paths)); } /** @@ -89,7 +88,7 @@ function startCase() { * @return void **/ function endCase() { - Configure::write('pluginPaths', $this->_paths); + App::build(array('plugins' => $this->_paths)); } /** @@ -123,6 +122,11 @@ function testBakeFoldersAndFiles() { $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'cases'), 'No cases dir %s'); $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'groups'), 'No groups dir %s'); $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'fixtures'), 'No fixtures dir %s'); + $this->assertTrue(is_dir($path . DS . 'vendors'), 'No vendors dir %s'); + $this->assertTrue(is_dir($path . DS . 'vendors' . DS . 'css'), 'No vendors css dir %s'); + $this->assertTrue(is_dir($path . DS . 'vendors' . DS . 'js'), 'No vendors js dir %s'); + $this->assertTrue(is_dir($path . DS . 'vendors' . DS . 'img'), 'No vendors img dir %s'); + $this->assertTrue(is_dir($path . DS . 'vendors' . DS . 'shells'), 'No vendors shells dir %s'); $file = $path . DS . 'bake_test_plugin_app_controller.php'; $this->Task->expectAt(0, 'createFile', array($file, '*'), 'No AppController %s'); @@ -139,7 +143,7 @@ function testBakeFoldersAndFiles() { * * @return void **/ - function testExecuteWithOneArg() { + function XXtestExecuteWithOneArg() { $this->Task->setReturnValueAt(0, 'in', $this->_testPath); $this->Task->setReturnValueAt(1, 'in', 'y'); $this->Task->Dispatch->args = array('BakeTestPlugin'); @@ -153,6 +157,7 @@ function testExecuteWithOneArg() { $this->Task->expectAt(1, 'createFile', array($file, '*'), 'No AppModel %s'); $this->Task->execute(); + $Folder =& new Folder($this->Task->path . 'bake_test_plugin'); $Folder->delete(); } @@ -162,7 +167,7 @@ function testExecuteWithOneArg() { * * @return void **/ - function testExecuteWithTwoArgs() { + function XXtestExecuteWithTwoArgs() { $this->Task->Model =& new PluginTestMockModelTask(); $this->Task->setReturnValueAt(0, 'in', $this->_testPath); $this->Task->setReturnValueAt(1, 'in', 'y'); diff --git a/cake/tests/groups/bake.group.php b/cake/tests/groups/bake.group.php index 16d063300..86b172318 100644 --- a/cake/tests/groups/bake.group.php +++ b/cake/tests/groups/bake.group.php @@ -50,6 +50,7 @@ function BakeGroupTest() { TestManager::addTestFile($this, $path . 'fixture'); TestManager::addTestFile($this, $path . 'test'); TestManager::addTestFile($this, $path . 'db_config'); + TestManager::addTestFile($this, $path . 'plugin'); TestManager::addTestFile($this, $path . 'project'); } } From 7e1f9eeebdf7836c020ebd1227c31ec98cc459ae Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 8 Jul 2009 23:30:29 -0400 Subject: [PATCH 0286/2083] Updating tests for ModelTask. Making it impossible to bake a model which does not have a table on the active connection. Fixes #6035 --- cake/console/libs/tasks/model.php | 6 ++++- .../cases/console/libs/tasks/model.test.php | 26 ++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index ab4b73147..efa8ad7a8 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -197,6 +197,10 @@ function __interactive() { if (!array_key_exists('id', $fields)) { $primaryKey = $this->findPrimaryKey($fields); } + } else { + $this->err(sprintf(__('Table %s does not exist, cannot bake a model without a table.', true), $useTable)); + $this->_stop(); + return false; } $displayField = $tempModel->hasField(array('name', 'title')); if (!$displayField) { @@ -243,7 +247,7 @@ function __interactive() { $this->hr(); $looksGood = $this->in(__('Look okay?', true), array('y','n'), 'y'); - + if (strtolower($looksGood) == 'y') { $vars = compact('associations', 'validate', 'primaryKey', 'useTable', 'displayField'); $vars['useDbConfig'] = $this->connection; diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index 51bcf5424..addd57007 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -698,6 +698,7 @@ function testExecuteIntoAll() { function testExecuteIntoInteractive() { $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; + $this->Task->interactive = true; $this->Task->setReturnValueAt(0, 'in', '1'); //choose article $this->Task->setReturnValueAt(1, 'in', 'n'); //no validation @@ -705,11 +706,34 @@ function testExecuteIntoInteractive() { $this->Task->setReturnValueAt(3, 'in', 'y'); //yes to comment relation $this->Task->setReturnValueAt(4, 'in', 'y'); //yes to user relation $this->Task->setReturnValueAt(5, 'in', 'y'); //yes to tag relation - $this->Task->setReturnValueAt(6, 'in', 'n'); //no to looksGood? + $this->Task->setReturnValueAt(6, 'in', 'n'); //no to additional assocs + $this->Task->setReturnValueAt(7, 'in', 'y'); //yes to looksGood? + $this->Task->setReturnValue('_checkUnitTest', true); + + $this->Task->Test->expectOnce('bake'); + $this->Task->Fixture->expectOnce('bake'); $filename = '/my/path/article.php'; + $this->Task->expectOnce('createFile'); $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class Article/'))); $this->Task->execute(); } + +/** + * test using bake interactively with a table that does not exist. + * + * @return void + **/ + function testExecuteWithNonExistantTableName() { + $this->Task->connection = 'test_suite'; + $this->Task->path = '/my/path/'; + + $this->Task->expectOnce('_stop'); + $this->Task->expectOnce('err'); + + $this->Task->setReturnValueAt(0, 'in', 'Foobar'); + $this->Task->setReturnValueAt(1, 'in', 'y'); + $this->Task->execute(); + } } ?> \ No newline at end of file From b90b7438535418170a2bc8cc3b07ceb1bf2460db Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 11 Jul 2009 15:58:39 -0400 Subject: [PATCH 0287/2083] Adding test cases from Javascript Helper. Preparing for refactor of JsHelper::object(). --- .../tests/cases/libs/view/helpers/js.test.php | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index 26834c1b1..a55047f8c 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -387,6 +387,60 @@ function testObject() { $this->assertEqual($result, $expected); } } +/** + * test compatibility of JsBaseEngineHelper::object() vs. json_encode() + * + * @return void + **/ + function testObjectAgainstJsonEncode() { + $skip = $this->skipIf(!function_exists('json_encode'), 'json_encode() not found, comparison tests skipped. %s'); + if ($skip) { + return; + } + $this->JsEngine->useNative = false; + $data = array(); + $data['mystring'] = "simple string"; + $this->assertEqual(json_encode($data), $this->JsEngine->object($data)); + + $data['mystring'] = "strïng with spécial chârs"; + $this->assertEqual(json_encode($data), $this->JsEngine->object($data)); + + $data['mystring'] = "a two lines\nstring"; + $this->assertEqual(json_encode($data), $this->JsEngine->object($data)); + + $data['mystring'] = "a \t tabbed \t string"; + $this->assertEqual(json_encode($data), $this->JsEngine->object($data)); + + $data['mystring'] = "a \"double-quoted\" string"; + $this->assertEqual(json_encode($data), $this->JsEngine->object($data)); + + $data['mystring'] = 'a \\"double-quoted\\" string'; + $this->assertEqual(json_encode($data), $this->JsEngine->object($data)); + } +/** + * test that JSON made with JsBaseEngineHelper::object() against json_decode() + * + * @return void + **/ + function testObjectAgainstJsonDecode() { + $skip = $this->skipIf(!function_exists('json_encode'), 'json_encode() not found, comparison tests skipped. %s'); + if ($skip) { + return; + } + $this->JsEngine->useNative = false; + + $data = array("simple string"); + $result = $this->JsEngine->object($data); + $this->assertEqual(json_decode($result), $data); + + $data = array('my \"string\"'); + $result = $this->JsEngine->object($data); + $this->assertEqual(json_decode($result), $data); + + $data = array('my \\"string\\"'); + $result = $this->JsEngine->object($data); + $this->assertEqual(json_decode($result), $data); + } /** * test Mapping of options. * From 50c624486e35398780674937ae6aba62e870f896 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 11 Jul 2009 17:21:06 -0400 Subject: [PATCH 0288/2083] Updating tests to reflect changes in json encoding. --- cake/libs/view/helpers/js.php | 108 ++++++++++++++++-- .../libs/view/helpers/jquery_engine.test.php | 6 +- .../tests/cases/libs/view/helpers/js.test.php | 16 +-- .../view/helpers/mootools_engine.test.php | 10 +- 4 files changed, 116 insertions(+), 24 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 1bcb37932..cdd087476 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -377,7 +377,7 @@ function object($data = array(), $options = array()) { * @return string a JavaScript-safe/JSON representation of $val * @access public **/ - function value($val, $quoteStrings = true) { + function value($val, $quoteString = true) { switch (true) { case (is_array($val) || is_object($val)): $val = $this->object($val); @@ -396,7 +396,7 @@ function value($val, $quoteStrings = true) { break; default: $val = $this->escape($val); - if ($quoteStrings) { + if ($quoteString) { $val = '"' . $val . '"'; } break; @@ -404,22 +404,114 @@ function value($val, $quoteStrings = true) { return $val; } /** - * Escape a string to be JavaScript friendly. + * Escape a string to be JSON friendly. + * + * List of escaped elements: * - * List of escaped ellements: - * + "\r\n" => '\n' * + "\r" => '\n' * + "\n" => '\n' * + '"' => '\"' - * + "'" => "\\'" * * @param string $script String that needs to get escaped. * @return string Escaped string. * @access public **/ function escape($string) { - $escape = array("\r\n" => '\n', "\r" => '\n', "\n" => '\n', '"' => '\"', "'" => "\\'"); - return str_replace(array_keys($escape), array_values($escape), $string); + App::import('Core', 'Multibyte'); + return $this->_utf8ToHex($string); + } +/** + * Encode a string into JSON. Converts and escapes necessary characters. + * + * @return void + **/ + function _utf8ToHex($string) { + $length = strlen($string); + $return = ''; + for ($i = 0; $i < $length; ++$i) { + $ord = ord($string{$i}); + switch (true) { + case $ord == 0x08: + $return .= '\b'; + break; + case $ord == 0x09: + $return .= '\t'; + break; + case $ord == 0x0A: + $return .= '\n'; + break; + case $ord == 0x0C: + $return .= '\f'; + break; + case $ord == 0x0D: + $return .= '\r'; + break; + case $ord == 0x22: + case $ord == 0x2F: + case $ord == 0x5C: + $return .= '\\' . $string{$i}; + break; + case (($ord >= 0x20) && ($ord <= 0x7F)): + $return .= $string{$i}; + break; + case (($ord & 0xE0) == 0xC0): + if ($i + 1 >= $length) { + $i += 1; + $return .= '?'; + break; + } + $charbits = $string{$i} . $string{$i + 1}; + $char = Multibyte::utf8($charbits); + $return .= sprintf('\u%04s', dechex($char[0])); + $i += 1; + break; + case (($ord & 0xF0) == 0xE0): + if ($i + 2 >= $length) { + $i += 2; + $return .= '?'; + break; + } + $charbits = $string{$i} . $string{$i + 1} . $string{$i + 2}; + $char = Multibyte::utf8($charbits); + $return .= sprintf('\u%04s', dechex($char[0])); + $i += 2; + break; + case (($ord & 0xF8) == 0xF0): + if ($i + 3 >= $length) { + $i += 3; + $return .= '?'; + break; + } + $charbits = $string{$i} . $string{$i + 1} . $string{$i + 2} . $string{$i + 3}; + $char = Multibyte::utf8($charbits); + $return .= sprintf('\u%04s', dechex($char[0])); + $i += 3; + break; + case (($ord & 0xFC) == 0xF8): + if ($i + 4 >= $length) { + $i += 4; + $return .= '?'; + break; + } + $charbits = $string{$i} . $string{$i + 1} . $string{$i + 2} . $string{$i + 3} . $string{$i + 4}; + $char = Multibyte::utf8($charbits); + $return .= sprintf('\u%04s', dechex($char[0])); + $i += 4; + break; + case (($ord & 0xFE) == 0xFC): + if ($i + 5 >= $length) { + $i += 5; + $return .= '?'; + break; + } + $charbits = $string{$i} . $string{$i + 1} . $string{$i + 2} . $string{$i + 3} . $string{$i + 4} . $string{$i + 5}; + $char = Multibyte::utf8($charbits); + $return .= sprintf('\u%04s', dechex($char[0])); + $i += 5; + break; + } + } + return $return; } /** * Create javascript selector for a CSS rule diff --git a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php index e12a6a4ef..0471c63e0 100644 --- a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php @@ -144,7 +144,7 @@ function testEffect() { **/ function testRequest() { $result = $this->Jquery->request(array('controller' => 'posts', 'action' => 'view', 1)); - $expected = '$.ajax({url:"/posts/view/1"});'; + $expected = '$.ajax({url:"\\/posts\\/view\\/1"});'; $this->assertEqual($result, $expected); $result = $this->Jquery->request('/people/edit/1', array( @@ -156,7 +156,7 @@ function testRequest() { 'type' => 'json', 'data' => array('name' => 'jim', 'height' => '185cm') )); - $expected = '$.ajax({beforeSend:doBefore, complete:doComplete, data:"name=jim&height=185cm", dataType:"json", error:handleError, method:"post", success:doSuccess, url:"/people/edit/1"});'; + $expected = '$.ajax({beforeSend:doBefore, complete:doComplete, data:"name=jim&height=185cm", dataType:"json", error:handleError, method:"post", success:doSuccess, url:"\\/people\\/edit\\/1"});'; $this->assertEqual($result, $expected); $result = $this->Jquery->request('/people/edit/1', array( @@ -164,7 +164,7 @@ function testRequest() { 'success' => 'doFoo', 'method' => 'post' )); - $expected = '$.ajax({method:"post", success:function (msg, status) {$("#updated").html(msg);}, url:"/people/edit/1"});'; + $expected = '$.ajax({method:"post", success:function (msg, status) {$("#updated").html(msg);}, url:"\\/people\\/edit\\/1"});'; $this->assertEqual($result, $expected); } /** diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index a55047f8c..e196a317b 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -277,19 +277,19 @@ function testEscaping() { $this->assertEqual($result, $expected); $result = $this->JsEngine->escape('CakePHP' . "\r\n" . 'Rapid Development Framework' . "\r" . 'For PHP'); - $expected = 'CakePHP\\nRapid Development Framework\\nFor PHP'; + $expected = 'CakePHP\\r\\nRapid Development Framework\\rFor PHP'; $this->assertEqual($result, $expected); $result = $this->JsEngine->escape('CakePHP: "Rapid Development Framework"'); $expected = 'CakePHP: \\"Rapid Development Framework\\"'; $this->assertEqual($result, $expected); - $result = $this->JsEngine->escape('CakePHP: \'Rapid Development Framework\''); - $expected = 'CakePHP: \\\'Rapid Development Framework\\\''; + $result = $this->JsEngine->escape("CakePHP: 'Rapid Development Framework'"); + $expected = "CakePHP: 'Rapid Development Framework'"; $this->assertEqual($result, $expected); $result = $this->JsEngine->escape('my \\"string\\"'); - $expected = 'my \\\"string\\\"'; + $expected = 'my \\\\\\"string\\\\\\"'; $this->assertEqual($result, $expected); } /** @@ -392,7 +392,7 @@ function testObject() { * * @return void **/ - function testObjectAgainstJsonEncode() { + function XXtestObjectAgainstJsonEncode() { $skip = $this->skipIf(!function_exists('json_encode'), 'json_encode() not found, comparison tests skipped. %s'); if ($skip) { return; @@ -433,7 +433,7 @@ function testObjectAgainstJsonDecode() { $result = $this->JsEngine->object($data); $this->assertEqual(json_decode($result), $data); - $data = array('my \"string\"'); + $data = array('my "string"'); $result = $this->JsEngine->object($data); $this->assertEqual(json_decode($result), $data); @@ -469,11 +469,11 @@ function testOptionParsing() { $JsEngine = new OptionEngineHelper(); $result = $JsEngine->testParseOptions(array('url' => '/posts/view/1', 'key' => 1)); - $expected = 'key:1, url:"/posts/view/1"'; + $expected = 'key:1, url:"\\/posts\\/view\\/1"'; $this->assertEqual($result, $expected); $result = $JsEngine->testParseOptions(array('url' => '/posts/view/1', 'success' => 'doSuccess'), array('success')); - $expected = 'success:doSuccess, url:"/posts/view/1"'; + $expected = 'success:doSuccess, url:"\\/posts\\/view\\/1"'; $this->assertEqual($result, $expected); } } diff --git a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php index 44b27af7a..06e450d4a 100644 --- a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php @@ -157,11 +157,11 @@ function testEffect() { **/ function testRequest() { $result = $this->Moo->request(array('controller' => 'posts', 'action' => 'view', 1)); - $expected = 'var jsRequest = new Request({url:"/posts/view/1"}).send();'; + $expected = 'var jsRequest = new Request({url:"\\/posts\\/view\\/1"}).send();'; $this->assertEqual($result, $expected); $result = $this->Moo->request('/posts/view/1', array('update' => 'content')); - $expected = 'var jsRequest = new Request.HTML({update:"content", url:"/posts/view/1"}).send();'; + $expected = 'var jsRequest = new Request.HTML({update:"content", url:"\\/posts\\/view\\/1"}).send();'; $this->assertEqual($result, $expected); $result = $this->Moo->request('/people/edit/1', array( @@ -171,7 +171,7 @@ function testRequest() { 'type' => 'json', 'data' => array('name' => 'jim', 'height' => '185cm') )); - $expected = 'var jsRequest = new Request.JSON({method:"post", onComplete:doSuccess, onFailure:handleError, url:"/people/edit/1"}).send({"name":"jim","height":"185cm"});'; + $expected = 'var jsRequest = new Request.JSON({method:"post", onComplete:doSuccess, onFailure:handleError, url:"\\/people\\/edit\\/1"}).send({"name":"jim","height":"185cm"});'; $this->assertEqual($result, $expected); $result = $this->Moo->request('/people/edit/1', array( @@ -179,7 +179,7 @@ function testRequest() { 'complete' => 'doSuccess', 'update' => '#update-zone' )); - $expected = 'var jsRequest = new Request.HTML({method:"post", onComplete:doSuccess, update:"update-zone", url:"/people/edit/1"}).send();'; + $expected = 'var jsRequest = new Request.HTML({method:"post", onComplete:doSuccess, update:"update-zone", url:"\\/people\\/edit\\/1"}).send();'; $this->assertEqual($result, $expected); $result = $this->Moo->request('/people/edit/1', array( @@ -190,7 +190,7 @@ function testRequest() { 'before' => 'doBefore', 'update' => 'update-zone' )); - $expected = 'var jsRequest = new Request.HTML({method:"post", onComplete:doComplete, onFailure:doFailure, onRequest:doBefore, onSuccess:doSuccess, update:"update-zone", url:"/people/edit/1"}).send();'; + $expected = 'var jsRequest = new Request.HTML({method:"post", onComplete:doComplete, onFailure:doFailure, onRequest:doBefore, onSuccess:doSuccess, update:"update-zone", url:"\\/people\\/edit\\/1"}).send();'; $this->assertEqual($result, $expected); } /** From 69de1291e11374fbd2c9261bf7206e1bce3e290b Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 11 Jul 2009 17:31:54 -0400 Subject: [PATCH 0289/2083] Removing deprecated options from object() Tests updated. --- cake/libs/view/helpers/js.php | 23 ++++--------------- .../tests/cases/libs/view/helpers/js.test.php | 2 +- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index cdd087476..5076b1aaf 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -299,9 +299,6 @@ function prompt($message, $default = '') { * * - 'prefix' - String prepended to the returned data. * - 'postfix' - String appended to the returned data. - * - 'stringKeys' - A list of array keys to be treated as a string - * - 'quoteKeys' - If false treats $options['stringKeys'] as a list of keys **not** to be quoted. - * - 'q' - Type of quote to use. * * @param array $data Data to be converted. * @param array $options Set of options, see above. @@ -310,8 +307,7 @@ function prompt($message, $default = '') { **/ function object($data = array(), $options = array()) { $defaultOptions = array( - 'block' => false, 'prefix' => '', 'postfix' => '', - 'stringKeys' => array(), 'quoteKeys' => true, 'q' => '"' + 'prefix' => '', 'postfix' => '', ); $options = array_merge($defaultOptions, $options); @@ -322,7 +318,7 @@ function object($data = array(), $options = array()) { $out = $keys = array(); $numeric = true; - if ($this->useNative) { + if ($this->useNative && function_exists('json_encode')) { $rt = json_encode($data); } else { if (is_null($data)) { @@ -341,17 +337,12 @@ function object($data = array(), $options = array()) { foreach ($data as $key => $val) { if (is_array($val) || is_object($val)) { - $val = $this->object($val, array_merge($options, array('block' => false))); + $val = $this->object($val, $options); } else { - $quoteStrings = ( - !count($options['stringKeys']) || - ($options['quoteKeys'] && in_array($key, $options['stringKeys'], true)) || - (!$options['quoteKeys'] && !in_array($key, $options['stringKeys'], true)) - ); - $val = $this->value($val, $quoteStrings); + $val = $this->value($val); } if (!$numeric) { - $val = $options['q'] . $this->value($key, false) . $options['q'] . ':' . $val; + $val = '"' . $this->value($key, false) . '":' . $val; } $out[] = $val; } @@ -363,10 +354,6 @@ function object($data = array(), $options = array()) { } } $rt = $options['prefix'] . $rt . $options['postfix']; - - if ($options['block']) { - $rt = $this->codeBlock($rt, array_diff_key($options, $defaultOptions)); - } return $rt; } /** diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index e196a317b..30b768e1a 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -392,7 +392,7 @@ function testObject() { * * @return void **/ - function XXtestObjectAgainstJsonEncode() { + function testObjectAgainstJsonEncode() { $skip = $this->skipIf(!function_exists('json_encode'), 'json_encode() not found, comparison tests skipped. %s'); if ($skip) { return; From 4d4bc9040e470fef419fcfbf3b6c708ea7bccac3 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sat, 11 Jul 2009 17:36:48 -0400 Subject: [PATCH 0290/2083] Adding additional tests for object() encoding. --- cake/tests/cases/libs/view/helpers/js.test.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index 30b768e1a..9c554123e 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -413,9 +413,17 @@ function testObjectAgainstJsonEncode() { $data['mystring'] = "a \"double-quoted\" string"; $this->assertEqual(json_encode($data), $this->JsEngine->object($data)); - + $data['mystring'] = 'a \\"double-quoted\\" string'; $this->assertEqual(json_encode($data), $this->JsEngine->object($data)); + + unset($data['mystring']); + $data[3] = array(1, 2, 3); + $this->assertEqual(json_encode($data), $this->JsEngine->object($data)); + + unset($data[3]); + $data = array('mystring' => null, 'bool' => false, 'array' => array(1, 44, 66)); + $this->assertEqual(json_encode($data), $this->JsEngine->object($data)); } /** * test that JSON made with JsBaseEngineHelper::object() against json_decode() From 5119e58e3ba6dd79e451ebf1278626e3dcd61577 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 12 Jul 2009 17:30:41 -0400 Subject: [PATCH 0291/2083] Starting work on Js::link() --- cake/libs/view/helpers/js.php | 39 +++++++++++++++++++ .../tests/cases/libs/view/helpers/js.test.php | 14 +++++++ 2 files changed, 53 insertions(+) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 5076b1aaf..05847dbe7 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -203,6 +203,45 @@ function getBuffer($clear = true) { } return $scripts; } +/** + * Generate an 'Ajax' link. Uses the selected JS engine to create a link + * element that is enhanced with Javascript. Options can include + * both those for HtmlHelper::link() and JsBaseEngine::request() + * + * @param string $title Title for the link. + * @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()); + } + $htmlOptions = $this->_getHtmlOptions($options); + $out = $this->Html->link($title, $url, $htmlOptions); + $this->get('#' . $options['id']); + $requestString = $this->request($url, $options); + if (!empty($requestString)) { + + } + return $out; + } +/** + * Parse a set of Options and extract the Html options. + * + * @param array Options to filter. + * @return array Array of options for non-js. + **/ + function _getHtmlOptions($options) { + $htmlKeys = array('class', 'id', 'escape', 'onblur', 'onfocus', 'rel', 'title'); + $htmlOptions = array(); + foreach ($htmlKeys as $key) { + if (isset($options[$key])) { + $htmlOptions[$key] = $options[$key]; + } + } + return $htmlOptions; + } } /** diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index 9c554123e..aacd31ae9 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -234,6 +234,20 @@ function testWriteScriptsInFile() { @unlink(WWW_ROOT . $filename[1]); } +/** + * test link() + * + * @return void + **/ + function testLink() { + $result = $this->Js->link('test link', '/posts/view/1', array('update' => '#content')); + $expected = array( + 'a' => array('id' => 'preg:/link-\d+/', 'href' => '/posts/view/1'), + 'test link', + '/a' + ); + $this->assertTags($result, $expected); + } } From 04fa46f228bf1634c815eb7ffa7e981ba40c16b8 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 12 Jul 2009 18:42:36 -0400 Subject: [PATCH 0292/2083] Updating Js::link() adding confirm option. --- cake/libs/view/helpers/js.php | 22 ++++-- .../tests/cases/libs/view/helpers/js.test.php | 70 +++++++++++-------- 2 files changed, 59 insertions(+), 33 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 05847dbe7..d91b3c849 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -206,8 +206,12 @@ function getBuffer($clear = true) { /** * Generate an 'Ajax' link. Uses the selected JS engine to create a link * element that is enhanced with Javascript. Options can include - * both those for HtmlHelper::link() and JsBaseEngine::request() + * both those for HtmlHelper::link() and JsBaseEngine::request(), JsBaseEngine::event(); * + * ### Options + * + * - confirm - Generate a confirm() dialog before sending the event. + * * @param string $title Title for the link. * @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() @@ -219,26 +223,34 @@ function link($title, $url = null, $options = array()) { } $htmlOptions = $this->_getHtmlOptions($options); $out = $this->Html->link($title, $url, $htmlOptions); - $this->get('#' . $options['id']); - $requestString = $this->request($url, $options); + $this->get('#' . $htmlOptions['id']); + $requestString = ''; + if (isset($options['confirm'])) { + $requestString .= 'var _confirm = ' . $this->confirm($options['confirm']); + $requestString .= "if (!_confirm) {\n\treturn false;\n}"; + unset($options['confirm']); + } + $requestString .= $this->request($url, $options); if (!empty($requestString)) { - + $this->event('click', $requestString, $options); } return $out; } /** * Parse a set of Options and extract the Html options. + * Extracted Html Options are removed from the $options param. * * @param array Options to filter. * @return array Array of options for non-js. **/ - function _getHtmlOptions($options) { + function _getHtmlOptions(&$options) { $htmlKeys = array('class', 'id', 'escape', 'onblur', 'onfocus', 'rel', 'title'); $htmlOptions = array(); foreach ($htmlKeys as $key) { if (isset($options[$key])) { $htmlOptions[$key] = $options[$key]; } + unset($options[$key]); } return $htmlOptions; } diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index aacd31ae9..a3c6d9698 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -83,7 +83,7 @@ class JsHelperTestCase extends CakeTestCase { */ function startTest() { $this->Js =& new JsHelper('JsBase'); - $this->Js->Html =& new HtmlHelper(); + $this->Js->Html =& new HtmlHelper(); $this->Js->JsBaseEngine =& new JsBaseEngineHelper(); $view =& new JsHelperMockView(); @@ -99,6 +99,16 @@ function endTest() { ClassRegistry::removeObject('view'); unset($this->Js); } +/** + * Switches $this->Js to a mocked engine. + * + * @return void + **/ + function _useMock() { + $this->Js =& new JsHelper(array('TestJs')); + $this->Js->TestJsEngine =& new TestJsEngineHelper(); + $this->Js->Html =& new HtmlHelper(); + } /** * test object construction * @@ -123,15 +133,14 @@ function testConstruction() { * @return void **/ function testMethodDispatching() { - $js =& new JsHelper(array('TestJs')); - $js->TestJsEngine =& new TestJsEngineHelper(); - $js->TestJsEngine->expectOnce('dispatchMethod', array('methodOne', array())); + $this->_useMock(); + $this->Js->TestJsEngine->expectOnce('dispatchMethod', array('methodOne', array())); - $js->methodOne(); + $this->Js->methodOne(); - $js->TestEngine =& new StdClass(); + $this->Js->TestEngine =& new StdClass(); $this->expectError(); - $js->someMethodThatSurelyDoesntExist(); + $this->Js->someMethodThatSurelyDoesntExist(); } /** * Test that method dispatching respects buffer parameters and bufferedMethods Lists. @@ -139,47 +148,47 @@ function testMethodDispatching() { * @return void **/ function testMethodDispatchWithBuffering() { - $js =& new JsHelper(array('TestJs')); - $js->TestJsEngine = new TestJsEngineHelper(); - $js->TestJsEngine->bufferedMethods = array('event', 'sortables'); - $js->TestJsEngine->setReturnValue('dispatchMethod', 'This is an event call', array('event', '*')); + $this->_useMock(); + + $this->Js->TestJsEngine->bufferedMethods = array('event', 'sortables'); + $this->Js->TestJsEngine->setReturnValue('dispatchMethod', 'This is an event call', array('event', '*')); - $js->event('click', 'foo'); - $result = $js->getBuffer(); + $this->Js->event('click', 'foo'); + $result = $this->Js->getBuffer(); $this->assertEqual(count($result), 1); $this->assertEqual($result[0], 'This is an event call'); - $result = $js->event('click', 'foo', array('buffer' => false)); - $buffer = $js->getBuffer(); + $result = $this->Js->event('click', 'foo', array('buffer' => false)); + $buffer = $this->Js->getBuffer(); $this->assertTrue(empty($buffer)); $this->assertEqual($result, 'This is an event call'); - $result = $js->event('click', 'foo', false); - $buffer = $js->getBuffer(); + $result = $this->Js->event('click', 'foo', false); + $buffer = $this->Js->getBuffer(); $this->assertTrue(empty($buffer)); $this->assertEqual($result, 'This is an event call'); - $js->TestJsEngine->setReturnValue('dispatchMethod', 'I am not buffered.', array('effect', '*')); + $this->Js->TestJsEngine->setReturnValue('dispatchMethod', 'I am not buffered.', array('effect', '*')); - $result = $js->effect('slideIn'); - $buffer = $js->getBuffer(); + $result = $this->Js->effect('slideIn'); + $buffer = $this->Js->getBuffer(); $this->assertTrue(empty($buffer)); $this->assertEqual($result, 'I am not buffered.'); - $result = $js->effect('slideIn', true); - $buffer = $js->getBuffer(); + $result = $this->Js->effect('slideIn', true); + $buffer = $this->Js->getBuffer(); $this->assertNull($result); $this->assertEqual(count($buffer), 1); $this->assertEqual($buffer[0], 'I am not buffered.'); - $result = $js->effect('slideIn', array('speed' => 'slow'), true); - $buffer = $js->getBuffer(); + $result = $this->Js->effect('slideIn', array('speed' => 'slow'), true); + $buffer = $this->Js->getBuffer(); $this->assertNull($result); $this->assertEqual(count($buffer), 1); $this->assertEqual($buffer[0], 'I am not buffered.'); - $result = $js->effect('slideIn', array('speed' => 'slow', 'buffer' => true)); - $buffer = $js->getBuffer(); + $result = $this->Js->effect('slideIn', array('speed' => 'slow', 'buffer' => true)); + $buffer = $this->Js->getBuffer(); $this->assertNull($result); $this->assertEqual(count($buffer), 1); $this->assertEqual($buffer[0], 'I am not buffered.'); @@ -190,7 +199,7 @@ function testMethodDispatchWithBuffering() { * @return void **/ function testWriteScriptsNoFile() { - $this->Js->JsBaseEngine = new TestJsEngineHelper(); + $this->_useMock(); $this->Js->buffer('one = 1;'); $this->Js->buffer('two = 2;'); $result = $this->Js->writeBuffer(array('onDomReady' => false, 'cache' => false)); @@ -203,7 +212,7 @@ function testWriteScriptsNoFile() { ); $this->assertTags($result, $expected, true); - $this->Js->JsBaseEngine->expectAtLeastOnce('domReady'); + $this->Js->TestJsEngine->expectAtLeastOnce('domReady'); $result = $this->Js->writeBuffer(array('onDomReady' => true, 'cache' => false)); $view =& new JsHelperMockView(); @@ -240,6 +249,11 @@ function testWriteScriptsInFile() { * @return void **/ function testLink() { + $this->_useMock(); + $this->Js->TestJsEngine->setReturnValue('request', 'ajax code'); + $this->Js->TestJsEngine->expectAt(0, 'request', array('/posts/view/1', '*')); + $this->Js->TestJsEngine->expectAt(0, 'event', array('click', 'ajax code')); + $result = $this->Js->link('test link', '/posts/view/1', array('update' => '#content')); $expected = array( 'a' => array('id' => 'preg:/link-\d+/', 'href' => '/posts/view/1'), From 04b151edc9b5ca95e57ab40199c43e91fb4ca6e4 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Sun, 12 Jul 2009 19:06:45 -0400 Subject: [PATCH 0293/2083] Updating tests to be more specific. Adding tests for confirm. --- .../tests/cases/libs/view/helpers/js.test.php | 43 ++++++++++++++++--- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index a3c6d9698..4dc79bd0f 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -106,7 +106,7 @@ function endTest() { **/ function _useMock() { $this->Js =& new JsHelper(array('TestJs')); - $this->Js->TestJsEngine =& new TestJsEngineHelper(); + $this->Js->TestJsEngine =& new TestJsEngineHelper($this); $this->Js->Html =& new HtmlHelper(); } /** @@ -248,19 +248,50 @@ function testWriteScriptsInFile() { * * @return void **/ - function testLink() { + function testLinkWithMock() { $this->_useMock(); - $this->Js->TestJsEngine->setReturnValue('request', 'ajax code'); - $this->Js->TestJsEngine->expectAt(0, 'request', array('/posts/view/1', '*')); - $this->Js->TestJsEngine->expectAt(0, 'event', array('click', 'ajax code')); + $options = array('update' => '#content'); - $result = $this->Js->link('test link', '/posts/view/1', array('update' => '#content')); + $this->Js->TestJsEngine->setReturnValue('dispatchMethod', 'ajax code', array('request', '*')); + $this->Js->TestJsEngine->expectAt(0, 'dispatchMethod', array('get', new AnythingExpectation())); + $this->Js->TestJsEngine->expectAt(1, 'dispatchMethod', array( + 'request', array('/posts/view/1', $options) + )); + $this->Js->TestJsEngine->expectAt(2, 'dispatchMethod', array( + 'event', array('click', 'ajax code', $options) + )); + + $result = $this->Js->link('test link', '/posts/view/1', $options); $expected = array( 'a' => array('id' => 'preg:/link-\d+/', 'href' => '/posts/view/1'), 'test link', '/a' ); $this->assertTags($result, $expected); + + $options = array( + 'confirm' => 'Are you sure?', + 'update' => '#content', + 'class' => 'my-class', + 'id' => 'custom-id', + 'escape' => false + ); + $this->Js->TestJsEngine->expectAt(0, 'confirm', array($options['confirm'])); + $this->Js->TestJsEngine->expectAt(1, 'request', array('/posts/view/1', '*')); +$code = <<<CODE +var _confirm = confirm("Are you sure?"); +if (!_confirm) { + return false; +} +CODE; + $this->Js->TestJsEngine->expectAt(1, 'event', array('click', $code)); + $result = $this->Js->link('test link »', '/posts/view/1', $options); + $expected = array( + 'a' => array('id' => $options['id'], 'class' => $options['class'], 'href' => '/posts/view/1'), + 'test link »', + '/a' + ); + $this->assertTags($result, $expected); } } From 80b9692856aec7143fbfa1d9c04da7b5ff4489b9 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 15 Jul 2009 10:00:35 -0400 Subject: [PATCH 0294/2083] Adding test and fixture generation to ModelTask::all --- cake/console/libs/tasks/model.php | 10 +++++++--- .../cases/console/libs/tasks/model.test.php | 18 +++++++++++++++++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index efa8ad7a8..2203028c4 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -110,6 +110,7 @@ function execute() { $object = $this->_getModelObject($model); if ($this->bake($object, false)) { if ($this->_checkUnitTest()) { + $this->bakeFixture($model); $this->bakeTest($model); } } @@ -123,12 +124,15 @@ function execute() { **/ function all() { $this->listAll($this->connection, false); - + $unitTestExists = $this->_checkUnitTest(); foreach ($this->__tables as $table) { $modelClass = Inflector::classify($table); $this->out(sprintf(__('Baking %s', true), $modelClass)); $object = $this->_getModelObject($modelClass); - $this->bake($object, false); + if ($this->bake($object, false) && $unitTestExists) { + $this->bakeFixture($modelClass); + $this->bakeTest($modelClass); + } } } @@ -749,7 +753,7 @@ function bake($name, $data = array()) { * @param string $className Model class name * @access private */ - function bakeTest($className, $useTable = null, $associations = array()) { + function bakeTest($className) { $this->Test->plugin = $this->plugin; $this->Test->connection = $this->connection; return $this->Test->bake('Model', $className); diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index addd57007..186ae003c 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -483,6 +483,19 @@ function testBakeFixture() { $this->assertEqual($this->Task->connection, $this->Task->Fixture->connection); } +/** + * Ensure that the test object is correctly called. + * + * @return void + **/ + function testBakeTest() { + $this->Task->Test->expectAt(0, 'bake', array('Model', 'Article')); + $this->Task->bakeTest('Article'); + + $this->assertEqual($this->Task->plugin, $this->Task->Test->plugin); + $this->assertEqual($this->Task->connection, $this->Task->Test->connection); + } + /** * test confirming of associations, and that when an association is hasMany * a question for the hasOne is also not asked. @@ -670,10 +683,13 @@ function testExecuteIntoAll() { $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; $this->Task->args = array('all'); + $this->Task->setReturnValue('_checkUnitTest', true); + + $this->Task->Fixture->expectCallCount('bake', 5); + $this->Task->Test->expectCallCount('bake', 5); $filename = '/my/path/article.php'; $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class Article/'))); - $this->Task->execute(); $filename = '/my/path/articles_tag.php'; $this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/class ArticlesTag/'))); From 1e8d01992ebb1f81bbc838f675730ae2211f8f5f Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Wed, 15 Jul 2009 10:14:16 -0400 Subject: [PATCH 0295/2083] Adding test generation for controllers baked with ControllerTask::all() --- cake/console/libs/tasks/controller.php | 5 ++++- cake/tests/cases/console/libs/tasks/controller.test.php | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 9d9de4c44..8a9bcbd1d 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -113,12 +113,15 @@ function all() { $this->interactive = false; $this->listAll($this->connection, false); ClassRegistry::config('Model', array('ds' => $this->connection)); + $unitTestExists = $this->_checkUnitTest(); foreach ($this->__tables as $table) { $model = $this->_modelName($table); $controller = $this->_controllerName($model); if (App::import('Model', $model)) { $actions = $this->bakeActions($controller); - $this->bake($controller, $actions); + if ($this->bake($controller, $actions) && $unitTestExists) { + $this->bakeTest($controller); + } } } } diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 204cccaa5..125eef72a 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -104,6 +104,7 @@ function startTest() { $this->Task->Template->params['theme'] = 'default'; $this->Task->Model =& new ControllerMockModelTask($this->Task->Dispatch); $this->Task->Project =& new ControllerMockProjectTask($this->Task->Dispatch); + $this->Task->Test =& new ControllerMockTestTask(); } /** @@ -368,7 +369,6 @@ function testBakeActionsWithNoSessions() { function testBakeTest() { $this->Task->plugin = 'ControllerTest'; $this->Task->connection = 'test_suite'; - $this->Task->Test =& new ControllerMockTestTask(); $this->Task->Test->expectOnce('bake', array('Controller', 'Articles')); $this->Task->bakeTest('Articles'); @@ -416,6 +416,10 @@ function testExecuteIntoAll() { $this->Task->path = '/my/path/'; $this->Task->args = array('all'); + $this->Task->setReturnValue('createFile', true); + $this->Task->setReturnValue('_checkUnitTest', true); + $this->Task->Test->expectCallCount('bake', 1); + $filename = '/my/path/articles_controller.php'; $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticlesController/'))); From 9f3a9e6d78e6a2db9cdd2035e17e7ca61c682f7b Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 16 Jul 2009 08:51:06 -0400 Subject: [PATCH 0296/2083] Adding test case for BakeShell and bake all --- cake/tests/cases/console/libs/bake.test.php | 109 ++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 cake/tests/cases/console/libs/bake.test.php diff --git a/cake/tests/cases/console/libs/bake.test.php b/cake/tests/cases/console/libs/bake.test.php new file mode 100644 index 000000000..22b813fbb --- /dev/null +++ b/cake/tests/cases/console/libs/bake.test.php @@ -0,0 +1,109 @@ +<?php +/** + * BakeShell Test Case + * + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org + * @package cake + * @subpackage cake.tests.cases.console.libs.tasks + * @since CakePHP(tm) v 1.3 + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + */ +App::import('Core', 'Shell'); + +if (!defined('DISABLE_AUTO_DISPATCH')) { + define('DISABLE_AUTO_DISPATCH', true); +} + +if (!class_exists('ShellDispatcher')) { + ob_start(); + $argv = false; + require CAKE . 'console' . DS . 'cake.php'; + ob_end_clean(); +} + +require_once CAKE . 'console' . DS . 'libs' . DS . 'bake.php'; +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'model.php'; +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'controller.php'; +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'db_config.php'; + +Mock::generatePartial( + 'ShellDispatcher', 'BakeShellMockShellDispatcher', + array('getInput', 'stdout', 'stderr', '_stop', '_initEnvironment') +); +Mock::generatePartial( + 'BakeShell', 'MockBakeShell', + array('in', 'hr', 'out', 'err', 'createFile', '_stop', '_checkUnitTest') +); + +Mock::generate('DbConfigTask', 'BakeShellMockDbConfigTask'); +Mock::generate('ModelTask', 'BakeShellMockModelTask'); +Mock::generate('ControllerTask', 'BakeShellMockControllerTask'); + +if (!class_exists('ArticlesController')) { + class ArticlesController extends Controller { + var $name = 'Articles'; + } +} + +class BakeShellTestCase extends CakeTestCase { +/** + * fixtures + * + * @var array + **/ + var $fixtures = array('core.article'); +/** + * start test + * + * @return void + **/ + function startTest() { + $this->Dispatch =& new BakeShellMockShellDispatcher(); + $this->Shell =& new MockBakeShell(); + $this->Shell->Dispatch =& $this->Dispatcher; + $this->Shell->Dispatch->shellPaths = App::path('shells'); + } +/** + * test bake all + * + * @return void + **/ + function testAllWithModelName() { + $this->Shell->Model =& new BakeShellMockModelTask(); + $this->Shell->Controller =& new BakeShellMockControllerTask(); + $this->Shell->View =& new BakeShellMockModelTask(); + $this->Shell->DbConfig =& new BakeShellMockDbConfigTask(); + + $this->Shell->DbConfig->expectOnce('getConfig'); + $this->Shell->DbConfig->setReturnValue('getConfig', 'test_suite'); + + $this->Shell->Model->setReturnValue('bake', true); + $this->Shell->Model->expectNever('getName'); + $this->Shell->Model->expectOnce('bake'); + + $this->Shell->Controller->expectOnce('bake'); + $this->Shell->Controller->setReturnValue('bake', true); + + $this->Shell->View->expectOnce('execute'); + + $this->Shell->expectAt(0, 'out', array('Bake All')); + $this->Shell->expectAt(1, 'out', array('Article Model was baked.')); + $this->Shell->expectAt(2, 'out', array('Article Controller was baked.')); + $this->Shell->expectAt(3, 'out', array('Article Views were baked.')); + $this->Shell->expectAt(4, 'out', array('Bake All complete')); + + $this->Shell->params = array(); + $this->Shell->args = array('Article', 'exitvalue'); + $this->Shell->all(); + } +} \ No newline at end of file From 08ce38c6cc806df6b7c4740bd13d8c55cc10d253 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 16 Jul 2009 08:52:33 -0400 Subject: [PATCH 0297/2083] Updating bake all to reflect changes in Task apis. Adding additional messages. --- cake/console/libs/bake.php | 18 +++++++++++------- cake/console/libs/tasks/model.php | 4 +++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index 3ec061729..8c37a0a80 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -128,22 +128,25 @@ function main() { * @access public */ function all() { - $ds = 'default'; $this->hr(); $this->out('Bake All'); $this->hr(); - if (isset($this->params['connection'])) { - $ds = $this->params['connection']; + if (!isset($this->params['connection']) && empty($this->connection)) { + $this->connection = $this->DbConfig->getConfig(); + } + + foreach (array('Model', 'Controller', 'View') as $task) { + $this->{$task}->connection = $this->connection; + $this->{$task}->interactive = false; } if (empty($this->args)) { - $name = $this->Model->getName($ds); + $name = $this->Model->getName($this->connection); } if (!empty($this->args[0])) { $name = $this->args[0]; - $this->Model->listAll($ds, false); } $modelExists = false; @@ -153,7 +156,7 @@ function all() { $modelExists = true; } else { App::import('Model'); - $object = new Model(array('name' => $name, 'ds' => $ds)); + $object = new Model(array('name' => $name, 'ds' => $this->connection)); } $modelBaked = $this->Model->bake($object, false); @@ -177,8 +180,9 @@ function all() { if (App::import('Controller', $controller)) { $this->View->args = array($controller); $this->View->execute(); + $this->out(sprintf(__('%s Views were baked.', true), $name)); } - $this->out(__('Bake All complete')); + $this->out(__('Bake All complete', true)); array_shift($this->args); } else { $this->err(__('Bake All could not continue without a valid model', true)); diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 2203028c4..23c04563a 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -449,7 +449,9 @@ function doAssociations(&$model) { if (!is_object($model)) { return false; } - $this->out(__('One moment while the associations are detected.', true)); + if ($this->interactive === true) { + $this->out(__('One moment while the associations are detected.', true)); + } $fields = $model->schema(); if (empty($fields)) { From a7fb5f96e91bc96d1bc3737c5ec5edebdbc3ad87 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 16 Jul 2009 09:12:32 -0400 Subject: [PATCH 0298/2083] Adding fixture baking in when model is baked. --- cake/console/libs/bake.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index 8c37a0a80..c18851338 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -136,15 +136,15 @@ function all() { $this->connection = $this->DbConfig->getConfig(); } + if (empty($this->args)) { + $name = $this->Model->getName($this->connection); + } + foreach (array('Model', 'Controller', 'View') as $task) { $this->{$task}->connection = $this->connection; $this->{$task}->interactive = false; } - if (empty($this->args)) { - $name = $this->Model->getName($this->connection); - } - if (!empty($this->args[0])) { $name = $this->args[0]; } @@ -164,6 +164,7 @@ function all() { if ($modelBaked && $modelExists === false) { $this->out(sprintf(__('%s Model was baked.', true), $model)); if ($this->_checkUnitTest()) { + $this->Model->bakeFixture($model); $this->Model->bakeTest($model); } $modelExists = true; From cbb568b3c7761f3233b815e03dbf73b259740eba Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 16 Jul 2009 12:50:37 -0400 Subject: [PATCH 0299/2083] Fixing getAdmin() method location to reflect changes in API. --- cake/console/libs/tasks/controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 8a9bcbd1d..514089e72 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -188,7 +188,7 @@ function __interactive() { $actions = $this->bakeActions($controllerName, null, strtolower($wannaUseSession) == 'y'); } if (strtolower($wannaBakeAdminCrud) == 'y') { - $admin = $this->getAdmin(); + $admin = $this->Project->getAdmin(); $actions .= $this->bakeActions($controllerName, $admin, strtolower($wannaUseSession) == 'y'); } From 2e3a311b0d60d23ab107aa890fb328678313d7dc Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 16 Jul 2009 21:34:14 -0400 Subject: [PATCH 0300/2083] Adding config/sql to plugin baking. --- cake/console/libs/tasks/plugin.php | 1 + cake/tests/cases/console/libs/tasks/plugin.test.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index 76803849d..d1ca64494 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -143,6 +143,7 @@ function bake($plugin) { $Folder = new Folder($this->path . $pluginPath); $directories = array( + 'config' . DS . 'sql', 'models' . DS . 'behaviors', 'controllers' . DS . 'components', 'views' . DS . 'helpers', diff --git a/cake/tests/cases/console/libs/tasks/plugin.test.php b/cake/tests/cases/console/libs/tasks/plugin.test.php index 06973bae0..665d6caa1 100644 --- a/cake/tests/cases/console/libs/tasks/plugin.test.php +++ b/cake/tests/cases/console/libs/tasks/plugin.test.php @@ -113,6 +113,8 @@ function testBakeFoldersAndFiles() { $path = $this->Task->path . 'bake_test_plugin'; $this->assertTrue(is_dir($path), 'No plugin dir %s'); + $this->assertTrue(is_dir($path . DS . 'config'), 'No config dir %s'); + $this->assertTrue(is_dir($path . DS . 'config' . DS . 'sql'), 'No config dir %s'); $this->assertTrue(is_dir($path . DS . 'controllers'), 'No controllers dir %s'); $this->assertTrue(is_dir($path . DS . 'controllers' . DS .'components'), 'No components dir %s'); $this->assertTrue(is_dir($path . DS . 'models'), 'No models dir %s'); From 22c98cc7122634efb4cb629ac23d54b9dae18828 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 16 Jul 2009 21:49:26 -0400 Subject: [PATCH 0301/2083] Adding empty files to baked plugins. --- cake/console/libs/tasks/plugin.php | 12 +++-- .../cases/console/libs/tasks/plugin.test.php | 50 +++++++++++++++++++ 2 files changed, 59 insertions(+), 3 deletions(-) diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index d1ca64494..5e50bb877 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -141,13 +141,17 @@ function bake($plugin) { if (strtolower($looksGood) == 'y') { $verbose = $this->in(__('Do you want verbose output?', true), array('y', 'n'), 'n'); - $Folder = new Folder($this->path . $pluginPath); + $Folder =& new Folder($this->path . $pluginPath); $directories = array( 'config' . DS . 'sql', 'models' . DS . 'behaviors', 'controllers' . DS . 'components', 'views' . DS . 'helpers', - 'tests' . DS . 'cases', + 'tests' . DS . 'cases' . DS . 'components', + 'tests' . DS . 'cases' . DS . 'helpers', + 'tests' . DS . 'cases' . DS . 'behaviors', + 'tests' . DS . 'cases' . DS . 'controllers', + 'tests' . DS . 'cases' . DS . 'models', 'tests' . DS . 'groups', 'tests' . DS . 'fixtures', 'vendors' . DS . 'img', @@ -157,7 +161,9 @@ function bake($plugin) { ); foreach ($directories as $directory) { - $Folder->create($this->path . $pluginPath . DS . $directory); + $dirPath = $this->path . $pluginPath . DS . $directory; + $Folder->create($dirPath); + $File =& new File($dirPath . DS . 'empty', true); } if (strtolower($verbose) == 'y') { diff --git a/cake/tests/cases/console/libs/tasks/plugin.test.php b/cake/tests/cases/console/libs/tasks/plugin.test.php index 665d6caa1..1d9e74532 100644 --- a/cake/tests/cases/console/libs/tasks/plugin.test.php +++ b/cake/tests/cases/console/libs/tasks/plugin.test.php @@ -113,22 +113,72 @@ function testBakeFoldersAndFiles() { $path = $this->Task->path . 'bake_test_plugin'; $this->assertTrue(is_dir($path), 'No plugin dir %s'); + $this->assertTrue(is_dir($path . DS . 'config'), 'No config dir %s'); $this->assertTrue(is_dir($path . DS . 'config' . DS . 'sql'), 'No config dir %s'); + $this->assertTrue(file_exists($path . DS . 'config' . DS . 'sql' . DS . 'empty'), 'No empty file %s'); + $this->assertTrue(is_dir($path . DS . 'controllers'), 'No controllers dir %s'); $this->assertTrue(is_dir($path . DS . 'controllers' . DS .'components'), 'No components dir %s'); + $this->assertTrue(file_exists($path . DS . 'controllers' . DS . 'components' . DS . 'empty'), 'No empty file %s'); $this->assertTrue(is_dir($path . DS . 'models'), 'No models dir %s'); + $this->assertTrue(file_exists($path . DS . 'models' . DS . 'behaviors' . DS . 'empty'), 'No empty file %s'); + $this->assertTrue(is_dir($path . DS . 'views'), 'No views dir %s'); $this->assertTrue(is_dir($path . DS . 'views' . DS . 'helpers'), 'No helpers dir %s'); + $this->assertTrue(file_exists($path . DS . 'views' . DS . 'helpers' . DS . 'empty'), 'No empty file %s'); + $this->assertTrue(is_dir($path . DS . 'tests'), 'No tests dir %s'); $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'cases'), 'No cases dir %s'); + + $this->assertTrue( + is_dir($path . DS . 'tests' . DS . 'cases' . DS . 'components'), 'No components cases dir %s' + ); + $this->assertTrue( + file_exists($path . DS . 'tests' . DS . 'cases' . DS . 'components' . DS . 'empty'), 'No empty file %s' + ); + + $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'cases' . DS . 'behaviors'), 'No behaviors cases dir %s'); + $this->assertTrue( + file_exists($path . DS . 'tests' . DS . 'cases' . DS . 'behaviors' . DS . 'empty'), 'No empty file %s' + ); + + $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'cases' . DS . 'helpers'), 'No helpers cases dir %s'); + $this->assertTrue( + file_exists($path . DS . 'tests' . DS . 'cases' . DS . 'helpers' . DS . 'empty'), 'No empty file %s' + ); + + $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'cases' . DS . 'models'), 'No models cases dir %s'); + $this->assertTrue( + file_exists($path . DS . 'tests' . DS . 'cases' . DS . 'models' . DS . 'empty'), 'No empty file %s' + ); + + $this->assertTrue( + is_dir($path . DS . 'tests' . DS . 'cases' . DS . 'controllers'), + 'No controllers cases dir %s' + ); + $this->assertTrue( + file_exists($path . DS . 'tests' . DS . 'cases' . DS . 'controllers' . DS . 'empty'), 'No empty file %s' + ); + $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'groups'), 'No groups dir %s'); + $this->assertTrue(file_exists($path . DS . 'tests' . DS . 'groups' . DS . 'empty'), 'No empty file %s'); + $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'fixtures'), 'No fixtures dir %s'); + $this->assertTrue(file_exists($path . DS . 'tests' . DS . 'fixtures' . DS . 'empty'), 'No empty file %s'); + $this->assertTrue(is_dir($path . DS . 'vendors'), 'No vendors dir %s'); $this->assertTrue(is_dir($path . DS . 'vendors' . DS . 'css'), 'No vendors css dir %s'); + $this->assertTrue(file_exists($path . DS . 'vendors' . DS . 'css' . DS . 'empty'), 'No empty file %s'); + $this->assertTrue(is_dir($path . DS . 'vendors' . DS . 'js'), 'No vendors js dir %s'); + $this->assertTrue(file_exists($path . DS . 'vendors' . DS . 'js' . DS . 'empty'), 'No empty file %s'); + $this->assertTrue(is_dir($path . DS . 'vendors' . DS . 'img'), 'No vendors img dir %s'); + $this->assertTrue(file_exists($path . DS . 'vendors' . DS . 'img' . DS . 'empty'), 'No empty file %s'); + $this->assertTrue(is_dir($path . DS . 'vendors' . DS . 'shells'), 'No vendors shells dir %s'); + $this->assertTrue(file_exists($path . DS . 'vendors' . DS . 'shells' . DS . 'empty'), 'No empty file %s'); $file = $path . DS . 'bake_test_plugin_app_controller.php'; $this->Task->expectAt(0, 'createFile', array($file, '*'), 'No AppController %s'); From 7b06ba2b3d74a41e086333135376a9b66a694d17 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 16 Jul 2009 23:12:47 -0400 Subject: [PATCH 0302/2083] Adding support for -admin flag when baking a controller's views. Using -admin will only bake admin methods. Refactoring some methods, removing newlines. --- cake/console/libs/tasks/view.php | 53 ++++++++---- .../cases/console/libs/tasks/view.test.php | 86 ++++++++++++++----- 2 files changed, 101 insertions(+), 38 deletions(-) diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 40a81ea69..7634efff4 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -88,7 +88,6 @@ class ViewTask extends Shell { */ function initialize() { } - /** * Execution method always used for tasks * @@ -129,6 +128,7 @@ function execute() { $this->bake($action, true); } else { $vars = $this->__loadController(); + $methods = $this->_methodsToBake(); $methods = array_diff( array_map('strtolower', get_class_methods($this->controllerName . 'Controller')), array_map('strtolower', get_class_methods('appcontroller')) @@ -136,9 +136,15 @@ function execute() { if (empty($methods)) { $methods = $this->scaffoldActions; } - $adminDelete = null; - $adminRoute = Configure::read('Routing.admin'); + if ($adminRoute && isset($this->params['admin'])) { + foreach ($methods as $i => $method) { + if (strpos($method, $adminRoute . '_') === false) { + unset($methods[$i]); + } + } + } + $adminDelete = null; if (!empty($adminRoute)) { $adminDelete = $adminRoute . '_delete'; } @@ -151,7 +157,30 @@ function execute() { } } } - +/** + * 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')), + array_map('strtolower', get_class_methods('appcontroller')) + ); + if (empty($methods)) { + $methods = $this->scaffoldActions; + } + $adminRoute = Configure::read('Routing.admin'); + foreach ($methods as $i => $method) { + if ($method == 'delete' || $method = $adminRoute . '_delete' || $method{0} == '_') { + unset($methods[$i]); + } + if ($adminRoute && isset($this->params['admin']) && strpos($method, $adminRoute . '_') === false) { + unset($methods[$i]); + } + } + return $methods; + } /** * Bake All views for All controllers. * @@ -172,7 +201,6 @@ function all() { } } } - /** * Handles interactive baking * @@ -226,7 +254,6 @@ function __interactive() { $this->customAction(); } } - /** * Loads Controller and sets variables for the template * Available template variables @@ -283,7 +310,6 @@ function __loadController() { return compact('modelClass', 'schema', 'primaryKey', 'displayField', 'singularVar', 'pluralVar', 'singularHumanName', 'pluralHumanName', 'fields','associations'); } - /** * Bake a view file for each of the supplied actions * @@ -296,7 +322,6 @@ function bakeActions($actions, $vars) { $this->bake($action, $content); } } - /** * handle creation of baking a custom action view file * @@ -326,7 +351,6 @@ function customAction() { $this->out(__('Bake Aborted.', true)); } } - /** * Assembles and writes bakes the view file. * @@ -346,7 +370,6 @@ function bake($action, $content = '') { $filename = $path . $this->controllerPath . DS . Inflector::underscore($action) . '.ctp'; return $this->createFile($filename, $content); } - /** * Builds content from template and variables * @@ -385,7 +408,6 @@ function getContent($template = null, $vars = null) { $this->err(sprintf(__('Template for %s could not be found', true), $template)); return false; } - /** * Displays help contents * @@ -398,16 +420,18 @@ function help() { $this->out('Commands:'); $this->out(''); $this->out("view <controller>"); - $this->out("\twill read the given controller for methods"); + $this->out("\tWill read the given controller for methods"); $this->out("\tand bake corresponding views."); + $this->out("\tUsing the -admin flag will only bake views for actions"); + $this->out("\tthat begin with Routing.admin."); $this->out("\tIf var scaffold is found it will bake the CRUD actions"); $this->out("\t(index,view,add,edit)"); $this->out(''); $this->out("view <controller> <action>"); - $this->out("\twill bake a template. core templates: (index, add, edit, view)"); + $this->out("\tWill bake a template. core templates: (index, add, edit, view)"); $this->out(''); $this->out("view <controller> <template> <alias>"); - $this->out("\twill use the template specified"); + $this->out("\tWill use the template specified"); $this->out("\tbut name the file based on the alias"); $this->out(''); $this->out("view all"); @@ -415,7 +439,6 @@ function help() { $this->out("\tRequires that models and controllers exist."); $this->_stop(); } - /** * Returns associations for controllers models. * diff --git a/cake/tests/cases/console/libs/tasks/view.test.php b/cake/tests/cases/console/libs/tasks/view.test.php index 22769075b..1f8f78dbd 100644 --- a/cake/tests/cases/console/libs/tasks/view.test.php +++ b/cake/tests/cases/console/libs/tasks/view.test.php @@ -1,9 +1,9 @@ <?php /* SVN FILE: $Id$ */ /** - * TestTaskTest file + * ViewTask Test file * - * Test Case for test generation shell task + * Test Case for view generation shell task * * PHP versions 4 and 5 * @@ -25,7 +25,6 @@ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ App::import('Core', 'Shell'); -App::import('Core', array('Controller', 'Model')); if (!defined('DISABLE_AUTO_DISPATCH')) { define('DISABLE_AUTO_DISPATCH', true); @@ -85,6 +84,32 @@ function add() { } } +class ViewTaskArticlesController extends Controller { + var $name = 'ViewTaskArticles'; + + function index() { + + } + function add() { + + } + + function admin_index() { + + } + function admin_add() { + + } + function admin_view() { + + } + function admin_edit() { + + } + function admin_delete() { + + } +} /** * ViewTaskTest class @@ -96,7 +121,7 @@ class ViewTaskTest extends CakeTestCase { var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag'); /** - * setUp method + * startTest method * * @return void * @access public @@ -111,9 +136,8 @@ function startTest() { $this->Task->Project =& new ViewTaskMockProjectTask(); $this->Task->path = TMP; } - /** - * tearDown method + * endTest method * * @return void * @access public @@ -121,7 +145,6 @@ function startTest() { function endTest() { ClassRegistry::flush(); } - /** * Test getContent and parsing of Templates. * @@ -151,13 +174,13 @@ function testGetContent() { $this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'name\'\]/', $result); $this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'body\'\]/', $result); } - /** * test getContent() using an admin_prefixed action. * * @return void **/ function testGetContentWithAdminAction() { + $_back = Configure::read('Routing.admin'); Configure::write('Routing.admin', 'admin'); $vars = array( 'modelClass' => 'TestViewModel', @@ -181,8 +204,9 @@ function testGetContentWithAdminAction() { $this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'id\'\]/', $result); $this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'name\'\]/', $result); $this->assertPattern('/testViewModel\[\'TestViewModel\'\]\[\'body\'\]/', $result); - } + Configure::write('Routing.admin', $_back); + } /** * test Bake method * @@ -202,12 +226,11 @@ function testBake() { $this->Task->bake('edit', true); $this->Task->expectAt(2, 'createFile', array( - TMP . 'view_task_comments' . DS . 'index.ctp', + TMP . 'view_task_comments' . DS . 'index.ctp', new PatternExpectation('/\$viewTaskComment\[\'Article\'\]\[\'title\'\]/') )); $this->Task->bake('index', true); } - /** * test bake() with a -plugin param * @@ -222,7 +245,6 @@ function testBakeWithPlugin() { $this->Task->expectAt(0, 'createFile', array($path, '*')); $this->Task->bake('view', true); } - /** * test bake actions baking multiple actions. * @@ -233,7 +255,7 @@ function testBakeActions() { $this->Task->controllerPath = 'view_task_comments'; $this->Task->expectAt(0, 'createFile', array( - TMP . 'view_task_comments' . DS . 'view.ctp', + TMP . 'view_task_comments' . DS . 'view.ctp', new PatternExpectation('/ViewTaskComments/') )); $this->Task->expectAt(1, 'createFile', array( @@ -247,7 +269,6 @@ function testBakeActions() { $this->Task->bakeActions(array('view', 'edit', 'index'), array()); } - /** * test baking a customAction (non crud) * @@ -265,7 +286,6 @@ function testCustomAction() { $this->Task->customAction(); } - /** * Test all() * @@ -285,7 +305,6 @@ function testExecuteIntoAll() { $this->Task->execute(); } - /** * test `cake bake view $controller view` * @@ -299,9 +318,9 @@ function testExecuteWithActionParam() { $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'view.ctp', '*')); $this->Task->execute(); } - /** - * test `cake bake view $controller` + * test `cake bake view $controller` + * Ensure that views are only baked for actions that exist in the controller. * * @return void **/ @@ -311,9 +330,30 @@ function testExecuteWithController() { $this->Task->expectCallCount('createFile', 2); $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'index.ctp', '*')); $this->Task->expectAt(1, 'createFile', array(TMP . 'view_task_comments' . DS . 'add.ctp', '*')); + $this->Task->execute(); } +/** + * test `cake bake view $controller -admin` + * Which only bakes admin methods, not non-admin methods. + * + * @return void + **/ + function testExecuteWithControllerAndAdminFlag() { + $_back = Configure::read('Routing.admin'); + Configure::write('Routing.admin', 'admin'); + $this->Task->args[0] = 'ViewTaskArticles'; + $this->Task->params['admin'] = 1; + + $this->Task->expectCallCount('createFile', 4); + $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_articles' . DS . 'admin_index.ctp', '*')); + $this->Task->expectAt(1, 'createFile', array(TMP . 'view_task_articles' . DS . 'admin_add.ctp', '*')); + $this->Task->expectAt(2, 'createFile', array(TMP . 'view_task_articles' . DS . 'admin_view.ctp', '*')); + $this->Task->expectAt(3, 'createFile', array(TMP . 'view_task_articles' . DS . 'admin_edit.ctp', '*')); + $this->Task->execute(); + Configure::write('Routing.admin', $_back); + } /** * test execute into interactive. * @@ -322,6 +362,7 @@ function testExecuteWithController() { function testExecuteInteractive() { $this->Task->connection = 'test_suite'; $this->Task->args = array(); + $this->Task->params = array(); $this->Task->Controller->setReturnValue('getName', 'ViewTaskComments'); $this->Task->setReturnValue('in', 'y'); @@ -349,7 +390,6 @@ function testExecuteInteractive() { $this->Task->execute(); } - /** * test execute into interactive() with admin methods. * @@ -359,20 +399,20 @@ function testExecuteInteractiveWithAdmin() { Configure::write('Routing.admin', 'admin'); $this->Task->connection = 'test_suite'; $this->Task->args = array(); - + $this->Task->Controller->setReturnValue('getName', 'ViewTaskComments'); $this->Task->Project->setReturnValue('getAdmin', 'admin_'); $this->Task->setReturnValueAt(0, 'in', 'y'); $this->Task->setReturnValueAt(1, 'in', 'n'); $this->Task->setReturnValueAt(2, 'in', 'y'); - + $this->Task->expectCallCount('createFile', 4); $this->Task->expectAt(0, 'createFile', array( - TMP . 'view_task_comments' . DS . 'admin_index.ctp', + TMP . 'view_task_comments' . DS . 'admin_index.ctp', new PatternExpectation('/ViewTaskComment/') )); $this->Task->expectAt(1, 'createFile', array( - TMP . 'view_task_comments' . DS . 'admin_view.ctp', + TMP . 'view_task_comments' . DS . 'admin_view.ctp', new PatternExpectation('/ViewTaskComment/') )); $this->Task->expectAt(2, 'createFile', array( From ad3e5f43e05cc96c690f0f25f543332b5f789463 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Thu, 16 Jul 2009 23:55:41 -0400 Subject: [PATCH 0303/2083] Removing newlines in files. Adding and update bake.test to bake group test. Fixing doc blocks. --- cake/console/libs/bake.php | 11 +----- cake/console/libs/tasks/controller.php | 24 ++---------- cake/console/libs/tasks/db_config.php | 10 +---- cake/console/libs/tasks/extract.php | 8 +--- cake/console/libs/tasks/fixture.php | 17 ++------- cake/console/libs/tasks/model.php | 35 +---------------- cake/console/libs/tasks/plugin.php | 15 +------- cake/console/libs/tasks/project.php | 1 - cake/console/libs/tasks/template.php | 14 ++----- cake/console/libs/tasks/test.php | 32 ++-------------- cake/console/libs/tasks/view.php | 8 +--- cake/tests/cases/console/libs/bake.test.php | 26 ++++++++----- .../console/libs/tasks/controller.test.php | 21 +--------- .../console/libs/tasks/db_config.test.php | 9 +---- .../cases/console/libs/tasks/fixture.test.php | 10 ++--- .../cases/console/libs/tasks/model.test.php | 38 +++---------------- .../cases/console/libs/tasks/plugin.test.php | 11 +----- .../cases/console/libs/tasks/project.test.php | 11 +----- .../console/libs/tasks/template.test.php | 16 +++----- .../cases/console/libs/tasks/test.test.php | 29 ++------------ .../cases/console/libs/tasks/view.test.php | 4 -- cake/tests/groups/bake.group.php | 3 +- 22 files changed, 68 insertions(+), 285 deletions(-) diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index c18851338..fc81eec16 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -1,5 +1,4 @@ <?php -/* SVN FILE: $Id$ */ /** * Command-line code generation utility to automate programmer chores. * @@ -21,9 +20,6 @@ * @package cake * @subpackage cake.cake.console.libs * @since CakePHP(tm) v 1.2.0.5012 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** @@ -137,9 +133,10 @@ function all() { } if (empty($this->args)) { + $this->Model->interactive = true; $name = $this->Model->getName($this->connection); } - + foreach (array('Model', 'Controller', 'View') as $task) { $this->{$task}->connection = $this->connection; $this->{$task}->interactive = false; @@ -188,10 +185,6 @@ function all() { } else { $this->err(__('Bake All could not continue without a valid model', true)); } - - if (empty($this->args)) { - $this->all(); - } $this->_stop(); } diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 514089e72..46828a750 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -1,5 +1,4 @@ <?php -/* SVN FILE: $Id$ */ /** * The ControllerTask handles creating and updating controller files. * @@ -8,20 +7,17 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. + * Copyright 2005-2009, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.tasks * @since CakePHP(tm) v 1.2 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** @@ -59,7 +55,6 @@ class ControllerTask extends Shell { */ function initialize() { } - /** * Execution method always used for tasks * @@ -102,7 +97,6 @@ function execute() { } } } - /** * Bake All the controllers at once. Will only bake controllers for models that exist. * @@ -125,7 +119,6 @@ function all() { } } } - /** * Interactive * @@ -209,7 +202,6 @@ function __interactive() { } } } - /** * Confirm a to be baked controller with the user * @@ -247,7 +239,6 @@ function confirmController($controllerName, $useDynamicScaffold, $helpers, $comp } $this->hr(); } - /** * Interact with the user and ask about which methods (admin or regular they want to bake) * @@ -264,7 +255,6 @@ function _askAboutMethods() { ); return array($wannaBakeCrud, $wannaBakeAdminCrud); } - /** * Bake scaffold actions * @@ -296,8 +286,6 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) { $actions = $this->Template->generate('actions', 'controller_actions'); return $actions; } - - /** * Assembles and writes a Controller file * @@ -326,7 +314,6 @@ function bake($controllerName, $actions = '', $helpers = null, $components = nul } return false; } - /** * Assembles and writes a unit test file * @@ -339,7 +326,6 @@ function bakeTest($className) { $this->Test->connection = $this->connection; return $this->Test->bake('Controller', $className); } - /** * Interact with the user and get a list of additional helpers * @@ -363,7 +349,6 @@ function doComponents() { __("Please provide a comma separated list of the component names you'd like to use.\nExample: 'Acl, Security, RequestHandler'", true) ); } - /** * Common code for property choice handling. * @@ -381,7 +366,6 @@ function _doPropertyChoices($prompt, $example) { } return array_filter($property); } - /** * Outputs and gets the list of possible controllers from database * @@ -408,7 +392,6 @@ function listAll($useDbConfig = null) { } return $this->__tables; } - /** * Forces the user to specify the controller he wants to bake, and returns the selected controller name. * @@ -441,7 +424,6 @@ function getName($useDbConfig = null) { } return $controllerName; } - /** * Displays help contents * @@ -474,4 +456,4 @@ function help() { $this->_stop(); } } -?> +?> \ No newline at end of file diff --git a/cake/console/libs/tasks/db_config.php b/cake/console/libs/tasks/db_config.php index e93a8312b..42c0a42af 100644 --- a/cake/console/libs/tasks/db_config.php +++ b/cake/console/libs/tasks/db_config.php @@ -1,5 +1,4 @@ <?php -/* SVN FILE: $Id$ */ /** * The DbConfig Task handles creating and updating the database.php * @@ -8,20 +7,17 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.tasks * @since CakePHP(tm) v 1.2 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** @@ -341,7 +337,6 @@ function bake($configs) { $filename = $this->path . 'database.php'; return $this->createFile($filename, $out); } - /** * Get a user specified Connection name * @@ -361,6 +356,5 @@ function getConfig() { } return $useDbConfig; } - } ?> \ No newline at end of file diff --git a/cake/console/libs/tasks/extract.php b/cake/console/libs/tasks/extract.php index 7918e8cd7..552eb8497 100644 --- a/cake/console/libs/tasks/extract.php +++ b/cake/console/libs/tasks/extract.php @@ -1,5 +1,4 @@ <?php -/* SVN FILE: $Id$ */ /** * Short description for file. * @@ -8,20 +7,17 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs * @since CakePHP(tm) v 1.2.0.5012 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 8a67edb4a..3ebc15e24 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -1,12 +1,11 @@ <?php -/* SVN FILE: $Id$ */ /** - * The FixtureTest handles creating and updating fixture files. + * The FixtureTask handles creating and updating fixture files. * * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. + * Copyright 2005-2009, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. @@ -17,9 +16,6 @@ * @package cake * @subpackage cake.cake.console.libs.tasks * @since CakePHP(tm) v 1.3 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** @@ -90,7 +86,6 @@ function execute() { $this->bake($model); } } - /** * Bake All the Fixtures at once. Will only bake fixtures for models that exist. * @@ -105,7 +100,6 @@ function all() { $this->bake($model); } } - /** * Interactive baking function * @@ -144,7 +138,6 @@ function importOptions($modelName) { } return $options; } - /** * Assembles and writes a Fixture file * @@ -199,7 +192,6 @@ function bake($model, $useTable = false, $importOptions = array()) { $out = $this->generateFixtureFile($model, compact('records', 'table', 'schema', 'import', 'fields')); return $out; } - /** * Generate the fixture file, and write to disk * @@ -226,7 +218,6 @@ function generateFixtureFile($model, $otherVars) { $this->createFile($path . $filename, $content); return $content; } - /** * Generates a string representation of a schema. * @@ -257,7 +248,6 @@ function _generateSchema($tableInfo) { $out .= "\n\t)"; return $out; } - /** * Generate String representation of Records * @@ -322,7 +312,6 @@ function _generateRecords($tableInfo, $recordCount = 1) { $out .= "\t)"; return $out; } - /** * Displays help contents * @@ -344,4 +333,4 @@ function help() { $this->_stop(); } } -?> +?> \ No newline at end of file diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 23c04563a..d436748d9 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -1,5 +1,4 @@ <?php -/* SVN FILE: $Id$ */ /** * The ModelTask handles creating and updating models files. * @@ -8,20 +7,17 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.tasks * @since CakePHP(tm) v 1.2 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ App::import('Model', 'ConnectionManager'); @@ -39,7 +35,6 @@ class ModelTask extends Shell { * @access public */ var $plugin = null; - /** * Name of the db connection used. * @@ -47,7 +42,6 @@ class ModelTask extends Shell { * @access public */ var $connection = null; - /** * path to MODELS directory * @@ -55,7 +49,6 @@ class ModelTask extends Shell { * @access public */ var $path = MODELS; - /** * tasks * @@ -63,21 +56,18 @@ class ModelTask extends Shell { * @access public */ var $tasks = array('DbConfig', 'Fixture', 'Test', 'Template'); - /** * Holds tables found on connection. * * @var array **/ var $__tables = array(); - /** * Holds validation method map. * * @var array **/ var $__validations = array(); - /** * startup method * @@ -87,7 +77,6 @@ function startup() { App::import('Core', 'Model'); parent::startup(); } - /** * Execution method always used for tasks * @@ -116,7 +105,6 @@ function execute() { } } } - /** * Bake all models at once. * @@ -135,7 +123,6 @@ function all() { } } } - /** * Get a model object for a class name. * @@ -146,7 +133,6 @@ function &_getModelObject($className) { $object = new Model(array('name' => $className, 'ds' => $this->connection)); return $object; } - /** * Generate a key value list of options and a prompt. * @@ -172,7 +158,6 @@ function inOptions($options, $prompt = null, $default = null) { } return $choice - 1; } - /** * Handles interactive baking * @@ -265,7 +250,6 @@ function __interactive() { return false; } } - /** * Print out all the associations of a particular type * @@ -283,7 +267,6 @@ function _printAssociation($modelName, $type, $associations) { } } } - /** * Finds a primary Key in a list of fields. * @@ -437,7 +420,6 @@ function fieldValidation($fieldName, $metaData, $primaryKey = 'id') { } return $validate; } - /** * Handles associations * @@ -484,7 +466,6 @@ function doAssociations(&$model) { } return $associations; } - /** * Find belongsTo relations and add them to the associations list. * @@ -513,7 +494,6 @@ function findBelongsTo(&$model, $associations) { } return $associations; } - /** * Find the hasOne and HasMany relations and add them to associations list * @@ -556,7 +536,6 @@ function findHasOneAndMany(&$model, $associations) { } return $associations; } - /** * Find the hasAndBelongsToMany relations and add them to associations list * @@ -596,7 +575,6 @@ function findHasAndBelongsToMany(&$model, $associations) { } return $associations; } - /** * Interact with the user and confirm associations. * @@ -624,7 +602,6 @@ function confirmAssociations(&$model, $associations) { } return $associations; } - /** * Interact with the user and generate additional non-conventional associations * @@ -691,7 +668,6 @@ function doMoreAssociations($model, $associations) { } return $associations; } - /** * Finds all possible keys to use on custom associations. * @@ -748,7 +724,6 @@ function bake($name, $data = array()) { $this->createFile($filename, $out); return $out; } - /** * Assembles and writes a unit test file * @@ -760,7 +735,6 @@ function bakeTest($className) { $this->Test->connection = $this->connection; return $this->Test->bake('Model', $className); } - /** * outputs the a list of possible models or controllers from database * @@ -781,7 +755,6 @@ function listAll($useDbConfig = null) { } return $this->__tables; } - /** * Interact with the user to determine the table name of a particular model * @@ -808,7 +781,6 @@ function getTable($modelName, $useDbConfig = null) { } return $useTable; } - /** * Get an Array of all the tables in the supplied connection * will halt the script if no tables are found. @@ -838,7 +810,6 @@ function getAllTables($useDbConfig = null) { } return $tables; } - /** * Forces the user to specify the model he wants to bake, and returns the selected model name. * @@ -870,7 +841,6 @@ function getName($useDbConfig = null) { } return $currentModelName; } - /** * Displays help contents * @@ -893,7 +863,6 @@ function help() { $this->out(""); $this->_stop(); } - /** * Interact with FixtureTask to automatically bake fixtures when baking models. * diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index 5e50bb877..e169e7c04 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -1,5 +1,4 @@ <?php -/* SVN FILE: $Id$ */ /** * The Plugin Task handles creating an empty plugin, ready to be used * @@ -8,20 +7,17 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.tasks * @since CakePHP(tm) v 1.2 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ @@ -37,7 +33,6 @@ class PluginTask extends Shell { * */ var $tasks = array('Model', 'Controller', 'View'); - /** * path to CONTROLLERS directory * @@ -45,7 +40,6 @@ class PluginTask extends Shell { * @access public */ var $path = null; - /** * initialize * @@ -54,7 +48,6 @@ class PluginTask extends Shell { function initialize() { $this->path = APP . 'plugins' . DS; } - /** * Execution method always used for tasks * @@ -99,7 +92,6 @@ function execute() { } } } - /** * Interactive interface * @@ -115,7 +107,6 @@ function __interactive($plugin = null) { $this->err(sprintf(__("An error occured trying to bake: %s in %s", true), $plugin, $this->path . $pluginPath)); } } - /** * Bake the plugin, create directories and files * @@ -200,7 +191,6 @@ function bake($plugin) { return true; } - /** * find and change $this->path to the user selection * @@ -221,7 +211,6 @@ function findPath($pathOptions) { } $this->path = $pathOptions[$choice - 1]; } - /** * Help * diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php index 7cc635cf5..fda6a7cf7 100644 --- a/cake/console/libs/tasks/project.php +++ b/cake/console/libs/tasks/project.php @@ -19,7 +19,6 @@ * @since CakePHP(tm) v 1.2 * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ - /** * Task class for creating new project apps and plugins * diff --git a/cake/console/libs/tasks/template.php b/cake/console/libs/tasks/template.php index ac01e9e30..fd01e90d5 100644 --- a/cake/console/libs/tasks/template.php +++ b/cake/console/libs/tasks/template.php @@ -2,7 +2,6 @@ /** * Template Task can generate templated output Used in other Tasks * - * * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) @@ -14,7 +13,7 @@ * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org * @package cake - * @subpackage cake. + * @subpackage cake.console.libs.tasks * @since CakePHP(tm) v 1.3 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ @@ -25,7 +24,6 @@ class TemplateTask extends Shell { * @var array **/ var $templateVars = array(); - /** * Paths to look for templates on. * Contains a list of $theme => $path @@ -33,7 +31,6 @@ class TemplateTask extends Shell { * @var array **/ var $templatePaths = array(); - /** * Initialize callback. Setup paths for the template task. * @@ -43,7 +40,6 @@ class TemplateTask extends Shell { function initialize() { $this->templatePaths = $this->_findThemes(); } - /** * Find the paths to all the installed shell themes in the app. * @@ -68,7 +64,6 @@ function _findThemes() { } return $themes; } - /** * Set variable values to the template scope * @@ -97,7 +92,6 @@ function set($one, $two = null) { $this->templateVars[$name] = $value; } } - /** * Runs the template * @@ -126,7 +120,6 @@ function generate($directory, $filename, $vars = null) { } return ''; } - /** * Find the theme name for the current operation. * If there is only one theme in $templatePaths it will be used. @@ -161,7 +154,6 @@ function getThemePath() { $this->Dispatch->params['theme'] = $themeNames[$index - 1]; return $indexedPaths[$index]; } - /** * Find a template inside a directory inside a path. * Will scan all other theme dirs if the template is not found in the first directory. @@ -187,5 +179,5 @@ function _findTemplate($path, $directory, $filename) { $this->_stop(); return false; } - -} \ No newline at end of file +} +?> \ No newline at end of file diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 6a7b6e732..54668a843 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -1,27 +1,21 @@ <?php -/* SVN FILE: $Id$ */ /** * The TestTask handles creating and updating test files. * - * Long description for file - * * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.tasks - * @since CakePHP(tm) v 1.2 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ + * @since CakePHP(tm) v 1.3 * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** @@ -52,28 +46,24 @@ class TestTask extends Shell { * @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; - /** * Execution method always used for tasks * @@ -95,7 +85,6 @@ function execute() { } } } - /** * Handles interactive baking * @@ -121,7 +110,6 @@ function __interactive($type = null) { $className = $this->getClassName($type); return $this->bake($type, $className); } - /** * Completes final steps for generating data to create test case. * @@ -185,7 +173,6 @@ function getObjectType() { } return $this->classTypes[$selection - 1]; } - /** * Get the user chosen Class name for the chosen type * @@ -206,7 +193,6 @@ function getClassName($objectType) { } return $selection; } - /** * Checks whether the chosen type can find its own fixtures. * Currently only model, and controller are supported @@ -217,7 +203,6 @@ function typeCanDetectFixtures($type) { $type = strtolower($type); return ($type == 'controller' || $type == 'model'); } - /** * Check if a class with the given type is loaded or can be loaded. * @@ -226,7 +211,6 @@ function typeCanDetectFixtures($type) { function isLoadableClass($type, $class) { return App::import($type, $class); } - /** * Construct an instance of the class to be tested. * So that fixtures can be detected @@ -244,7 +228,6 @@ function &buildTestSubject($type, $class) { } return $instance; } - /** * Gets the real class name from the cake short form. * @@ -256,7 +239,6 @@ function getRealClassName($type, $class) { } return $class . $type; } - /** * Get methods declared in the class given. * No parent methods will be returned @@ -276,7 +258,6 @@ function getTestableMethods($className) { } return $out; } - /** * Generate the list of fixtures that will be required to run this test based on * loaded models. @@ -293,7 +274,6 @@ function generateFixtureList(&$subject) { } return array_values($this->_fixtures); } - /** * Process a model recursively and pull out all the * model names converting them to fixture names. @@ -317,7 +297,6 @@ function _processModel(&$subject) { } } } - /** * Process all the models attached to a controller * and generate a fixture list. @@ -335,7 +314,6 @@ function _processController(&$subject) { $this->_processModel($subject->{$model}); } } - /** * Add classname to the fixture list. * Sets the app. or plugin.plugin_name. prefix. @@ -353,7 +331,6 @@ function _addFixture($name) { $fixture = $prefix . Inflector::underscore($name); $this->_fixtures[$name] = $fixture; } - /** * Interact with the user to get additional fixtures they want to use. * @@ -370,7 +347,6 @@ function getUserFixtures() { $this->_fixtures = array_merge($this->_fixtures, $fixtures); return $fixtures; } - /** * Is a mock class required for this type of test? * Controllers require a mock class. @@ -381,7 +357,6 @@ function hasMockClass($type) { $type = strtolower($type); return $type == 'controller'; } - /** * Generate a constructor code snippet for the type and classname * @@ -397,7 +372,6 @@ function generateConstructor($type, $fullClassName) { } return "new $fullClassName()\n"; } - /** * make the filename for the test case. resolve the suffixes for controllers * and get the plugin path if needed. diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 7634efff4..ba5f1c37e 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -1,5 +1,4 @@ <?php -/* SVN FILE: $Id$ */ /** * The View Tasks handles creating and updating view files. * @@ -8,20 +7,17 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.tasks * @since CakePHP(tm) v 1.2 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ App::import('Core', 'Controller'); diff --git a/cake/tests/cases/console/libs/bake.test.php b/cake/tests/cases/console/libs/bake.test.php index 22b813fbb..925953e09 100644 --- a/cake/tests/cases/console/libs/bake.test.php +++ b/cake/tests/cases/console/libs/bake.test.php @@ -49,9 +49,9 @@ Mock::generate('ModelTask', 'BakeShellMockModelTask'); Mock::generate('ControllerTask', 'BakeShellMockControllerTask'); -if (!class_exists('ArticlesController')) { - class ArticlesController extends Controller { - var $name = 'Articles'; +if (!class_exists('UsersController')) { + class UsersController extends Controller { + var $name = 'Users'; } } @@ -61,7 +61,7 @@ class BakeShellTestCase extends CakeTestCase { * * @var array **/ - var $fixtures = array('core.article'); + var $fixtures = array('core.user'); /** * start test * @@ -70,9 +70,17 @@ class BakeShellTestCase extends CakeTestCase { function startTest() { $this->Dispatch =& new BakeShellMockShellDispatcher(); $this->Shell =& new MockBakeShell(); - $this->Shell->Dispatch =& $this->Dispatcher; + $this->Shell->Dispatch =& $this->Dispatch; $this->Shell->Dispatch->shellPaths = App::path('shells'); } +/** + * endTest method + * + * @return void + **/ + function endTest() { + unset($this->Dispatch, $this->Shell); + } /** * test bake all * @@ -97,13 +105,13 @@ function testAllWithModelName() { $this->Shell->View->expectOnce('execute'); $this->Shell->expectAt(0, 'out', array('Bake All')); - $this->Shell->expectAt(1, 'out', array('Article Model was baked.')); - $this->Shell->expectAt(2, 'out', array('Article Controller was baked.')); - $this->Shell->expectAt(3, 'out', array('Article Views were baked.')); + $this->Shell->expectAt(1, 'out', array('User Model was baked.')); + $this->Shell->expectAt(2, 'out', array('User Controller was baked.')); + $this->Shell->expectAt(3, 'out', array('User Views were baked.')); $this->Shell->expectAt(4, 'out', array('Bake All complete')); $this->Shell->params = array(); - $this->Shell->args = array('Article', 'exitvalue'); + $this->Shell->args = array('User'); $this->Shell->all(); } } \ No newline at end of file diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 125eef72a..f43ce27b5 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -2,7 +2,6 @@ /** * ControllerTask Test Case * - * * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) @@ -88,9 +87,8 @@ class ControllerTaskTest extends CakeTestCase { * @var array **/ var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag'); - /** - * setUp method + * startTest method * * @return void * @access public @@ -106,9 +104,8 @@ function startTest() { $this->Task->Project =& new ControllerMockProjectTask($this->Task->Dispatch); $this->Task->Test =& new ControllerMockTestTask(); } - /** - * tearDown method + * endTest method * * @return void * @access public @@ -117,7 +114,6 @@ function endTest() { unset($this->Task, $this->Dispatcher); ClassRegistry::flush(); } - /** * test ListAll * @@ -146,7 +142,6 @@ function testListAll() { $expected = array('articles', 'articles_tags', 'comments', 'tags'); $this->assertEqual($result, $expected); } - /** * Test that getName interacts with the user and returns the controller name. * @@ -173,7 +168,6 @@ function testGetName() { $result = $this->Task->getName('test_suite'); $this->Task->expectOnce('err'); } - /** * test helper interactions * @@ -196,7 +190,6 @@ function testDoHelpers() { $expected = array('Javascript', 'Ajax', 'CustomOne'); $this->assertEqual($result, $expected); } - /** * test component interactions * @@ -219,7 +212,6 @@ function testDoComponents() { $expected = array('RequestHandler', 'Security'); $this->assertEqual($result, $expected); } - /** * test Confirming controller user interaction * @@ -237,7 +229,6 @@ function testConfirmController() { $this->Task->expectAt(4, 'out', array("Components:\n\tAcl, Auth")); $this->Task->confirmController($controller, $scaffold, $helpers, $components); } - /** * test the bake method * @@ -260,7 +251,6 @@ function testBake() { $this->assertNoPattern('/helpers/', $result); $this->assertNoPattern('/components/', $result); } - /** * test bake() with a -plugin param * @@ -282,7 +272,6 @@ function testBakeWithPlugin() { $path, new PatternExpectation('/ArticlesController extends ControllerTestAppController/'))); $this->Task->bake('Articles', '--actions--', array(), array(), array()); } - /** * test that bakeActions is creating the correct controller Code. (Using sessions) * @@ -325,7 +314,6 @@ function testBakeActionsUsingSessions() { $this->assertTrue(strpos($result, 'function admin_edit($id = null)') !== false); $this->assertTrue(strpos($result, 'function admin_delete($id = null)') !== false); } - /** * Test baking with Controller::flash() or no sessions. * @@ -360,7 +348,6 @@ function testBakeActionsWithNoSessions() { $this->assertTrue(strpos($result, 'if ($this->Article->del($id))') !== false); $this->assertTrue(strpos($result, "\$this->flash(__('Article deleted', true), array('action' => 'index'))") !== false); } - /** * test baking a test * @@ -376,7 +363,6 @@ function testBakeTest() { $this->assertEqual($this->Task->plugin, $this->Task->Test->plugin); $this->assertEqual($this->Task->connection, $this->Task->Test->connection); } - /** * test Interactive mode. * @@ -400,7 +386,6 @@ function testInteractive() { $filename = '/my/path/articles_controller.php'; $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticlesController/'))); } - /** * test that execute runs all when the first arg == all * @@ -425,7 +410,6 @@ function testExecuteIntoAll() { $this->Task->execute(); } - /** * test that `cake bake controller foo scaffold` works. * @@ -448,7 +432,6 @@ function testExecuteWithScaffoldParam() { $this->Task->execute(); } - /** * test that `cake bake controller foo scaffold admin` works * diff --git a/cake/tests/cases/console/libs/tasks/db_config.test.php b/cake/tests/cases/console/libs/tasks/db_config.test.php index 45dde61a7..bfd999e0d 100644 --- a/cake/tests/cases/console/libs/tasks/db_config.test.php +++ b/cake/tests/cases/console/libs/tasks/db_config.test.php @@ -2,7 +2,6 @@ /** * DBConfigTask Test Case * - * * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) @@ -74,9 +73,8 @@ class TEST_DATABASE_CONFIG { * @subpackage cake.tests.cases.console.libs.tasks */ class DbConfigTaskTest extends CakeTestCase { - /** - * setUp method + * startTest method * * @return void * @access public @@ -90,9 +88,8 @@ function startTest() { $this->Task->params['working'] = rtrim(APP, '/'); $this->Task->databaseClassName = 'TEST_DATABASE_CONFIG'; } - /** - * tearDown method + * endTest method * * @return void * @access public @@ -101,7 +98,6 @@ function endTest() { unset($this->Task, $this->Dispatcher); ClassRegistry::flush(); } - /** * Test the getConfig method. * @@ -112,7 +108,6 @@ function testGetConfig() { $result = $this->Task->getConfig(); $this->assertEqual($result, 'otherOne'); } - /** * test that initialize sets the path up. * diff --git a/cake/tests/cases/console/libs/tasks/fixture.test.php b/cake/tests/cases/console/libs/tasks/fixture.test.php index 9f4a540a9..2981ab88f 100644 --- a/cake/tests/cases/console/libs/tasks/fixture.test.php +++ b/cake/tests/cases/console/libs/tasks/fixture.test.php @@ -2,8 +2,6 @@ /** * FixtureTask Test case * - * - * * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) @@ -15,7 +13,7 @@ * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org * @package cake - * @subpackage cake. + * @subpackage cake.tests.cases.console.libs.tasks * @since CakePHP(tm) v 1.3 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ @@ -63,7 +61,7 @@ class FixtureTaskTest extends CakeTestCase { **/ var $fixtures = array('core.article', 'core.comment'); /** - * setUp method + * startTest method * * @return void * @access public @@ -78,7 +76,7 @@ function startTest() { $this->Task->Template->initialize(); } /** - * tearDown method + * endTest method * * @return void * @access public @@ -132,7 +130,6 @@ function testExecuteWithNamedModel() { $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticleFixture/'))); $this->Task->execute(); } - /** * test that execute runs all() when args[0] = all * @@ -152,7 +149,6 @@ function testExecuteIntoAll() { $this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/class CommentFixture/'))); $this->Task->execute(); } - /** * test interactive mode of execute * diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index 186ae003c..540414d87 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -1,5 +1,4 @@ <?php -/* SVN FILE: $Id$ */ /** * TestTaskTest file * @@ -8,20 +7,17 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2009, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2009, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.cases.console.libs.tasks - * @since CakePHP v 1.2.0.7726 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ + * @since CakePHP v 1.3 * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ App::import('Core', 'Shell'); @@ -72,9 +68,8 @@ class ModelTaskTest extends CakeTestCase { * @var array **/ var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag', 'core.category_thread'); - /** - * setUp method + * starTest method * * @return void * @access public @@ -88,9 +83,8 @@ function startTest() { $this->Task->Fixture =& new MockModelTaskFixtureTask(); $this->Task->Test =& new MockModelTaskFixtureTask(); } - /** - * tearDown method + * endTest method * * @return void * @access public @@ -99,7 +93,6 @@ function endTest() { unset($this->Task, $this->Dispatcher); ClassRegistry::flush(); } - /** * Test that listAll scans the database connection and lists all the tables in it.s * @@ -126,7 +119,6 @@ function testListAll() { $expected = array('articles', 'articles_tags', 'category_threads', 'comments', 'tags'); $this->assertEqual($result, $expected); } - /** * Test that getName interacts with the user and returns the model name. * @@ -153,7 +145,6 @@ function testGetName() { $result = $this->Task->getName('test_suite'); $this->Task->expectOnce('err'); } - /** * Test table name interactions * @@ -180,7 +171,6 @@ function testInitValidations() { $result = $this->Task->initValidations(); $this->assertTrue(in_array('notempty', $result)); } - /** * test that individual field validation works, with interactive = false * tests the guessing features of validation @@ -209,7 +199,6 @@ function testFieldValidationGuessing() { $result = $this->Task->fieldValidation('test', array('type' => 'boolean', 'length' => 10, 'null' => false)); $expected = array('numeric' => 'numeric'); } - /** * test that interactive field validation works and returns multiple validators. * @@ -227,7 +216,6 @@ function testInteractiveFieldValidation() { $expected = array('notempty' => 'notempty', 'maxlength' => 'maxlength'); $this->assertEqual($result, $expected); } - /** * test the validation Generation routine * @@ -288,7 +276,6 @@ function testNonInteractiveDoValidation() { ); $this->assertEqual($result, $expected); } - /** * test that finding primary key works * @@ -306,7 +293,6 @@ function testFindPrimaryKey() { $expected = 'my_field'; $this->assertEqual($result, $expected); } - /** * test finding Display field * @@ -326,7 +312,6 @@ function testFindDisplayField() { $result = $this->Task->findDisplayField($fields); $this->assertEqual($result, 'tagname'); } - /** * test that belongsTo generation works. * @@ -365,7 +350,6 @@ function testBelongsToGeneration() { ); $this->assertEqual($result, $expected); } - /** * test that hasOne and/or hasMany relations are generated properly. * @@ -415,7 +399,6 @@ function testHasManyHasOneGeneration() { ); $this->assertEqual($result, $expected); } - /** * test that habtm generation works * @@ -439,7 +422,6 @@ function testHasAndBelongsToManyGeneration() { ); $this->assertEqual($result, $expected); } - /** * test non interactive doAssociations * @@ -482,7 +464,6 @@ function testBakeFixture() { $this->assertEqual($this->Task->plugin, $this->Task->Fixture->plugin); $this->assertEqual($this->Task->connection, $this->Task->Fixture->connection); } - /** * Ensure that the test object is correctly called. * @@ -495,7 +476,6 @@ function testBakeTest() { $this->assertEqual($this->Task->plugin, $this->Task->Test->plugin); $this->assertEqual($this->Task->connection, $this->Task->Test->connection); } - /** * test confirming of associations, and that when an association is hasMany * a question for the hasOne is also not asked. @@ -536,7 +516,6 @@ function testConfirmAssociations() { $this->assertTrue(empty($result['hasMany'])); $this->assertTrue(empty($result['hasOne'])); } - /** * test that inOptions generates questions and only accepts a valid answer * @@ -556,7 +535,6 @@ function testInOptions() { $result = $this->Task->inOptions($options, 'Pick a number'); $this->assertEqual($result, 1); } - /** * test baking validation * @@ -584,7 +562,6 @@ function testBakeValidation() { $pattern = '/' . preg_quote("'notempty' => array('rule' => array('notempty')),", '/') . '/'; $this->assertPattern($pattern, $result); } - /** * test baking relations * @@ -638,7 +615,6 @@ function testBakeRelations() { $this->assertPattern('/SomethingElse/', $result); $this->assertPattern('/Comment/', $result); } - /** * test bake() with a -plugin param * @@ -658,7 +634,6 @@ function testBakeWithPlugin() { $path, new PatternExpectation('/Article extends ControllerTestAppModel/'))); $this->Task->bake('Article', array(), array()); } - /** * test that execute passes runs bake depending with named model. * @@ -673,7 +648,6 @@ function testExecuteWithNamedModel() { $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class Article extends AppModel/'))); $this->Task->execute(); } - /** * test that execute runs all() when args[0] = all * @@ -705,7 +679,6 @@ function testExecuteIntoAll() { $this->Task->execute(); } - /** * test the interactive side of bake. * @@ -734,7 +707,6 @@ function testExecuteIntoInteractive() { $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class Article/'))); $this->Task->execute(); } - /** * test using bake interactively with a table that does not exist. * diff --git a/cake/tests/cases/console/libs/tasks/plugin.test.php b/cake/tests/cases/console/libs/tasks/plugin.test.php index 1d9e74532..120bf50ef 100644 --- a/cake/tests/cases/console/libs/tasks/plugin.test.php +++ b/cake/tests/cases/console/libs/tasks/plugin.test.php @@ -56,9 +56,8 @@ * @subpackage cake.tests.cases.console.libs.tasks */ class PluginTaskTest extends CakeTestCase { - /** - * setUp method + * startTest method * * @return void * @access public @@ -70,7 +69,6 @@ function startTest() { $this->Task->Dispatch =& $this->Dispatcher; $this->Task->path = TMP . 'tests' . DS; } - /** * startCase methods * @@ -81,7 +79,6 @@ function startCase() { $this->_testPath = array_push($paths, TMP . 'tests' . DS); App::build(array('plugins' => $paths)); } - /** * endCase * @@ -90,9 +87,8 @@ function startCase() { function endCase() { App::build(array('plugins' => $this->_paths)); } - /** - * tearDown method + * endTest method * * @return void * @access public @@ -100,7 +96,6 @@ function endCase() { function endTest() { ClassRegistry::flush(); } - /** * test bake() * @@ -189,7 +184,6 @@ function testBakeFoldersAndFiles() { $Folder =& new Folder($this->Task->path . 'bake_test_plugin'); $Folder->delete(); } - /** * Test Execute * @@ -213,7 +207,6 @@ function XXtestExecuteWithOneArg() { $Folder =& new Folder($this->Task->path . 'bake_test_plugin'); $Folder->delete(); } - /** * test execute chaining into MVC parts * diff --git a/cake/tests/cases/console/libs/tasks/project.test.php b/cake/tests/cases/console/libs/tasks/project.test.php index a78f97659..928f54b0b 100644 --- a/cake/tests/cases/console/libs/tasks/project.test.php +++ b/cake/tests/cases/console/libs/tasks/project.test.php @@ -53,9 +53,8 @@ * @subpackage cake.tests.cases.console.libs.tasks */ class ProjectTaskTest extends CakeTestCase { - /** - * setUp method + * startTest method * * @return void * @access public @@ -67,9 +66,8 @@ function startTest() { $this->Task->Dispatch =& $this->Dispatcher; $this->Task->path = TMP . 'tests' . DS; } - /** - * tearDown method + * endTest method * * @return void * @access public @@ -80,7 +78,6 @@ function endTest() { $Folder =& new Folder($this->Task->path . 'bake_test_app'); $Folder->delete(); } - /** * creates a test project that is used for testing project task. * @@ -92,7 +89,6 @@ function _setupTestProject() { $this->Task->setReturnValueAt(1, 'in', 'n'); $this->Task->bake($this->Task->path . 'bake_test_app', $skel); } - /** * test bake() method and directory creation. * @@ -113,7 +109,6 @@ function testBake() { $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'groups'), 'No groups dir %s'); $this->assertTrue(is_dir($path . DS . 'tests' . DS . 'fixtures'), 'No fixtures dir %s'); } - /** * test generation of Security.salt * @@ -130,7 +125,6 @@ function testSecuritySaltGeneration() { $contents = $file->read(); $this->assertNoPattern('/DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi/', $contents, 'Default Salt left behind. %s'); } - /** * test getAdmin method, and that it returns Routing.admin or writes to config file. * @@ -149,7 +143,6 @@ function testGetAdmin() { $result = $this->Task->getAdmin(); $this->assertEqual($result, 'super_duper_admin_'); } - /** * Test execute method with one param to destination folder. * diff --git a/cake/tests/cases/console/libs/tasks/template.test.php b/cake/tests/cases/console/libs/tasks/template.test.php index fbb6a439c..6d13ae2d7 100644 --- a/cake/tests/cases/console/libs/tasks/template.test.php +++ b/cake/tests/cases/console/libs/tasks/template.test.php @@ -16,7 +16,7 @@ * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org * @package cake - * @subpackage cake. + * @subpackage cake.tests.cases.console.libs.tasks * @since CakePHP(tm) v 1.3 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ @@ -53,7 +53,7 @@ */ class TemplateTaskTest extends CakeTestCase { /** - * setUp method + * startTest method * * @return void * @access public @@ -61,12 +61,11 @@ class TemplateTaskTest extends CakeTestCase { function startTest() { $this->Dispatcher =& new TestTemplateTaskMockShellDispatcher(); $this->Task =& new MockTemplateTask($this->Dispatcher); - $this->Task->Dispatch = new $this->Dispatcher; + $this->Task->Dispatch =& $this->Dispatcher; $this->Task->Dispatch->shellPaths = App::path('shells'); } - /** - * tearDown method + * endTest method * * @return void * @access public @@ -75,7 +74,6 @@ function endTest() { unset($this->Task, $this->Dispatcher); ClassRegistry::flush(); } - /** * test that set sets variables * @@ -92,7 +90,6 @@ function testSet() { $this->assertTrue(isset($this->Task->templateVars['four'])); $this->assertEqual($this->Task->templateVars['four'], 'five'); } - /** * test finding themes installed in * @@ -104,7 +101,6 @@ function testFindingInstalledThemesForBake() { $this->Task->initialize(); $this->assertEqual($this->Task->templatePaths, array('default' => $consoleLibs . 'templates' . DS . 'default' . DS)); } - /** * test getting the correct theme name. Ensure that with only one theme, or a theme param * that the user is not bugged. If there are more, find and return the correct theme name @@ -128,9 +124,8 @@ function testGetThemePath() { $this->Task->setReturnValueAt(0, 'in', '1'); $result = $this->Task->getThemePath(); $this->assertEqual($result, $defaultTheme); - $this->assertEqual($this->Dispatch->params['theme'], 'default'); + $this->assertEqual($this->Dispatcher->params['theme'], 'default'); } - /** * test generate * @@ -145,7 +140,6 @@ function testGenerate() { $expected = "I got rendered\nfoo"; $this->assertEqual($result, $expected); } - /** * test generate with a missing template in the chosen theme. * ensure fallback to default works. diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index 8b695329d..7525ff0bf 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -8,20 +8,17 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2009, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2009, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.cases.console.libs.tasks * @since CakePHP v 1.2.0.7726 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ App::import('Core', 'Shell'); @@ -126,7 +123,7 @@ class TestTaskTest extends CakeTestCase { var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag'); /** - * setUp method + * startTest method * * @return void * @access public @@ -138,9 +135,8 @@ function startTest() { $this->Task->Dispatch =& $this->Dispatcher; $this->Task->Template =& new TemplateTask($this->Dispatcher); } - /** - * tearDown method + * endTest method * * @return void * @access public @@ -148,7 +144,6 @@ function startTest() { function endTest() { ClassRegistry::flush(); } - /** * Test that file path generation doesn't continuously append paths. * @@ -172,7 +167,6 @@ function testFilePathGeneration () { $this->Task->expectAt(2, 'createFile', array($file, '*')); $this->Task->bake('Controller', 'Comments'); } - /** * Test that method introspection pulls all relevant non parent class * methods into the test case. @@ -184,7 +178,6 @@ function testMethodIntrospection() { $expected = array('doSomething', 'doSomethingElse'); $this->assertEqual($result, $expected); } - /** * test that the generation of fixtures works correctly. * @@ -198,7 +191,6 @@ function testFixtureArrayGenerationFromModel() { $this->assertEqual(sort($result), sort($expected)); } - /** * test that the generation of fixtures works correctly. * @@ -212,7 +204,6 @@ function testFixtureArrayGenerationFromController() { $this->assertEqual(sort($result), sort($expected)); } - /** * test user interaction to get object type * @@ -227,7 +218,6 @@ function testGetObjectType() { $result = $this->Task->getObjectType(); $this->assertEqual($result, $this->Task->classTypes[1]); } - /** * creating test subjects should clear the registry so the registry is always fresh * @@ -251,7 +241,6 @@ function testRegistryClearWhenBuildingTestObjects() { $keys = ClassRegistry::keys(); $this->assertFalse(in_array('random', $keys)); } - /** * test that getClassName returns the user choice as a classname. * @@ -272,7 +261,6 @@ function testGetClassName() { $options = Configure::listObjects('model'); $this->assertEqual($result, $options[0]); } - /** * Test the user interaction for defining additional fixtures. * @@ -285,7 +273,6 @@ function testGetUserFixtures() { $expected = array('app.pizza', 'app.topping', 'app.side_dish'); $this->assertEqual($result, $expected); } - /** * test that resolving classnames works * @@ -307,7 +294,6 @@ function testGetRealClassname() { $result = $this->Task->getRealClassname('Component', 'Auth'); $this->assertEqual($result, 'AuthComponent'); } - /** * test baking files. * @@ -336,7 +322,6 @@ function testBakeModelTest() { $this->assertPattern("/'app\.test_task_tag'/", $result); $this->assertPattern("/'app\.articles_tag'/", $result); } - /** * test baking controller test files, ensure that the stub class is generated. * @@ -366,7 +351,6 @@ function testBakeControllerTest() { $this->assertPattern("/'app\.test_task_tag'/", $result); $this->assertPattern("/'app\.articles_tag'/", $result); } - /** * test Constructor generation ensure that constructClasses is called for controllers * @@ -385,7 +369,6 @@ function testGenerateContsructor() { $expected = "new FormHelper()\n"; $this->assertEqual($result, $expected); } - /** * Test that mock class generation works for the appropriate classes * @@ -395,7 +378,6 @@ function testMockClassGeneration() { $result = $this->Task->hasMockClass('controller'); $this->assertTrue($result); } - /** * test bake() with a -plugin param * @@ -408,7 +390,6 @@ function testBakeWithPlugin() { $this->Task->expectAt(0, 'createFile', array($path, '*')); $this->Task->bake('Helper', 'Form'); } - /** * Test filename generation for each type + plugins * @@ -442,7 +423,6 @@ function testTestCaseFileName() { $expected = APP . 'plugins' . DS . 'test_test' . DS . 'tests' . DS . 'cases' . DS . 'models' . DS . 'post.test.php'; $this->assertEqual($result, $expected); } - /** * test execute with a type defined * @@ -455,7 +435,6 @@ function testExecuteWithOneArg() { $this->Task->expectAt(0, 'createFile', array('*', new PatternExpectation('/class TestTaskTagTestCase extends CakeTestCase/'))); $this->Task->execute(); } - /** * test execute with type and class name defined * diff --git a/cake/tests/cases/console/libs/tasks/view.test.php b/cake/tests/cases/console/libs/tasks/view.test.php index 1f8f78dbd..ca2251f89 100644 --- a/cake/tests/cases/console/libs/tasks/view.test.php +++ b/cake/tests/cases/console/libs/tasks/view.test.php @@ -1,5 +1,4 @@ <?php -/* SVN FILE: $Id$ */ /** * ViewTask Test file * @@ -19,9 +18,6 @@ * @package cake * @subpackage cake.tests.cases.console.libs.tasks * @since CakePHP v 1.2.0.7726 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ App::import('Core', 'Shell'); diff --git a/cake/tests/groups/bake.group.php b/cake/tests/groups/bake.group.php index 86b172318..6289307ad 100644 --- a/cake/tests/groups/bake.group.php +++ b/cake/tests/groups/bake.group.php @@ -17,7 +17,7 @@ * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups - * @since CakePHP(tm) v 1.3Ã¥ + * @since CakePHP(tm) v 1.3 * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ /** @@ -44,6 +44,7 @@ class BakeGroupTest extends GroupTest { */ function BakeGroupTest() { $path = CORE_TEST_CASES . DS . 'console' . DS . 'libs' . DS . 'tasks' . DS; + TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'console' . DS . 'libs' . DS . 'bake'); TestManager::addTestFile($this, $path . 'controller'); TestManager::addTestFile($this, $path . 'model'); TestManager::addTestFile($this, $path . 'view'); From 4a4b9eefe5282bb3df557af0ba0c80462a6e6c61 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Fri, 17 Jul 2009 00:09:06 -0400 Subject: [PATCH 0304/2083] Updating file headers. Removing newlines. --- cake/libs/view/helpers/jquery_engine.php | 7 ++-- cake/libs/view/helpers/js.php | 2 +- cake/libs/view/helpers/mootools_engine.php | 29 ++++++----------- cake/libs/view/helpers/prototype_engine.php | 32 ++++++------------- .../libs/view/helpers/jquery_engine.test.php | 2 -- .../tests/cases/libs/view/helpers/js.test.php | 10 ++---- .../view/helpers/mootools_engine.test.php | 1 - .../view/helpers/prototype_engine.test.php | 1 - cake/tests/groups/javascript.group.php | 11 ++----- 9 files changed, 27 insertions(+), 68 deletions(-) diff --git a/cake/libs/view/helpers/jquery_engine.php b/cake/libs/view/helpers/jquery_engine.php index df8c50676..89531fafa 100644 --- a/cake/libs/view/helpers/jquery_engine.php +++ b/cake/libs/view/helpers/jquery_engine.php @@ -18,10 +18,7 @@ * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake - * @subpackage cake. - * @version - * @modifiedby - * @lastmodified + * @subpackage cake.view.helpers * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ App::import('Helper', 'Js'); @@ -248,4 +245,4 @@ function slider($options = array()) { return $this->_methodTemplate('slider', $template, $options, $callbacks); } } -?> +?> \ No newline at end of file diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index d91b3c849..097fecb2a 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -797,4 +797,4 @@ function _toQuerystring($parameters) { return $out; } } -?> +?> \ No newline at end of file diff --git a/cake/libs/view/helpers/mootools_engine.php b/cake/libs/view/helpers/mootools_engine.php index 10b118a6b..582c891ad 100644 --- a/cake/libs/view/helpers/mootools_engine.php +++ b/cake/libs/view/helpers/mootools_engine.php @@ -12,20 +12,19 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework <http://www.cakephp.org/> - * Copyright 2006-2008, Cake Software Foundation, Inc. - * 1785 E. Sahara Avenue, Suite 490-204 - * Las Vegas, Nevada 89104 + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project - * @package cake - * @subpackage cake.views.helpers - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.libs.view.helpers + * @since CakePHP(tm) v 1.3 + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ App::import('Helper', 'Js'); @@ -67,7 +66,6 @@ class MootoolsEngineHelper extends JsBaseEngineHelper { 'step' => 'steps' ) ); - /** * Create javascript selector for a CSS rule * @@ -86,7 +84,6 @@ function get($selector) { $this->selection = '$$("' . $selector . '")'; return $this; } - /** * Add an event to the script cache. Operates on the currently selected elements. * @@ -114,7 +111,6 @@ function event($type, $callback, $options = array()) { $out = $this->selection . ".addEvent(\"{$type}\", $callback);"; return $out; } - /** * Create a domReady event. This is a special event in many libraries * @@ -125,7 +121,6 @@ function domReady($functionBody) { $this->selection = 'window'; return $this->event('domready', $functionBody, array('stop' => false)); } - /** * Create an iteration over the current selection result. * @@ -136,7 +131,6 @@ function domReady($functionBody) { function each($callback) { return $this->selection . '.each(function (item, index) {' . $callback . '});'; } - /** * Trigger an Effect. * @@ -176,7 +170,6 @@ function effect($name, $options = array()) { } return $this->selection . '.' . $effect . ';'; } - /** * Create an new Request. * @@ -213,7 +206,6 @@ function request($url, $options = array()) { $options = $this->_parseOptions($options, $callbacks); return "var jsRequest = new Request$type({{$options}}).send($data);"; } - /** * Create a sortable element. * @@ -229,7 +221,6 @@ function sortable($options = array()) { $options = $this->_parseOptions($options, $callbacks); return 'var jsSortable = new Sortables(' . $this->selection . ', {' . $options . '});'; } - /** * Create a Draggable element. * @@ -245,7 +236,6 @@ function drag($options = array()) { $options = $this->_parseOptions($options, $callbacks); return 'var jsDrag = new Drag(' . $this->selection . ', {' . $options . '});'; } - /** * Create a Droppable element. * @@ -285,7 +275,6 @@ function drop($options = array()) { $this->selection = $options['droppables']; return $out; } - /** * Create a slider control * @@ -315,4 +304,4 @@ function slider($options = array()) { return $out; } } -?> +?> \ No newline at end of file diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php index 245c63adf..acefe4552 100644 --- a/cake/libs/view/helpers/prototype_engine.php +++ b/cake/libs/view/helpers/prototype_engine.php @@ -7,23 +7,19 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework <http://www.cakephp.org/> - * Copyright 2006-2008, Cake Software Foundation, Inc. - * 1785 E. Sahara Avenue, Suite 490-204 - * Las Vegas, Nevada 89104 + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project - * @package cake - * @subpackage cake. - * @version - * @modifiedby - * @lastmodified - * @license http://www.opensource.org/licenses/mit-license.php The MIT License + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.libs.view.helpers + * @since CakePHP(tm) v 1.3 + * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ App::import('Helper', 'Js'); @@ -67,7 +63,6 @@ class PrototypeEngineHelper extends JsBaseEngineHelper { 'value' => 'sliderValue', ) ); - /** * Create javascript selector for a CSS rule * @@ -86,7 +81,6 @@ function get($selector) { $this->selection = '$$("' . $selector . '")'; return $this; } - /** * Add an event to the script cache. Operates on the currently selected elements. * @@ -114,7 +108,6 @@ function event($type, $callback, $options = array()) { $out = $this->selection . ".observe(\"{$type}\", $callback);"; return $out; } - /** * Create a domReady event. This is a special event in many libraries * @@ -125,7 +118,6 @@ function domReady($functionBody) { $this->selection = 'document'; return $this->event('dom:loaded', $functionBody, array('stop' => false)); } - /** * Create an iteration over the current selection result. * @@ -136,7 +128,6 @@ function domReady($functionBody) { function each($callback) { return $this->selection . '.each(function (item, index) {' . $callback . '});'; } - /** * Trigger an Effect. * @@ -181,7 +172,6 @@ function effect($name, $options = array()) { } return $effect; } - /** * Create an Ajax or Ajax.Updater call. * @@ -209,7 +199,6 @@ function request($url, $options = array()) { } return "var jsRequest = new Ajax$type($url$options);"; } - /** * Create a sortable element. * @@ -228,7 +217,6 @@ function sortable($options = array()) { } return 'var jsSortable = Sortable.create(' . $this->selection . $options . ');'; } - /** * Create a Draggable element. * @@ -247,7 +235,6 @@ function drag($options = array()) { } return 'var jsDrag = new Draggable(' . $this->selection . $options . ');'; } - /** * Create a Droppable element. * @@ -266,7 +253,6 @@ function drop($options = array()) { } return 'Droppables.add(' . $this->selection . $options . ');'; } - /** * Creates a slider control widget. * @@ -296,4 +282,4 @@ function slider($options = array()) { return $out; } } -?> +?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php index 0471c63e0..bcf02c1f9 100644 --- a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php @@ -2,8 +2,6 @@ /** * JqueryEngineTestCase * - * - * * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework <http://www.cakephp.org/> diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index 4dc79bd0f..e4ebc9e52 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -1,5 +1,4 @@ <?php -/* SVN FILE: $Id$ */ /** * JsHelper Test Case * @@ -18,10 +17,7 @@ * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers - * @since CakePHP(tm) v 1.2.0.4206 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ + * @since CakePHP(tm) v 1.3 * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ App::import('Helper', array('Js', 'Html')); @@ -76,7 +72,7 @@ class JsHelperTestCase extends CakeTestCase { */ var $cDataEnd = 'preg:/[^\]]*\]\]\>[\s\r\n]*/'; /** - * setUp method + * startTest method * * @access public * @return void @@ -90,7 +86,7 @@ function startTest() { ClassRegistry::addObject('view', $view); } /** - * tearDown method + * endTest method * * @access public * @return void diff --git a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php index 06e450d4a..626866ebf 100644 --- a/cake/tests/cases/libs/view/helpers/mootools_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/mootools_engine.test.php @@ -148,7 +148,6 @@ function testEffect() { $result = $this->Moo->effect('slideOut', array('speed' => 'slow')); $expected = '$("foo").set("slide", {duration:"long"}).slide("out");'; $this->assertEqual($result, $expected); - } /** * Test Request Generation diff --git a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php index b8c838d65..d9bc19ea7 100644 --- a/cake/tests/cases/libs/view/helpers/prototype_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/prototype_engine.test.php @@ -207,7 +207,6 @@ function testRequest() { )); $expected = 'var jsRequest = new Ajax.Request("/people/edit/1", {method:"post", onComplete:doSuccess, onFailure:handleError, parameters:{"name":"jim","height":"185cm"}});'; $this->assertEqual($result, $expected); - } /** * test sortable list generation diff --git a/cake/tests/groups/javascript.group.php b/cake/tests/groups/javascript.group.php index b32bfaba8..3c2c4a98f 100644 --- a/cake/tests/groups/javascript.group.php +++ b/cake/tests/groups/javascript.group.php @@ -1,27 +1,22 @@ <?php -/* SVN FILE: $Id$ */ /** * AllCoreJavascriptHelpersGroupTest file * - * Long description for file * * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups - * @since CakePHP(tm) v 1.2.0.4206 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ + * @since CakePHP(tm) v 1.3 * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ /** From a5bfe72bd25e4b56aa2332c5dcc8d72f4d201eea Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Fri, 17 Jul 2009 00:10:48 -0400 Subject: [PATCH 0305/2083] Updating file header and doc blocks. --- cake/libs/view/helpers/js.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 097fecb2a..1b9b0c690 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -1,25 +1,21 @@ <?php -/* SVN FILE: $Id$ */ /** * Javascript Generator class file. * * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2009, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2009, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.libs.view.helpers * @since CakePHP v 1.2 - * @version $Revision$ - * @modifiedby $LastChangedBy$ - * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License **/ /** @@ -61,6 +57,7 @@ class JsHelper extends AppHelper { * __objects * * @var array + * @access private **/ var $__objects = array(); /** From 2ab3986d14843e46741923e1fe148ba101e2ab13 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Fri, 17 Jul 2009 16:00:44 -0400 Subject: [PATCH 0306/2083] Removing extra ; from generated code. --- cake/console/libs/tasks/fixture.php | 2 +- cake/console/libs/templates/default/classes/fixture.ctp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 3ebc15e24..75230dbf3 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -166,7 +166,7 @@ function bake($model, $useTable = false, $importOptions = array()) { if ($modelImport && $recordImport) { $modelImport .= ', '; } - $import = sprintf("array(%s%s);\n", $modelImport, $recordImport); + $import = sprintf("array(%s%s)", $modelImport, $recordImport); } $this->_Schema = new CakeSchema(); diff --git a/cake/console/libs/templates/default/classes/fixture.ctp b/cake/console/libs/templates/default/classes/fixture.ctp index 34d84bf4a..aa8c0678c 100644 --- a/cake/console/libs/templates/default/classes/fixture.ctp +++ b/cake/console/libs/templates/default/classes/fixture.ctp @@ -29,7 +29,7 @@ class <?php echo $model; ?>Fixture extends CakeTestFixture { <?php endif; ?> <?php if ($import): ?> var $import = <?php echo $import; ?>; -<?php endif;?> +<?php endif; ?> <?php if ($schema): ?> var $fields = <?php echo $schema; ?>; From de51d880fbac09d3387fcea5fb4e008c2e4e387c Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 20 Jul 2009 00:20:58 -0400 Subject: [PATCH 0307/2083] Adding prompts for PluginTask with no args. Test cases added. --- cake/console/libs/tasks/plugin.php | 2 ++ .../cases/console/libs/tasks/plugin.test.php | 25 +++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index e169e7c04..2049d8c80 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -75,6 +75,8 @@ function execute() { } else { $this->__interactive($plugin); } + } else { + return $this->__interactive(); } if (isset($this->args[0])) { diff --git a/cake/tests/cases/console/libs/tasks/plugin.test.php b/cake/tests/cases/console/libs/tasks/plugin.test.php index 120bf50ef..ca07503f3 100644 --- a/cake/tests/cases/console/libs/tasks/plugin.test.php +++ b/cake/tests/cases/console/libs/tasks/plugin.test.php @@ -184,12 +184,33 @@ function testBakeFoldersAndFiles() { $Folder =& new Folder($this->Task->path . 'bake_test_plugin'); $Folder->delete(); } +/** + * test execute with no args, flowing into interactive, + * + * @return void + **/ + function testExecuteWithNoArgs() { + $this->Task->setReturnValueAt(0, 'in', 'TestPlugin'); + $this->Task->setReturnValueAt(1, 'in', '2'); + $this->Task->setReturnValueAt(2, 'in', 'y'); + $this->Task->setReturnValueAt(3, 'in', 'n'); + + $path = $this->Task->path . 'test_plugin'; + $file = $path . DS . 'test_plugin_app_controller.php'; + $this->Task->expectAt(0, 'createFile', array($file, '*'), 'No AppController %s'); + + $file = $path . DS . 'test_plugin_app_model.php'; + $this->Task->expectAt(1, 'createFile', array($file, '*'), 'No AppModel %s'); + + $this->Task->args = array(); + $this->Task->execute(); + } /** * Test Execute * * @return void **/ - function XXtestExecuteWithOneArg() { + function testExecuteWithOneArg() { $this->Task->setReturnValueAt(0, 'in', $this->_testPath); $this->Task->setReturnValueAt(1, 'in', 'y'); $this->Task->Dispatch->args = array('BakeTestPlugin'); @@ -212,7 +233,7 @@ function XXtestExecuteWithOneArg() { * * @return void **/ - function XXtestExecuteWithTwoArgs() { + function testExecuteWithTwoArgs() { $this->Task->Model =& new PluginTestMockModelTask(); $this->Task->setReturnValueAt(0, 'in', $this->_testPath); $this->Task->setReturnValueAt(1, 'in', 'y'); From 10f5ae22a9821898681309dd85571123b428b6b4 Mon Sep 17 00:00:00 2001 From: mark_story <mark@mark-story.com> Date: Mon, 20 Jul 2009 00:59:18 -0400 Subject: [PATCH 0308/2083] Adding prompt for supplying custom conditions for fixture. --- cake/console/libs/tasks/fixture.php | 17 +++++++++++++++-- .../cases/console/libs/tasks/fixture.test.php | 8 ++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 75230dbf3..30ef74844 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -52,6 +52,12 @@ class FixtureTask extends Shell { * @var string **/ var $connection = null; +/** + * Schema instance + * + * @var object + **/ + var $_Schema = null; /** * Override initialize * @@ -128,14 +134,21 @@ function __interactive() { **/ function importOptions($modelName) { $options = array(); - $doSchema = $this->in('Would you like to import schema for this fixture?', array('y', 'n'), 'n'); + $doSchema = $this->in(__('Would you like to import schema for this fixture?', true), array('y', 'n'), 'n'); if ($doSchema == 'y') { $options['schema'] = $modelName; } - $doRecords = $this->in('Would you like to import records for this fixture?', array('y', 'n'), 'n'); + $doRecords = $this->in(__('Would you like to use record importing for this fixture?', true), array('y', 'n'), 'n'); if ($doRecords == 'y') { $options['records'] = true; } + if ($doRecords == 'n') { + $prompt = sprintf(__("Would you like to build this fixture with data from %s's table?", true), $modelName); + $fromDb = $this->in($prompt, array('y', 'n'), 'n'); + if (strtolower($fromDb) == 'y') { + $options['fromTable'] = true; + } + } return $options; } /** diff --git a/cake/tests/cases/console/libs/tasks/fixture.test.php b/cake/tests/cases/console/libs/tasks/fixture.test.php index 2981ab88f..a44d4432c 100644 --- a/cake/tests/cases/console/libs/tasks/fixture.test.php +++ b/cake/tests/cases/console/libs/tasks/fixture.test.php @@ -112,10 +112,18 @@ function testImportOptions() { $this->Task->setReturnValueAt(2, 'in', 'n'); $this->Task->setReturnValueAt(3, 'in', 'n'); + $this->Task->setReturnValueAt(4, 'in', 'n'); $result = $this->Task->importOptions('Article'); $expected = array(); $this->assertEqual($result, $expected); + + $this->Task->setReturnValueAt(5, 'in', 'n'); + $this->Task->setReturnValueAt(6, 'in', 'n'); + $this->Task->setReturnValueAt(7, 'in', 'y'); + $result = $this->Task->importOptions('Article'); + $expected = array('fromTable' => true); + $this->assertEqual($result, $expected); } /** * test that execute passes runs bake depending with named model. From 0935eb04773ce4055c782114bf71aa516bb9b740 Mon Sep 17 00:00:00 2001 From: gwoo <gwoo@cakephp.org> Date: Mon, 20 Jul 2009 09:59:16 -0700 Subject: [PATCH 0309/2083] fixing up some broken tests --- .../cases/libs/controller/scaffold.test.php | 16 ++++++------- cake/tests/cases/libs/i18n.test.php | 2 +- cake/tests/cases/libs/view/theme.test.php | 23 ++++++++++--------- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/cake/tests/cases/libs/controller/scaffold.test.php b/cake/tests/cases/libs/controller/scaffold.test.php index d0813a419..5ed30a97e 100644 --- a/cake/tests/cases/libs/controller/scaffold.test.php +++ b/cake/tests/cases/libs/controller/scaffold.test.php @@ -235,6 +235,11 @@ class ScaffoldViewTest extends CakeTestCase { */ function setUp() { $this->Controller =& new ScaffoldMockController(); + + App::build(array( + 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS), + 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) + )); } /** * tearDown method @@ -244,6 +249,8 @@ function setUp() { */ function tearDown() { unset($this->Controller); + + App::build(); } /** * testGetViewFilename method @@ -293,13 +300,6 @@ function testGetViewFilename() { $expected = 'cake' . DS . 'libs' . DS . 'view' . DS . 'errors' . DS . 'scaffold_error.ctp'; $this->assertEqual($result, $expected); - $_back = array( - 'viewPaths' => Configure::read('viewPaths'), - 'pluginPaths' => Configure::read('pluginPaths'), - ); - Configure::write('viewPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS)); - Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)); - $Controller =& new ScaffoldMockController(); $Controller->scaffold = 'admin'; $Controller->viewPath = 'posts'; @@ -329,8 +329,6 @@ function testGetViewFilename() { . DS .'test_plugin' . DS . 'views' . DS . 'tests' . DS . 'scaffold.edit.ctp'; $this->assertEqual($result, $expected); - Configure::write('viewPaths', $_back['viewPaths']); - Configure::write('pluginPaths', $_back['pluginPaths']); Configure::write('Routing.admin', $_admin); } /** diff --git a/cake/tests/cases/libs/i18n.test.php b/cake/tests/cases/libs/i18n.test.php index 3650a1206..0a3e61d10 100644 --- a/cake/tests/cases/libs/i18n.test.php +++ b/cake/tests/cases/libs/i18n.test.php @@ -40,7 +40,7 @@ class I18nTest extends CakeTestCase { */ function setUp() { App::build(array( - 'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale') + 'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale'), 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins') )); } diff --git a/cake/tests/cases/libs/view/theme.test.php b/cake/tests/cases/libs/view/theme.test.php index 4644bf11c..ee69ccb68 100644 --- a/cake/tests/cases/libs/view/theme.test.php +++ b/cake/tests/cases/libs/view/theme.test.php @@ -159,6 +159,18 @@ function tearDown() { unset($this->PostsController); unset($this->Controller); } +/** + * startTest + * + * @access public + * @return void + */ + function startTest() { + App::build(array( + 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), + 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS) + )); + } /** * endTest * @@ -182,11 +194,6 @@ function testPluginGetTemplate() { $this->Controller->theme = 'test_plugin_theme'; $ThemeView = new TestThemeView($this->Controller); - App::build(array( - 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), - 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS) - )); - $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS .'test_plugin' . DS . 'views' . DS . 'themed' . DS . 'test_plugin_theme' . DS .'tests' . DS .'index.ctp'; $result = $ThemeView->getViewFileName('index'); $this->assertEqual($result, $expected); @@ -210,12 +217,6 @@ function testGetTemplate() { $ThemeView = new TestThemeView($this->Controller); $ThemeView->theme = 'test_theme'; - - App::build(array( - 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), - 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS) - )); - $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS .'pages' . DS .'home.ctp'; $result = $ThemeView->getViewFileName('home'); $this->assertEqual($result, $expected); From 025942e354ca75bde84296c4e2913b2dad9ea93c Mon Sep 17 00:00:00 2001 From: gwoo <gwoo@cakephp.org> Date: Mon, 20 Jul 2009 10:06:13 -0700 Subject: [PATCH 0310/2083] updating test header for 1.3 --- cake/tests/lib/header.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/tests/lib/header.php b/cake/tests/lib/header.php index 1fd6d9989..2a125a264 100644 --- a/cake/tests/lib/header.php +++ b/cake/tests/lib/header.php @@ -29,7 +29,7 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv='content-Type' content='text/html; <?php echo $characterSet; ?>' /> - <title>CakePHP Test Suite v 1.2.0.0 + CakePHP Test Suite 1.3 - +
From 4c0d90c50290d6fa403296171f4f46e0f81ed6c4 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Wed, 6 Jan 2010 22:52:04 -0500 Subject: [PATCH 1388/2083] Adding paintDocumentFooter and paintDocumentHeader to CakeBaseReporter and CakeHtmlReporter. Refactoring case list and group lists to use reporter methods. --- cake/tests/lib/cake_test_suite_dispatcher.php | 8 ++++++++ .../tests/lib/reporter/cake_base_reporter.php | 20 +++++++++++++++++++ .../tests/lib/reporter/cake_html_reporter.php | 14 +++++++++++-- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/cake/tests/lib/cake_test_suite_dispatcher.php b/cake/tests/lib/cake_test_suite_dispatcher.php index 44460719e..59365c818 100644 --- a/cake/tests/lib/cake_test_suite_dispatcher.php +++ b/cake/tests/lib/cake_test_suite_dispatcher.php @@ -136,7 +136,11 @@ function _checkXdebug() { * @return void */ function _testCaseList() { + $Reporter =& $this->getReporter(); + $Reporter->paintDocumentHeader(); + $Reporter->paintTestMenu(); CakeTestMenu::testCaseList(); + $Reporter->paintDocumentEnd(); } /** @@ -145,7 +149,11 @@ function _testCaseList() { * @return void */ function _groupTestList() { + $Reporter =& $this->getReporter(); + $Reporter->paintDocumentHeader(); + $Reporter->paintTestMenu(); CakeTestMenu::groupTestList(); + $Reporter->paintDocumentEnd(); } /** diff --git a/cake/tests/lib/reporter/cake_base_reporter.php b/cake/tests/lib/reporter/cake_base_reporter.php index 208e9ca10..dca615863 100644 --- a/cake/tests/lib/reporter/cake_base_reporter.php +++ b/cake/tests/lib/reporter/cake_base_reporter.php @@ -107,6 +107,26 @@ function testCaseList() { * @return void */ function groupTestList() { + + } + +/** + * paints the header of the response from the test suite. + * Used to paint things like head elements in an html page. + * + * @return void + */ + function paintDocumentHeader() { + + } + +/** + * paints the end of the response from the test suite. + * Used to paint things like in an html page. + * + * @return void + */ + function paintDocumentFooter() { } diff --git a/cake/tests/lib/reporter/cake_html_reporter.php b/cake/tests/lib/reporter/cake_html_reporter.php index 3d5206547..4bb8ea927 100644 --- a/cake/tests/lib/reporter/cake_html_reporter.php +++ b/cake/tests/lib/reporter/cake_html_reporter.php @@ -177,8 +177,7 @@ function paintFooter($test_name) { } echo $this->_paintLinks(); echo '
'; - $baseDir = $this->params['baseDir']; - include CAKE_TESTS_LIB . 'templates' . DS . 'footer.php'; + $this->paintDocumentEnd(); } /** @@ -211,6 +210,7 @@ function _paintLinks() { echo "

Run more tests | Show Passes | \n"; echo " Analyze Code Coverage

\n"; } + /** * Convert an array of parameters into a query string url * @@ -227,6 +227,16 @@ function _queryString($url) { return $out; } +/** + * paints the end of the document html. + * + * @return void + */ + function paintDocumentEnd() { + $baseDir = $this->params['baseDir']; + include CAKE_TESTS_LIB . 'templates' . DS . 'footer.php'; + } + /** * Paints the test failure with a breadcrumbs * trail of the nesting test suites below the From a0f5d0fc0214622a9473925e89d7fdd92532c14a Mon Sep 17 00:00:00 2001 From: Mark Story Date: Wed, 6 Jan 2010 23:02:37 -0500 Subject: [PATCH 1389/2083] Renaming menu template file. Refactoring logic from CakeTestMenu into the Reporters. --- cake/tests/lib/cake_test_menu.php | 18 ------ cake/tests/lib/cake_test_suite_dispatcher.php | 4 +- .../tests/lib/reporter/cake_html_reporter.php | 23 +++++++- cake/tests/lib/templates/content.php | 58 ------------------- .../lib/{content.php => templates/menu.php} | 4 +- 5 files changed, 26 insertions(+), 81 deletions(-) delete mode 100644 cake/tests/lib/templates/content.php rename cake/tests/lib/{content.php => templates/menu.php} (95%) diff --git a/cake/tests/lib/cake_test_menu.php b/cake/tests/lib/cake_test_menu.php index c2f920de9..3e7e262f8 100644 --- a/cake/tests/lib/cake_test_menu.php +++ b/cake/tests/lib/cake_test_menu.php @@ -84,24 +84,6 @@ function testHeader() { } } -/** - * Provides the left hand navigation for the testsuite - * - * @return void - * @access public - */ - function testSuiteHeader() { - switch (CAKE_TEST_OUTPUT) { - case CAKE_TEST_OUTPUT_HTML: - ob_start(); - $groups = $_SERVER['PHP_SELF'] . '?show=groups'; - $cases = $_SERVER['PHP_SELF'] . '?show=cases'; - $plugins = App::objects('plugin'); - include CAKE_TESTS_LIB . 'content.php'; - break; - } - } - /** * Provides the testsuite footer text * diff --git a/cake/tests/lib/cake_test_suite_dispatcher.php b/cake/tests/lib/cake_test_suite_dispatcher.php index 59365c818..26b5068ba 100644 --- a/cake/tests/lib/cake_test_suite_dispatcher.php +++ b/cake/tests/lib/cake_test_suite_dispatcher.php @@ -139,7 +139,7 @@ function _testCaseList() { $Reporter =& $this->getReporter(); $Reporter->paintDocumentHeader(); $Reporter->paintTestMenu(); - CakeTestMenu::testCaseList(); + $Reporter->testCaseList(); $Reporter->paintDocumentEnd(); } @@ -152,7 +152,7 @@ function _groupTestList() { $Reporter =& $this->getReporter(); $Reporter->paintDocumentHeader(); $Reporter->paintTestMenu(); - CakeTestMenu::groupTestList(); + $Reporter->groupTestList(); $Reporter->paintDocumentEnd(); } diff --git a/cake/tests/lib/reporter/cake_html_reporter.php b/cake/tests/lib/reporter/cake_html_reporter.php index 4bb8ea927..3a256333f 100644 --- a/cake/tests/lib/reporter/cake_html_reporter.php +++ b/cake/tests/lib/reporter/cake_html_reporter.php @@ -129,7 +129,28 @@ function paintDocumentHeader() { * @return void */ function paintTestMenu() { - CakeTestMenu::testSuiteHeader(); + $groups = $_SERVER['PHP_SELF'] . '?show=groups'; + $cases = $_SERVER['PHP_SELF'] . '?show=cases'; + $plugins = App::objects('plugin'); + include CAKE_TESTS_LIB . 'templates' . DS . 'menu.php'; + } + +/** + * Retrieves and paints the list of tests cases in an HTML format. + * + * @return void + */ + function testCaseList() { + CakeTestMenu::testCaseList(); + } + +/** + * Retrieves and paints the list of group tests in an HTML format. + * + * @return void + */ + function groupTestList() { + CakeTestMenu::groupTestList(); } /** diff --git a/cake/tests/lib/templates/content.php b/cake/tests/lib/templates/content.php deleted file mode 100644 index 8fd087474..000000000 --- a/cake/tests/lib/templates/content.php +++ /dev/null @@ -1,58 +0,0 @@ - - * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The Open Group Test Suite License - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake - * @subpackage cake.cake.tests.lib - * @since CakePHP(tm) v 1.2.0.4433 - * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License - */ -?> -
- -
-
\ No newline at end of file diff --git a/cake/tests/lib/content.php b/cake/tests/lib/templates/menu.php similarity index 95% rename from cake/tests/lib/content.php rename to cake/tests/lib/templates/menu.php index 8fd087474..2a5b86219 100644 --- a/cake/tests/lib/content.php +++ b/cake/tests/lib/templates/menu.php @@ -21,7 +21,7 @@
  • - App + App
    • Test Groups
    • Test Cases
    • @@ -31,7 +31,7 @@ if (!empty($plugins)): ?>
    • - Plugins + Plugins From 730153b1516f368a73dcae8efcfa025b9187b062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Perras?= Date: Thu, 7 Jan 2010 17:49:57 -0500 Subject: [PATCH 1390/2083] Adding isset() checks for CakeSchema::compare() when diff'ing db indexes. Allows for slightly better interoperability between schemas generated with CakePHP 1.2 and with 1.3 --- cake/libs/model/schema.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cake/libs/model/schema.php b/cake/libs/model/schema.php index d607dbf57..d1a455290 100644 --- a/cake/libs/model/schema.php +++ b/cake/libs/model/schema.php @@ -168,7 +168,7 @@ function load($options = array()) { * Reads database and creates schema tables * * Options - * + * * - 'connection' - the db connection to use * - 'name' - name of the schema * - 'models' - a list of models to use, or false to ignore models @@ -428,8 +428,12 @@ function compare($old, $new = null) { if (isset($old[$table]['indexes']) && isset($new[$table]['indexes'])) { $diff = $this->_compareIndexes($new[$table]['indexes'], $old[$table]['indexes']); if ($diff) { - $tables[$table]['drop']['indexes'] = $diff['drop']; - $tables[$table]['add']['indexes'] = $diff['add']; + if (isset($tables[$table]['drop']['indexes']) && isset($diff['drop'])) { + $tables[$table]['drop']['indexes'] = $diff['drop']; + } + if (isset($tables[$table]['add']['indexes']) && isset($diff['add'])) { + $tables[$table]['add']['indexes'] = $diff['add']; + } } } } From 61079f63174e21e670b0a9efe6296524c45a52f5 Mon Sep 17 00:00:00 2001 From: tPl0ch Date: Thu, 7 Jan 2010 21:15:10 +0100 Subject: [PATCH 1391/2083] Fixes #42. Updated Sanitize::clean() with 'remove_html' option. Updated Sanitize::html() to accept new options. Updated test cases. Signed-off-by: Mark Story --- cake/libs/sanitize.php | 37 +++++++++++++++++++------ cake/tests/cases/libs/sanitize.test.php | 28 ++++++++++++++----- 2 files changed, 49 insertions(+), 16 deletions(-) diff --git a/cake/libs/sanitize.php b/cake/libs/sanitize.php index 8edb7b8d4..533f52556 100644 --- a/cake/libs/sanitize.php +++ b/cake/libs/sanitize.php @@ -79,22 +79,40 @@ function escape($string, $connection = 'default') { /** * Returns given string safe for display as HTML. Renders entities. + * + * strip_tags() is not validating HTML, so it might strip whole passages + * with broken HTML. * * @param string $string String from where to strip tags - * @param boolean $remove If true, the string is stripped of all HTML tags + * @param array $options + * + * possible options: + * + * - remove (boolean) if true strips all HTML tags before encoding + * - charset (string) the charset used to encode the string + * - quotes (int) see http://php.net/manual/en/function.htmlentities.php + * * @return string Sanitized string * @access public * @static */ - function html($string, $remove = false) { - if ($remove) { + function html($string, $options = array()) { + $default = array( + 'remove' => false, + 'charset' => 'UTF-8', + 'quotes' => ENT_QUOTES + ); + + $options = array_merge($default, $options); + + if ($options['remove']) { $string = strip_tags($string); - } else { - $patterns = array('&', '%', '<', '>', '"', "'", '(', ')', '+', '-'); - $replacements = array("&", "%", "<", ">", """, "'", "(", ")", "+", "-"); - $string = str_replace($patterns, $replacements, $string); } - return $string; + $encoding = Configure::read('App.encoding'); + if (empty($encoding)) { + $encoding = $options['charset']; + } + return htmlentities($string, $options['quotes'], $encoding); } /** @@ -198,6 +216,7 @@ function clean($data, $options = array()) { $options = array_merge(array( 'connection' => 'default', 'odd_spaces' => true, + 'remove_html' => false, 'encode' => true, 'dollar' => true, 'carriage' => true, @@ -216,7 +235,7 @@ function clean($data, $options = array()) { $data = str_replace(chr(0xCA), '', str_replace(' ', ' ', $data)); } if ($options['encode']) { - $data = Sanitize::html($data); + $data = Sanitize::html($data, array('remove' => $options['remove_html'])); } if ($options['dollar']) { $data = str_replace("\\\$", "$", $data); diff --git a/cake/tests/cases/libs/sanitize.test.php b/cake/tests/cases/libs/sanitize.test.php index 49b023b77..8a6f7c325 100644 --- a/cake/tests/cases/libs/sanitize.test.php +++ b/cake/tests/cases/libs/sanitize.test.php @@ -145,7 +145,7 @@ function testEscapeAlphaNumeric() { */ function testClean() { $string = 'test & "quote" \'other\' ;.$ symbol.' . "\r" . 'another line'; - $expected = 'test & "quote" 'other' ;.$ symbol.another line'; + $expected = 'test & "quote" 'other' ;.$ symbol.another line'; $result = Sanitize::clean($string, array('connection' => 'test_suite')); $this->assertEqual($result, $expected); @@ -170,7 +170,7 @@ function testClean() { $this->assertEqual($result, $expected); $array = array(array('test & "quote" \'other\' ;.$ symbol.' . "\r" . 'another line')); - $expected = array(array('test & "quote" 'other' ;.$ symbol.another line')); + $expected = array(array('test & "quote" 'other' ;.$ symbol.another line')); $result = Sanitize::clean($array, array('connection' => 'test_suite')); $this->assertEqual($result, $expected); @@ -179,8 +179,8 @@ function testClean() { $result = Sanitize::clean($array, array('encode' => false, 'escape' => false, 'connection' => 'test_suite')); $this->assertEqual($result, $expected); - $array = array(array('test odd '.chr(0xCA).' spaces'.chr(0xCA))); - $expected = array(array('test odd '.chr(0xCA).' spaces'.chr(0xCA))); + $array = array(array('test odd Ä spacesé')); + $expected = array(array('test odd Ä spacesé')); $result = Sanitize::clean($array, array('odd_spaces' => false, 'escape' => false, 'connection' => 'test_suite')); $this->assertEqual($result, $expected); @@ -203,12 +203,26 @@ function testClean() { */ function testHtml() { $string = '

      This is a test string & so is this

      '; - $expected = 'This is a test string & so is this'; - $result = Sanitize::html($string, true); + $expected = 'This is a test string & so is this'; + $result = Sanitize::html($string, array('remove' => true)); $this->assertEqual($result, $expected); $string = 'The "lazy" dog \'jumped\' & flew over the moon. If (1+1) = 2 is true, (2-1) = 1 is also true'; - $expected = 'The "lazy" dog 'jumped' & flew over the moon. If (1+1) = 2 <em>is</em> true, (2-1) = 1 is also true'; + $expected = 'The "lazy" dog 'jumped' & flew over the moon. If (1+1) = 2 <em>is</em> true, (2-1) = 1 is also true'; + $result = Sanitize::html($string); + $this->assertEqual($result, $expected); + + $string = 'The "lazy" dog \'jumped\''; + $expected = 'The "lazy" dog \'jumped\''; + $result = Sanitize::html($string, array('quotes' => ENT_COMPAT)); + $this->assertEqual($result, $expected); + + $string = 'The "lazy" dog \'jumped\''; + $result = Sanitize::html($string, array('quotes' => ENT_NOQUOTES)); + $this->assertEqual($result, $string); + + $string = 'The "lazy" dog \'jumped\' & flew over the moon. If (1+1) = 2 is true, (2-1) = 1 is also true'; + $expected = 'The "lazy" dog 'jumped' & flew over the moon. If (1+1) = 2 <em>is</em> true, (2-1) = 1 is also true'; $result = Sanitize::html($string); $this->assertEqual($result, $expected); } From b47b858355c73845cbeb6b24e3060288930da9a3 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 7 Jan 2010 21:47:23 -0500 Subject: [PATCH 1392/2083] Updating and reformatting docs for Sanitize. --- cake/libs/sanitize.php | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/cake/libs/sanitize.php b/cake/libs/sanitize.php index 533f52556..9492acbdb 100644 --- a/cake/libs/sanitize.php +++ b/cake/libs/sanitize.php @@ -35,6 +35,7 @@ class Sanitize { * Removes any non-alphanumeric characters. * * @param string $string String to sanitize + * @param array $allowed An array of additional characters that are not to be removed. * @return string Sanitized string * @access public * @static @@ -80,18 +81,17 @@ function escape($string, $connection = 'default') { /** * Returns given string safe for display as HTML. Renders entities. * - * strip_tags() is not validating HTML, so it might strip whole passages + * strip_tags() does not validating HTML syntax or structure, so it might strip whole passages * with broken HTML. * + * ### Options: + * + * - remove (boolean) if true strips all HTML tags before encoding + * - charset (string) the charset used to encode the string + * - quotes (int) see http://php.net/manual/en/function.htmlentities.php + * * @param string $string String from where to strip tags - * @param array $options - * - * possible options: - * - * - remove (boolean) if true strips all HTML tags before encoding - * - charset (string) the charset used to encode the string - * - quotes (int) see http://php.net/manual/en/function.htmlentities.php - * + * @param array $options Array of options to use. * @return string Sanitized string * @access public * @static @@ -173,6 +173,10 @@ function stripAll($str) { * Strips the specified tags from output. First parameter is string from * where to remove tags. All subsequent parameters are tags. * + * Ex.`$clean = Sanitize::stripTags($dirty, 'b', 'p', 'div');` + * + * Will remove all ``, `

      `, and `

      ` tags from the $dirty string. + * * @param string $str String to sanitize * @param string $tag Tag to remove (add more parameters as needed) * @return string sanitized String @@ -193,8 +197,16 @@ function stripTags() { /** * Sanitizes given array or value for safe input. Use the options to specify * the connection to use, and what filters should be applied (with a boolean - * value). Valid filters: odd_spaces, encode, dollar, carriage, unicode, - * escape, backslash. + * value). Valid filters: + * + * - odd_spaces - removes any non space whitespace characters + * - encode - Encode any html entities. Encode must be true for the `remove_html` to work. + * - dollar - Escape `$` with `\$` + * - carriage - Remove `\r` + * - unicode - + * - escape - Should the string be SQL escaped. + * - backslash - + * - remove_html - Strip HTML with strip_tags. `encode` must be true for this option to work. * * @param mixed $data Data to sanitize * @param mixed $options If string, DB connection being used, otherwise set of options From 5654aa063b55b601bc3a9dc71ba413b5d843615c Mon Sep 17 00:00:00 2001 From: dogmatic Date: Fri, 8 Jan 2010 11:39:40 +0200 Subject: [PATCH 1393/2083] last commit broke schema, this works better with the help of markstory --- cake/libs/configure.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 524f4d2fb..0e6520d20 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -825,8 +825,10 @@ function objects($type, $path = null, $cache = true) { $items = array(); foreach ((array)$path as $dir) { + if ($dir != APP) { $items = $_this->__list($dir, $types[$type]['suffix'], $extension); $objects = array_merge($items, array_diff($objects, $items)); + } } if ($type !== 'file') { From 4ffacfad2d30ce09de42a651b6ce541a0f685444 Mon Sep 17 00:00:00 2001 From: dogmatic Date: Fri, 8 Jan 2010 11:39:40 +0200 Subject: [PATCH 1394/2083] last commit broke schema, this works better with the help of markstory Signed-off-by: Mark Story --- cake/libs/configure.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 919c8456d..fb463fa6a 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -823,8 +823,10 @@ function objects($type, $path = null, $cache = true) { $items = array(); foreach ((array)$path as $dir) { + if ($dir != APP) { $items = $_this->__list($dir, $types[$type]['suffix'], $extension); $objects = array_merge($items, array_diff($objects, $items)); + } } if ($type !== 'file') { From 11a5403aaf4049b4a3e605b14057ba17ff093990 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Fri, 8 Jan 2010 18:35:01 -0500 Subject: [PATCH 1395/2083] Removing unused variables from inflections.php. These variables are artifacts from previous refactorings and have been non-functional for quite sometime. Fixes #163 --- app/config/inflections.php | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/app/config/inflections.php b/app/config/inflections.php index ed8c08b3d..07ca6d2a8 100644 --- a/app/config/inflections.php +++ b/app/config/inflections.php @@ -53,18 +53,5 @@ * $singularRules = array('/(s)tatuses$/i' => '\1\2tatus', '/(matr)ices$/i' =>'\1ix','/(vert|ind)ices$/i') */ $singularRules = array(); -/** - * This is a key only array of singular words that should not be inflected. - * You should not have to change this value below if you do change it use same format - * as the $uninflectedPlural above. - */ - $uninflectedSingular = $uninflectedPlural; -/** - * This is a key => value array of singular irregular words. - * Most of the time this will be a reverse of the above $irregularPlural array - * You should not have to change this value below if you do change it use same format - * - * $irregularSingular = array('atlases' => 'atlas', 'beefs' => 'beef', 'brothers' => 'brother') - */ - $irregularSingular = array_flip($irregularPlural); + ?> \ No newline at end of file From bc2dd3c987330430d226bcbeefb40b14c8877615 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 09:29:28 -0500 Subject: [PATCH 1396/2083] Removing refactored header and footer. --- cake/tests/lib/cake_test_menu.php | 43 ------------------------------- 1 file changed, 43 deletions(-) diff --git a/cake/tests/lib/cake_test_menu.php b/cake/tests/lib/cake_test_menu.php index 3e7e262f8..809477fd1 100644 --- a/cake/tests/lib/cake_test_menu.php +++ b/cake/tests/lib/cake_test_menu.php @@ -56,48 +56,5 @@ function getTestManager() { } } -/** - * Includes the Testsuite Header - * - * @return void - * @access public - */ - function testHeader() { - switch (CAKE_TEST_OUTPUT) { - case CAKE_TEST_OUTPUT_HTML: - ob_start(); - if (!class_exists('dispatcher')) { - require CAKE . 'dispatcher.php'; - } - $dispatch =& new Dispatcher(); - $dispatch->baseUrl(); - define('BASE', $dispatch->webroot); - $baseUrl = BASE; - $characterSet = 'charset=utf-8'; - include CAKE_TESTS_LIB . 'header.php'; - - break; - case CAKE_TEST_OUTPUT_TEXT: - default: - header('content-type: text/plain'); - break; - } - } - -/** - * Provides the testsuite footer text - * - * @return void - * @access public - */ - function footer() { - switch ( CAKE_TEST_OUTPUT) { - case CAKE_TEST_OUTPUT_HTML: - ob_start(); - $baseUrl = BASE; - include CAKE_TESTS_LIB . 'footer.php'; - break; - } - } } ?> \ No newline at end of file From c529d3c6e9d5fb80725c852ad20bfa429781fff4 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 10:55:58 -0500 Subject: [PATCH 1397/2083] Refactoring test case list output generation into Reporters. --- .../tests/lib/reporter/cake_base_reporter.php | 6 +- .../tests/lib/reporter/cake_html_reporter.php | 56 ++++++++++--------- 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/cake/tests/lib/reporter/cake_base_reporter.php b/cake/tests/lib/reporter/cake_base_reporter.php index dca615863..89a7c5a08 100644 --- a/cake/tests/lib/reporter/cake_base_reporter.php +++ b/cake/tests/lib/reporter/cake_base_reporter.php @@ -97,7 +97,8 @@ function _getTime() { * @return mixed */ function testCaseList() { - + $testList = TestManager::getTestCaseList(); + return $testList; } /** @@ -107,7 +108,8 @@ function testCaseList() { * @return void */ function groupTestList() { - + $testList = TestManager::getGroupTestList(); + return $testList; } /** diff --git a/cake/tests/lib/reporter/cake_html_reporter.php b/cake/tests/lib/reporter/cake_html_reporter.php index 3a256333f..a1bdd8902 100644 --- a/cake/tests/lib/reporter/cake_html_reporter.php +++ b/cake/tests/lib/reporter/cake_html_reporter.php @@ -26,7 +26,7 @@ * @package cake * @subpackage cake.tests.lib */ -class CakeHtmlReporter extends SimpleReporter { +class CakeHtmlReporter extends CakeBaseReporter { /** * Character set for the output of test reporting. @@ -43,30 +43,6 @@ class CakeHtmlReporter extends SimpleReporter { */ var $_show_passes = false; -/** - * Time the test runs started. - * - * @var integer - * @access protected - */ - var $_timeStart = 0; - -/** - * Time the test runs ended - * - * @var integer - * @access protected - */ - var $_timeEnd = 0; - -/** - * Duration of all test methods. - * - * @var integer - * @access protected - */ - var $_timeDuration = 0; - /** * Array of request parameters. Usually parsed GET params. * @@ -94,6 +70,7 @@ function CakeHtmlReporter($character_set = 'ISO-8859-1', $params = array()) { $this->SimpleReporter(); $this->_character_set = !empty($character_set) ? $character_set : 'ISO-8859-1'; $this->params = $params; + $this->_url = $_SERVER['PHP_SELF']; } /** @@ -141,7 +118,34 @@ function paintTestMenu() { * @return void */ function testCaseList() { - CakeTestMenu::testCaseList(); + $testCases = parent::testCaseList(); + $app = $this->params['app']; + $plugin = $this->params['plugin']; + + $buffer = "

      Core Test Cases:

      \n
        "; + $urlExtra = null; + if ($app) { + $buffer = "

        App Test Cases:

        \n
          "; + $urlExtra = '&app=true'; + } elseif ($plugin) { + $buffer = "

          " . Inflector::humanize($plugin) . " Test Cases:

          \n
            "; + $urlExtra = '&plugin=' . $plugin; + } + + if (1 > count($testCases)) { + $buffer .= "EMPTY"; + echo $buffer; + } + + foreach ($testCases as $testCaseFile => $testCase) { + $title = explode(strpos($testCase, '\\') ? '\\' : '/', str_replace('.test.php', '', $testCase)); + $title[count($title) - 1] = Inflector::camelize($title[count($title) - 1]); + $title = implode(' / ', $title); + + $buffer .= "
          • " . $title . "
          • \n"; + } + $buffer .= "
          \n"; + echo $buffer; } /** From bdc84cd5d0ab34eedaf8699ccf436edeab519495 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 11:20:47 -0500 Subject: [PATCH 1398/2083] Renaming paintDocumentHeader to paintDocumentStart Renaming paintDocumentFooter to paintDocumentEnd Moving features from CakeTestMenu, HtmlTestManager, and TextTestManager into the appropriate Reporters. --- cake/tests/lib/cake_test_suite_dispatcher.php | 4 +- .../tests/lib/reporter/cake_base_reporter.php | 66 +++++++++++++- .../tests/lib/reporter/cake_html_reporter.php | 89 +++++++------------ .../tests/lib/reporter/cake_text_reporter.php | 40 ++++++++- 4 files changed, 132 insertions(+), 67 deletions(-) diff --git a/cake/tests/lib/cake_test_suite_dispatcher.php b/cake/tests/lib/cake_test_suite_dispatcher.php index 26b5068ba..52da314c7 100644 --- a/cake/tests/lib/cake_test_suite_dispatcher.php +++ b/cake/tests/lib/cake_test_suite_dispatcher.php @@ -137,7 +137,7 @@ function _checkXdebug() { */ function _testCaseList() { $Reporter =& $this->getReporter(); - $Reporter->paintDocumentHeader(); + $Reporter->paintDocumentStart(); $Reporter->paintTestMenu(); $Reporter->testCaseList(); $Reporter->paintDocumentEnd(); @@ -150,7 +150,7 @@ function _testCaseList() { */ function _groupTestList() { $Reporter =& $this->getReporter(); - $Reporter->paintDocumentHeader(); + $Reporter->paintDocumentStart(); $Reporter->paintTestMenu(); $Reporter->groupTestList(); $Reporter->paintDocumentEnd(); diff --git a/cake/tests/lib/reporter/cake_base_reporter.php b/cake/tests/lib/reporter/cake_base_reporter.php index 89a7c5a08..0bedcc9b5 100644 --- a/cake/tests/lib/reporter/cake_base_reporter.php +++ b/cake/tests/lib/reporter/cake_base_reporter.php @@ -50,6 +50,42 @@ class CakeBaseReporter extends SimpleReporter { */ var $_timeDuration = 0; +/** + * Array of request parameters. Usually parsed GET params. + * + * @var array + */ + var $params = array(); + +/** + * Character set for the output of test reporting. + * + * @var string + * @access protected + */ + var $_characterSet; + +/** + * Does nothing yet. The first output will + * be sent on the first test start. + * + * ### Params + * + * - show_passes - Should passes be shown + * - plugin - Plugin test being run? + * - app - App test being run. + * - case - The case being run + * + * @param string $charset The character set to output with. Defaults to UTF-8 + * @param array $params Array of request parameters the reporter should use. See above. + * @access public + */ + function CakeBaseReporter($charset = 'utf-8', $params = array()) { + $this->SimpleReporter(); + $this->_characterSet = $charset; + $this->params = $params; + } + /** * Signals / Paints the beginning of a TestSuite executing. * Starts the timer for the TestSuite execution time. @@ -113,24 +149,46 @@ function groupTestList() { } /** - * paints the header of the response from the test suite. + * Paints the start of the response from the test suite. * Used to paint things like head elements in an html page. * * @return void */ - function paintDocumentHeader() { + function paintDocumentStart() { } /** - * paints the end of the response from the test suite. + * Paints the end of the response from the test suite. * Used to paint things like in an html page. * * @return void */ - function paintDocumentFooter() { + function paintDocumentEnd() { + + } + +/** + * Paint a list of test sets, core, app, and plugin test sets + * available. + * + * @return void + */ + function paintTestMenu() { } +/** + * Get the baseUrl if one is available. + * + * @return string The base url for the request. + */ + function baseUrl() { + if (!empty($_SERVER['PHP_SELF'])) { + return $_SERVER['PHP_SELF']; + } + return ''; + } + } ?> \ No newline at end of file diff --git a/cake/tests/lib/reporter/cake_html_reporter.php b/cake/tests/lib/reporter/cake_html_reporter.php index a1bdd8902..9c9cbbfdf 100644 --- a/cake/tests/lib/reporter/cake_html_reporter.php +++ b/cake/tests/lib/reporter/cake_html_reporter.php @@ -28,51 +28,6 @@ */ class CakeHtmlReporter extends CakeBaseReporter { -/** - * Character set for the output of test reporting. - * - * @var string - * @access protected - */ - var $_character_set; -/** - * Toggle to show passes in output. - * - * @var boolean - * @access protected - */ - var $_show_passes = false; - -/** - * Array of request parameters. Usually parsed GET params. - * - * @var array - */ - var $params = array(); - -/** - * Does nothing yet. The first output will - * be sent on the first test start. For use - * by a web browser. - * - * ### Params - * - * - show_passes - Should passes be shown - * - plugin - Plugin test being run? - * - app - App test being run. - * - case - The case being run - * - * @param string $character_set The character set to output with. Defaults to ISO-8859-1 - * @param array $params Array of request parameters the reporter should use. See above. - * @access public - */ - function CakeHtmlReporter($character_set = 'ISO-8859-1', $params = array()) { - $this->SimpleReporter(); - $this->_character_set = !empty($character_set) ? $character_set : 'ISO-8859-1'; - $this->params = $params; - $this->_url = $_SERVER['PHP_SELF']; - } - /** * Paints the top of the web page setting the * title to the name of the starting test. @@ -83,18 +38,18 @@ function CakeHtmlReporter($character_set = 'ISO-8859-1', $params = array()) { */ function paintHeader($testName) { $this->sendNoCacheHeaders(); - $this->paintDocumentHeader(); + $this->paintDocumentStart(); $this->paintTestMenu(); echo "

          $testName

          \n"; echo "
            \n"; } /** - * Paints the document header contained in header.php + * Paints the document start content contained in header.php * * @return void */ - function paintDocumentHeader() { + function paintDocumentStart() { $baseDir = $this->params['baseDir']; include CAKE_TESTS_LIB . 'templates' . DS . 'header.php'; } @@ -106,8 +61,8 @@ function paintDocumentHeader() { * @return void */ function paintTestMenu() { - $groups = $_SERVER['PHP_SELF'] . '?show=groups'; - $cases = $_SERVER['PHP_SELF'] . '?show=cases'; + $groups = $this->baseUrl() . '?show=groups'; + $cases = $this->baseUrl() . '?show=cases'; $plugins = App::objects('plugin'); include CAKE_TESTS_LIB . 'templates' . DS . 'menu.php'; } @@ -134,15 +89,13 @@ function testCaseList() { if (1 > count($testCases)) { $buffer .= "EMPTY"; - echo $buffer; } foreach ($testCases as $testCaseFile => $testCase) { $title = explode(strpos($testCase, '\\') ? '\\' : '/', str_replace('.test.php', '', $testCase)); $title[count($title) - 1] = Inflector::camelize($title[count($title) - 1]); $title = implode(' / ', $title); - - $buffer .= "
          • " . $title . "
          • \n"; + $buffer .= "
          • " . $title . "
          • \n"; } $buffer .= "
          \n"; echo $buffer; @@ -154,7 +107,27 @@ function testCaseList() { * @return void */ function groupTestList() { - CakeTestMenu::groupTestList(); + $groupTests = parent::groupTestList(); + $app = $this->params['app']; + $plugin = $this->params['plugin']; + + $buffer = "

          Core Test Groups:

          \n
            "; + $urlExtra = null; + if ($app) { + $buffer = "

            App Test Groups:

            \n
              "; + $urlExtra = '&app=true'; + } else if ($plugin) { + $buffer = "

              " . Inflector::humanize($plugin) . " Test Groups:

              \n
                "; + $urlExtra = '&plugin=' . $plugin; + } + + $buffer .= "
              • All tests
              • \n"; + + foreach ($groupTests as $groupTest) { + $buffer .= "
              • " . $groupTest . "
              • \n"; + } + $buffer .= "
              \n"; + echo $buffer; } /** @@ -232,8 +205,8 @@ function _paintLinks() { $show = $this->_queryString($show); $query = $this->_queryString($query); - echo "

              Run more tests | Show Passes | \n"; - echo " Analyze Code Coverage

              \n"; + echo "

              Run more tests | Show Passes | \n"; + echo " Analyze Code Coverage

              \n"; } /** @@ -253,7 +226,7 @@ function _queryString($url) { } /** - * paints the end of the document html. + * Paints the end of the document html. * * @return void */ @@ -380,7 +353,7 @@ function paintFormattedMessage($message) { * @access protected */ function _htmlEntities($message) { - return htmlentities($message, ENT_COMPAT, $this->_character_set); + return htmlentities($message, ENT_COMPAT, $this->_characterSet); } } ?> \ No newline at end of file diff --git a/cake/tests/lib/reporter/cake_text_reporter.php b/cake/tests/lib/reporter/cake_text_reporter.php index 6a4ff7b76..4c3bf6c87 100644 --- a/cake/tests/lib/reporter/cake_text_reporter.php +++ b/cake/tests/lib/reporter/cake_text_reporter.php @@ -26,6 +26,7 @@ * @subpackage cake.tests.lib */ class CakeTextReporter extends CakeBaseReporter { + /** * Paints the end of the test with a summary of * the passes and failures. @@ -59,9 +60,7 @@ function paintFooter($test_name) { * @access public */ function paintHeader($test_name) { - if (! SimpleReporter::inCli()) { - header('Content-type: text/plain'); - } + header('Content-type: text/plain'); echo "$test_name\n"; flush(); } @@ -142,5 +141,40 @@ function paintFormattedMessage($message) { echo "$message\n"; flush(); } + +/** + * Generate a test case list in plain text. + * Creates as series of url's for tests that can be run. + * One case per line. + * + * @return void + */ + function testCaseList() { + $testCases = parent::testCaseList(); + $app = $this->params['app']; + $plugin = $this->params['plugin']; + + $buffer = "Core Test Cases:\n"; + $urlExtra = ''; + if ($app) { + $buffer = "App Test Cases:\n"; + $urlExtra = '&app=true'; + } elseif ($plugin) { + $buffer = Inflector::humanize($plugin) . " Test Cases:\n"; + $urlExtra = '&plugin=' . $plugin; + } + + if (1 > count($testCases)) { + $buffer .= "EMPTY"; + echo $buffer; + } + + foreach ($testCases as $testCaseFile => $testCase) { + $buffer .= $_SERVER['SERVER_NAME'] . $this->baseUrl() ."?case=" . $testCase . "&output=text"."\n"; + } + + $buffer .= "\n"; + echo $buffer; + } } ?> \ No newline at end of file From 28ad1ea1c2aff03fcd3a19f8c85126dc21881240 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 11:24:52 -0500 Subject: [PATCH 1399/2083] Removing constants from app/webroot/test.php as they are no longer needed. --- app/webroot/test.php | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/app/webroot/test.php b/app/webroot/test.php index 28c4a9430..7bdd62463 100644 --- a/app/webroot/test.php +++ b/app/webroot/test.php @@ -89,21 +89,6 @@ die(__('Debug setting does not allow access to this url.', true)); } -/** - * - * Used to determine output to display - */ -define('CAKE_TEST_OUTPUT_HTML', 1); -define('CAKE_TEST_OUTPUT_TEXT', 2); - -if (!isset($_GET['output']) || (isset($_GET['output']) && $_GET['output'] == 'html')) { - define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_HTML); -} else { - Debugger::output('txt'); - define('CAKE_TEST_OUTPUT', CAKE_TEST_OUTPUT_TEXT); -} -define('RUN_TEST_LINK', $_SERVER['PHP_SELF']); - require_once CAKE_TESTS_LIB . 'cake_test_suite_dispatcher.php'; $Dispatcher = new CakeTestSuiteDispatcher(); From e061a5335845feeb0e3371c2524b3097ed27ca68 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 11:25:35 -0500 Subject: [PATCH 1400/2083] Removing CakeTestMenu as its been made obsolete. Removing constant use from reporter. --- cake/tests/lib/cake_test_menu.php | 60 ------------------- cake/tests/lib/cake_test_suite_dispatcher.php | 1 - .../tests/lib/reporter/cake_html_reporter.php | 2 +- 3 files changed, 1 insertion(+), 62 deletions(-) delete mode 100644 cake/tests/lib/cake_test_menu.php diff --git a/cake/tests/lib/cake_test_menu.php b/cake/tests/lib/cake_test_menu.php deleted file mode 100644 index 809477fd1..000000000 --- a/cake/tests/lib/cake_test_menu.php +++ /dev/null @@ -1,60 +0,0 @@ - - * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The Open Group Test Suite License - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake - * @subpackage cake.cake.tests.lib - * @since CakePHP(tm) v 1.3 - * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License - */ -class CakeTestMenu { - -/** - * Prints a list of test cases - * - * @return void - * @access public - */ - function testCaseList() { - $class = CakeTestMenu::getTestManager(); - echo call_user_func(array($class, 'getTestCaseList')); - } - -/** - * Prints a list of group tests - * - * @return void - * @access public - */ - function groupTestList() { - $class = CakeTestMenu::getTestManager(); - echo call_user_func(array($class, 'getGroupTestList')); - } - -/** - * Gets the correct test manager for the chosen output. - * - * @return void - */ - function getTestManager() { - switch (CAKE_TEST_OUTPUT) { - case CAKE_TEST_OUTPUT_HTML: - return 'HtmlTestManager'; - case CAKE_TEST_OUTPUT_TEXT: - default: - return 'TextTestManager'; - } - } - -} -?> \ No newline at end of file diff --git a/cake/tests/lib/cake_test_suite_dispatcher.php b/cake/tests/lib/cake_test_suite_dispatcher.php index 52da314c7..7523c6b45 100644 --- a/cake/tests/lib/cake_test_suite_dispatcher.php +++ b/cake/tests/lib/cake_test_suite_dispatcher.php @@ -18,7 +18,6 @@ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ require_once CAKE_TESTS_LIB . 'test_manager.php'; -require_once CAKE_TESTS_LIB . 'cake_test_menu.php'; /** * CakeTestSuiteDispatcher handles web requests to the test suite and runs the correct action. diff --git a/cake/tests/lib/reporter/cake_html_reporter.php b/cake/tests/lib/reporter/cake_html_reporter.php index 9c9cbbfdf..1e272209b 100644 --- a/cake/tests/lib/reporter/cake_html_reporter.php +++ b/cake/tests/lib/reporter/cake_html_reporter.php @@ -205,7 +205,7 @@ function _paintLinks() { $show = $this->_queryString($show); $query = $this->_queryString($query); - echo "

              Run more tests | Show Passes | \n"; + echo "

              Run more tests | Show Passes | \n"; echo " Analyze Code Coverage

              \n"; } From 88f58dfbe8aa187b2a381d5be70e7ae594de1b77 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 19:19:09 -0500 Subject: [PATCH 1401/2083] Fixing missing headers when in plain text reporting. --- cake/tests/lib/reporter/cake_text_reporter.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cake/tests/lib/reporter/cake_text_reporter.php b/cake/tests/lib/reporter/cake_text_reporter.php index 4c3bf6c87..dd793a475 100644 --- a/cake/tests/lib/reporter/cake_text_reporter.php +++ b/cake/tests/lib/reporter/cake_text_reporter.php @@ -27,6 +27,17 @@ */ class CakeTextReporter extends CakeBaseReporter { +/** + * Sets the text/plain header if the test is not a CLI test. + * + * @return void + */ + function paintDocumentStart() { + if (!SimpleReporter::inCli()) { + header('Content-type: text/plain'); + } + } + /** * Paints the end of the test with a summary of * the passes and failures. @@ -52,6 +63,7 @@ function paintFooter($test_name) { echo 'Peak memory use: (in bytes): ' . number_format(memory_get_peak_usage()) . "\n"; } } + /** * Paints the title only. * @@ -60,7 +72,6 @@ function paintFooter($test_name) { * @access public */ function paintHeader($test_name) { - header('Content-type: text/plain'); echo "$test_name\n"; flush(); } From f567d9aacc74929107d340050ef22255361ef726 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 19:35:01 -0500 Subject: [PATCH 1402/2083] Removing unnecessary TestManager subclasses --- cake/tests/lib/cake_test_suite_dispatcher.php | 8 +- cake/tests/lib/test_manager.php | 189 ------------------ 2 files changed, 1 insertion(+), 196 deletions(-) diff --git a/cake/tests/lib/cake_test_suite_dispatcher.php b/cake/tests/lib/cake_test_suite_dispatcher.php index 7523c6b45..1b671204d 100644 --- a/cake/tests/lib/cake_test_suite_dispatcher.php +++ b/cake/tests/lib/cake_test_suite_dispatcher.php @@ -46,7 +46,7 @@ class CakeTestSuiteDispatcher { * * @var string */ - var $_managerClass; + var $_managerClass = 'TestManager'; /** * The Instance of the Manager being used. @@ -162,12 +162,6 @@ function _groupTestList() { * @static */ function &getManager() { - $className = ucwords($this->params['output']) . 'TestManager'; - if (class_exists($className)) { - $this->_managerClass = $className; - } else { - $this->_managerClass = 'TextTestManager'; - } if (empty($this->Manager)) { $this->Manager = new $this->_managerClass(); } diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index 7181f7465..09a3572cd 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -449,193 +449,4 @@ function &getTestCaseList() { } } -/** - * The TextTestManager ensures that the list of available tests is printed as a list of urls in a text-friendly format - * - * @package cake - * @subpackage cake.cake.tests.lib - */ -class TextTestManager extends TestManager { - var $_url; - -/** - * Constructor - * - * @return void - * @access public - */ - function TextTestManager() { - parent::TestManager(); - $this->_url = $_SERVER['PHP_SELF']; - } - -/** - * Returns the base url - * - * @return string The base URL for link building. - * @access public - */ - function getBaseURL() { - return $this->_url; - } - -/** - * Returns a list of available group tests in a text-friendly format - * - * @return string A link list for group tests. - * @access public - */ - function &getGroupTestList() { - $manager =& new TextTestManager(); - $groupTests =& $manager->_getTestGroupList($manager->_getTestsPath('groups')); - - $buffer = "Core Test Groups:\n"; - $urlExtra = ''; - if ($manager->appTest) { - $buffer = "App Test Groups:\n"; - $urlExtra = '&app=true'; - } else if ($manager->pluginTest) { - $buffer = Inflector::humanize($manager->pluginTest) . " Test Groups:\n"; - $urlExtra = '&plugin=' . $manager->pluginTest; - } - - $buffer .= "All tests\n" . $_SERVER['SERVER_NAME'] . $manager->getBaseURL() . "?group=all&output=txt{$urlExtra}\n"; - - foreach ((array)$groupTests as $groupTest) { - $buffer .= $_SERVER['SERVER_NAME'] . $manager->getBaseURL() . "?group=" . $groupTest . "&output=text{$urlExtra}\n"; - } - - return $buffer; - } - -/** - * Returns a list of available test cases in a text-friendly format - * - * @param string A link list for test cases. - * @access public - */ - function &getTestCaseList() { - $manager =& new TextTestManager(); - $testCases =& $manager->_getTestCaseList($manager->_getTestsPath()); - - $buffer = "Core Test Cases:\n"; - $urlExtra = ''; - if ($manager->appTest) { - $buffer = "App Test Cases:\n"; - $urlExtra = '&app=true'; - } else if ($manager->pluginTest) { - $buffer = Inflector::humanize($manager->pluginTest) . " Test Cases:\n"; - $urlExtra = '&plugin=' . $manager->pluginTest; - } - - if (1 > count($testCases)) { - $buffer .= "EMPTY"; - return $buffer; - } - - foreach ($testCases as $testCaseFile => $testCase) { - $buffer .= $_SERVER['SERVER_NAME']. $manager->getBaseURL()."?case=" . $testCase . "&output=text"."\n"; - } - - $buffer .= "\n"; - return $buffer; - } -} - -/** - * The HtmlTestManager provides the foundation for the web-based CakePHP testsuite. - * It prints the different lists of tests and provides the interface for CodeCoverage, etc. - * - * @package cake - * @subpackage cake.cake.tests.lib - */ -class HtmlTestManager extends TestManager { - var $_url; - -/** - * Constructor - * - * @return void - * @access public - */ - function HtmlTestManager() { - parent::TestManager(); - $this->_url = $_SERVER['PHP_SELF']; - } - -/** - * Returns the current base url - * - * @return void - * @access public - */ - function getBaseURL() { - return $this->_url; - } - -/** - * Prints the links to the available group tests - * - * @access public - */ - function &getGroupTestList() { - $manager =& new HtmlTestManager(); - $urlExtra = ''; - $groupTests =& $manager->_getTestGroupList($manager->_getTestsPath('groups')); - - $buffer = "

              Core Test Groups:

              \n
                "; - $urlExtra = null; - if ($manager->appTest) { - $buffer = "

                App Test Groups:

                \n
                  "; - $urlExtra = '&app=true'; - } else if ($manager->pluginTest) { - $buffer = "

                  " . Inflector::humanize($manager->pluginTest) . " Test Groups:

                  \n
                    "; - $urlExtra = '&plugin=' . $manager->pluginTest; - } - - $buffer .= "
                  • All tests
                  • \n"; - - foreach ($groupTests as $groupTest) { - $buffer .= "
                  • " . $groupTest . "
                  • \n"; - } - $buffer .= "
                  \n"; - return $buffer; - } - -/** - * Prints the links to the available test cases - * - * @access public - */ - function &getTestCaseList() { - $urlExtra = ''; - $manager =& new HtmlTestManager(); - $testCases =& $manager->_getTestCaseList($manager->_getTestsPath()); - - $buffer = "

                  Core Test Cases:

                  \n
                    "; - $urlExtra = null; - if ($manager->appTest) { - $buffer = "

                    App Test Cases:

                    \n
                      "; - $urlExtra = '&app=true'; - } else if ($manager->pluginTest) { - $buffer = "

                      " . Inflector::humanize($manager->pluginTest) . " Test Cases:

                      \n
                        "; - $urlExtra = '&plugin=' . $manager->pluginTest; - } - - if (1 > count($testCases)) { - $buffer .= "EMPTY"; - return $buffer; - } - - foreach ($testCases as $testCaseFile => $testCase) { - $title = explode(strpos($testCase, '\\') ? '\\' : '/', str_replace('.test.php', '', $testCase)); - $title[count($title) - 1] = Inflector::camelize($title[count($title) - 1]); - $title = implode(' / ', $title); - - $buffer .= "
                      • " . $title . "
                      • \n"; - } - $buffer .= "
                      \n"; - return $buffer; - } -} ?> \ No newline at end of file From 5a10e52d1fd942ff95cfc85da9b65e607a37aa36 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 19:37:37 -0500 Subject: [PATCH 1403/2083] Updating package strings for reporters --- cake/tests/lib/reporter/cake_html_reporter.php | 2 +- cake/tests/lib/reporter/cake_text_reporter.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/tests/lib/reporter/cake_html_reporter.php b/cake/tests/lib/reporter/cake_html_reporter.php index 1e272209b..c85f118eb 100644 --- a/cake/tests/lib/reporter/cake_html_reporter.php +++ b/cake/tests/lib/reporter/cake_html_reporter.php @@ -13,7 +13,7 @@ * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org * @package cake - * @subpackage cake.cake.tests.libs + * @subpackage cake.tests.libs.reporter * @since CakePHP(tm) v 1.2.0.4433 * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ diff --git a/cake/tests/lib/reporter/cake_text_reporter.php b/cake/tests/lib/reporter/cake_text_reporter.php index dd793a475..7d3b7f5e5 100644 --- a/cake/tests/lib/reporter/cake_text_reporter.php +++ b/cake/tests/lib/reporter/cake_text_reporter.php @@ -13,7 +13,7 @@ * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org * @package cake - * @subpackage cake.cake.tests.libs + * @subpackage cake.tests.libs.reporter * @since CakePHP(tm) v 1.3 * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ From 1e0215b7c1b4f7291346665074cc3e69c8583601 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 19:44:50 -0500 Subject: [PATCH 1404/2083] Correcting whitespace. --- cake/console/libs/testsuite.php | 34 ++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php index d2856e84d..a0fdef3c3 100644 --- a/cake/console/libs/testsuite.php +++ b/cake/console/libs/testsuite.php @@ -94,7 +94,7 @@ function initialize() { $this->__installSimpleTest(); require_once CAKE . 'tests' . DS . 'lib' . DS . 'test_manager.php'; - require_once CAKE . 'tests' . DS . 'lib' . DS . 'cli_reporter.php'; + require_once CAKE . 'tests' . DS . 'lib' . DS . 'reporter' . DS . 'cake_cli_reporter.php'; $plugins = App::objects('plugin'); foreach ($plugins as $p) { @@ -139,7 +139,7 @@ function main() { } if ($this->__canRun()) { - $this->out('Running '.$this->category.' '.$this->type.' '.$this->file); + $this->out('Running ' . $this->category . ' ' . $this->type . ' ' . $this->file); $exitCode = 0; if (!$this->__run()) { @@ -201,7 +201,7 @@ function __canRun() { $isPlugin = in_array(Inflector::underscore($this->category), $this->plugins); if ($isNeitherAppNorCore && !$isPlugin) { - $this->err($this->category.' is an invalid test category (either "app", "core" or name of a plugin)'); + $this->err($this->category . ' is an invalid test category (either "app", "core" or name of a plugin)'); return false; } @@ -212,7 +212,7 @@ function __canRun() { } if (!in_array($this->type, array('all', 'group', 'case'))) { - $this->err($this->type.' is invalid. Should be case, group or all'); + $this->err($this->type . ' is invalid. Should be case, group or all'); return false; } @@ -221,27 +221,27 @@ function __canRun() { return true; break; case 'group': - if (file_exists($folder.DS.'groups'.DS.$this->file.'.group.php')) { + if (file_exists($folder . DS . 'groups' . DS . $this->file . '.group.php')) { return true; } break; case 'case': - if ($this->category == 'app' && file_exists($folder.DS.'cases'.DS.$this->file.'.test.php')) { + if ($this->category == 'app' && file_exists($folder . DS . 'cases' . DS . $this->file . '.test.php')) { return true; } - $coreCaseExists = file_exists($folder.DS.'cases'.DS.$this->file.'.test.php'); - $coreLibCaseExists = file_exists($folder.DS.'cases'.DS.'libs'.DS.$this->file.'.test.php'); + $coreCaseExists = file_exists($folder . DS . 'cases' . DS . $this->file . '.test.php'); + $coreLibCaseExists = file_exists($folder . DS . 'cases' . DS . 'libs' . DS . $this->file . '.test.php'); if ($this->category == 'core' && ($coreCaseExists || $coreLibCaseExists)) { return true; } - if ($isPlugin && file_exists($folder.DS.'cases'.DS.$this->file.'.test.php')) { + if ($isPlugin && file_exists($folder . DS . 'cases' . DS . $this->file . '.test.php')) { return true; } break; } - $this->err($this->category.' '.$this->type.' '.$this->file.' is an invalid test identifier'); + $this->err($this->category . ' ' . $this->type . ' ' . $this->file . ' is an invalid test identifier'); return false; } @@ -273,7 +273,7 @@ function __run() { if ($this->category == 'app') { $path = APP_TEST_GROUPS; } elseif ($this->isPluginTest) { - $path = APP.'plugins'.DS.$this->category.DS.'tests'.DS.'groups'; + $path = APP . 'plugins' . DS . $this->category . DS . 'tests' . DS . 'groups'; } if ($this->doCoverage) { @@ -287,16 +287,16 @@ function __run() { return $result; } if ($this->category === 'core') { - $coreCaseExists = file_exists(CORE_TEST_CASES.DS.$this->file.'.test.php'); + $coreCaseExists = file_exists(CORE_TEST_CASES . DS . $this->file . '.test.php'); if ($coreCaseExists) { $case = $this->file . '.test.php'; } else { $case = 'libs' . DS . $this->file . '.test.php'; } } elseif ($this->category === 'app') { - $case = $this->file.'.test.php'; + $case = $this->file . '.test.php'; } elseif ($this->isPluginTest) { - $case = $this->file.'.test.php'; + $case = $this->file . '.test.php'; } if ($this->doCoverage) { @@ -322,7 +322,7 @@ function __findFolderByCategory($category) { $folder = ''; $paths = array( 'core' => CAKE, - 'app' => APP + 'app' => APP ); if (array_key_exists($category, $paths)) { @@ -350,8 +350,8 @@ function __findFolderByCategory($category) { function __setGetVars() { if (in_array($this->category, $this->plugins)) { $_GET['plugin'] = $this->category; - } elseif (in_array(Inflector::Humanize($this->category), $this->plugins)) { - $_GET['plugin'] = Inflector::Humanize($this->category); + } elseif (in_array(Inflector::humanize($this->category), $this->plugins)) { + $_GET['plugin'] = Inflector::humanize($this->category); } elseif ($this->category == 'app') { $_GET['app'] = true; } From 8a567933689d9b7600aa4164f0711cf06d4a7b2a Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 19:52:52 -0500 Subject: [PATCH 1405/2083] Correcting doc blocks. --- cake/tests/lib/test_manager.php | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index 09a3572cd..661e4e6ad 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -97,6 +97,7 @@ function _installSimpleTest() { * @param boolean $testing Are tests supposed to be auto run. Set to true to return testcase list. * @return mixed * @access public + * @static */ function runAllTests(&$reporter, $testing = false) { $manager =& new TestManager(); @@ -181,6 +182,7 @@ function runGroupTest($groupTestName, &$reporter) { * @param string $directory The directory to add tests from. * @return void * @access public + * @static */ function addTestCasesFromDirectory(&$groupTest, $directory = '.') { $manager =& new TestManager(); @@ -197,6 +199,7 @@ function addTestCasesFromDirectory(&$groupTest, $directory = '.') { * @param string $file The file name, minus the suffix to add. * @return void * @access public + * @static */ function addTestFile(&$groupTest, $file) { $manager =& new TestManager(); @@ -223,6 +226,7 @@ function &getTestCaseList() { /** * Builds the list of test cases from a given directory * + * @param string $directory Directory to get test case list from. * @access public */ function &_getTestCaseList($directory = '.') { @@ -237,7 +241,8 @@ function &_getTestCaseList($directory = '.') { /** * Returns a list of test files from a given directory * - * @access public + * @param string $directory Directory to get test case files from. + * @access protected */ function &_getTestFileList($directory = '.') { $return = $this->_getRecursiveFileList($directory, array(&$this, '_isTestCaseFile')); @@ -248,6 +253,7 @@ function &_getTestFileList($directory = '.') { * Returns a list of group tests found in the current valid test case path * * @access public + * @static */ function &getGroupTestList() { $manager =& new TestManager(); @@ -259,7 +265,7 @@ function &getGroupTestList() { * Returns a list of group test files from a given directory * * @param string $directory The directory to get group test files from. - * @access public + * @access protected */ function &_getTestGroupFileList($directory = '.') { $return = $this->_getRecursiveFileList($directory, array(&$this, '_isTestGroupFile')); @@ -270,7 +276,7 @@ function &_getTestGroupFileList($directory = '.') { * Returns a list of group test files from a given directory * * @param string $directory The directory to get group tests from. - * @access public + * @access protected */ function &_getTestGroupList($directory = '.') { $fileList =& $this->_getTestGroupFileList($directory); @@ -287,7 +293,7 @@ function &_getTestGroupList($directory = '.') { * Returns a list of class names from a group test file * * @param string $groupTestFile The groupTest file to scan for TestSuite classnames. - * @access public + * @access protected */ function &_getGroupTestClassNames($groupTestFile) { $file = implode("\n", file($groupTestFile)); @@ -306,7 +312,7 @@ function &_getGroupTestClassNames($groupTestFile) { * * @param string $directory The directory to scan for files. * @param mixed $fileTestFunction - * @access public + * @access protected */ function &_getRecursiveFileList($directory = '.', $fileTestFunction) { $fileList = array(); @@ -332,7 +338,7 @@ function &_getRecursiveFileList($directory = '.', $fileTestFunction) { * * @param string $file * @return void - * @access public + * @access protected */ function _isTestCaseFile($file) { return $this->_hasExpectedExtension($file, $this->_testExtension); @@ -343,7 +349,7 @@ function _isTestCaseFile($file) { * * @param string $file * @return void - * @access public + * @access protected */ function _isTestGroupFile($file) { return $this->_hasExpectedExtension($file, $this->_groupExtension); @@ -355,7 +361,7 @@ function _isTestGroupFile($file) { * @param string $file * @param string $extension * @return void - * @access public + * @access protected */ function _hasExpectedExtension($file, $extension) { return $extension == strtolower(substr($file, (0 - strlen($extension)))); @@ -366,7 +372,7 @@ function _hasExpectedExtension($file, $extension) { * * @param string $type either 'cases' or 'groups' * @return string The path tests are located on - * @access public + * @access protected */ function _getTestsPath($type = 'cases') { if (!empty($this->appTest)) { From 6721c4926d6dad470be1772f4c23eac3e1ab4b1b Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 20:19:49 -0500 Subject: [PATCH 1406/2083] Renaming CliReporter to CakeCliReporter, so it name matches the other new refactored reporters. --- .../reporter/{cli_reporter.php => cake_cli_reporter.php} | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) rename cake/tests/lib/reporter/{cli_reporter.php => cake_cli_reporter.php} (95%) diff --git a/cake/tests/lib/reporter/cli_reporter.php b/cake/tests/lib/reporter/cake_cli_reporter.php similarity index 95% rename from cake/tests/lib/reporter/cli_reporter.php rename to cake/tests/lib/reporter/cake_cli_reporter.php index 35c6c1df9..aecbce25e 100644 --- a/cake/tests/lib/reporter/cli_reporter.php +++ b/cake/tests/lib/reporter/cake_cli_reporter.php @@ -1,6 +1,6 @@ Date: Sat, 9 Jan 2010 20:20:13 -0500 Subject: [PATCH 1407/2083] Fixing package string on CakeBaseReporter --- cake/tests/lib/reporter/cake_base_reporter.php | 2 +- cake/tests/lib/test_manager.php | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/cake/tests/lib/reporter/cake_base_reporter.php b/cake/tests/lib/reporter/cake_base_reporter.php index 0bedcc9b5..109bc012a 100644 --- a/cake/tests/lib/reporter/cake_base_reporter.php +++ b/cake/tests/lib/reporter/cake_base_reporter.php @@ -13,7 +13,7 @@ * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org * @package cake - * @subpackage cake.cake.tests.libs + * @subpackage cake.tests.libs.reporter * @since CakePHP(tm) v 1.3 * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index 661e4e6ad..e00ee0204 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -97,16 +97,13 @@ function _installSimpleTest() { * @param boolean $testing Are tests supposed to be auto run. Set to true to return testcase list. * @return mixed * @access public - * @static */ function runAllTests(&$reporter, $testing = false) { - $manager =& new TestManager(); - - $testCases =& $manager->_getTestFileList($manager->_getTestsPath()); - if ($manager->appTest) { + $testCases =& $this->_getTestFileList($this->_getTestsPath()); + if ($this->appTest) { $test =& new TestSuite('All App Tests'); - } else if ($manager->pluginTest) { - $test =& new TestSuite('All ' . Inflector::humanize($manager->pluginTest) . ' Plugin Tests'); + } else if ($this->pluginTest) { + $test =& new TestSuite('All ' . Inflector::humanize($this->pluginTest) . ' Plugin Tests'); } else { $test =& new TestSuite('All Core Tests'); } @@ -337,7 +334,7 @@ function &_getRecursiveFileList($directory = '.', $fileTestFunction) { * Tests if a file has the correct test case extension * * @param string $file - * @return void + * @return boolean * @access protected */ function _isTestCaseFile($file) { From 80670d85fbe99c0fc1ba2a12607729576968cf72 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 20:20:51 -0500 Subject: [PATCH 1408/2083] Updating TestSuite shell to use refactored classes and methods in the TestSuite. --- cake/console/libs/testsuite.php | 91 +++++++++++++++++++-------------- 1 file changed, 54 insertions(+), 37 deletions(-) diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php index a0fdef3c3..3228a7a33 100644 --- a/cake/console/libs/testsuite.php +++ b/cake/console/libs/testsuite.php @@ -100,41 +100,64 @@ function initialize() { foreach ($plugins as $p) { $this->plugins[] = Inflector::underscore($p); } + $this->parseArgs(); + $this->getManager(); } /** - * Main entry point to this shell + * Parse the arguments given into the Shell object properties. * * @return void * @access public */ - function main() { - $this->out($this->headline); - $this->hr(); + function parseArgs() { + $this->category = $this->args[0]; - if (count($this->args) > 0) { - $this->category = $this->args[0]; + if (!in_array($this->category, array('app', 'core'))) { + $this->isPluginTest = true; + } - if (!in_array($this->category, array('app', 'core'))) { - $this->isPluginTest = true; - } + if (isset($this->args[1])) { + $this->type = $this->args[1]; + } - if (isset($this->args[1])) { - $this->type = $this->args[1]; + if (isset($this->args[2])) { + if ($this->args[2] == 'cov') { + $this->doCoverage = true; + } else { + $this->file = Inflector::underscore($this->args[2]); } + } - if (isset($this->args[2])) { - if ($this->args[2] == 'cov') { - $this->doCoverage = true; - } else { - $this->file = Inflector::underscore($this->args[2]); - } - } + if (isset($this->args[3]) && $this->args[3] == 'cov') { + $this->doCoverage = true; + } + } - if (isset($this->args[3]) && $this->args[3] == 'cov') { - $this->doCoverage = true; - } - } else { +/** + * Gets a manager instance, and set the app/plugin properties. + * + * @return void + */ + function getManager() { + $this->Manager = new TestManager(); + $this->Manager->appTest = ($this->category === 'app'); + if ($this->isPluginTest) { + $this->Manager->pluginTest = $this->category; + } + } + +/** + * Main entry point to this shell + * + * @return void + * @access public + */ + function main() { + $this->out($this->headline); + $this->hr(); + + if (count($this->args) == 0) { $this->err('Sorry, you did not pass any arguments!'); } @@ -252,11 +275,10 @@ function __canRun() { * @access private */ function __run() { - $reporter = new CLIReporter(); - $this->__setGetVars(); + $Reporter = new CakeCliReporter(); if ($this->type == 'all') { - return TestManager::runAllTests($reporter); + return $this->Manager->runAllTests($Reporter); } if ($this->doCoverage) { @@ -278,9 +300,9 @@ function __run() { if ($this->doCoverage) { require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php'; - CodeCoverageManager::start($ucFirstGroup, $reporter); + CodeCoverageManager::start($ucFirstGroup, $Reporter); } - $result = TestManager::runGroupTest($ucFirstGroup, $reporter); + $result = $this->Manager->runGroupTest($ucFirstGroup, $Reporter); if ($this->doCoverage) { CodeCoverageManager::report(); } @@ -301,10 +323,10 @@ function __run() { if ($this->doCoverage) { require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php'; - CodeCoverageManager::start($case, $reporter); + CodeCoverageManager::start($case, $Reporter); } - $result = TestManager::runTestCase($case, $reporter); + $result = $this->Manager->runTestCase($case, $Reporter); if ($this->doCoverage) { CodeCoverageManager::report(); } @@ -328,14 +350,9 @@ function __findFolderByCategory($category) { if (array_key_exists($category, $paths)) { $folder = $paths[$category] . 'tests'; } else { - $scoredCategory = Inflector::underscore($category); - $folder = APP . 'plugins' . DS . $scoredCategory . DS; - $pluginPaths = App::path('plugins'); - foreach ($pluginPaths as $path) { - if (file_exists($path . $scoredCategory . DS . 'tests')) { - $folder = $path . $scoredCategory . DS . 'tests'; - break; - } + $pluginPath = App::pluginPath($category); + if (is_dir($pluginPath . 'tests')) { + $folder = $pluginPath . 'tests' . DS; } } return $folder; From 924571971199690d2eafc1a04f055f0268ebd16e Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 21:22:41 -0500 Subject: [PATCH 1409/2083] Updating TestManager::getExtension to be an instance method only. Updating doc blocks for TestManager. Removing CliTestManager as it is no longer used/needed. --- cake/tests/lib/test_manager.php | 57 +++++---------------------------- 1 file changed, 8 insertions(+), 49 deletions(-) diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index e00ee0204..af29e2f3c 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -125,7 +125,7 @@ function runAllTests(&$reporter, $testing = false) { * @param string $testCaseFile Filename of the test to be run. * @param Object $reporter Reporter instance to attach to the test case. * @param boolean $testing Set to true if testing, otherwise test case will be run. - * @return mixed + * @return mixed Result of test case being run. * @access public */ function runTestCase($testCaseFile, &$reporter, $testing = false) { @@ -150,7 +150,7 @@ function runTestCase($testCaseFile, &$reporter, $testing = false) { * * @param string $groupTestName GroupTest that you want to run. * @param Object $reporter Reporter instance to use with the group test being run. - * @return mixed + * @return mixed Results of group test being run. * @access public */ function runGroupTest($groupTestName, &$reporter) { @@ -213,6 +213,7 @@ function addTestFile(&$groupTest, $file) { * Returns a list of test cases found in the current valid test case path * * @access public + * @static */ function &getTestCaseList() { $manager =& new TestManager(); @@ -224,7 +225,7 @@ function &getTestCaseList() { * Builds the list of test cases from a given directory * * @param string $directory Directory to get test case list from. - * @access public + * @access protected */ function &_getTestCaseList($directory = '.') { $fileList =& $this->_getTestFileList($directory); @@ -334,7 +335,7 @@ function &_getRecursiveFileList($directory = '.', $fileTestFunction) { * Tests if a file has the correct test case extension * * @param string $file - * @return boolean + * @return boolean Whether $file is a test case. * @access protected */ function _isTestCaseFile($file) { @@ -345,7 +346,7 @@ function _isTestCaseFile($file) { * Tests if a file has the correct group test extension * * @param string $file - * @return void + * @return boolean Whether $file is a group * @access protected */ function _isTestGroupFile($file) { @@ -403,52 +404,10 @@ function _getTestsPath($type = 'cases') { * @access public */ function getExtension($type = 'test') { - $manager =& new TestManager(); if ($type == 'test') { - return $manager->_testExtension; - } - return $manager->_groupExtension; - } -} - -/** - * The CliTestManager ensures that the list of available files are printed in the correct cli format - * - * @package cake - * @subpackage cake.cake.tests.lib - */ -class CliTestManager extends TestManager { - -/** - * Prints the list of group tests in a cli friendly format - * - * @access public - */ - function &getGroupTestList() { - $manager =& new CliTestManager(); - $groupTests =& $manager->_getTestGroupList($manager->_getTestsPath('groups')); - $buffer = "Available Group Test:\n"; - - foreach ($groupTests as $groupTest) { - $buffer .= " " . $groupTest . "\n"; - } - return $buffer . "\n"; - } - -/** - * Prints the list of test cases in a cli friendly format - * - * @access public - */ - function &getTestCaseList() { - $manager =& new CliTestManager(); - $testCases =& $manager->_getTestCaseList($manager->_getTestsPath()); - $buffer = "Available Test Cases:\n"; - - foreach ($testCases as $testCaseFile => $testCase) { - $buffer .= " " . $testCaseFile . "\n"; + return $this->_testExtension; } - return $buffer . "\n"; + return $this->_groupExtension; } } From 6a3152c5185203c0555803da09f7b4eb59eaee3d Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 21:24:27 -0500 Subject: [PATCH 1410/2083] Update file header. --- cake/tests/lib/test_manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index af29e2f3c..3b543a614 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -1,6 +1,6 @@ Date: Sat, 9 Jan 2010 21:25:05 -0500 Subject: [PATCH 1411/2083] Refactoring testsuite shell features, and adding i18n text. --- cake/console/libs/testsuite.php | 57 +++++++++++++++++---------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php index 3228a7a33..3670e76e2 100644 --- a/cake/console/libs/testsuite.php +++ b/cake/console/libs/testsuite.php @@ -69,14 +69,6 @@ class TestSuiteShell extends Shell { */ var $doCoverage = false; -/** - * The headline for the test output - * - * @var string - * @access public - */ - var $headline = 'CakePHP Test Shell'; - /** * Initialization method installs Simpletest and loads all plugins * @@ -111,6 +103,9 @@ function initialize() { * @access public */ function parseArgs() { + if (empty($this->args)) { + return; + } $this->category = $this->args[0]; if (!in_array($this->category, array('app', 'core'))) { @@ -154,24 +149,24 @@ function getManager() { * @access public */ function main() { - $this->out($this->headline); + $this->out(__('CakePHP Test Shell', true)); $this->hr(); if (count($this->args) == 0) { - $this->err('Sorry, you did not pass any arguments!'); + $this->error(__('Sorry, you did not pass any arguments!', true)); } if ($this->__canRun()) { - $this->out('Running ' . $this->category . ' ' . $this->type . ' ' . $this->file); + $message = sprintf(__('Running %s %s %s', true), $this->category, $this->type, $this->file); + $this->out($message); $exitCode = 0; if (!$this->__run()) { $exitCode = 1; } - exit($exitCode); + $this->_stop($exitCode); } else { - $this->err('Sorry, the tests could not be found.'); - exit(1); + $this->error(__('Sorry, the tests could not be found.', true)); } } @@ -224,47 +219,55 @@ function __canRun() { $isPlugin = in_array(Inflector::underscore($this->category), $this->plugins); if ($isNeitherAppNorCore && !$isPlugin) { - $this->err($this->category . ' is an invalid test category (either "app", "core" or name of a plugin)'); + $message = sprintf( + __('%s is an invalid test category (either "app", "core" or name of a plugin)', true), + $this->category + ); + $this->error($message); return false; } $folder = $this->__findFolderByCategory($this->category); if (!file_exists($folder)) { - $this->err($folder . ' not found'); + $this->err(sprintf(__('%s not found', true), $folder)); return false; } if (!in_array($this->type, array('all', 'group', 'case'))) { - $this->err($this->type . ' is invalid. Should be case, group or all'); + $this->err(sprintf(__('%s is invalid. Should be case, group or all', true), $this->type)); return false; } + $ext = $this->Manager->getExtensino($this->type); switch ($this->type) { case 'all': return true; - break; case 'group': - if (file_exists($folder . DS . 'groups' . DS . $this->file . '.group.php')) { + if (file_exists($folder . DS . 'groups' . DS . $this->file . $ext)) { return true; } break; case 'case': - if ($this->category == 'app' && file_exists($folder . DS . 'cases' . DS . $this->file . '.test.php')) { + if ($this->category == 'app' && file_exists($folder . DS . 'cases' . DS . $this->file . $ext)) { return true; } - $coreCaseExists = file_exists($folder . DS . 'cases' . DS . $this->file . '.test.php'); - $coreLibCaseExists = file_exists($folder . DS . 'cases' . DS . 'libs' . DS . $this->file . '.test.php'); + $coreCaseExists = file_exists($folder . DS . 'cases' . DS . $this->file . $ext); + $coreLibCaseExists = file_exists($folder . DS . 'cases' . DS . 'libs' . DS . $this->file . $ext); if ($this->category == 'core' && ($coreCaseExists || $coreLibCaseExists)) { return true; } - if ($isPlugin && file_exists($folder . DS . 'cases' . DS . $this->file . '.test.php')) { + if ($isPlugin && file_exists($folder . DS . 'cases' . DS . $this->file . $ext)) { return true; } break; } - - $this->err($this->category . ' ' . $this->type . ' ' . $this->file . ' is an invalid test identifier'); + + $message = sprintf( + __('%s %s %s is an invalid test identifier', true), + $this->category, $this->type, $this->file + ); + $this->err($message); return false; } @@ -283,7 +286,7 @@ function __run() { if ($this->doCoverage) { if (!extension_loaded('xdebug')) { - $this->out('You must install Xdebug to use the CakePHP(tm) Code Coverage Analyzation. Download it from http://www.xdebug.org/docs/install'); + $this->out(__('You must install Xdebug to use the CakePHP(tm) Code Coverage Analyzation. Download it from http://www.xdebug.org/docs/install', true)); exit(0); } } @@ -385,7 +388,7 @@ function __setGetVars() { */ function __installSimpleTest() { if (!App::import('Vendor', 'simpletest' . DS . 'reporter')) { - $this->err('Sorry, Simpletest could not be found. Download it from http://simpletest.org and install it to your vendors directory.'); + $this->err(__('Sorry, Simpletest could not be found. Download it from http://simpletest.org and install it to your vendors directory.', true)); exit; } } From a8f289349ea56b986832c40b6624e9d7b64fdf5a Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 21:29:57 -0500 Subject: [PATCH 1412/2083] Letting TestManager::getExtension accept either test or case as a test case type. --- cake/tests/lib/test_manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index 3b543a614..21ee551ca 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -404,7 +404,7 @@ function _getTestsPath($type = 'cases') { * @access public */ function getExtension($type = 'test') { - if ($type == 'test') { + if ($type == 'test' || $type == 'case') { return $this->_testExtension; } return $this->_groupExtension; From 081509a09c1893b803cee40bb88856f258b65e57 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 21:30:46 -0500 Subject: [PATCH 1413/2083] Fixing typos. Removing useless constant. Fixing constructor --- cake/console/libs/testsuite.php | 2 +- cake/tests/lib/reporter/cake_cli_reporter.php | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php index 3670e76e2..f4822441d 100644 --- a/cake/console/libs/testsuite.php +++ b/cake/console/libs/testsuite.php @@ -237,7 +237,7 @@ function __canRun() { $this->err(sprintf(__('%s is invalid. Should be case, group or all', true), $this->type)); return false; } - $ext = $this->Manager->getExtensino($this->type); + $ext = $this->Manager->getExtension($this->type); switch ($this->type) { case 'all': diff --git a/cake/tests/lib/reporter/cake_cli_reporter.php b/cake/tests/lib/reporter/cake_cli_reporter.php index aecbce25e..e2db21771 100644 --- a/cake/tests/lib/reporter/cake_cli_reporter.php +++ b/cake/tests/lib/reporter/cake_cli_reporter.php @@ -17,10 +17,6 @@ * @since CakePHP(tm) v 1.2.0.4433 * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ - if (! defined('ST_FAILDETAIL_SEPARATOR')) { - define('ST_FAILDETAIL_SEPARATOR', "->"); - } - if (version_compare(PHP_VERSION, '4.4.4', '<=') || PHP_SAPI == 'cgi') { define('STDOUT', fopen('php://stdout', 'w')); @@ -37,9 +33,9 @@ */ class CakeCliReporter extends TextReporter { - var $faildetail_separator = ST_FAILDETAIL_SEPARATOR; + var $faildetail_separator = '->'; - function CLIReporter($faildetail_separator = NULL) { + function CakeCLIReporter($faildetail_separator = NULL) { $this->SimpleReporter(); if (! is_null($faildetail_separator)) { $this->setFailDetailSeparator($faildetail_separator); From 7b5addec3e7287e4906c742299c93aafc9a8b682 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 22:02:35 -0500 Subject: [PATCH 1414/2083] Making CakeCliReporter a subclass of CakeBaseReporter. Removing duplicated output from reporter message. Adjusting formatting of output to be more readable. --- cake/tests/lib/reporter/cake_cli_reporter.php | 70 +++++++++++++------ 1 file changed, 49 insertions(+), 21 deletions(-) diff --git a/cake/tests/lib/reporter/cake_cli_reporter.php b/cake/tests/lib/reporter/cake_cli_reporter.php index e2db21771..bc1f17255 100644 --- a/cake/tests/lib/reporter/cake_cli_reporter.php +++ b/cake/tests/lib/reporter/cake_cli_reporter.php @@ -24,6 +24,8 @@ register_shutdown_function(create_function('', 'fclose(STDOUT); fclose(STDERR); return true;')); } +include_once dirname(__FILE__) . DS . 'cake_base_reporter.php'; + /** * Minimal command line test displayer. Writes fail details to STDERR. Returns 0 * to the shell if all tests pass, ST_FAILS_RETURN_CODE if any test fails. @@ -31,47 +33,73 @@ * @package cake * @subpackage cake.tests.libs.reporter */ -class CakeCliReporter extends TextReporter { +class CakeCliReporter extends CakeBaseReporter { - var $faildetail_separator = '->'; + var $separator = '->'; - function CakeCLIReporter($faildetail_separator = NULL) { + function CakeCLIReporter($separator = NULL) { $this->SimpleReporter(); - if (! is_null($faildetail_separator)) { - $this->setFailDetailSeparator($faildetail_separator); + if (!is_null($separator)) { + $this->setFailDetailSeparator($separator); } } function setFailDetailSeparator($separator) { - $this->faildetail_separator = $separator; + $this->separator = $separator; } /** - * Return a formatted faildetail for printing. + * Paint fail faildetail to STDERR. + * + * @param string $message Message of the fail. + * @return void + * @access public */ - function &_paintTestFailDetail(&$message) { - $buffer = ''; - $faildetail = $this->getTestList(); - array_shift($faildetail); - $buffer .= implode($this->faildetail_separator, $faildetail); - $buffer .= $this->faildetail_separator . "$message\n"; - return $buffer; + function paintFail($message) { + parent::paintFail($message); + $breadcrumb = $this->getTestList(); + array_shift($breadcrumb); + $message .= "\n\tin " . implode("\n\tin ", array_reverse($breadcrumb)); + $message .= "\n\n"; + fwrite(STDERR, 'FAIL' . $this->separator . $message); } /** - * Paint fail faildetail to STDERR. + * Paint PHP errors to STDERR. + * + * @param string $message Message of the Error + * @return void + * @access public */ - function paintFail($message) { - parent::paintFail($message); - fwrite(STDERR, 'FAIL' . $this->faildetail_separator . $this->_paintTestFailDetail($message)); + function paintError($message) { + parent::paintError($message); + $breadcrumb = $this->getTestList(); + array_shift($breadcrumb); + $message .= "\n\tin " . implode("\n\tin ", array_reverse($breadcrumb)); + $message .= "\n\n"; + fwrite(STDERR, 'ERROR' . $this->separator . $message); } /** * Paint exception faildetail to STDERR. + * + * @param string $message Message of the Error + * @return void + * @access public */ - function paintException($message) { - parent::paintException($message); - fwrite(STDERR, 'EXCEPTION' . $this->faildetail_separator . $this->_paintTestFailDetail($message)); + function paintException($exception) { + parent::paintException($exception); + $message .= sprintf('Unexpected exception of type [%s] with message [%s] in [%s] line [%s]', + get_class($exception), + $exception->getMessage(), + $exception->getFile(), + $exception->getLine() + ); + $breadcrumb = $this->getTestList(); + array_shift($breadcrumb); + $message .= "\n\tin " . implode("\n\tin ", array_reverse($breadcrumb)); + $message .= "\n\n"; + fwrite(STDERR, 'EXCEPTION' . $this->separator . $message); } /** From f52900f8181e6834746ac077263f3a23455c0493 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 22:04:28 -0500 Subject: [PATCH 1415/2083] Adding time and memory use to CakeCliReporter --- cake/tests/lib/reporter/cake_cli_reporter.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cake/tests/lib/reporter/cake_cli_reporter.php b/cake/tests/lib/reporter/cake_cli_reporter.php index bc1f17255..dc2409b0c 100644 --- a/cake/tests/lib/reporter/cake_cli_reporter.php +++ b/cake/tests/lib/reporter/cake_cli_reporter.php @@ -117,6 +117,10 @@ function paintFooter($test_name) { $buffer .= ", " . $this->getExceptionCount() . " exceptions"; } $buffer .= ".\n"; + $buffer .= 'Time taken by tests (in seconds): ' . $this->_timeDuration . "\n"; + if (function_exists('memory_get_peak_usage')) { + $buffer .= 'Peak memory use: (in bytes): ' . number_format(memory_get_peak_usage()) . "\n"; + } fwrite(STDOUT, $buffer); } else { fwrite(STDOUT, $buffer . $this->getPassCount() . " passes.\n"); From 03da53bb9296193e92f9e35c50ae6d2c323a3b25 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 22:35:29 -0500 Subject: [PATCH 1416/2083] Correcting classname used in CodeCoverageManager Moving CodeCoverageManager::report() to be inside the html document. --- cake/tests/lib/cake_test_suite_dispatcher.php | 8 -------- cake/tests/lib/code_coverage_manager.php | 2 +- cake/tests/lib/reporter/cake_html_reporter.php | 7 +++++++ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/cake/tests/lib/cake_test_suite_dispatcher.php b/cake/tests/lib/cake_test_suite_dispatcher.php index 1b671204d..7ba5f7596 100644 --- a/cake/tests/lib/cake_test_suite_dispatcher.php +++ b/cake/tests/lib/cake_test_suite_dispatcher.php @@ -230,9 +230,6 @@ function _runGroupTest() { CodeCoverageManager::start($this->params['group'], $Reporter); } $this->Manager->runGroupTest(ucfirst($this->params['group']), $Reporter); - if ($this->params['codeCoverage']) { - CodeCoverageManager::report(); - } } } @@ -246,12 +243,7 @@ function _runTestCase() { if ($this->params['codeCoverage']) { CodeCoverageManager::start($this->params['case'], $Reporter); } - $this->Manager->runTestCase($this->params['case'], $Reporter); - - if ($this->params['codeCoverage']) { - CodeCoverageManager::report(); - } } } ?> \ No newline at end of file diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index 019c632a2..81af4a040 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -155,7 +155,7 @@ function report($output = true) { case 'CakeHtmlReporter': $result = $manager->reportCaseHtmlDiff(@file($testObjectFile), $coverageData, $execCodeLines, $manager->numDiffContextLines); break; - case 'CLIReporter': + case 'CakeCliReporter': $result = $manager->reportCaseCli(@file($testObjectFile), $coverageData, $execCodeLines, $manager->numDiffContextLines); break; default: diff --git a/cake/tests/lib/reporter/cake_html_reporter.php b/cake/tests/lib/reporter/cake_html_reporter.php index c85f118eb..53162aa4b 100644 --- a/cake/tests/lib/reporter/cake_html_reporter.php +++ b/cake/tests/lib/reporter/cake_html_reporter.php @@ -175,6 +175,13 @@ function paintFooter($test_name) { } echo $this->_paintLinks(); echo '
      '; + if ( + isset($this->params['codeCoverage']) && + $this->params['codeCoverage'] && + class_exists('CodeCoverageManager') + ) { + CodeCoverageManager::report(); + } $this->paintDocumentEnd(); } From d79bacd1ed7b7452c59c663d8b998c3b511919d8 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 22:41:49 -0500 Subject: [PATCH 1417/2083] Making CodeCoverageManager get its settings from the reporter. This makes code coverage much less reliant on GET parameters. --- cake/tests/lib/code_coverage_manager.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index 81af4a040..eb6294e1c 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -96,24 +96,24 @@ function &getInstance() { */ function start($testCaseFile, &$reporter) { $manager =& CodeCoverageManager::getInstance(); - $manager->reporter = $reporter; + $manager->reporter =& $reporter; $testCaseFile = str_replace(DS . DS, DS, $testCaseFile); $thisFile = str_replace('.php', '.test.php', basename(__FILE__)); if (strpos($testCaseFile, $thisFile) !== false) { trigger_error('Xdebug supports no parallel coverage analysis - so this is not possible.', E_USER_ERROR); } - - if (isset($_GET['app'])) { + + if ($reporter->params['app']) { $manager->appTest = true; } - if (isset($_GET['group'])) { + if ($reporter->params['group']) { $manager->groupTest = true; } - if (isset($_GET['plugin'])) { - $manager->pluginTest = Inflector::underscore($_GET['plugin']); + if ($reporter->params['plugin']) { + $manager->pluginTest = Inflector::underscore($reporter->params['plugin']); } $manager->testCaseFile = $testCaseFile; xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); From bcd7d3402390b1c7842f5417ef0d0b58858abff9 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 22:51:17 -0500 Subject: [PATCH 1418/2083] Refactoring breadcrumb and time generation in the CLI reporter. --- cake/tests/lib/reporter/cake_cli_reporter.php | 58 ++++++++++++++----- 1 file changed, 42 insertions(+), 16 deletions(-) diff --git a/cake/tests/lib/reporter/cake_cli_reporter.php b/cake/tests/lib/reporter/cake_cli_reporter.php index dc2409b0c..60d30751e 100644 --- a/cake/tests/lib/reporter/cake_cli_reporter.php +++ b/cake/tests/lib/reporter/cake_cli_reporter.php @@ -57,10 +57,7 @@ function setFailDetailSeparator($separator) { */ function paintFail($message) { parent::paintFail($message); - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - $message .= "\n\tin " . implode("\n\tin ", array_reverse($breadcrumb)); - $message .= "\n\n"; + $message .= $this->_getBreadcrumb(); fwrite(STDERR, 'FAIL' . $this->separator . $message); } @@ -73,10 +70,7 @@ function paintFail($message) { */ function paintError($message) { parent::paintError($message); - $breadcrumb = $this->getTestList(); - array_shift($breadcrumb); - $message .= "\n\tin " . implode("\n\tin ", array_reverse($breadcrumb)); - $message .= "\n\n"; + $message .= $this->_getBreadcrumb(); fwrite(STDERR, 'ERROR' . $this->separator . $message); } @@ -95,11 +89,32 @@ function paintException($exception) { $exception->getFile(), $exception->getLine() ); + $message .= $this->_getBreadcrumb(); + fwrite(STDERR, 'EXCEPTION' . $this->separator . $message); + } + +/** + * Get the breadcrumb trail for the current test method/case + * + * @return string The string for the breadcrumb + */ + function _getBreadcrumb() { $breadcrumb = $this->getTestList(); array_shift($breadcrumb); - $message .= "\n\tin " . implode("\n\tin ", array_reverse($breadcrumb)); - $message .= "\n\n"; - fwrite(STDERR, 'EXCEPTION' . $this->separator . $message); + $out = "\n\tin " . implode("\n\tin ", array_reverse($breadcrumb)); + $out .= "\n\n"; + return $out; + } + +/** + * Paint a test skip message + * + * @param string $message The message of the skip + * @return void + */ + function paintSkip($message) { + parent::paintSkip($message); + fwrite(STDOUT, 'SKIP' . $this->separator . $message . "\n\n"); } /** @@ -117,14 +132,25 @@ function paintFooter($test_name) { $buffer .= ", " . $this->getExceptionCount() . " exceptions"; } $buffer .= ".\n"; - $buffer .= 'Time taken by tests (in seconds): ' . $this->_timeDuration . "\n"; - if (function_exists('memory_get_peak_usage')) { - $buffer .= 'Peak memory use: (in bytes): ' . number_format(memory_get_peak_usage()) . "\n"; - } + $buffer .= $this->_timeStats(); fwrite(STDOUT, $buffer); } else { - fwrite(STDOUT, $buffer . $this->getPassCount() . " passes.\n"); + fwrite(STDOUT, $buffer . $this->getPassCount() . " passes.\n" . $this->_timeStats()); + } + } + +/** + * Get the time and memory stats for this test case/group + * + * @return string String content to display + * @access protected + */ + function _timeStats() { + $out = 'Time taken by tests (in seconds): ' . $this->_timeDuration . "\n"; + if (function_exists('memory_get_peak_usage')) { + $out .= 'Peak memory use: (in bytes): ' . number_format(memory_get_peak_usage()) . "\n"; } + return $out; } } ?> \ No newline at end of file From f4bda62ea34304adc2e4b9068985186364129a89 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 9 Jan 2010 23:00:03 -0500 Subject: [PATCH 1419/2083] Adding doc blocks and correcting constructor of CakeCliReporter Fixing TestSuite console code coverage output. --- cake/console/libs/testsuite.php | 7 +++++- cake/tests/lib/reporter/cake_cli_reporter.php | 24 ++++++++++++++++--- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php index f4822441d..162119a28 100644 --- a/cake/console/libs/testsuite.php +++ b/cake/console/libs/testsuite.php @@ -278,7 +278,11 @@ function __canRun() { * @access private */ function __run() { - $Reporter = new CakeCliReporter(); + $Reporter = new CakeCliReporter('utf-8', array( + 'app' => $this->Manager->appTest, + 'plugin' => $this->Manager->pluginTest, + 'group' => ($this->type === 'group') + )); if ($this->type == 'all') { return $this->Manager->runAllTests($Reporter); @@ -332,6 +336,7 @@ function __run() { $result = $this->Manager->runTestCase($case, $Reporter); if ($this->doCoverage) { CodeCoverageManager::report(); + $this->out(); } return $result; diff --git a/cake/tests/lib/reporter/cake_cli_reporter.php b/cake/tests/lib/reporter/cake_cli_reporter.php index 60d30751e..b736ce4d1 100644 --- a/cake/tests/lib/reporter/cake_cli_reporter.php +++ b/cake/tests/lib/reporter/cake_cli_reporter.php @@ -34,11 +34,29 @@ * @subpackage cake.tests.libs.reporter */ class CakeCliReporter extends CakeBaseReporter { - +/** + * separator string for fail, error, exception, and skip messages. + * + * @var string + */ var $separator = '->'; - function CakeCLIReporter($separator = NULL) { - $this->SimpleReporter(); +/** + * array of 'request' parameters + * + * @var array + */ + var $params = array(); + +/** + * Constructor + * + * @param string $separator + * @param array $params + * @return void + */ + function CakeCLIReporter($separator = NULL, $params = array()) { + $this->CakeBaseReporter('utf-8', $params); if (!is_null($separator)) { $this->setFailDetailSeparator($separator); } From 3bd8bd2e0e99529c56b8a783da1eb98260407053 Mon Sep 17 00:00:00 2001 From: predominant Date: Sun, 10 Jan 2010 20:52:49 +1100 Subject: [PATCH 1420/2083] Adding Inflector::underscore tests --- cake/tests/cases/libs/inflector.test.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cake/tests/cases/libs/inflector.test.php b/cake/tests/cases/libs/inflector.test.php index 7ce4a6ced..6102e0e07 100644 --- a/cake/tests/cases/libs/inflector.test.php +++ b/cake/tests/cases/libs/inflector.test.php @@ -245,6 +245,19 @@ function testInflectorSlugWithMap() { $this->assertEqual($result, $expected); } +/** + * testInflectorUnderscore method + * + * @return void + * @access public + */ + function testInflectorUnderscore() { + $this->assertIdentical(Inflector::underscore('TestThing'), 'test_thing'); + $this->assertIdentical(Inflector::underscore('testThing'), 'test_thing'); + $this->assertIdentical(Inflector::underscore('TestThingExtra'), 'test_thing_extra'); + $this->assertIdentical(Inflector::underscore('testThingExtra'), 'test_thing_extra'); + } + /** * testVariableNaming method * From 0959de60310a323abfb0de3850d8ecae9bfe5527 Mon Sep 17 00:00:00 2001 From: predominant Date: Sun, 10 Jan 2010 20:54:20 +1100 Subject: [PATCH 1421/2083] Adding more tests to check cache paths and stupid values. --- cake/tests/cases/libs/inflector.test.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cake/tests/cases/libs/inflector.test.php b/cake/tests/cases/libs/inflector.test.php index 6102e0e07..f83cb8389 100644 --- a/cake/tests/cases/libs/inflector.test.php +++ b/cake/tests/cases/libs/inflector.test.php @@ -256,6 +256,17 @@ function testInflectorUnderscore() { $this->assertIdentical(Inflector::underscore('testThing'), 'test_thing'); $this->assertIdentical(Inflector::underscore('TestThingExtra'), 'test_thing_extra'); $this->assertIdentical(Inflector::underscore('testThingExtra'), 'test_thing_extra'); + + // Identical checks test the cache code path. + $this->assertIdentical(Inflector::underscore('TestThing'), 'test_thing'); + $this->assertIdentical(Inflector::underscore('testThing'), 'test_thing'); + $this->assertIdentical(Inflector::underscore('TestThingExtra'), 'test_thing_extra'); + $this->assertIdentical(Inflector::underscore('testThingExtra'), 'test_thing_extra'); + + // Test stupid values + $this->assertIdentical(Inflector::underscore(''), ''); + $this->assertIdentical(Inflector::underscore(0), '0'); + $this->assertIdentical(Inflector::underscore(false), ''); } /** From a0aca7ee62387761014c45cc8163e3eb3913d434 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 10 Jan 2010 12:34:55 -0500 Subject: [PATCH 1422/2083] Adding output buffering to htmlreporter fixing issues with tests that send headers like Dispatcher test. --- cake/tests/lib/reporter/cake_html_reporter.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cake/tests/lib/reporter/cake_html_reporter.php b/cake/tests/lib/reporter/cake_html_reporter.php index 53162aa4b..b7e0934e9 100644 --- a/cake/tests/lib/reporter/cake_html_reporter.php +++ b/cake/tests/lib/reporter/cake_html_reporter.php @@ -38,6 +38,7 @@ class CakeHtmlReporter extends CakeBaseReporter { */ function paintHeader($testName) { $this->sendNoCacheHeaders(); + ob_start(); $this->paintDocumentStart(); $this->paintTestMenu(); echo "

      $testName

      \n"; @@ -240,6 +241,7 @@ function _queryString($url) { function paintDocumentEnd() { $baseDir = $this->params['baseDir']; include CAKE_TESTS_LIB . 'templates' . DS . 'footer.php'; + ob_end_flush(); } /** From e304246e8f177daf207952c1c3beb44abe669b89 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 10 Jan 2010 12:39:21 -0500 Subject: [PATCH 1423/2083] Updating test manager test cases to reflect changes in API. --- cake/tests/cases/libs/test_manager.test.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cake/tests/cases/libs/test_manager.test.php b/cake/tests/cases/libs/test_manager.test.php index 5a673f690..dc717ee11 100644 --- a/cake/tests/cases/libs/test_manager.test.php +++ b/cake/tests/cases/libs/test_manager.test.php @@ -19,7 +19,6 @@ * @since CakePHP(tm) v 1.2.0.4206 * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ -App::import('Core', 'TestManager'); /** * TestManagerTest class @@ -36,7 +35,7 @@ class TestManagerTest extends CakeTestCase { * @access public */ function setUp() { - $this->Sut =& new TestManager(); + $this->TestManager =& new TestManager(); $this->Reporter =& new CakeHtmlReporter(); } @@ -47,12 +46,12 @@ function setUp() { * @access public */ function testRunAllTests() { - $folder =& new Folder($this->Sut->_getTestsPath()); - $extension = str_replace('.', '\.', TestManager::getExtension('test')); + $folder =& new Folder($this->TestManager->_getTestsPath()); + $extension = str_replace('.', '\.', $this->TestManager->getExtension('test')); $out = $folder->findRecursive('.*' . $extension); $reporter =& new CakeHtmlReporter(); - $list = TestManager::runAllTests($reporter, true); + $list = $this->TestManager->runAllTests($reporter, true); $this->assertEqual(count($out), count($list)); } @@ -65,12 +64,12 @@ function testRunAllTests() { */ function testRunTestCase() { $file = md5(time()); - $result = $this->Sut->runTestCase($file, $this->Reporter); + $result = $this->TestManager->runTestCase($file, $this->Reporter); $this->assertError('Test case ' . $file . ' cannot be found'); $this->assertFalse($result); $file = str_replace(CORE_TEST_CASES, '', __FILE__); - $result = $this->Sut->runTestCase($file, $this->Reporter, true); + $result = $this->TestManager->runTestCase($file, $this->Reporter, true); $this->assertTrue($result); } From cf5c48ecc54650db24f66fef29786d3b72554aab Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 10 Jan 2010 12:48:11 -0500 Subject: [PATCH 1424/2083] Making CakeBaseReporter constructor take null for charset, so its easier to type. --- cake/tests/lib/reporter/cake_base_reporter.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cake/tests/lib/reporter/cake_base_reporter.php b/cake/tests/lib/reporter/cake_base_reporter.php index 109bc012a..7a12fd3ae 100644 --- a/cake/tests/lib/reporter/cake_base_reporter.php +++ b/cake/tests/lib/reporter/cake_base_reporter.php @@ -82,6 +82,9 @@ class CakeBaseReporter extends SimpleReporter { */ function CakeBaseReporter($charset = 'utf-8', $params = array()) { $this->SimpleReporter(); + if (!$charset) { + $charset = 'utf-8'; + } $this->_characterSet = $charset; $this->params = $params; } From 836c7de7cb23f3c346985940275f7a05dc07ec62 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 10 Jan 2010 12:48:40 -0500 Subject: [PATCH 1425/2083] Updating CodeCoverageManager test case and CodeCoverageManager --- .../cases/libs/code_coverage_manager.test.php | 10 +++---- cake/tests/lib/code_coverage_manager.php | 27 ++++++++++++++----- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/cake/tests/cases/libs/code_coverage_manager.test.php b/cake/tests/cases/libs/code_coverage_manager.test.php index cfc5968b2..b07c3f6cf 100644 --- a/cake/tests/cases/libs/code_coverage_manager.test.php +++ b/cake/tests/cases/libs/code_coverage_manager.test.php @@ -19,7 +19,6 @@ */ require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php'; require_once CAKE . 'tests' . DS . 'lib' . DS . 'cli_reporter.php'; -require_once CAKE . 'tests' . DS . 'lib' . DS . 'cake_reporter.php'; /** * CodeCoverageManagerTest class @@ -65,12 +64,13 @@ function endCase() { */ function testNoTestCaseSupplied() { if (PHP_SAPI != 'cli') { - unset($_GET['group']); - CodeCoverageManager::start(substr(md5(microtime()), 0, 5), new CakeHtmlReporter()); + $reporter =& new CakeHtmlReporter(null, array('group' => false, 'app' => false, 'plugin' => false)); + + CodeCoverageManager::start(substr(md5(microtime()), 0, 5), $reporter); CodeCoverageManager::report(false); $this->assertError(); - CodeCoverageManager::start('tests' . DS . 'lib' . DS . basename(__FILE__), new CakeHtmlReporter()); + CodeCoverageManager::start('tests' . DS . 'lib' . DS . basename(__FILE__), $reporter); CodeCoverageManager::report(false); $this->assertError(); @@ -96,7 +96,7 @@ function remove($var) { $contents[1] = array_filter($contents[1], "remove"); foreach ($contents[1] as $file) { - CodeCoverageManager::start('libs'.DS.$file, new CakeHtmlReporter()); + CodeCoverageManager::start('libs'.DS.$file, $reporter); CodeCoverageManager::report(false); $this->assertNoErrors('libs'.DS.$file); } diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index eb6294e1c..3dee49713 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -93,6 +93,7 @@ function &getInstance() { * @param string $testCaseFile * @param string $reporter * @return void + * @static */ function start($testCaseFile, &$reporter) { $manager =& CodeCoverageManager::getInstance(); @@ -103,26 +104,35 @@ function start($testCaseFile, &$reporter) { if (strpos($testCaseFile, $thisFile) !== false) { trigger_error('Xdebug supports no parallel coverage analysis - so this is not possible.', E_USER_ERROR); } - + $manager->setParams($reporter); + $manager->testCaseFile = $testCaseFile; + xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); + } + +/** + * Set the parameters from a reporter to the CodeCoverageManager + * + * @return void + */ + function setParams(&$reporter) { if ($reporter->params['app']) { - $manager->appTest = true; + $this->appTest = true; } if ($reporter->params['group']) { - $manager->groupTest = true; + $this->groupTest = true; } if ($reporter->params['plugin']) { - $manager->pluginTest = Inflector::underscore($reporter->params['plugin']); + $this->pluginTest = Inflector::underscore($reporter->params['plugin']); } - $manager->testCaseFile = $testCaseFile; - xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); } /** * Stops the current code coverage analyzation and dumps a nice report depending on the reporter that was passed to start() * * @return void + * @static */ function report($output = true) { $manager =& CodeCoverageManager::getInstance(); @@ -212,6 +222,7 @@ function report($output = true) { * @param string $execCodeLines * @param string $output * @return void + * @static */ function reportCaseHtml($testObjectFile, $coverageData, $execCodeLines) { $manager = CodeCoverageManager::getInstance(); @@ -248,6 +259,7 @@ function reportCaseHtml($testObjectFile, $coverageData, $execCodeLines) { * @param string $execCodeLines * @param string $output * @return void + * @static */ function reportCaseHtmlDiff($testObjectFile, $coverageData, $execCodeLines, $numContextLines) { $manager = CodeCoverageManager::getInstance(); @@ -366,6 +378,7 @@ function reportCaseHtmlDiff($testObjectFile, $coverageData, $execCodeLines, $num * @param string $execCodeLines * @param string $output * @return void + * @static */ function reportCaseCli($testObjectFile, $coverageData, $execCodeLines) { $manager = CodeCoverageManager::getInstance(); @@ -396,6 +409,7 @@ function reportCaseCli($testObjectFile, $coverageData, $execCodeLines) { * @param string $execCodeLines * @param string $output * @return void + * @static */ function reportGroupHtml($testObjectFiles, $coverageData, $execCodeLines, $numContextLines) { $manager = CodeCoverageManager::getInstance(); @@ -436,6 +450,7 @@ function reportGroupHtml($testObjectFiles, $coverageData, $execCodeLines, $numCo * @param string $execCodeLines * @param string $output * @return void + * @static */ function reportGroupCli($testObjectFiles, $coverageData, $execCodeLines) { $manager = CodeCoverageManager::getInstance(); From 6147de77259dad9439a6863744394b4637e4c657 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 10 Jan 2010 12:52:06 -0500 Subject: [PATCH 1426/2083] Fixing notice errors in test case. --- cake/tests/cases/libs/view/view.test.php | 1 + 1 file changed, 1 insertion(+) diff --git a/cake/tests/cases/libs/view/view.test.php b/cake/tests/cases/libs/view/view.test.php index d13b1d58f..42e315819 100644 --- a/cake/tests/cases/libs/view/view.test.php +++ b/cake/tests/cases/libs/view/view.test.php @@ -697,6 +697,7 @@ function testRender() { $this->PostsController->helpers = array('Cache', 'Html'); $this->PostsController->constructClasses(); $this->PostsController->cacheAction = array('index' => 3600); + $this->PostsController->params['action'] = 'index'; Configure::write('Cache.check', true); $View = new TestView($this->PostsController); From 3dad64c9c0c274cb26faddacad4f41002a9f59d0 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 10 Jan 2010 13:05:35 -0500 Subject: [PATCH 1427/2083] Moving buffer start in CakeHtmlReporter to fix errors when displaying menus. Adding paintDocumentStart() to CakeTextReporter::paintHeader() to fix issues with test results not being text/plain. --- cake/tests/lib/reporter/cake_html_reporter.php | 2 +- cake/tests/lib/reporter/cake_text_reporter.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cake/tests/lib/reporter/cake_html_reporter.php b/cake/tests/lib/reporter/cake_html_reporter.php index b7e0934e9..81b2c9663 100644 --- a/cake/tests/lib/reporter/cake_html_reporter.php +++ b/cake/tests/lib/reporter/cake_html_reporter.php @@ -38,7 +38,6 @@ class CakeHtmlReporter extends CakeBaseReporter { */ function paintHeader($testName) { $this->sendNoCacheHeaders(); - ob_start(); $this->paintDocumentStart(); $this->paintTestMenu(); echo "

      $testName

      \n"; @@ -51,6 +50,7 @@ function paintHeader($testName) { * @return void */ function paintDocumentStart() { + ob_start(); $baseDir = $this->params['baseDir']; include CAKE_TESTS_LIB . 'templates' . DS . 'header.php'; } diff --git a/cake/tests/lib/reporter/cake_text_reporter.php b/cake/tests/lib/reporter/cake_text_reporter.php index 7d3b7f5e5..8de320821 100644 --- a/cake/tests/lib/reporter/cake_text_reporter.php +++ b/cake/tests/lib/reporter/cake_text_reporter.php @@ -72,6 +72,7 @@ function paintFooter($test_name) { * @access public */ function paintHeader($test_name) { + $this->paintDocumentStart(); echo "$test_name\n"; flush(); } From b83f3d37c8b2ffd1bbfe4a991cf02a29bf94884c Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 10 Jan 2010 13:06:11 -0500 Subject: [PATCH 1428/2083] Removing unused method. --- cake/tests/lib/code_coverage_manager.php | 37 ------------------------ 1 file changed, 37 deletions(-) diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index 3dee49713..1c19791e4 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -214,43 +214,6 @@ function report($output = true) { } } -/** - * Html reporting - * - * @param string $testObjectFile - * @param string $coverageData - * @param string $execCodeLines - * @param string $output - * @return void - * @static - */ - function reportCaseHtml($testObjectFile, $coverageData, $execCodeLines) { - $manager = CodeCoverageManager::getInstance(); - $lineCount = $coveredCount = 0; - $report = ''; - - foreach ($testObjectFile as $num => $line) { - $num++; - $foundByManualFinder = isset($execCodeLines[$num]) && trim($execCodeLines[$num]) != ''; - $foundByXdebug = isset($coverageData[$num]) && $coverageData[$num] !== -2; - - // xdebug does not find all executable lines (zend engine fault) - if ($foundByManualFinder && $foundByXdebug) { - $class = 'uncovered'; - $lineCount++; - - if ($coverageData[$num] > 0) { - $class = 'covered'; - $coveredCount++; - } - } else { - $class = 'ignored'; - } - $report .= $manager->__paintCodeline($class, $num, $line); - } - return $manager->__paintHeader($lineCount, $coveredCount, $report); - } - /** * Diff reporting * From da26124add3ef94e6f232b9d8a310e68a357b2fc Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 10 Jan 2010 13:23:37 -0500 Subject: [PATCH 1429/2083] Renaming CodeCoverageManager::start() to init(). Adding a start(), stop(), and clear() methods to CodeCoverageManager. Making CakeBaseReporter toggle code coverage on and off as needed. Updating test case for CodeCoverageManager. --- .../cases/libs/code_coverage_manager.test.php | 6 +-- cake/tests/lib/code_coverage_manager.php | 44 ++++++++++++++++--- 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/cake/tests/cases/libs/code_coverage_manager.test.php b/cake/tests/cases/libs/code_coverage_manager.test.php index b07c3f6cf..29caa3c7a 100644 --- a/cake/tests/cases/libs/code_coverage_manager.test.php +++ b/cake/tests/cases/libs/code_coverage_manager.test.php @@ -66,11 +66,11 @@ function testNoTestCaseSupplied() { if (PHP_SAPI != 'cli') { $reporter =& new CakeHtmlReporter(null, array('group' => false, 'app' => false, 'plugin' => false)); - CodeCoverageManager::start(substr(md5(microtime()), 0, 5), $reporter); + CodeCoverageManager::init(substr(md5(microtime()), 0, 5), $reporter); CodeCoverageManager::report(false); $this->assertError(); - CodeCoverageManager::start('tests' . DS . 'lib' . DS . basename(__FILE__), $reporter); + CodeCoverageManager::init('tests' . DS . 'lib' . DS . basename(__FILE__), $reporter); CodeCoverageManager::report(false); $this->assertError(); @@ -96,7 +96,7 @@ function remove($var) { $contents[1] = array_filter($contents[1], "remove"); foreach ($contents[1] as $file) { - CodeCoverageManager::start('libs'.DS.$file, $reporter); + CodeCoverageManager::init('libs'.DS.$file, $reporter); CodeCoverageManager::report(false); $this->assertNoErrors('libs'.DS.$file); } diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index 1c19791e4..b207c7707 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -87,15 +87,14 @@ function &getInstance() { } /** - * Starts a new Coverage Analyzation for a given test case file - * @TODO: Works with $_GET now within the function body, which will make it hard when we do code coverage reports for CLI + * Initializes a new Coverage Analyzation for a given test case file * - * @param string $testCaseFile - * @param string $reporter + * @param string $testCaseFile The test case file being covered. + * @param object $reporter Instance of the reporter running. * @return void * @static */ - function start($testCaseFile, &$reporter) { + function init($testCaseFile, &$reporter) { $manager =& CodeCoverageManager::getInstance(); $manager->reporter =& $reporter; $testCaseFile = str_replace(DS . DS, DS, $testCaseFile); @@ -106,9 +105,41 @@ function start($testCaseFile, &$reporter) { } $manager->setParams($reporter); $manager->testCaseFile = $testCaseFile; + CodeCoverageManager::start(); + } + +/** + * Start/resume Code coverage collection. + * + * @return void + * @static + */ + function start() { xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); } +/** + * Stops/pauses code coverage collection. Does not clean the + * code coverage memory. Use clean() to clear code coverage memory + * + * @return void + * @static + */ + function stop() { + xdebug_stop_code_coverage(false); + } + +/** + * Clears the existing code coverage information. Also stops any + * running collection. + * + * @return void + * @static + */ + function clear() { + xdebug_stop_code_coverage(); + } + /** * Set the parameters from a reporter to the CodeCoverageManager * @@ -137,6 +168,8 @@ function setParams(&$reporter) { function report($output = true) { $manager =& CodeCoverageManager::getInstance(); + CodeCoverageManager::stop(); + if (!$manager->groupTest) { $testObjectFile = $manager->__testObjectFileFromCaseFile($manager->testCaseFile, $manager->appTest); @@ -145,7 +178,6 @@ function report($output = true) { return ; } $dump = xdebug_get_code_coverage(); - xdebug_stop_code_coverage(); $coverageData = array(); foreach ($dump as $file => $data) { From d7164c416e27e762ba6973c82b57a68ff0fc04b1 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 10 Jan 2010 13:24:41 -0500 Subject: [PATCH 1430/2083] Adding code coverage toggling to CakeBaseReporter. Updating CodeCoverageManager method use in CakeTestSuiteDispatcher. --- cake/tests/lib/cake_test_suite_dispatcher.php | 4 +-- .../tests/lib/reporter/cake_base_reporter.php | 29 +++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/cake/tests/lib/cake_test_suite_dispatcher.php b/cake/tests/lib/cake_test_suite_dispatcher.php index 7ba5f7596..445636693 100644 --- a/cake/tests/lib/cake_test_suite_dispatcher.php +++ b/cake/tests/lib/cake_test_suite_dispatcher.php @@ -227,7 +227,7 @@ function _runGroupTest() { $this->Manager->runAllTests($Reporter); } else { if ($this->params['codeCoverage']) { - CodeCoverageManager::start($this->params['group'], $Reporter); + CodeCoverageManager::init($this->params['group'], $Reporter); } $this->Manager->runGroupTest(ucfirst($this->params['group']), $Reporter); } @@ -241,7 +241,7 @@ function _runGroupTest() { function _runTestCase() { $Reporter =& CakeTestSuiteDispatcher::getReporter(); if ($this->params['codeCoverage']) { - CodeCoverageManager::start($this->params['case'], $Reporter); + CodeCoverageManager::init($this->params['case'], $Reporter); } $this->Manager->runTestCase($this->params['case'], $Reporter); } diff --git a/cake/tests/lib/reporter/cake_base_reporter.php b/cake/tests/lib/reporter/cake_base_reporter.php index 7a12fd3ae..c634f89d0 100644 --- a/cake/tests/lib/reporter/cake_base_reporter.php +++ b/cake/tests/lib/reporter/cake_base_reporter.php @@ -75,6 +75,7 @@ class CakeBaseReporter extends SimpleReporter { * - plugin - Plugin test being run? * - app - App test being run. * - case - The case being run + * - codeCoverage - Whether the case/group being run is being code covered. * * @param string $charset The character set to output with. Defaults to UTF-8 * @param array $params Array of request parameters the reporter should use. See above. @@ -117,6 +118,34 @@ function paintGroupEnd($test_name) { parent::paintGroupEnd($test_name); } +/** + * Paints the beginning of a test method being run. This is used + * to start/resume the code coverage tool. + * + * @param string $method The method name being run. + * @return void + */ + function paintMethodStart($method) { + parent::paintMethodStart($method); + if (!empty($this->params['codeCoverage'])) { + CodeCoverageManager::start(); + } + } + +/** + * Paints the end of a test method being run. This is used + * to pause the collection of code coverage if its being used. + * + * @param string $method The name of the method being run. + * @return void + */ + function paintMethodEnd($method) { + parent::paintMethodEnd($method); + if (!empty($this->params['codeCoverage'])) { + CodeCoverageManager::stop(); + } + } + /** * Get the current time in microseconds. Similar to getMicrotime in basics.php * but in a separate function to reduce dependancies. From 645807211b9ec7f5e9cb4c07afd8748645935631 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 10 Jan 2010 13:39:41 -0500 Subject: [PATCH 1431/2083] Adding clear to CodeCoverageManager. --- cake/tests/lib/code_coverage_manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index b207c7707..0aac099ce 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -214,7 +214,6 @@ function report($output = true) { } } $dump = xdebug_get_code_coverage(); - xdebug_stop_code_coverage(); $coverageData = array(); foreach ($dump as $file => $data) { if (in_array($file, $testObjectFiles)) { @@ -240,6 +239,7 @@ function report($output = true) { break; } } + CodeCoverageManager::clear(); if ($output) { echo $result; From 5a88aaf909a7f87af95ad567d1c4a028a19e4702 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 10 Jan 2010 15:28:29 -0500 Subject: [PATCH 1432/2083] Refactoring loops in CodeCoverageManager --- cake/tests/lib/code_coverage_manager.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index 0aac099ce..4b975ab53 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -105,7 +105,6 @@ function init($testCaseFile, &$reporter) { } $manager->setParams($reporter); $manager->testCaseFile = $testCaseFile; - CodeCoverageManager::start(); } /** @@ -180,11 +179,8 @@ function report($output = true) { $dump = xdebug_get_code_coverage(); $coverageData = array(); - foreach ($dump as $file => $data) { - if ($file == $testObjectFile) { - $coverageData = $data; - break; - } + if (isset($dump[$testObjectFile])) { + $coverageData = $dump[$testObjectFile]; } if (empty($coverageData) && $output) { @@ -215,9 +211,10 @@ function report($output = true) { } $dump = xdebug_get_code_coverage(); $coverageData = array(); - foreach ($dump as $file => $data) { - if (in_array($file, $testObjectFiles)) { - $coverageData[$file] = $data; + + foreach ($testObjectFiles as $file) { + if (isset($dump[$file])) { + $coverageData[$file] = $dump[$file]; } } From e7e1a9b15c7ef8d42a41c1700aa70b8af79728db Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 10 Jan 2010 15:42:30 -0500 Subject: [PATCH 1433/2083] Further refactoring of code coverage manager. --- cake/tests/lib/code_coverage_manager.php | 86 +++++++++++++----------- 1 file changed, 47 insertions(+), 39 deletions(-) diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index 4b975ab53..ddd1eefe9 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -168,24 +168,15 @@ function report($output = true) { $manager =& CodeCoverageManager::getInstance(); CodeCoverageManager::stop(); + CodeCoverageManager::clear(); - if (!$manager->groupTest) { - $testObjectFile = $manager->__testObjectFileFromCaseFile($manager->testCaseFile, $manager->appTest); - - if (!file_exists($testObjectFile)) { - trigger_error('This test object file is invalid: ' . $testObjectFile); - return ; - } - $dump = xdebug_get_code_coverage(); - $coverageData = array(); + list($coverageData, $testObjectFile) = $manager->_getCoverageData(); - if (isset($dump[$testObjectFile])) { - $coverageData = $dump[$testObjectFile]; - } + if (empty($coverageData) && $output) { + echo 'The test object file is never loaded.'; + } - if (empty($coverageData) && $output) { - echo 'The test object file is never loaded.'; - } + if (!$manager->groupTest) { $execCodeLines = $manager->__getExecutableLines(file_get_contents($testObjectFile)); $result = ''; @@ -201,48 +192,65 @@ function report($output = true) { break; } } else { - $testObjectFiles = $manager->__testObjectFilesFromGroupFile($manager->testCaseFile, $manager->appTest); - - foreach ($testObjectFiles as $file) { - if (!file_exists($file)) { - trigger_error('This test object file is invalid: ' . $file); - return ; - } - } - $dump = xdebug_get_code_coverage(); - $coverageData = array(); - - foreach ($testObjectFiles as $file) { - if (isset($dump[$file])) { - $coverageData[$file] = $dump[$file]; - } - } - - if (empty($coverageData) && $output) { - echo 'The test object files are never loaded.'; - } - $execCodeLines = $manager->__getExecutableLines($testObjectFiles); + $execCodeLines = $manager->__getExecutableLines($testObjectFile); $result = ''; switch (get_class($manager->reporter)) { case 'CakeHtmlReporter': - $result = $manager->reportGroupHtml($testObjectFiles, $coverageData, $execCodeLines, $manager->numDiffContextLines); + $result = $manager->reportGroupHtml($testObjectFile, $coverageData, $execCodeLines, $manager->numDiffContextLines); break; case 'CLIReporter': - $result = $manager->reportGroupCli($testObjectFiles, $coverageData, $execCodeLines, $manager->numDiffContextLines); + $result = $manager->reportGroupCli($testObjectFile, $coverageData, $execCodeLines, $manager->numDiffContextLines); break; default: trigger_error('Currently only HTML and CLI reporting is supported for code coverage analysis.'); break; } } - CodeCoverageManager::clear(); if ($output) { echo $result; } } +/** + * Gets the coverage data for the test case or group test that is being run. + * + * @return void + */ + function _getCoverageData() { + $coverageData = array(); + $dump = xdebug_get_code_coverage(); + + if ($this->groupTest) { + $testObjectFile = $this->__testObjectFilesFromGroupFile($this->testCaseFile, $this->appTest); + + foreach ($testObjectFile as $file) { + if (!file_exists($file)) { + trigger_error('This test object file is invalid: ' . $file); + return ; + } + } + foreach ($testObjectFile as $file) { + if (isset($dump[$file])) { + $coverageData[$file] = $dump[$file]; + } + } + } else { + $testObjectFile = $this->__testObjectFileFromCaseFile($this->testCaseFile, $this->appTest); + + if (!file_exists($testObjectFile)) { + trigger_error('This test object file is invalid: ' . $testObjectFile); + return ; + } + + if (isset($dump[$testObjectFile])) { + $coverageData = $dump[$testObjectFile]; + } + } + return array($coverageData, $testObjectFile); + } + /** * Diff reporting * From 02dbbcdfc6806269af12abd8e20fc368d9408522 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 10 Jan 2010 15:45:41 -0500 Subject: [PATCH 1434/2083] Fixing CliReporter class name as well as making cli/text output the default if the reporter is unknown. --- cake/tests/lib/code_coverage_manager.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index ddd1eefe9..dac048f90 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -159,7 +159,8 @@ function setParams(&$reporter) { } /** - * Stops the current code coverage analyzation and dumps a nice report depending on the reporter that was passed to start() + * Stops the current code coverage analyzation and dumps a nice report + * depending on the reporter that was passed to start() * * @return void * @static @@ -185,10 +186,8 @@ function report($output = true) { $result = $manager->reportCaseHtmlDiff(@file($testObjectFile), $coverageData, $execCodeLines, $manager->numDiffContextLines); break; case 'CakeCliReporter': - $result = $manager->reportCaseCli(@file($testObjectFile), $coverageData, $execCodeLines, $manager->numDiffContextLines); - break; default: - trigger_error('Currently only HTML and CLI reporting is supported for code coverage analysis.'); + $result = $manager->reportCaseCli(@file($testObjectFile), $coverageData, $execCodeLines, $manager->numDiffContextLines); break; } } else { @@ -199,11 +198,9 @@ function report($output = true) { case 'CakeHtmlReporter': $result = $manager->reportGroupHtml($testObjectFile, $coverageData, $execCodeLines, $manager->numDiffContextLines); break; - case 'CLIReporter': - $result = $manager->reportGroupCli($testObjectFile, $coverageData, $execCodeLines, $manager->numDiffContextLines); - break; + case 'CakeCliReporter': default: - trigger_error('Currently only HTML and CLI reporting is supported for code coverage analysis.'); + $result = $manager->reportGroupCli($testObjectFile, $coverageData, $execCodeLines, $manager->numDiffContextLines); break; } } From 980a85cec494e6a2c0854fef8149e82182c23418 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 10 Jan 2010 15:55:09 -0500 Subject: [PATCH 1435/2083] Updating testsuite shell to use new CodeCoverage methods. --- cake/console/libs/testsuite.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php index 162119a28..bc261d36e 100644 --- a/cake/console/libs/testsuite.php +++ b/cake/console/libs/testsuite.php @@ -307,7 +307,8 @@ function __run() { if ($this->doCoverage) { require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php'; - CodeCoverageManager::start($ucFirstGroup, $Reporter); + CodeCoverageManager::init($ucFirstGroup, $Reporter); + CodeCoverageManager::start(); } $result = $this->Manager->runGroupTest($ucFirstGroup, $Reporter); if ($this->doCoverage) { @@ -330,7 +331,8 @@ function __run() { if ($this->doCoverage) { require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php'; - CodeCoverageManager::start($case, $Reporter); + CodeCoverageManager::init($case, $Reporter); + CodeCoverageManager::start(); } $result = $this->Manager->runTestCase($case, $Reporter); From 9989327b5b26bf3079e2f9665cc74b7e5edd9749 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 10 Jan 2010 15:55:49 -0500 Subject: [PATCH 1436/2083] Fixing constructor of CakeCliReporter to match CakeBaseReporter. --- cake/tests/lib/reporter/cake_cli_reporter.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cake/tests/lib/reporter/cake_cli_reporter.php b/cake/tests/lib/reporter/cake_cli_reporter.php index b736ce4d1..61775842c 100644 --- a/cake/tests/lib/reporter/cake_cli_reporter.php +++ b/cake/tests/lib/reporter/cake_cli_reporter.php @@ -55,11 +55,8 @@ class CakeCliReporter extends CakeBaseReporter { * @param array $params * @return void */ - function CakeCLIReporter($separator = NULL, $params = array()) { - $this->CakeBaseReporter('utf-8', $params); - if (!is_null($separator)) { - $this->setFailDetailSeparator($separator); - } + function CakeCLIReporter($charset = 'utf-8', $params = array()) { + $this->CakeBaseReporter($charset, $params); } function setFailDetailSeparator($separator) { From 489958ea48f43e1832130d527ceb76ca4b22ee8f Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 10 Jan 2010 15:56:24 -0500 Subject: [PATCH 1437/2083] CakeTextReporter now outputs code coverage. --- cake/tests/lib/reporter/cake_text_reporter.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cake/tests/lib/reporter/cake_text_reporter.php b/cake/tests/lib/reporter/cake_text_reporter.php index 8de320821..68dd09b6c 100644 --- a/cake/tests/lib/reporter/cake_text_reporter.php +++ b/cake/tests/lib/reporter/cake_text_reporter.php @@ -62,6 +62,13 @@ function paintFooter($test_name) { if (function_exists('memory_get_peak_usage')) { echo 'Peak memory use: (in bytes): ' . number_format(memory_get_peak_usage()) . "\n"; } + if ( + isset($this->params['codeCoverage']) && + $this->params['codeCoverage'] && + class_exists('CodeCoverageManager') + ) { + CodeCoverageManager::report(); + } } /** From 84e70c1db1e8075427f20d510f035f081f701246 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 10 Jan 2010 15:56:51 -0500 Subject: [PATCH 1438/2083] Adding linebreak for text/cli output situations. --- cake/tests/lib/code_coverage_manager.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index dac048f90..503a7dcdf 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -174,7 +174,7 @@ function report($output = true) { list($coverageData, $testObjectFile) = $manager->_getCoverageData(); if (empty($coverageData) && $output) { - echo 'The test object file is never loaded.'; + echo "The test object file is never loaded.\n"; } if (!$manager->groupTest) { @@ -221,7 +221,6 @@ function _getCoverageData() { if ($this->groupTest) { $testObjectFile = $this->__testObjectFilesFromGroupFile($this->testCaseFile, $this->appTest); - foreach ($testObjectFile as $file) { if (!file_exists($file)) { trigger_error('This test object file is invalid: ' . $file); From 896414e63231abb2ce28d259f9547f847dfad585 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Mon, 11 Jan 2010 09:40:45 -0500 Subject: [PATCH 1439/2083] Fixing parse error in PHP4 caused by optional arguments with default values being passed by reference. Fixes #180 --- cake/libs/model/datasources/dbo_source.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 387cc373c..5a689c3e2 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -2258,7 +2258,7 @@ function limit($limit, $offset = null) { * @return string ORDER BY clause * @access public */ - function order($keys, $direction = 'ASC', &$model = null) { + function order($keys, $direction = 'ASC', $model = null) { if (!is_array($keys)) { $keys = array($keys); } From 4ada5b7eea447c76e8af04f2647f409a67cee241 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Mon, 11 Jan 2010 09:44:51 -0500 Subject: [PATCH 1440/2083] Fixing notice errors caused by incorrect datatyping in php4. --- cake/libs/model/datasources/dbo_source.php | 2 +- cake/tests/cases/libs/model/datasources/dbo_source.test.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 5a689c3e2..a0f935e84 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -1884,7 +1884,7 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) { if ($count >= 1 && !in_array($fields[0], array('*', 'COUNT(*)'))) { for ($i = 0; $i < $count; $i++) { - if (in_array($fields[$i], $virtual)) { + if (is_string($fields[$i]) && in_array($fields[$i], $virtual)) { unset($fields[$i]); continue; } diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index cc111308c..8b5ee8b62 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -2934,7 +2934,7 @@ function testFieldParsing() { * @return void */ function testFieldsWithExpression() { - $expression =& $this->testDb->expression("CASE Sample.id WHEN 1 THEN 'Id One' ELSE 'Other Id' END AS case_col"); + $expression = $this->testDb->expression("CASE Sample.id WHEN 1 THEN 'Id One' ELSE 'Other Id' END AS case_col"); $result = $this->testDb->fields($this->Model, null, array("id", $expression)); $expected = array( '`TestModel`.`id`', From dda2414b5bd2efbab99e355631a4c0545ee842bb Mon Sep 17 00:00:00 2001 From: Mark Story Date: Mon, 11 Jan 2010 09:48:53 -0500 Subject: [PATCH 1441/2083] Fixing compatibility in ConnectionManager with php4. Fixes #187 --- cake/libs/model/connection_manager.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cake/libs/model/connection_manager.php b/cake/libs/model/connection_manager.php index 2686aded2..0adf16b64 100644 --- a/cake/libs/model/connection_manager.php +++ b/cake/libs/model/connection_manager.php @@ -141,7 +141,12 @@ function sourceList() { */ function getSourceName(&$source) { $_this =& ConnectionManager::getInstance(); - return array_search($source, $_this->_dataSources); + foreach ($_this->_dataSources as $name => $ds) { + if ($ds == $source) { + return $name; + } + } + return ''; } /** From bbb105fc8c1bf125172ff4306ec92355fe6dc620 Mon Sep 17 00:00:00 2001 From: Phally Date: Sat, 9 Jan 2010 20:29:49 +0100 Subject: [PATCH 1442/2083] Added virtual field support for GROUP BY. --- cake/libs/model/datasources/dbo_source.php | 9 ++++++-- .../cases/libs/model/model_read.test.php | 23 +++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) mode change 100644 => 100755 cake/libs/model/datasources/dbo_source.php mode change 100644 => 100755 cake/tests/cases/libs/model/model_read.test.php diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php old mode 100644 new mode 100755 index a0f935e84..0e559a374 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -1413,7 +1413,7 @@ function buildStatement($query, &$model) { 'order' => $this->order($query['order'], 'ASC', $model), 'limit' => $this->limit($query['limit'], $query['offset']), 'joins' => implode(' ', $query['joins']), - 'group' => $this->group($query['group']) + 'group' => $this->group($query['group'], $model) )); } @@ -2328,9 +2328,14 @@ function order($keys, $direction = 'ASC', $model = null) { * @return mixed string condition or null * @access public */ - function group($group) { + function group($group, &$model = null) { if ($group) { if (is_array($group)) { + foreach($group as $index => $key) { + if ($model->isVirtualField($key)) { + $group[$index] = '(' . $model->getVirtualField($key) . ')'; + } + } $group = implode(', ', $group); } return ' GROUP BY ' . $this->__quoteFields($group); diff --git a/cake/tests/cases/libs/model/model_read.test.php b/cake/tests/cases/libs/model/model_read.test.php old mode 100644 new mode 100755 index 3bd57eb05..6bc4606f8 --- a/cake/tests/cases/libs/model/model_read.test.php +++ b/cake/tests/cases/libs/model/model_read.test.php @@ -7240,6 +7240,29 @@ function testVirtualFields() { $Post->virtualFields = array('other_field' => 'COUNT(Post.id) + 1'); $result = $Post->field('other_field'); $this->assertEqual($result, 4); + + ClassRegistry::flush(); + $Post = ClassRegistry::init('Post'); + + $Post->create(); + $Post->virtualFields = array( + 'year' => 'YEAR(Post.created)', + 'unique_test_field' => 'COUNT(Post.id)' + ); + + $expectation = array( + 'Post' => array( + 'year' => 2007, + 'unique_test_field' => 3 + ) + ); + + $result = $Post->find('first', array( + 'fields' => array_keys($Post->virtualFields), + 'group' => array('year') + )); + + $this->assertEqual($result, $expectation); } } ?> \ No newline at end of file From cecfd72f28ecbd026a3eec3a426bd989b42831fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Mon, 11 Jan 2010 11:51:55 -0430 Subject: [PATCH 1443/2083] Fixing parse error in php 4 --- cake/libs/model/datasources/dbo_source.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 0e559a374..7064b4642 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -2328,7 +2328,7 @@ function order($keys, $direction = 'ASC', $model = null) { * @return mixed string condition or null * @access public */ - function group($group, &$model = null) { + function group($group, $model = null) { if ($group) { if (is_array($group)) { foreach($group as $index => $key) { From 3fe4b4661479e8090d4cf27f9feb12b276e8578a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Mon, 11 Jan 2010 12:06:27 -0430 Subject: [PATCH 1444/2083] Fixing DboSource::group() to test for virtual fields when first parameter is not an array --- cake/libs/model/datasources/dbo_source.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 7064b4642..8b39acb16 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -2330,14 +2330,16 @@ function order($keys, $direction = 'ASC', $model = null) { */ function group($group, $model = null) { if ($group) { - if (is_array($group)) { - foreach($group as $index => $key) { - if ($model->isVirtualField($key)) { - $group[$index] = '(' . $model->getVirtualField($key) . ')'; - } + if (!is_array($group)) { + $group = array($group); + } + + foreach($group as $index => $key) { + if ($model->isVirtualField($key)) { + $group[$index] = '(' . $model->getVirtualField($key) . ')'; } - $group = implode(', ', $group); } + $group = implode(', ', $group); return ' GROUP BY ' . $this->__quoteFields($group); } return null; From aa9258cbd162bfb317a0915647e7b85c9e50987d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Mon, 11 Jan 2010 12:08:46 -0430 Subject: [PATCH 1445/2083] Adding test for DboSource::group() and virtual fields Closes #184 --- cake/libs/model/datasources/dbo_source.php | 1 - .../libs/model/datasources/dbo_source.test.php | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 8b39acb16..88b673dfe 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -2333,7 +2333,6 @@ function group($group, $model = null) { if (!is_array($group)) { $group = array($group); } - foreach($group as $index => $key) { if ($model->isVirtualField($key)) { $group[$index] = '(' . $model->getVirtualField($key) . ')'; diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index 8b5ee8b62..0cd9bc0f9 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -4240,5 +4240,23 @@ function testVirtualFieldsFetch() { )); $this->assertEqual($expected, $result); } + +/** + * test calculate to generate claculate statements on virtual fields + * + * @return void + */ + function testVirtualFieldsInGroup() { + $this->loadFixtures('Article'); + + $Article =& ClassRegistry::init('Article'); + $Article->virtualFields = array( + 'this_year' => 'YEAR(Article.created)' + ); + + $result = $this->db->group('this_year',$Article); + $expected = " GROUP BY (YEAR(`Article`.`created`))"; + $this->assertEqual($expected, $result); + } } ?> \ No newline at end of file From 8bc4f0336e21fc3c45b6edf74316e7610c0d6ad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Mon, 16 Nov 2009 19:30:10 -0430 Subject: [PATCH 1446/2083] Beginings of a parser of locale definition file --- cake/libs/i18n.php | 73 +++++++++++++++++++++++++++ cake/tests/cases/libs/i18n.test.php | 6 +++ cake/tests/test_app/locale/po/LC_TIME | 60 ++++++++++++++++++++++ 3 files changed, 139 insertions(+) create mode 100644 cake/tests/test_app/locale/po/LC_TIME diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index 9ffa9b601..9914df729 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -443,6 +443,79 @@ function __loadPo($file, $domain) { return $this->__domains[$this->category][$this->__lang][$domain] = array_merge($merge ,$translations); } + function __loadLocaleDefinition($file, $domain = null) { + $_this =& I18N::getInstance(); + $handler = fopen($file,'r'); + $comment = '#'; + $escape = '\\'; + $currentToken = false; + $value = ''; + while ($line = fgets($handler)) { + $line = trim($line); + if (empty($line) || $line[0] === $comment) { + continue; + } + $parts = preg_split("/[[:space:]]+/",$line); + if ($parts[0] === 'comment_char') { + $comment = $parts[1]; + continue; + } + if ($parts[0] === 'escape_char') { + $escape = $parts[1]; + continue; + } + $count = count($parts); + if ($count == 2) { + $currentToken = $parts[0]; + $value = $parts[1]; + } elseif ($count == 1) { + $value .= $parts[0]; + } else { + continue; + } + + $len = strlen($value) - 1; + if ($value[$len] === $escape) { + $value = substr($value,0,$len); + continue; + } + + $mustEscape = array($escape.',',$escape.';',$escape.'<',$escape.'>',$escape.$escape); + $replacements = array_map('crc32',$mustEscape); + $value = str_replace($mustEscape,$replacements,$value); + $value = explode(';',$value); + $_this->__escape = $escape; + foreach ($value as $i => $val) { + $val = trim($val,'"'); + $val = preg_replace_callback('/(<)?(?P.[^>]*)(>)?/',array(&$this,'__parseLiteralValue'),$val); + $val = str_replace($replacements,$mustEscape,$val); + $value[$i] = $val; + } + if (count($value) == 1) { + $this->__domains[$this->category][$this->__lang][$domain][$currentToken] = array_pop($value); + } else { + $this->__domains[$this->category][$this->__lang][$domain][$currentToken] = $value; + } + } + debug($this->__domains[$this->category][$this->__lang][$domain],true); + } + + function __parseLiteralValue($string) { + $string = $string['literal']; + switch (substr($string,0,2)) { + case $this->__escape . 'x': + $string = chr(hexdec(substr($string,-2))); + break; + case $this->__escape . 'd': + + break; + } + if (substr($string,0,3) === 'U00') { + $string = chr(hexdec(substr($string,-2))); + } + return $string; + } + /** * Object destructor * diff --git a/cake/tests/cases/libs/i18n.test.php b/cake/tests/cases/libs/i18n.test.php index 589c4c3fa..687003777 100644 --- a/cake/tests/cases/libs/i18n.test.php +++ b/cake/tests/cases/libs/i18n.test.php @@ -2589,6 +2589,12 @@ function testCategoryThenSingular() { $this->assertEqual('Po (translated)', $singular); } + function testTimeDefinition() { + $I18n = I18n::getInstance(); + $file = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS . 'po' . DS .'LC_TIME'; + $I18n->__loadLocaleDefinition($file); + } + /** * Singular method * diff --git a/cake/tests/test_app/locale/po/LC_TIME b/cake/tests/test_app/locale/po/LC_TIME new file mode 100644 index 000000000..8caceb8c9 --- /dev/null +++ b/cake/tests/test_app/locale/po/LC_TIME @@ -0,0 +1,60 @@ +escape_char / +comment_char % +abday "";"";/ + "";"";/ + "";"";/ + "" +day "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "" + +week 7;19971130;7 +first_weekday 1 +first_workday 2 +abmon "";"";/ + "";"";/ + "";"";/ + "";"";/ + "";"";/ + "";"" +mon "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "" +% Appropriate date and time representation (%c) +% "%a %d %b %Y %r %Z" +d_t_fmt "" +% +% Appropriate date representation (%x) +% "%m/%d/%Y" +d_fmt "" +% +% Appropriate time representation (%X) +% "%r" +t_fmt "" +% +% Appropriate AM/PM time representation (%r) +% "%I:%M:%S %p" +t_fmt_ampm "/ +" +% +% Strings for AM/PM +% +am_pm "";"" +% +% Appropriate date representation (date(1)) "%a %b %e %H:%M:%S %Z %Y" +date_fmt "/ +/ +" From 50f58da60d52148562c4d743498011fbee4c80de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Tue, 17 Nov 2009 14:17:23 -0430 Subject: [PATCH 1447/2083] Continuing work on locale definition file parser --- cake/libs/i18n.php | 34 +++++++++++++++++---------- cake/tests/cases/libs/i18n.test.php | 5 ++-- cake/tests/test_app/locale/po/LC_TIME | 2 +- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index 9914df729..4ea024a83 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -277,6 +277,7 @@ function __bindTextDomain($domain) { foreach ($this->l10n->languagePath as $lang) { $file = $directory . $lang . DS . $this->category . DS . $domain; + $localeDef = $directory . $lang . DS . $this->category; if ($core) { $app = $directory . $lang . DS . $this->category . DS . 'core'; @@ -302,6 +303,10 @@ function __bindTextDomain($domain) { $this->__loadPo($f, $domain); $this->__noLocale = false; break 2; + } elseif (file_exists($localeDef) && ($f = fopen($localeDef, "r"))) { + $this->__loadLocaleDefinition($f, $domain); + $this->__noLocale = false; + return $domain; } } } @@ -445,12 +450,11 @@ function __loadPo($file, $domain) { function __loadLocaleDefinition($file, $domain = null) { $_this =& I18N::getInstance(); - $handler = fopen($file,'r'); $comment = '#'; $escape = '\\'; $currentToken = false; $value = ''; - while ($line = fgets($handler)) { + while ($line = fgets($file)) { $line = trim($line); if (empty($line) || $line[0] === $comment) { continue; @@ -487,7 +491,7 @@ function __loadLocaleDefinition($file, $domain = null) { $_this->__escape = $escape; foreach ($value as $i => $val) { $val = trim($val,'"'); - $val = preg_replace_callback('/(<)?(?P.[^>]*)(>)?/',array(&$this,'__parseLiteralValue'),$val); + $val = preg_replace_callback('/(?:<)?(.[^>]*)(?:>)?/',array(&$this,'__parseLiteralValue'),$val); $val = str_replace($replacements,$mustEscape,$val); $value[$i] = $val; } @@ -497,21 +501,25 @@ function __loadLocaleDefinition($file, $domain = null) { $this->__domains[$this->category][$this->__lang][$domain][$currentToken] = $value; } } - debug($this->__domains[$this->category][$this->__lang][$domain],true); } function __parseLiteralValue($string) { - $string = $string['literal']; - switch (substr($string,0,2)) { - case $this->__escape . 'x': - $string = chr(hexdec(substr($string,-2))); - break; - case $this->__escape . 'd': - - break; + $string = $string[1]; + if (substr($string,0,2) === $this->__escape . 'x') { + $delimiter = $this->__escape . 'x'; + return join('',array_map('chr',array_map('hexdec',array_filter(explode($delimiter,$string))))); + } + if (substr($string,0,2) === $this->__escape . 'd') { + $delimiter = $this->__escape . 'd'; + return join('',array_map('chr',array_filter(explode($delimiter,$string)))); + } + if ($string[0] === $this->__escape && isset($string[1]) && is_numeric($string[1])) { + $delimiter = $this->__escape; + return join('',array_map('chr',array_filter(explode($delimiter,$string)))); } if (substr($string,0,3) === 'U00') { - $string = chr(hexdec(substr($string,-2))); + $delimiter = 'U00'; + return join('',array_map('chr',array_map('hexdec',array_filter(explode($delimiter,$string))))); } return $string; } diff --git a/cake/tests/cases/libs/i18n.test.php b/cake/tests/cases/libs/i18n.test.php index 687003777..822b1922f 100644 --- a/cake/tests/cases/libs/i18n.test.php +++ b/cake/tests/cases/libs/i18n.test.php @@ -2590,9 +2590,8 @@ function testCategoryThenSingular() { } function testTimeDefinition() { - $I18n = I18n::getInstance(); - $file = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS . 'po' . DS .'LC_TIME'; - $I18n->__loadLocaleDefinition($file); + Configure::write('Config.language', 'po'); + $abday = __c('abday', 5, true); } /** diff --git a/cake/tests/test_app/locale/po/LC_TIME b/cake/tests/test_app/locale/po/LC_TIME index 8caceb8c9..fe9f56629 100644 --- a/cake/tests/test_app/locale/po/LC_TIME +++ b/cake/tests/test_app/locale/po/LC_TIME @@ -1,6 +1,6 @@ escape_char / comment_char % -abday "";"";/ +abday "";"";/ "";"";/ "";"";/ "" From 7e9fc9f7051c075a837cb7cbb635b2e838e84f7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Mon, 11 Jan 2010 15:19:57 -0430 Subject: [PATCH 1448/2083] Test case for date format definition using a LC_TIME locale file --- cake/tests/cases/libs/i18n.test.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/i18n.test.php b/cake/tests/cases/libs/i18n.test.php index 822b1922f..23fab7bef 100644 --- a/cake/tests/cases/libs/i18n.test.php +++ b/cake/tests/cases/libs/i18n.test.php @@ -2591,7 +2591,9 @@ function testCategoryThenSingular() { function testTimeDefinition() { Configure::write('Config.language', 'po'); - $abday = __c('abday', 5, true); + $result = __c('d_fmt', 5, true); + $expected = '%m/%d/%Y'; + $this->assertEqual($result,$expected); } /** From 04562982b241ac2744e77283edad95f82806ff23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Mon, 11 Jan 2010 15:34:16 -0430 Subject: [PATCH 1449/2083] Fixing doc block --- cake/tests/cases/libs/model/datasources/dbo_source.test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index 0cd9bc0f9..f0d4f4b49 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -4242,7 +4242,7 @@ function testVirtualFieldsFetch() { } /** - * test calculate to generate claculate statements on virtual fields + * test group to generate GROUP BY statements on virtual fields * * @return void */ From 07b43be1259212d7d4146d4f77d55cf0adf4b42c Mon Sep 17 00:00:00 2001 From: Mark Story Date: Mon, 11 Jan 2010 18:00:45 -0500 Subject: [PATCH 1450/2083] Making CLI case code coverage reports include text. --- cake/tests/lib/code_coverage_manager.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index 503a7dcdf..946842901 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -681,7 +681,6 @@ function __paintGroupResultLineCli($file, $lineCount, $coveredCount) { $manager =& CodeCoverageManager::getInstance(); $codeCoverage = $manager->__calcCoverage($lineCount, $coveredCount); $class = 'bad'; - if ($codeCoverage > 50) { $class = 'ok'; } @@ -702,7 +701,14 @@ function __paintGroupResultLineCli($file, $lineCount, $coveredCount) { function __paintHeaderCli($lineCount, $coveredCount, $report) { $manager =& CodeCoverageManager::getInstance(); $codeCoverage = $manager->__calcCoverage($lineCount, $coveredCount); - return $report = 'Code Coverage: ' . $codeCoverage . '%'; + $class = 'bad'; + if ($codeCoverage > 50) { + $class = 'ok'; + } + if ($codeCoverage > 80) { + $class = 'good'; + } + return $report = "Code Coverage: $codeCoverage% ($class)\n"; } /** From 0803e2a5a69dca16a72145387d2ff5ea8e9b328f Mon Sep 17 00:00:00 2001 From: Mark Story Date: Mon, 11 Jan 2010 18:04:08 -0500 Subject: [PATCH 1451/2083] Moving CLI code coverage generation into the CliReporter. --- cake/tests/lib/reporter/cake_cli_reporter.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cake/tests/lib/reporter/cake_cli_reporter.php b/cake/tests/lib/reporter/cake_cli_reporter.php index 61775842c..654cfce2e 100644 --- a/cake/tests/lib/reporter/cake_cli_reporter.php +++ b/cake/tests/lib/reporter/cake_cli_reporter.php @@ -152,6 +152,14 @@ function paintFooter($test_name) { } else { fwrite(STDOUT, $buffer . $this->getPassCount() . " passes.\n" . $this->_timeStats()); } + + if ( + isset($this->params['codeCoverage']) && + $this->params['codeCoverage'] && + class_exists('CodeCoverageManager') + ) { + CodeCoverageManager::report(); + } } /** From 4a96f52be98757997f3af6e4b44a36e7c682900b Mon Sep 17 00:00:00 2001 From: Mark Story Date: Mon, 11 Jan 2010 18:04:38 -0500 Subject: [PATCH 1452/2083] Refactoring testsuite shell and consolidating duplicated filename generation logic. --- cake/console/libs/testsuite.php | 105 ++++++++++++++------------------ 1 file changed, 46 insertions(+), 59 deletions(-) diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php index bc261d36e..0eee7555f 100644 --- a/cake/console/libs/testsuite.php +++ b/cake/console/libs/testsuite.php @@ -237,32 +237,12 @@ function __canRun() { $this->err(sprintf(__('%s is invalid. Should be case, group or all', true), $this->type)); return false; } - $ext = $this->Manager->getExtension($this->type); - switch ($this->type) { - case 'all': - return true; - case 'group': - if (file_exists($folder . DS . 'groups' . DS . $this->file . $ext)) { - return true; - } - break; - case 'case': - if ($this->category == 'app' && file_exists($folder . DS . 'cases' . DS . $this->file . $ext)) { - return true; - } - $coreCaseExists = file_exists($folder . DS . 'cases' . DS . $this->file . $ext); - $coreLibCaseExists = file_exists($folder . DS . 'cases' . DS . 'libs' . DS . $this->file . $ext); - if ($this->category == 'core' && ($coreCaseExists || $coreLibCaseExists)) { - return true; - } - - if ($isPlugin && file_exists($folder . DS . 'cases' . DS . $this->file . $ext)) { - return true; - } - break; + $fileName = $this->__getFileName($folder, $this->isPluginTest); + if ($fileName === true || file_exists($folder . $fileName)) { + return true; } - + $message = sprintf( __('%s %s %s is an invalid test identifier', true), $this->category, $this->type, $this->file @@ -270,7 +250,6 @@ function __canRun() { $this->err($message); return false; } - /** * Executes the tests depending on our settings * @@ -281,7 +260,8 @@ function __run() { $Reporter = new CakeCliReporter('utf-8', array( 'app' => $this->Manager->appTest, 'plugin' => $this->Manager->pluginTest, - 'group' => ($this->type === 'group') + 'group' => ($this->type === 'group'), + 'codeCoverage' => $this->doCoverage )); if ($this->type == 'all') { @@ -291,62 +271,68 @@ function __run() { if ($this->doCoverage) { if (!extension_loaded('xdebug')) { $this->out(__('You must install Xdebug to use the CakePHP(tm) Code Coverage Analyzation. Download it from http://www.xdebug.org/docs/install', true)); - exit(0); + $this->_stop(0); } } if ($this->type == 'group') { $ucFirstGroup = ucfirst($this->file); - - $path = CORE_TEST_GROUPS; - if ($this->category == 'app') { - $path = APP_TEST_GROUPS; - } elseif ($this->isPluginTest) { - $path = APP . 'plugins' . DS . $this->category . DS . 'tests' . DS . 'groups'; - } - if ($this->doCoverage) { require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php'; CodeCoverageManager::init($ucFirstGroup, $Reporter); CodeCoverageManager::start(); } $result = $this->Manager->runGroupTest($ucFirstGroup, $Reporter); - if ($this->doCoverage) { - CodeCoverageManager::report(); - } return $result; } - if ($this->category === 'core') { - $coreCaseExists = file_exists(CORE_TEST_CASES . DS . $this->file . '.test.php'); - if ($coreCaseExists) { - $case = $this->file . '.test.php'; - } else { - $case = 'libs' . DS . $this->file . '.test.php'; - } - } elseif ($this->category === 'app') { - $case = $this->file . '.test.php'; - } elseif ($this->isPluginTest) { - $case = $this->file . '.test.php'; - } + + $folder = $folder = $this->__findFolderByCategory($this->category); + $case = $this->__getFileName($folder, $this->isPluginTest); if ($this->doCoverage) { require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php'; CodeCoverageManager::init($case, $Reporter); CodeCoverageManager::start(); } - $result = $this->Manager->runTestCase($case, $Reporter); - if ($this->doCoverage) { - CodeCoverageManager::report(); - $this->out(); - } - return $result; } /** - * Finds the correct folder to look for tests for based on the input category + * Gets the concrete filename for the inputted test name and category/type + * + * @param string $folder Folder name to look for files in. + * @param boolean $isPlugin If the test case is a plugin. + * @return mixed Either string filename or boolean false on failure. Or true if the type is 'all' + * @access private + */ + function __getFileName($folder, $isPlugin) { + $ext = $this->Manager->getExtension($this->type); + switch ($this->type) { + case 'all': + return true; + case 'group': + return $this->file . $ext; + case 'case': + if ($this->category == 'app' || $isPlugin) { + return $this->file . $ext; + } + $coreCase = $this->file . $ext; + $coreLibCase = 'libs' . DS . $this->file . $ext; + + if ($this->category == 'core' && file_exists($folder . DS . $coreCase)) { + return $coreCase; + } elseif ($this->category == 'core' && file_exists($folder . DS . $coreLibCase)) { + return $coreLibCase; + } + } + return false; + } + +/** + * Finds the correct folder to look for tests for based on the input category and type. * + * @param string $category The category of the test. Either 'app', 'core' or a plugin name. * @return string the folder path * @access private */ @@ -356,13 +342,14 @@ function __findFolderByCategory($category) { 'core' => CAKE, 'app' => APP ); + $typeDir = $this->type === 'group' ? 'groups' : 'cases'; if (array_key_exists($category, $paths)) { - $folder = $paths[$category] . 'tests'; + $folder = $paths[$category] . 'tests' . DS . $typeDir . DS; } else { $pluginPath = App::pluginPath($category); if (is_dir($pluginPath . 'tests')) { - $folder = $pluginPath . 'tests' . DS; + $folder = $pluginPath . 'tests' . DS . $typeDir . DS; } } return $folder; From 5149d65c7e5516d255b507ee61fe709983f1c874 Mon Sep 17 00:00:00 2001 From: Juan Basso Date: Mon, 11 Jan 2010 13:46:21 -0200 Subject: [PATCH 1453/2083] Adding redirect to baked controllers so when no delete could be done an error page is not displayed. Fixes #188 Signed-off-by: Mark Story --- cake/console/libs/tasks/controller.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 428cdcebe..d4ab58abe 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -386,6 +386,12 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) { $actions .= "\t\t\t\$this->flash(__('{$singularHumanName} deleted', true), array('action' => 'index'));\n"; } $actions .= "\t\t}\n"; + if ($wannaUseSession) { + $actions .= "\t\t\$this->Session->setFlash(__('The {$singularHumanName} could not be deleted. Please, try again.', true));\n"; + $actions .= "\t\t\$this->redirect(array('action' => 'index'));\n"; + } else { + $actions .= "\t\t\$this->flash(__('The {$singularHumanName} could not be deleted. Please, try again.', true), array('action' => 'index'));\n"; + } $actions .= "\t}\n"; $actions .= "\n"; return $actions; From a0c3c4b8036faebc000b4112515a225a8bc0d54a Mon Sep 17 00:00:00 2001 From: Mark Story Date: Mon, 11 Jan 2010 23:54:06 -0500 Subject: [PATCH 1454/2083] Updating AuthComponent::startup() so that being redirected to loginAction with no Auth.redirect value in the session and a non empty loginRedirect defined, the Auth.redirect value is not overwritten. This prevents redirection to already accessible pages. Test cases updated. Fixes #173 --- cake/libs/controller/components/auth.php | 2 +- .../libs/controller/components/auth.test.php | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index 13a6fb29a..b391b972b 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -337,7 +337,7 @@ function startup(&$controller) { if ($loginAction == $url) { $model =& $this->getModel(); if (empty($controller->data) || !isset($controller->data[$model->alias])) { - if (!$this->Session->check('Auth.redirect') && env('HTTP_REFERER')) { + if (!$this->Session->check('Auth.redirect') && !$this->loginRedirect && env('HTTP_REFERER')) { $this->Session->write('Auth.redirect', $controller->referer(null, true)); } return false; diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php index 202c53043..874fb1e13 100644 --- a/cake/tests/cases/libs/controller/components/auth.test.php +++ b/cake/tests/cases/libs/controller/components/auth.test.php @@ -623,6 +623,31 @@ function testLogin() { $this->Controller->Session->delete('Auth'); } +/** + * test that being redirected to the login page, with no post data does + * not set the session value. Saving the session value in this circumstance + * can cause the user to be redirected to an already public page. + * + * @return void + */ + function testLoginActionNotSettingAuthRedirect() { + $_referer = $_SERVER['HTTP_REFERER']; + $_SERVER['HTTP_REFERER'] = '/pages/display/about'; + + $this->Controller->data = array(); + $this->Controller->params = Router::parse('auth_test/login'); + $this->Controller->params['url']['url'] = 'auth_test/login'; + $this->Controller->Session->delete('Auth'); + + $this->Controller->Auth->loginRedirect = '/users/dashboard'; + $this->Controller->Auth->loginAction = 'auth_test/login'; + $this->Controller->Auth->userModel = 'AuthUser'; + + $this->Controller->Auth->startup($this->Controller); + $redirect = $this->Controller->Session->read('Auth.redirect'); + $this->assertNull($redirect); + } + /** * testAuthorizeFalse method * From 637b0133a8b706bffa09f41071cc7bd6a5e8f7b4 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Tue, 12 Jan 2010 09:30:40 -0500 Subject: [PATCH 1455/2083] Removing memory limit configuration from test.php. Was problematic in that it would override php.ini settings which could be higher. --- app/webroot/test.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/webroot/test.php b/app/webroot/test.php index 7bdd62463..2e0aacb49 100644 --- a/app/webroot/test.php +++ b/app/webroot/test.php @@ -18,7 +18,6 @@ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ set_time_limit(0); -ini_set('memory_limit','128M'); ini_set('display_errors', 1); /** * Use the DS to separate the directories in other defines From dc00cfe539b5511522ed3d947c0dd2b221d15b8b Mon Sep 17 00:00:00 2001 From: Mark Story Date: Tue, 12 Jan 2010 18:28:16 -0500 Subject: [PATCH 1456/2083] Adding   to baked index files to fix rendering issues in IE. --- cake/console/templates/default/views/index.ctp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/console/templates/default/views/index.ctp b/cake/console/templates/default/views/index.ctp index c0e7222ed..430f8ee17 100644 --- a/cake/console/templates/default/views/index.ctp +++ b/cake/console/templates/default/views/index.ctp @@ -48,7 +48,7 @@ } } if ($isKey !== true) { - echo "\t\t\n\t\t\t\n\t\t\n"; + echo "\t\t \n"; } } From 6ba16f31bf994dbff7a7ca8b0b77082348a449b9 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Tue, 12 Jan 2010 18:28:41 -0500 Subject: [PATCH 1457/2083] Updating generic css to work with IE7. --- app/webroot/css/cake.generic.css | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/webroot/css/cake.generic.css b/app/webroot/css/cake.generic.css index ff38ae761..c9340ac63 100644 --- a/app/webroot/css/cake.generic.css +++ b/app/webroot/css/cake.generic.css @@ -1,6 +1,6 @@ /** * - * PHP versions 4 and 5 + * Generic CSS for CakePHP * * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) @@ -160,9 +160,11 @@ table tr td { vertical-align: top; border-bottom:1px solid #ddd; } -table tr:nth-child(2n) td, -table tr.altrow td { - background: #fafafa; +table tr:nth-child(2n) td { + background: #f5f5f5; +} +table .altrow td { + background: #f5f5f5; } td.actions { text-align: center; From 84840c7b04a30b0fab4651f99e3d38d8aa313180 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Tue, 12 Jan 2010 23:27:17 -0500 Subject: [PATCH 1458/2083] Fixing issues with magic input() type detection and adding/updating tests. --- cake/libs/view/helpers/form.php | 14 ++++++------- .../cases/libs/view/helpers/form.test.php | 21 ++++++++++++++----- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 69c207db2..bc4cf6b85 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -661,9 +661,7 @@ function input($fieldName, $options = array()) { $this->_introspectModel($modelKey); } - $userType = isset($options['type']) ? true : false; - - if (!$userType) { + if (!isset($options['type'])) { $options['type'] = 'text'; $fieldDef = array(); if (isset($options['options'])) { @@ -693,6 +691,9 @@ function input($fieldName, $options = array()) { $options['type'] = 'hidden'; } } + if (preg_match('/_id$/', $fieldKey)) { + $options['type'] = 'select'; + } if ($modelKey === $fieldKey) { $options['type'] = 'select'; @@ -701,18 +702,15 @@ function input($fieldName, $options = array()) { } } } - $types = array('text', 'checkbox', 'radio', 'select'); + $types = array('checkbox', 'radio', 'select'); - if (!isset($options['options']) && in_array($options['type'], $types) && !$userType) { + if (!isset($options['options']) && in_array($options['type'], $types)) { $view =& ClassRegistry::getObject('view'); $varName = Inflector::variable( Inflector::pluralize(preg_replace('/_id$/', '', $fieldKey)) ); $varOptions = $view->getVar($varName); if (is_array($varOptions)) { - if ($options['type'] !== 'radio') { - $options['type'] = 'select'; - } $options['options'] = $varOptions; } } diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 4fa394c50..0cd3fe540 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -2049,6 +2049,18 @@ function testInputOverridingMagicSelectType() { $this->assertTags($result, $expected); } +/** + * Test that magic input() selects can easily be converted into radio types without error. + * + * @return void + */ + function testInputMagicSelectChangeToRadio() { + $view =& ClassRegistry::getObject('view'); + $view->viewVars['users'] = array('value' => 'good', 'other' => 'bad'); + $result = $this->Form->input('Model.user_id', array('type' => 'radio')); + $this->assertPattern('/input type="radio"/', $result); + } + /** * testFormInputs method * @@ -5930,17 +5942,16 @@ function testMultiRecordForm() { $this->Form->data['ValidateProfile'][1]['ValidateItem'][2]['profile_id'] = '1'; $result = $this->Form->input('ValidateProfile.1.ValidateItem.2.profile_id'); $expected = array( - 'div' => array('class' => 'input text error'), + 'div' => array('class' => 'input select error'), 'label' => array('for' => 'ValidateProfile1ValidateItem2ProfileId'), 'Profile', '/label', - 'input' => array( - 'name' => 'data[ValidateProfile][1][ValidateItem][2][profile_id]', 'type' => 'text', - 'value' => '1', + 'select' => array( + 'name' => 'data[ValidateProfile][1][ValidateItem][2][profile_id]', 'id' => 'ValidateProfile1ValidateItem2ProfileId', - 'maxlength' => 8, 'class' => 'form-error' ), + '/select', array('div' => array('class' => 'error-message')), 'Error', '/div', From 54b566fcabde5815c8f6a2f4fa68d9437e7a5c31 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Wed, 13 Jan 2010 00:07:53 -0500 Subject: [PATCH 1459/2083] Updating generic CSS fixing issues in IE7 and making actions column slightly wider. --- app/webroot/css/cake.generic.css | 40 ++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/app/webroot/css/cake.generic.css b/app/webroot/css/cake.generic.css index c9340ac63..a968da7ab 100644 --- a/app/webroot/css/cake.generic.css +++ b/app/webroot/css/cake.generic.css @@ -21,7 +21,7 @@ padding:0; } -/* General Style Info */ +/** General Style Info **/ body { background: #003d4c; color: #fff; @@ -69,7 +69,7 @@ ul, li { margin: 0 12px; } -/* Layout */ +/** Layout **/ #container { text-align: left; } @@ -112,13 +112,13 @@ div.form, div.index, div.view { float:right; - width:81%; + width:76%; border-left:1px solid #666; padding:10px 2%; } div.actions { float:left; - width:11%; + width:16%; padding:10px 1.5%; } div.actions h3 { @@ -127,7 +127,7 @@ div.actions h3 { } -/* Tables */ +/** Tables **/ table { background: #fff; border-right:0; @@ -186,7 +186,7 @@ table td.actions a { color:#fff; } -/* Paging */ +/** Paging **/ div.paging { background:#fff; color: #ccc; @@ -203,7 +203,7 @@ div.paging span.current { div.paging span a { } -/* Scaffold View */ +/** Scaffold View **/ dl { line-height: 2em; margin: 0em 0em; @@ -223,12 +223,12 @@ dd { vertical-align: top; } -/* Forms */ +/** Forms **/ form { clear: both; margin-right: 20px; padding: 0; - width: 80%; + width: 95%; } fieldset { border: 1px solid #ccc; @@ -306,6 +306,9 @@ input[type=checkbox] { margin: 0px 6px 7px 2px; width: auto; } +div.checkbox label { + display: inline; +} input[type=radio] { float:left; width:auto; @@ -324,7 +327,7 @@ form .submit input[type=submit] { background: -webkit-gradient(linear, left top, left bottom, from(#a8ea9c), to(#62af56)); background-image: -moz-linear-gradient(top, #a8ea9c, #62af56); border-color: #2d6324; - color: #111; + color: #000; text-shadow: #8cee7c 0px 1px 0px; } form .submit input[type=submit]:hover { @@ -333,7 +336,7 @@ form .submit input[type=submit]:hover { background-image: -moz-linear-gradient(top, #85e573, #4ca83d); } -/* Notices and Errors */ +/** Notices and Errors **/ div.message { clear: both; color: #fff; @@ -378,19 +381,21 @@ p.error em { color: #fff; } -/* Actions */ +/** Actions **/ div.actions ul { - margin: 0px 0; + margin: 0; padding: 0; } div.actions li { margin:0 0 0.5em 0; list-style-type: none; white-space: nowrap; + padding: 0; } div.actions ul li a { - font-weight:normal; - display:block; + font-weight: normal; + display: block; + clear: both; } div.actions ul li a:hover { text-decoration: underline; @@ -411,6 +416,7 @@ td.actions a { border-radius:8px; text-decoration:none; text-shadow: #fff 0px 1px 0px; + min-width: 0; } input[type=submit]:hover, div.actions ul li a:hover, @@ -419,13 +425,13 @@ td.actions a:hover { background: -webkit-gradient(linear, left top, left bottom, from(#f7f7e1), to(#eeeca9)); } -/* Related */ +/** Related **/ div.related { clear: both; display: block; } -/* Debugging */ +/** Debugging **/ pre { color: #000; background: #f0f0f0; From 2de96390911cae311335c4ab1ebf4f59be59fdbc Mon Sep 17 00:00:00 2001 From: Mark Story Date: Wed, 13 Jan 2010 00:12:45 -0500 Subject: [PATCH 1460/2083] Updating scaffolds to match new bake design. --- cake/libs/view/scaffolds/edit.ctp | 1 + cake/libs/view/scaffolds/index.ctp | 21 +++++++++++---------- cake/libs/view/scaffolds/view.ctp | 1 + 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/cake/libs/view/scaffolds/edit.ctp b/cake/libs/view/scaffolds/edit.ctp index 0faa8c591..3bbaa3291 100644 --- a/cake/libs/view/scaffolds/edit.ctp +++ b/cake/libs/view/scaffolds/edit.ctp @@ -25,6 +25,7 @@ ?>
+

    action != 'add'):?>
  • Html->link(__('Delete', true), array('action' => 'delete', $this->Form->value($modelClass.'.'.$primaryKey)), null, __('Are you sure you want to delete', true).' #' . $this->Form->value($modelClass.'.'.$primaryKey)); ?>
  • diff --git a/cake/libs/view/scaffolds/index.ctp b/cake/libs/view/scaffolds/index.ctp index d38bd9738..b94cc9110 100644 --- a/cake/libs/view/scaffolds/index.ctp +++ b/cake/libs/view/scaffolds/index.ctp @@ -19,11 +19,6 @@ ?>

    -

    Paginator->counter(array( - 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true) -)); -?>

    @@ -67,13 +62,19 @@ endforeach; echo "\n"; ?>
    -
    -
    -Paginator->prev('<< ' . __('previous', true), array(), null, array('class' => 'disabled')) . "\n";?> - | Paginator->numbers() . "\n"?> -Paginator->next(__('next', true) .' >>', array(), null, array('class' => 'disabled')) . "\n";?> +

    Paginator->counter(array( + 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true) + )); + ?>

    +
    + Paginator->prev('<< ' . __('previous', true), array(), null, array('class' => 'disabled')) . "\n";?> + | Paginator->numbers() . "\n"?> + Paginator->next(__('next', true) .' >>', array(), null, array('class' => 'disabled')) . "\n";?> +
    +

    • Html->link(sprintf(__('New %s', true), $singularHumanName), array('action' => 'add')); ?>
    +

      " .$this->Html->link(sprintf(__('Edit %s', true), $singularHumanName), array('action' => 'edit', ${$singularVar}[$modelClass][$primaryKey])). " \n"; From 53f0771a48325e3e08b8d73d1270498a32052b8d Mon Sep 17 00:00:00 2001 From: Mark Story Date: Wed, 13 Jan 2010 00:14:57 -0500 Subject: [PATCH 1461/2083] Fixing output of 'Actions' in bake templates. Now outputs a __() call. --- cake/console/templates/default/views/form.ctp | 2 +- cake/console/templates/default/views/index.ctp | 2 +- cake/console/templates/default/views/view.ctp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cake/console/templates/default/views/form.ctp b/cake/console/templates/default/views/form.ctp index 4438f9487..1f445f2a3 100644 --- a/cake/console/templates/default/views/form.ctp +++ b/cake/console/templates/default/views/form.ctp @@ -43,7 +43,7 @@ ?>
    -

    +

    "; ?>

    • Html->link(__('Delete', true), array('action' => 'delete', \$this->Form->value('{$modelClass}.{$primaryKey}')), null, sprintf(__('Are you sure you want to delete # %s?', true), \$this->Form->value('{$modelClass}.{$primaryKey}'))); ?>";?>
    • diff --git a/cake/console/templates/default/views/index.ctp b/cake/console/templates/default/views/index.ctp index 430f8ee17..35e059b8c 100644 --- a/cake/console/templates/default/views/index.ctp +++ b/cake/console/templates/default/views/index.ctp @@ -77,7 +77,7 @@
-

+

"; ?>

  • Html->link(sprintf(__('New %s', true), __('{$singularHumanName}', true)), array('action' => 'add')); ?>";?>
-

+

"; ?>

    Html->link(sprintf(__('Edit %s', true), __('{$singularHumanName}', true)), array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?> \n"; From f93094b6eaa860236db4903c234cc90a04af073a Mon Sep 17 00:00:00 2001 From: Mark Story Date: Wed, 13 Jan 2010 00:17:15 -0500 Subject: [PATCH 1462/2083] Moving skel/config/sql to skel/config/schema Updating index.php and test.php in skel dir. --- .../skel/config/{sql => schema}/db_acl.php | 0 .../skel/config/{sql => schema}/db_acl.sql | 0 .../skel/config/{sql => schema}/i18n.php | 0 .../skel/config/{sql => schema}/i18n.sql | 0 .../skel/config/{sql => schema}/sessions.php | 0 .../skel/config/{sql => schema}/sessions.sql | 0 cake/console/templates/skel/webroot/index.php | 12 ++- cake/console/templates/skel/webroot/test.php | 85 +------------------ 8 files changed, 9 insertions(+), 88 deletions(-) rename cake/console/templates/skel/config/{sql => schema}/db_acl.php (100%) rename cake/console/templates/skel/config/{sql => schema}/db_acl.sql (100%) rename cake/console/templates/skel/config/{sql => schema}/i18n.php (100%) rename cake/console/templates/skel/config/{sql => schema}/i18n.sql (100%) rename cake/console/templates/skel/config/{sql => schema}/sessions.php (100%) rename cake/console/templates/skel/config/{sql => schema}/sessions.sql (100%) diff --git a/cake/console/templates/skel/config/sql/db_acl.php b/cake/console/templates/skel/config/schema/db_acl.php similarity index 100% rename from cake/console/templates/skel/config/sql/db_acl.php rename to cake/console/templates/skel/config/schema/db_acl.php diff --git a/cake/console/templates/skel/config/sql/db_acl.sql b/cake/console/templates/skel/config/schema/db_acl.sql similarity index 100% rename from cake/console/templates/skel/config/sql/db_acl.sql rename to cake/console/templates/skel/config/schema/db_acl.sql diff --git a/cake/console/templates/skel/config/sql/i18n.php b/cake/console/templates/skel/config/schema/i18n.php similarity index 100% rename from cake/console/templates/skel/config/sql/i18n.php rename to cake/console/templates/skel/config/schema/i18n.php diff --git a/cake/console/templates/skel/config/sql/i18n.sql b/cake/console/templates/skel/config/schema/i18n.sql similarity index 100% rename from cake/console/templates/skel/config/sql/i18n.sql rename to cake/console/templates/skel/config/schema/i18n.sql diff --git a/cake/console/templates/skel/config/sql/sessions.php b/cake/console/templates/skel/config/schema/sessions.php similarity index 100% rename from cake/console/templates/skel/config/sql/sessions.php rename to cake/console/templates/skel/config/schema/sessions.php diff --git a/cake/console/templates/skel/config/sql/sessions.sql b/cake/console/templates/skel/config/schema/sessions.sql similarity index 100% rename from cake/console/templates/skel/config/sql/sessions.sql rename to cake/console/templates/skel/config/schema/sessions.sql diff --git a/cake/console/templates/skel/webroot/index.php b/cake/console/templates/skel/webroot/index.php index ebb3c6c72..5935a869c 100644 --- a/cake/console/templates/skel/webroot/index.php +++ b/cake/console/templates/skel/webroot/index.php @@ -1,6 +1,8 @@ dispatch(); - CakePHPTestRunMore(); - CakePHPTestAnalyzeCodeCoverage(); -} elseif (isset($_GET['show']) && $_GET['show'] == 'cases') { - CakePHPTestCaseList(); -} else { - CakePHPTestGroupTestList(); -} -CakePHPTestSuiteFooter(); -$output = ob_get_clean(); -echo $output; ?> \ No newline at end of file From 4e3aedecde62e30c726e2f60aba4d7b8f6b5030b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Wed, 13 Jan 2010 09:21:36 -0430 Subject: [PATCH 1463/2083] Fixing persitModel and plugin Behaviors. Closes #192 --- cake/libs/model/behavior.php | 3 ++ cake/tests/cases/libs/object.test.php | 23 +++++++++-- cake/tests/test_app/models/persister_one.php | 2 +- cake/tests/test_app/models/persister_two.php | 2 +- .../behaviors/test_plugin_persister_one.php | 38 +++++++++++++++++++ .../behaviors/test_plugin_persister_two.php | 38 +++++++++++++++++++ 6 files changed, 100 insertions(+), 6 deletions(-) create mode 100644 cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php create mode 100644 cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php diff --git a/cake/libs/model/behavior.php b/cake/libs/model/behavior.php index fdbc64e30..0f994c2c9 100644 --- a/cake/libs/model/behavior.php +++ b/cake/libs/model/behavior.php @@ -286,6 +286,9 @@ function attach($behavior, $config = array()) { $this->{$name} =& new $class; } ClassRegistry::addObject($class, $this->{$name}); + if (!empty($plugin)) { + ClassRegistry::addObject($plugin.'.'.$class, $clas); + } } } elseif (isset($this->{$name}->settings) && isset($this->{$name}->settings[$this->modelName])) { if ($config !== null && $config !== false) { diff --git a/cake/tests/cases/libs/object.test.php b/cake/tests/cases/libs/object.test.php index 743d88da1..3ce6fbbfd 100644 --- a/cake/tests/cases/libs/object.test.php +++ b/cake/tests/cases/libs/object.test.php @@ -425,10 +425,12 @@ function testPersistWithBehavior() { Configure::write('Cache.disable', false); Configure::write('modelPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS)); + Configure::write('pluginPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins'. DS)); Configure::write('behaviorPaths', array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models'. DS . 'behaviors' . DS)); $this->assertFalse(class_exists('PersisterOneBehaviorBehavior')); $this->assertFalse(class_exists('PersisterTwoBehaviorBehavior')); + $this->assertFalse(class_exists('TestPluginPersisterBehavior')); $Controller = new RequestActionPersistentController(); $Controller->persistModel = true; @@ -439,11 +441,11 @@ function testPersistWithBehavior() { $contents = str_replace('"PersisterOne"', '"PersisterTwo"', file_get_contents(CACHE . 'persistent' . DS . 'persisteroneregistry.php')); $contents = str_replace('persister_one_', 'persister_two_', file_get_contents(CACHE . 'persistent' . DS . 'persisteroneregistry.php')); - $result = file_put_contents(CACHE . 'persistent' . DS . 'persisteroneregistry.php', $contents); $this->assertTrue(class_exists('PersisterOneBehaviorBehavior')); $this->assertFalse(class_exists('PersisterTwoBehaviorBehavior')); + $this->assertFalse(class_exists('TestPluginPersisterTwoBehavior')); $Controller = new RequestActionPersistentController(); $Controller->persistModel = true; @@ -451,6 +453,7 @@ function testPersistWithBehavior() { $this->assertTrue(class_exists('PersisterOneBehaviorBehavior')); $this->assertTrue(class_exists('PersisterTwoBehaviorBehavior')); + $this->assertTrue(class_exists('TestPluginPersisterTwoBehavior')); @unlink(CACHE . 'persistent' . DS . 'persisterone.php'); @unlink(CACHE . 'persistent' . DS . 'persisteroneregistry.php'); @@ -484,7 +487,13 @@ function testPersistWithBehaviorAndRequestAction() { $this->assertTrue(file_exists(CACHE . 'persistent' . DS . 'persisteroneregistry.php')); $keys = ClassRegistry::keys(); - $this->assertEqual($keys, array('persister_one', 'comment', 'persister_one_behavior_behavior')); + $this->assertEqual($keys, array( + 'persister_one', + 'comment', + 'persister_one_behavior_behavior', + 'test_plugin_persister_one_behavior', + 'test_plugin.test_plugin_persister_one_behavior' + )); ob_start(); $Controller->set('content_for_layout', 'cool'); @@ -492,8 +501,14 @@ function testPersistWithBehaviorAndRequestAction() { $result = ob_get_clean(); $keys = ClassRegistry::keys(); - $this->assertEqual($keys, array('persister_one', 'comment', 'persister_one_behavior_behavior', 'view')); - + $this->assertEqual($keys, array( + 'persister_one', + 'comment', + 'persister_one_behavior_behavior', + 'test_plugin_persister_one_behavior', + 'test_plugin.test_plugin_persister_one_behavior', + 'view' + )); $result = $this->object->requestAction('/request_action_persistent/index'); $expected = 'This is a test'; $this->assertEqual($result, $expected); diff --git a/cake/tests/test_app/models/persister_one.php b/cake/tests/test_app/models/persister_one.php index 76222829f..37fd2b4ef 100644 --- a/cake/tests/test_app/models/persister_one.php +++ b/cake/tests/test_app/models/persister_one.php @@ -28,7 +28,7 @@ class PersisterOne extends AppModel { var $useTable = 'posts'; var $name = 'PersisterOne'; - var $actsAs = array('PersisterOneBehavior'); + var $actsAs = array('PersisterOneBehavior','TestPlugin.TestPluginPersisterOne'); var $hasMany = array('Comment'); } diff --git a/cake/tests/test_app/models/persister_two.php b/cake/tests/test_app/models/persister_two.php index 4596f9479..36d2423da 100644 --- a/cake/tests/test_app/models/persister_two.php +++ b/cake/tests/test_app/models/persister_two.php @@ -28,7 +28,7 @@ class PersisterTwo extends AppModel { var $useTable = 'posts'; var $name = 'PersisterTwo'; - var $actsAs = array('PersisterOneBehavior'); + var $actsAs = array('PersisterOneBehavior','TestPlugin.TestPluginPersisterOne'); var $hasMany = array('Comment'); } diff --git a/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php b/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php new file mode 100644 index 000000000..5530fd286 --- /dev/null +++ b/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php @@ -0,0 +1,38 @@ + \ No newline at end of file diff --git a/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php b/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php new file mode 100644 index 000000000..89f2def32 --- /dev/null +++ b/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php @@ -0,0 +1,38 @@ + \ No newline at end of file From 1c542b6ea595956922d0ea9011b3a6300fc5e7d5 Mon Sep 17 00:00:00 2001 From: Juan Basso Date: Wed, 13 Jan 2010 11:02:45 -0200 Subject: [PATCH 1464/2083] Fixing var name when not have SimpleTest or XDebug installed. Signed-off-by: Mark Story --- cake/tests/lib/cake_test_suite_dispatcher.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/tests/lib/cake_test_suite_dispatcher.php b/cake/tests/lib/cake_test_suite_dispatcher.php index 445636693..cbbd6d4a6 100644 --- a/cake/tests/lib/cake_test_suite_dispatcher.php +++ b/cake/tests/lib/cake_test_suite_dispatcher.php @@ -109,7 +109,7 @@ function dispatch() { */ function _checkSimpleTest() { if (!App::import('Vendor', 'simpletest' . DS . 'reporter')) { - $basePath = $this->_baseDir; + $baseDir = $this->_baseDir; include CAKE_TESTS_LIB . 'templates' . DS . 'simpletest.php'; exit(); } @@ -123,7 +123,7 @@ function _checkSimpleTest() { */ function _checkXdebug() { if (!extension_loaded('xdebug')) { - $basePath = $this->_baseDir; + $baseDir = $this->_baseDir; include CAKE_TESTS_LIB . 'templates' . DS . 'xdebug.php'; exit(); } From d8257518ded3be18d31ab88b4e61f6f1d15f5fea Mon Sep 17 00:00:00 2001 From: Juan Basso Date: Wed, 13 Jan 2010 10:52:46 -0200 Subject: [PATCH 1465/2083] Fixing include in test of CodeCoverageManager. Fixes #196 Signed-off-by: Mark Story --- cake/tests/cases/libs/code_coverage_manager.test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/code_coverage_manager.test.php b/cake/tests/cases/libs/code_coverage_manager.test.php index 29caa3c7a..a2e730c60 100644 --- a/cake/tests/cases/libs/code_coverage_manager.test.php +++ b/cake/tests/cases/libs/code_coverage_manager.test.php @@ -18,7 +18,7 @@ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php'; -require_once CAKE . 'tests' . DS . 'lib' . DS . 'cli_reporter.php'; +require_once CAKE . 'tests' . DS . 'lib' . DS . 'reporter' . DS . 'cake_cli_reporter.php'; /** * CodeCoverageManagerTest class From 8496055059ca46bcfc04c300076ca987643181ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Wed, 13 Jan 2010 12:57:41 -0430 Subject: [PATCH 1466/2083] Adding php5 check to avoid errors when using __get() or __isset() methods in models --- cake/libs/model/behaviors/acl.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cake/libs/model/behaviors/acl.php b/cake/libs/model/behaviors/acl.php index 8bc2c3969..a103c5008 100644 --- a/cake/libs/model/behaviors/acl.php +++ b/cake/libs/model/behaviors/acl.php @@ -53,7 +53,11 @@ function setup(&$model, $config = array()) { if (!class_exists('AclNode')) { require LIBS . 'model' . DS . 'db_acl.php'; } - $model->{$type} =& ClassRegistry::init($type); + if (PHP5) { + $model->{$type} = ClassRegistry::init($type); + } else { + $model->{$type} =& ClassRegistry::init($type); + } if (!method_exists($model, 'parentNode')) { trigger_error("Callback parentNode() not defined in {$model->alias}", E_USER_WARNING); } From 848dc518abfde025faa48a1f5f2ae83a0199aad4 Mon Sep 17 00:00:00 2001 From: ADmad Date: Thu, 14 Jan 2010 04:13:39 +0530 Subject: [PATCH 1467/2083] Adding 'id' attribute to hidden field generated for multiple select and multiple checkboxes. Fixes issue where invalid markup was generated in case to multiple checkboxes --- cake/libs/view/helpers/form.php | 7 +++- .../cases/libs/view/helpers/form.test.php | 32 +++++++++---------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index bc4cf6b85..e8023ba96 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -1310,7 +1310,12 @@ function select($fieldName, $options = array(), $selected = null, $attributes = $style = ($attributes['multiple'] === 'checkbox') ? 'checkbox' : null; $template = ($style) ? 'checkboxmultiplestart' : 'selectmultiplestart'; $tag = $this->Html->tags[$template]; - $select[] = $this->hidden(null, array('value' => '', 'id' => null, 'secure' => false)); + $hiddenAttributes = array( + 'value' => '', + 'id' => $attributes['id'] . ($style ? '' : '_'), + 'secure' => false + ); + $select[] = $this->hidden(null, $hiddenAttributes); } else { $tag = $this->Html->tags['selectstart']; } diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 0cd3fe540..b9ee7dc99 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -1860,7 +1860,7 @@ function testInputDatetime() { $this->Form->data = array('Contact' => array('created' => null)); $result = $this->Form->input('Contact.created', array('type' => 'datetime', 'dateFormat' => 'NONE')); $this->assertPattern('/for\="ContactCreatedHour"/', $result); - + $this->Form->data = array('Contact' => array('created' => null)); $result = $this->Form->input('Contact.created', array('type' => 'datetime', 'timeFormat' => 'NONE')); $this->assertPattern('/for\="ContactCreatedMonth"/', $result); @@ -2015,7 +2015,7 @@ function testInputSelectType() { 'label' => array('for' => 'UserUser'), 'User', '/label', - 'input' => array('type' => 'hidden', 'name' => 'data[User][User]', 'value' => ''), + 'input' => array('type' => 'hidden', 'name' => 'data[User][User]', 'value' => '', 'id' => 'UserUser_'), 'select' => array('name' => 'data[User][User][]', 'id' => 'UserUser', 'multiple' => 'multiple'), array('option' => array('value' => '')), '/option', @@ -2267,7 +2267,7 @@ function testFormInputs() { function testSelectAsCheckbox() { $result = $this->Form->select('Model.multi_field', array('first', 'second', 'third'), array(0, 1), array('multiple' => 'checkbox')); $expected = array( - 'input' => array('type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => ''), + 'input' => array('type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => '', 'id' => 'ModelMultiField'), array('div' => array('class' => 'checkbox')), array('input' => array('type' => 'checkbox', 'name' => 'data[Model][multi_field][]', 'checked' => 'checked', 'value' => '0', 'id' => 'ModelMultiField0')), array('label' => array('for' => 'ModelMultiField0', 'class' => 'selected')), @@ -2978,7 +2978,7 @@ function testSelectMultiple() { ); $expected = array( 'input' => array( - 'type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => '' + 'type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => '', 'id' => 'ModelMultiField_' ), 'select' => array( 'name' => 'data[Model][multi_field][]', @@ -3002,7 +3002,7 @@ function testSelectMultiple() { ); $expected = array( 'input' => array( - 'type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => '' + 'type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => '', 'id' => 'ModelMultiField_' ), 'select' => array( 'name' => 'data[Model][multi_field][]', @@ -3026,7 +3026,7 @@ function testSelectMultiple() { ); $expected = array( 'input' => array( - 'type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => '' + 'type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => '', 'id' => 'ModelMultiField_' ), 'select' => array( 'name' => 'data[Model][multi_field][]', 'id' => 'ModelMultiField', @@ -3075,7 +3075,7 @@ function testHabtmSelectBox() { $result = $this->Form->input('ContactTag', array('div' => false, 'label' => false)); $expected = array( 'input' => array( - 'type' => 'hidden', 'name' => 'data[ContactTag][ContactTag]', 'value' => '' + 'type' => 'hidden', 'name' => 'data[ContactTag][ContactTag]', 'value' => '', 'id' => 'ContactTagContactTag_' ), 'select' => array( 'name' => 'data[ContactTag][ContactTag][]', 'id' => 'ContactTagContactTag', @@ -3110,7 +3110,7 @@ function testSelectMultipleCheckboxes() { $expected = array( 'input' => array( - 'type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => '' + 'type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => '', 'id' => 'ModelMultiField' ), array('div' => array('class' => 'checkbox')), array('input' => array( @@ -3149,7 +3149,7 @@ function testSelectMultipleCheckboxes() { ); $expected = array( 'input' => array( - 'type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => '' + 'type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => '', 'id' => 'ModelMultiField' ), array('div' => array('class' => 'checkbox')), array('input' => array( @@ -3186,7 +3186,7 @@ function testSelectMultipleCheckboxes() { ); $expected = array( 'input' => array( - 'type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => '' + 'type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => '', 'id' => 'ModelMultiField' ), array('div' => array('class' => 'checkbox')), array('input' => array( @@ -3237,7 +3237,7 @@ function testInputMultipleCheckboxes() { array('label' => array('for' => 'ModelMultiField')), 'Multi Field', '/label', - 'input' => array('type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => ''), + 'input' => array('type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => '', 'id' => 'ModelMultiField'), array('div' => array('class' => 'checkbox')), array('input' => array('type' => 'checkbox', 'name' => 'data[Model][multi_field][]', 'value' => '0', 'id' => 'ModelMultiField0')), array('label' => array('for' => 'ModelMultiField0')), @@ -3266,7 +3266,7 @@ function testInputMultipleCheckboxes() { array('label' => array('for' => 'ModelMultiField')), 'Multi Field', '/label', - 'input' => array('type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => ''), + 'input' => array('type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => '', 'id' => 'ModelMultiField'), array('div' => array('class' => 'checkbox')), array('input' => array('type' => 'checkbox', 'name' => 'data[Model][multi_field][]', 'value' => 'a', 'id' => 'ModelMultiFieldA')), array('label' => array('for' => 'ModelMultiFieldA')), @@ -3291,7 +3291,7 @@ function testInputMultipleCheckboxes() { $result = $this->Form->input('Model.multi_field', array('options' => array('1' => 'first'), 'multiple' => 'checkbox', 'label' => false, 'div' => false)); $expected = array( - 'input' => array('type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => ''), + 'input' => array('type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => '', 'id' => 'ModelMultiField'), array('div' => array('class' => 'checkbox')), array('input' => array('type' => 'checkbox', 'name' => 'data[Model][multi_field][]', 'value' => '1', 'id' => 'ModelMultiField1')), array('label' => array('for' => 'ModelMultiField1')), @@ -3303,7 +3303,7 @@ function testInputMultipleCheckboxes() { $result = $this->Form->input('Model.multi_field', array('options' => array('2' => 'second'), 'multiple' => 'checkbox', 'label' => false, 'div' => false)); $expected = array( - 'input' => array('type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => ''), + 'input' => array('type' => 'hidden', 'name' => 'data[Model][multi_field]', 'value' => '', 'id' => 'ModelMultiField'), array('div' => array('class' => 'checkbox')), array('input' => array('type' => 'checkbox', 'name' => 'data[Model][multi_field][]', 'value' => '2', 'id' => 'ModelMultiField2')), array('label' => array('for' => 'ModelMultiField2')), @@ -3923,7 +3923,7 @@ function testDateTime() { 'label' => array('for' => 'ContactTagContactTag'), 'Contact Tag', '/label', - array('input' => array('type' => 'hidden', 'name' => 'data[ContactTag][ContactTag]', 'value' => '')), + array('input' => array('type' => 'hidden', 'name' => 'data[ContactTag][ContactTag]', 'value' => '', 'id' => 'ContactTagContactTag_')), array('select' => array('name' => 'data[ContactTag][ContactTag][]', 'multiple' => 'multiple', 'id' => 'ContactTagContactTag')), '/select', '/div' @@ -5232,7 +5232,7 @@ function testEditFormWithData() { $this->Form->create(); $result = $this->Form->select('People.People', $options, null, array('multiple' => true)); $expected = array( - 'input' => array('type' => 'hidden', 'name' => 'data[People][People]', 'value' => ''), + 'input' => array('type' => 'hidden', 'name' => 'data[People][People]', 'value' => '', 'id' => 'PeoplePeople_'), 'select' => array( 'name' => 'data[People][People][]', 'multiple' => 'multiple', 'id' => 'PeoplePeople' ), From 619f9210f36ab4e8665ba0e84b71c1904e1ae8c2 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Wed, 13 Jan 2010 21:55:32 -0500 Subject: [PATCH 1468/2083] Removing orphaned method. --- cake/console/libs/testsuite.php | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php index 0eee7555f..e9a3c30ba 100644 --- a/cake/console/libs/testsuite.php +++ b/cake/console/libs/testsuite.php @@ -355,25 +355,6 @@ function __findFolderByCategory($category) { return $folder; } -/** - * Sets some get vars needed for TestManager - * - * @return void - * @access private - */ - function __setGetVars() { - if (in_array($this->category, $this->plugins)) { - $_GET['plugin'] = $this->category; - } elseif (in_array(Inflector::humanize($this->category), $this->plugins)) { - $_GET['plugin'] = Inflector::humanize($this->category); - } elseif ($this->category == 'app') { - $_GET['app'] = true; - } - if ($this->type == 'group') { - $_GET['group'] = true; - } - } - /** * tries to install simpletest and exits gracefully if it is not there * From 943af988f679d12c5b383fa7362a7deb82835d84 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Wed, 13 Jan 2010 22:37:30 -0500 Subject: [PATCH 1469/2083] Fixing alignment issues in tables. --- app/webroot/css/cake.generic.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/webroot/css/cake.generic.css b/app/webroot/css/cake.generic.css index a968da7ab..3de408a0c 100644 --- a/app/webroot/css/cake.generic.css +++ b/app/webroot/css/cake.generic.css @@ -139,7 +139,7 @@ table { th { border:0; border-bottom:2px solid #555; - text-align: center; + text-align: left; padding:4px; } th a { From 8243afa38364ee5ee1aec91614cc834386560437 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Wed, 13 Jan 2010 23:03:02 -0500 Subject: [PATCH 1470/2083] Updating css file in skel dir. --- .../skel/webroot/css/cake.generic.css | 196 ++++++++++++------ 1 file changed, 128 insertions(+), 68 deletions(-) diff --git a/cake/console/templates/skel/webroot/css/cake.generic.css b/cake/console/templates/skel/webroot/css/cake.generic.css index 6c68821e9..3de408a0c 100644 --- a/cake/console/templates/skel/webroot/css/cake.generic.css +++ b/cake/console/templates/skel/webroot/css/cake.generic.css @@ -1,6 +1,6 @@ /** * - * PHP versions 4 and 5 + * Generic CSS for CakePHP * * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) @@ -16,13 +16,12 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ - * { margin:0; padding:0; } -/* General Style Info */ +/** General Style Info **/ body { background: #003d4c; color: #fff; @@ -31,14 +30,12 @@ body { margin: 0; } a { - background:#fff; color: #003d4c; text-decoration: underline; font-weight: bold; } a:hover { - background:#fff; - color: #003d4c; + color: #367889; text-decoration:none; } a img { @@ -46,37 +43,33 @@ a img { } h1, h2, h3, h4 { font-weight: normal; + margin-bottom:0.5em; } h1 { background:#fff; color: #003d4c; font-size: 100%; - margin: 0.1em 0; } h2 { background:#fff; color: #e32; - font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif; + font-family:'Gill Sans','lucida grande', helvetica, arial, sans-serif; font-size: 190%; - margin: 0.3em 0; - padding-top: 0.8em; } h3 { color: #993; - font-family:'Gill Sans','lucida grande',helvetica, arial, sans-serif; + font-family:'Gill Sans','lucida grande', helvetica, arial, sans-serif; font-size: 165%; - padding-top: 1.5em; } h4 { color: #993; font-weight: normal; - padding-top: 0.5em; } ul, li { margin: 0 12px; } -/* Layout */ +/** Layout **/ #container { text-align: left; } @@ -85,7 +78,8 @@ ul, li { padding: 10px 20px; } #header h1 { - background: #003d4c url('../img/cake.icon.gif') no-repeat left; + line-height:20px; + background: #003d4c url('../img/cake.icon.png') no-repeat left; color: #fff; padding: 0px 30px; } @@ -113,10 +107,29 @@ ul, li { text-align: right; } -/* Tables */ +/** containers **/ +div.form, +div.index, +div.view { + float:right; + width:76%; + border-left:1px solid #666; + padding:10px 2%; +} +div.actions { + float:left; + width:16%; + padding:10px 1.5%; +} +div.actions h3 { + padding-top:0; + color:#777; +} + + +/** Tables **/ table { background: #fff; - border:1px solid #ccc; border-right:0; clear: both; color: #333; @@ -124,39 +137,42 @@ table { width: 100%; } th { - background: #f2f2f2; - border:1px solid #bbb; - border-top: 1px solid #fff; - border-left: 1px solid #fff; - text-align: center; + border:0; + border-bottom:2px solid #555; + text-align: left; + padding:4px; } th a { - background:#f2f2f2; display: block; padding: 2px 4px; text-decoration: none; } -th a:hover { - background: #ccc; - color: #333; - text-decoration: none; +th a.asc:after { + content: ' ⇣'; +} +th a.desc:after { + content: ' ⇡'; } table tr td { background: #fff; - border-right: 1px solid #ccc; - padding: 4px; - text-align: center; + padding: 6px; + text-align: left; vertical-align: top; + border-bottom:1px solid #ddd; } -table tr.altrow td { - background: #f4f4f4; +table tr:nth-child(2n) td { + background: #f5f5f5; +} +table .altrow td { + background: #f5f5f5; } td.actions { text-align: center; white-space: nowrap; } -td.actions a { +table td.actions a { margin: 0px 6px; + padding:2px 5px; } .cake-sql-log table { background: #f4f4f4; @@ -164,27 +180,30 @@ td.actions a { .cake-sql-log td { padding: 4px 8px; text-align: left; + font-family: Monaco, Consolas, "Courier New", monospaced; +} +.cake-sql-log caption { + color:#fff; } -/* Paging */ +/** Paging **/ div.paging { background:#fff; color: #ccc; - margin-bottom: 2em; + margin-top: 1em; + clear:both; } -div.paging div.disabled { +div.paging span.disabled { color: #ddd; display: inline; } -div.paging span { -} div.paging span.current { - color: #000; + color: #c73e14; } div.paging span a { } -/* Scaffold View */ +/** Scaffold View **/ dl { line-height: 2em; margin: 0em 0em; @@ -204,16 +223,16 @@ dd { vertical-align: top; } -/* Forms */ +/** Forms **/ form { clear: both; margin-right: 20px; padding: 0; - width: 80%; + width: 95%; } fieldset { border: 1px solid #ccc; - margin-top: 30px; + margin-bottom: 1em; padding: 16px 20px; } fieldset legend { @@ -241,30 +260,33 @@ form div { padding: .5em; vertical-align: text-top; } -form div.input { +form .input { color: #444; } -form div.required { - color: #333; +form .required { font-weight: bold; } +form .required label:after { + color: #e32; + content: '*'; + display:inline; +} form div.submit { border: 0; clear: both; margin-top: 10px; - margin-left: 140px; } label { display: block; font-size: 110%; - padding-right: 20px; + margin-bottom:3px; } input, textarea { clear: both; font-size: 140%; font-family: "frutiger linotype", "lucida grande", "verdana", sans-serif; - padding: 2px; - width: 100%; + padding: 1%; + width:98%; } select { clear: both; @@ -284,6 +306,9 @@ input[type=checkbox] { margin: 0px 6px 7px 2px; width: auto; } +div.checkbox label { + display: inline; +} input[type=radio] { float:left; width:auto; @@ -295,23 +320,37 @@ div.radio label { input[type=submit] { display: inline; font-size: 110%; - padding: 2px 5px; width: auto; - vertical-align: bottom; +} +form .submit input[type=submit] { + background:#62af56; + background: -webkit-gradient(linear, left top, left bottom, from(#a8ea9c), to(#62af56)); + background-image: -moz-linear-gradient(top, #a8ea9c, #62af56); + border-color: #2d6324; + color: #000; + text-shadow: #8cee7c 0px 1px 0px; +} +form .submit input[type=submit]:hover { + background:#4ca83d; + background: -webkit-gradient(linear, left top, left bottom, from(#85e573), to(#4ca83d)); + background-image: -moz-linear-gradient(top, #85e573, #4ca83d); } -/* Notices and Errors */ +/** Notices and Errors **/ div.message { clear: both; - color: #900; + color: #fff; font-size: 140%; font-weight: bold; - margin: 1em 0; + margin: 0 0 1em 0; + background: #c73e14; + padding: 5px; } div.error-message { clear: both; - color: #900; + color: #fff; font-weight: bold; + background: #c73e14; } p.error { background-color: #e32; @@ -342,35 +381,57 @@ p.error em { color: #fff; } -/* Actions */ +/** Actions **/ div.actions ul { - margin: 0px 0; + margin: 0; padding: 0; } div.actions li { - display: inline; + margin:0 0 0.5em 0; list-style-type: none; - line-height: 2em; - margin: 0 2em 0 0; white-space: nowrap; + padding: 0; } div.actions ul li a { - background:#fff; - color: #003d4c; - text-decoration: none; + font-weight: normal; + display: block; + clear: both; } div.actions ul li a:hover { - color: #333; text-decoration: underline; } -/* Related */ +input[type=submit], +div.actions ul li a, +td.actions a { + font-weight:normal; + padding: 4px 8px; + background:#e6e49f; + background: -webkit-gradient(linear, left top, left bottom, from(#f1f1d4), to(#e6e49f)); + background-image: -moz-linear-gradient(top, #f1f1d4, #e6e49f); + color:#333; + border:1px solid #aaac62; + -webkit-border-radius:8px; + -moz-border-radius:8px; + border-radius:8px; + text-decoration:none; + text-shadow: #fff 0px 1px 0px; + min-width: 0; +} +input[type=submit]:hover, +div.actions ul li a:hover, +td.actions a:hover { + background: #f0f09a; + background: -webkit-gradient(linear, left top, left bottom, from(#f7f7e1), to(#eeeca9)); +} + +/** Related **/ div.related { clear: both; display: block; } -/* Debugging */ +/** Debugging **/ pre { color: #000; background: #f0f0f0; @@ -386,7 +447,6 @@ pre.cake-debug { } div.cake-stack-trace { background: #fff; - border: 4px dotted #ffcc00; color: #333; margin: 0px; padding: 6px; From ff3aefe93a0a37f55fdd0a2a62bb476293f3afd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Perras?= Date: Wed, 13 Jan 2010 21:53:44 -0500 Subject: [PATCH 1471/2083] Adding missing

    to Html test reporter template. --- cake/tests/lib/templates/footer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cake/tests/lib/templates/footer.php b/cake/tests/lib/templates/footer.php index eb970a657..0b443da0c 100644 --- a/cake/tests/lib/templates/footer.php +++ b/cake/tests/lib/templates/footer.php @@ -20,9 +20,11 @@ ?>
Date: Wed, 13 Jan 2010 22:29:10 -0500 Subject: [PATCH 1472/2083] Updating CakeTestSuiteDispatcher parsing of . Better handling of cases where dirname() of PHP_SELF returns only '/'. --- cake/tests/lib/cake_test_suite_dispatcher.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cake/tests/lib/cake_test_suite_dispatcher.php b/cake/tests/lib/cake_test_suite_dispatcher.php index cbbd6d4a6..8b30cb6fa 100644 --- a/cake/tests/lib/cake_test_suite_dispatcher.php +++ b/cake/tests/lib/cake_test_suite_dispatcher.php @@ -76,7 +76,8 @@ class CakeTestSuiteDispatcher { */ function CakeTestSuiteDispatcher() { $this->_baseUrl = $_SERVER['PHP_SELF']; - $this->_baseDir = dirname($this->_baseUrl) . '/'; + $dir = dirname($this->_baseUrl); + $this->_baseDir = ($dir === '/') ? $dir : $dir . '/'; } /** From 4d1f6b82e809a8c5657d7d92e8b2e8a3b2a8a334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Perras?= Date: Wed, 13 Jan 2010 23:14:06 -0500 Subject: [PATCH 1473/2083] Removing use of subclass method 'fullTableName()' in Datasource superclass. Fixes #100. --- cake/libs/model/datasources/datasource.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cake/libs/model/datasources/datasource.php b/cake/libs/model/datasources/datasource.php index f016e2d18..99d3e8568 100644 --- a/cake/libs/model/datasources/datasource.php +++ b/cake/libs/model/datasources/datasource.php @@ -123,9 +123,9 @@ class DataSource extends Object { var $_queriesLog = array(); /** - * Maximum number of items in query log, to prevent query log taking over - * too much memory on large amounts of queries -- I we've had problems at - * >6000 queries on one system. + * Maximum number of items in query log + * + * This is to prevent query log taking over too much memory. * * @var int Maximum number of queries in the queries log. * @access protected @@ -270,7 +270,8 @@ function describe(&$model) { if ($this->cacheSources === false) { return null; } - $table = $this->fullTableName($model, false); + $table = $model->tablePrefix . $model->table; + if (isset($this->__descriptions[$table])) { return $this->__descriptions[$table]; } @@ -374,7 +375,7 @@ function update(&$model, $fields = null, $values = null) { * To-be-overridden in subclasses. * * @param Model $model The model class having record(s) deleted - * @param mixed $id Primary key of the model + * @param mixed $id Primary key of the model * @access public */ function delete(&$model, $id = null) { @@ -489,7 +490,7 @@ function __cacheDescription($object, $data = null) { * @param array $data Array of data with values that will be inserted in placeholders. * @param string $association Name of association model being replaced * @param unknown_type $assocData - * @param Model $model Instance of the model to replace $__cakeID__$ + * @param Model $model Instance of the model to replace $__cakeID__$ * @param Model $linkModel Instance of model to replace $__cakeForeignKey__$ * @param array $stack * @return string String of query data with placeholders replaced. From 15b8a3ec716f1ff14e003d1938ce8d7fcb0e20c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Perras?= Date: Wed, 13 Jan 2010 23:47:14 -0500 Subject: [PATCH 1474/2083] Updating copyright date on all files. --- app/config/acl.ini.php | 4 ++-- app/config/bootstrap.php | 4 ++-- app/config/core.php | 4 ++-- app/config/database.php.default | 4 ++-- app/config/inflections.php | 4 ++-- app/config/routes.php | 4 ++-- app/config/sql/db_acl.php | 4 ++-- app/config/sql/db_acl.sql | 2 +- app/config/sql/i18n.php | 4 ++-- app/config/sql/i18n.sql | 2 +- app/config/sql/sessions.php | 4 ++-- app/config/sql/sessions.sql | 2 +- app/index.php | 4 ++-- app/webroot/css.php | 4 ++-- app/webroot/css/cake.generic.css | 4 ++-- app/webroot/index.php | 4 ++-- app/webroot/js/vendors.php | 4 ++-- app/webroot/test.php | 4 ++-- cake/LICENSE.txt | 2 +- cake/basics.php | 4 ++-- cake/bootstrap.php | 4 ++-- cake/config/config.php | 4 ++-- cake/config/paths.php | 4 ++-- cake/config/unicode/casefolding/0080_00ff.php | 4 ++-- cake/config/unicode/casefolding/0100_017f.php | 4 ++-- cake/config/unicode/casefolding/0180_024F.php | 4 ++-- cake/config/unicode/casefolding/0250_02af.php | 4 ++-- cake/config/unicode/casefolding/0370_03ff.php | 4 ++-- cake/config/unicode/casefolding/0400_04ff.php | 4 ++-- cake/config/unicode/casefolding/0500_052f.php | 4 ++-- cake/config/unicode/casefolding/0530_058f.php | 4 ++-- cake/config/unicode/casefolding/1e00_1eff.php | 4 ++-- cake/config/unicode/casefolding/1f00_1fff.php | 4 ++-- cake/config/unicode/casefolding/2100_214f.php | 4 ++-- cake/config/unicode/casefolding/2150_218f.php | 4 ++-- cake/config/unicode/casefolding/2460_24ff.php | 4 ++-- cake/config/unicode/casefolding/2c00_2c5f.php | 4 ++-- cake/config/unicode/casefolding/2c60_2c7f.php | 4 ++-- cake/config/unicode/casefolding/2c80_2cff.php | 4 ++-- cake/config/unicode/casefolding/ff00_ffef.php | 4 ++-- cake/console/cake | 4 ++-- cake/console/cake.bat | 4 ++-- cake/console/cake.php | 4 ++-- cake/console/error.php | 4 ++-- cake/console/libs/acl.php | 4 ++-- cake/console/libs/api.php | 4 ++-- cake/console/libs/bake.php | 4 ++-- cake/console/libs/console.php | 4 ++-- cake/console/libs/i18n.php | 4 ++-- cake/console/libs/schema.php | 4 ++-- cake/console/libs/shell.php | 4 ++-- cake/console/libs/tasks/controller.php | 4 ++-- cake/console/libs/tasks/db_config.php | 4 ++-- cake/console/libs/tasks/extract.php | 4 ++-- cake/console/libs/tasks/model.php | 4 ++-- cake/console/libs/tasks/plugin.php | 4 ++-- cake/console/libs/tasks/project.php | 4 ++-- cake/console/libs/tasks/test.php | 4 ++-- cake/console/libs/tasks/view.php | 4 ++-- cake/console/libs/templates/skel/app_controller.php | 4 ++-- cake/console/libs/templates/skel/app_helper.php | 4 ++-- cake/console/libs/templates/skel/app_model.php | 4 ++-- cake/console/libs/templates/skel/config/acl.ini.php | 4 ++-- cake/console/libs/templates/skel/config/bootstrap.php | 4 ++-- cake/console/libs/templates/skel/config/core.php | 4 ++-- cake/console/libs/templates/skel/config/database.php.default | 4 ++-- cake/console/libs/templates/skel/config/inflections.php | 4 ++-- cake/console/libs/templates/skel/config/routes.php | 4 ++-- cake/console/libs/templates/skel/config/sql/db_acl.php | 4 ++-- cake/console/libs/templates/skel/config/sql/db_acl.sql | 2 +- cake/console/libs/templates/skel/config/sql/i18n.php | 4 ++-- cake/console/libs/templates/skel/config/sql/i18n.sql | 2 +- cake/console/libs/templates/skel/config/sql/sessions.php | 4 ++-- cake/console/libs/templates/skel/config/sql/sessions.sql | 2 +- .../libs/templates/skel/controllers/pages_controller.php | 4 ++-- cake/console/libs/templates/skel/index.php | 4 ++-- .../libs/templates/skel/views/elements/email/html/default.ctp | 4 ++-- .../libs/templates/skel/views/elements/email/text/default.ctp | 4 ++-- cake/console/libs/templates/skel/views/layouts/ajax.ctp | 4 ++-- cake/console/libs/templates/skel/views/layouts/default.ctp | 4 ++-- .../libs/templates/skel/views/layouts/email/html/default.ctp | 4 ++-- .../libs/templates/skel/views/layouts/email/text/default.ctp | 4 ++-- cake/console/libs/templates/skel/views/layouts/flash.ctp | 4 ++-- cake/console/libs/templates/skel/webroot/css.php | 4 ++-- cake/console/libs/templates/skel/webroot/css/cake.generic.css | 4 ++-- cake/console/libs/templates/skel/webroot/index.php | 4 ++-- cake/console/libs/templates/skel/webroot/js/vendors.php | 4 ++-- cake/console/libs/templates/skel/webroot/test.php | 4 ++-- cake/console/libs/templates/views/form.ctp | 4 ++-- cake/console/libs/templates/views/index.ctp | 4 ++-- cake/console/libs/templates/views/view.ctp | 4 ++-- cake/console/libs/testsuite.php | 4 ++-- cake/dispatcher.php | 4 ++-- cake/libs/cache.php | 4 ++-- cake/libs/cache/apc.php | 4 ++-- cake/libs/cache/file.php | 4 ++-- cake/libs/cache/memcache.php | 4 ++-- cake/libs/cache/xcache.php | 4 ++-- cake/libs/cake_log.php | 4 ++-- cake/libs/class_registry.php | 4 ++-- cake/libs/configure.php | 4 ++-- cake/libs/controller/app_controller.php | 4 ++-- cake/libs/controller/component.php | 4 ++-- cake/libs/controller/components/acl.php | 4 ++-- cake/libs/controller/components/auth.php | 4 ++-- cake/libs/controller/components/cookie.php | 4 ++-- cake/libs/controller/components/email.php | 4 ++-- cake/libs/controller/components/request_handler.php | 4 ++-- cake/libs/controller/components/security.php | 4 ++-- cake/libs/controller/components/session.php | 4 ++-- cake/libs/controller/controller.php | 4 ++-- cake/libs/controller/pages_controller.php | 4 ++-- cake/libs/controller/scaffold.php | 4 ++-- cake/libs/debugger.php | 4 ++-- cake/libs/error.php | 4 ++-- cake/libs/file.php | 4 ++-- cake/libs/flay.php | 4 ++-- cake/libs/folder.php | 4 ++-- cake/libs/http_socket.php | 4 ++-- cake/libs/i18n.php | 4 ++-- cake/libs/inflector.php | 4 ++-- cake/libs/l10n.php | 4 ++-- cake/libs/magic_db.php | 4 ++-- cake/libs/model/app_model.php | 4 ++-- cake/libs/model/behavior.php | 4 ++-- cake/libs/model/behaviors/acl.php | 4 ++-- cake/libs/model/behaviors/containable.php | 4 ++-- cake/libs/model/behaviors/translate.php | 4 ++-- cake/libs/model/behaviors/tree.php | 4 ++-- cake/libs/model/connection_manager.php | 4 ++-- cake/libs/model/datasources/datasource.php | 4 ++-- cake/libs/model/datasources/dbo/dbo_adodb.php | 4 ++-- cake/libs/model/datasources/dbo/dbo_db2.php | 2 +- cake/libs/model/datasources/dbo/dbo_firebird.php | 4 ++-- cake/libs/model/datasources/dbo/dbo_mssql.php | 4 ++-- cake/libs/model/datasources/dbo/dbo_mysql.php | 4 ++-- cake/libs/model/datasources/dbo/dbo_mysqli.php | 4 ++-- cake/libs/model/datasources/dbo/dbo_odbc.php | 4 ++-- cake/libs/model/datasources/dbo/dbo_oracle.php | 4 ++-- cake/libs/model/datasources/dbo/dbo_postgres.php | 4 ++-- cake/libs/model/datasources/dbo/dbo_sqlite.php | 4 ++-- cake/libs/model/datasources/dbo/dbo_sybase.php | 4 ++-- cake/libs/model/datasources/dbo_source.php | 4 ++-- cake/libs/model/db_acl.php | 4 ++-- cake/libs/model/model.php | 4 ++-- cake/libs/model/schema.php | 4 ++-- cake/libs/multibyte.php | 4 ++-- cake/libs/object.php | 4 ++-- cake/libs/overloadable.php | 4 ++-- cake/libs/overloadable_php4.php | 4 ++-- cake/libs/overloadable_php5.php | 4 ++-- cake/libs/router.php | 4 ++-- cake/libs/sanitize.php | 4 ++-- cake/libs/security.php | 4 ++-- cake/libs/session.php | 4 ++-- cake/libs/set.php | 4 ++-- cake/libs/socket.php | 4 ++-- cake/libs/string.php | 4 ++-- cake/libs/validation.php | 4 ++-- cake/libs/view/elements/dump.ctp | 4 ++-- cake/libs/view/elements/email/html/default.ctp | 4 ++-- cake/libs/view/elements/email/text/default.ctp | 4 ++-- cake/libs/view/errors/error404.ctp | 4 ++-- cake/libs/view/errors/missing_action.ctp | 4 ++-- cake/libs/view/errors/missing_component_class.ctp | 4 ++-- cake/libs/view/errors/missing_component_file.ctp | 4 ++-- cake/libs/view/errors/missing_connection.ctp | 4 ++-- cake/libs/view/errors/missing_controller.ctp | 4 ++-- cake/libs/view/errors/missing_helper_class.ctp | 4 ++-- cake/libs/view/errors/missing_helper_file.ctp | 4 ++-- cake/libs/view/errors/missing_layout.ctp | 4 ++-- cake/libs/view/errors/missing_model.ctp | 4 ++-- cake/libs/view/errors/missing_scaffolddb.ctp | 4 ++-- cake/libs/view/errors/missing_table.ctp | 4 ++-- cake/libs/view/errors/missing_view.ctp | 4 ++-- cake/libs/view/errors/private_action.ctp | 4 ++-- cake/libs/view/errors/scaffold_error.ctp | 4 ++-- cake/libs/view/helper.php | 4 ++-- cake/libs/view/helpers/ajax.php | 4 ++-- cake/libs/view/helpers/app_helper.php | 4 ++-- cake/libs/view/helpers/cache.php | 4 ++-- cake/libs/view/helpers/form.php | 4 ++-- cake/libs/view/helpers/html.php | 4 ++-- cake/libs/view/helpers/javascript.php | 4 ++-- cake/libs/view/helpers/js.php | 4 ++-- cake/libs/view/helpers/number.php | 4 ++-- cake/libs/view/helpers/paginator.php | 4 ++-- cake/libs/view/helpers/rss.php | 4 ++-- cake/libs/view/helpers/session.php | 4 ++-- cake/libs/view/helpers/text.php | 4 ++-- cake/libs/view/helpers/time.php | 4 ++-- cake/libs/view/helpers/xml.php | 4 ++-- cake/libs/view/layouts/ajax.ctp | 4 ++-- cake/libs/view/layouts/default.ctp | 4 ++-- cake/libs/view/layouts/email/html/default.ctp | 4 ++-- cake/libs/view/layouts/email/text/default.ctp | 4 ++-- cake/libs/view/layouts/flash.ctp | 4 ++-- cake/libs/view/media.php | 4 ++-- cake/libs/view/pages/home.ctp | 4 ++-- cake/libs/view/scaffolds/edit.ctp | 4 ++-- cake/libs/view/scaffolds/index.ctp | 4 ++-- cake/libs/view/scaffolds/view.ctp | 4 ++-- cake/libs/view/theme.php | 4 ++-- cake/libs/view/view.php | 4 ++-- cake/libs/xml.php | 4 ++-- cake/tests/cases/basics.test.php | 4 ++-- cake/tests/cases/console/cake.test.php | 4 ++-- cake/tests/cases/console/libs/acl.test.php | 4 ++-- cake/tests/cases/console/libs/api.test.php | 4 ++-- cake/tests/cases/console/libs/schema.test.php | 4 ++-- cake/tests/cases/console/libs/shell.test.php | 4 ++-- cake/tests/cases/console/libs/tasks/extract.test.php | 4 ++-- cake/tests/cases/console/libs/tasks/model.test.php | 4 ++-- cake/tests/cases/console/libs/tasks/test.test.php | 4 ++-- cake/tests/cases/dispatcher.test.php | 4 ++-- cake/tests/cases/libs/cache.test.php | 4 ++-- cake/tests/cases/libs/cache/apc.test.php | 4 ++-- cake/tests/cases/libs/cache/file.test.php | 4 ++-- cake/tests/cases/libs/cache/memcache.test.php | 4 ++-- cake/tests/cases/libs/cache/xcache.test.php | 4 ++-- cake/tests/cases/libs/cake_log.test.php | 4 ++-- cake/tests/cases/libs/cake_test_case.test.php | 4 ++-- cake/tests/cases/libs/cake_test_fixture.test.php | 4 ++-- cake/tests/cases/libs/class_registry.test.php | 4 ++-- cake/tests/cases/libs/code_coverage_manager.test.php | 4 ++-- cake/tests/cases/libs/configure.test.php | 4 ++-- cake/tests/cases/libs/controller/component.test.php | 4 ++-- cake/tests/cases/libs/controller/components/acl.test.php | 4 ++-- cake/tests/cases/libs/controller/components/auth.test.php | 4 ++-- cake/tests/cases/libs/controller/components/cookie.test.php | 4 ++-- cake/tests/cases/libs/controller/components/email.test.php | 4 ++-- .../cases/libs/controller/components/request_handler.test.php | 4 ++-- cake/tests/cases/libs/controller/components/security.test.php | 4 ++-- cake/tests/cases/libs/controller/components/session.test.php | 4 ++-- cake/tests/cases/libs/controller/controller.test.php | 4 ++-- .../cases/libs/controller/controller_merge_vars.test.php | 4 ++-- cake/tests/cases/libs/controller/pages_controller.test.php | 4 ++-- cake/tests/cases/libs/controller/scaffold.test.php | 4 ++-- cake/tests/cases/libs/debugger.test.php | 4 ++-- cake/tests/cases/libs/error.test.php | 4 ++-- cake/tests/cases/libs/file.test.php | 4 ++-- cake/tests/cases/libs/flay.test.php | 4 ++-- cake/tests/cases/libs/folder.test.php | 4 ++-- cake/tests/cases/libs/http_socket.test.php | 4 ++-- cake/tests/cases/libs/i18n.test.php | 4 ++-- cake/tests/cases/libs/inflector.test.php | 4 ++-- cake/tests/cases/libs/l10n.test.php | 4 ++-- cake/tests/cases/libs/magic_db.test.php | 4 ++-- cake/tests/cases/libs/model/behaviors/acl.test.php | 4 ++-- cake/tests/cases/libs/model/behaviors/containable.test.php | 4 ++-- cake/tests/cases/libs/model/behaviors/translate.test.php | 4 ++-- cake/tests/cases/libs/model/behaviors/tree.test.php | 4 ++-- cake/tests/cases/libs/model/connection_manager.test.php | 4 ++-- .../tests/cases/libs/model/datasources/dbo/dbo_adodb.test.php | 4 ++-- .../tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php | 4 ++-- .../tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php | 4 ++-- .../cases/libs/model/datasources/dbo/dbo_mysqli.test.php | 4 ++-- .../cases/libs/model/datasources/dbo/dbo_oracle.test.php | 4 ++-- .../cases/libs/model/datasources/dbo/dbo_postgres.test.php | 4 ++-- .../cases/libs/model/datasources/dbo/dbo_sqlite.test.php | 4 ++-- cake/tests/cases/libs/model/datasources/dbo_source.test.php | 4 ++-- cake/tests/cases/libs/model/db_acl.test.php | 4 ++-- cake/tests/cases/libs/model/model.test.php | 4 ++-- cake/tests/cases/libs/model/model_delete.test.php | 4 ++-- cake/tests/cases/libs/model/model_integration.test.php | 4 ++-- cake/tests/cases/libs/model/model_read.test.php | 4 ++-- cake/tests/cases/libs/model/model_validation.test.php | 4 ++-- cake/tests/cases/libs/model/model_write.test.php | 4 ++-- cake/tests/cases/libs/model/models.php | 4 ++-- cake/tests/cases/libs/model/schema.test.php | 4 ++-- cake/tests/cases/libs/multibyte.test.php | 4 ++-- cake/tests/cases/libs/object.test.php | 4 ++-- cake/tests/cases/libs/overloadable.test.php | 4 ++-- cake/tests/cases/libs/router.test.php | 4 ++-- cake/tests/cases/libs/sanitize.test.php | 4 ++-- cake/tests/cases/libs/security.test.php | 4 ++-- cake/tests/cases/libs/session.test.php | 4 ++-- cake/tests/cases/libs/set.test.php | 4 ++-- cake/tests/cases/libs/socket.test.php | 4 ++-- cake/tests/cases/libs/string.test.php | 4 ++-- cake/tests/cases/libs/test_manager.test.php | 4 ++-- cake/tests/cases/libs/validation.test.php | 4 ++-- cake/tests/cases/libs/view/helper.test.php | 4 ++-- cake/tests/cases/libs/view/helpers/ajax.test.php | 4 ++-- cake/tests/cases/libs/view/helpers/cache.test.php | 4 ++-- cake/tests/cases/libs/view/helpers/form.test.php | 4 ++-- cake/tests/cases/libs/view/helpers/html.test.php | 4 ++-- cake/tests/cases/libs/view/helpers/javascript.test.php | 4 ++-- cake/tests/cases/libs/view/helpers/js.test.php | 4 ++-- cake/tests/cases/libs/view/helpers/number.test.php | 4 ++-- cake/tests/cases/libs/view/helpers/paginator.test.php | 4 ++-- cake/tests/cases/libs/view/helpers/rss.test.php | 4 ++-- cake/tests/cases/libs/view/helpers/session.test.php | 4 ++-- cake/tests/cases/libs/view/helpers/text.test.php | 4 ++-- cake/tests/cases/libs/view/helpers/time.test.php | 4 ++-- cake/tests/cases/libs/view/helpers/xml.test.php | 4 ++-- cake/tests/cases/libs/view/theme.test.php | 4 ++-- cake/tests/cases/libs/view/view.test.php | 4 ++-- cake/tests/cases/libs/xml.test.php | 4 ++-- cake/tests/fixtures/account_fixture.php | 4 ++-- cake/tests/fixtures/aco_action_fixture.php | 4 ++-- cake/tests/fixtures/aco_fixture.php | 4 ++-- cake/tests/fixtures/aco_two_fixture.php | 4 ++-- cake/tests/fixtures/advertisement_fixture.php | 4 ++-- cake/tests/fixtures/another_article_fixture.php | 4 ++-- cake/tests/fixtures/apple_fixture.php | 4 ++-- cake/tests/fixtures/aro_fixture.php | 4 ++-- cake/tests/fixtures/aro_two_fixture.php | 4 ++-- cake/tests/fixtures/aros_aco_fixture.php | 4 ++-- cake/tests/fixtures/aros_aco_two_fixture.php | 4 ++-- cake/tests/fixtures/article_featured_fixture.php | 4 ++-- cake/tests/fixtures/article_featureds_tags_fixture.php | 4 ++-- cake/tests/fixtures/article_fixture.php | 4 ++-- cake/tests/fixtures/articles_tag_fixture.php | 4 ++-- cake/tests/fixtures/attachment_fixture.php | 4 ++-- cake/tests/fixtures/auth_user_custom_field_fixture.php | 4 ++-- cake/tests/fixtures/auth_user_fixture.php | 4 ++-- cake/tests/fixtures/author_fixture.php | 4 ++-- cake/tests/fixtures/basket_fixture.php | 4 ++-- cake/tests/fixtures/bid_fixture.php | 4 ++-- cake/tests/fixtures/binary_test_fixture.php | 4 ++-- cake/tests/fixtures/book_fixture.php | 4 ++-- cake/tests/fixtures/cache_test_model_fixture.php | 4 ++-- cake/tests/fixtures/callback_fixture.php | 4 ++-- cake/tests/fixtures/category_fixture.php | 4 ++-- cake/tests/fixtures/category_thread_fixture.php | 4 ++-- cake/tests/fixtures/cd_fixture.php | 4 ++-- cake/tests/fixtures/comment_fixture.php | 4 ++-- cake/tests/fixtures/content_account_fixture.php | 4 ++-- cake/tests/fixtures/content_fixture.php | 4 ++-- cake/tests/fixtures/counter_cache_post_fixture.php | 4 ++-- .../counter_cache_post_nonstandard_primary_key_fixture.php | 4 ++-- cake/tests/fixtures/counter_cache_user_fixture.php | 4 ++-- .../counter_cache_user_nonstandard_primary_key_fixture.php | 4 ++-- cake/tests/fixtures/data_test_fixture.php | 4 ++-- cake/tests/fixtures/datatype_fixture.php | 4 ++-- cake/tests/fixtures/dependency_fixture.php | 4 ++-- cake/tests/fixtures/device_fixture.php | 4 ++-- cake/tests/fixtures/device_type_category_fixture.php | 4 ++-- cake/tests/fixtures/device_type_fixture.php | 4 ++-- cake/tests/fixtures/document_directory_fixture.php | 4 ++-- cake/tests/fixtures/document_fixture.php | 4 ++-- cake/tests/fixtures/exterior_type_category_fixture.php | 4 ++-- cake/tests/fixtures/feature_set_fixture.php | 4 ++-- cake/tests/fixtures/featured_fixture.php | 4 ++-- cake/tests/fixtures/film_file_fixture.php | 4 ++-- cake/tests/fixtures/flag_tree_fixture.php | 4 ++-- cake/tests/fixtures/fruit_fixture.php | 4 ++-- cake/tests/fixtures/fruits_uuid_tag_fixture.php | 4 ++-- cake/tests/fixtures/home_fixture.php | 4 ++-- cake/tests/fixtures/image_fixture.php | 4 ++-- cake/tests/fixtures/item_fixture.php | 4 ++-- cake/tests/fixtures/items_portfolio_fixture.php | 4 ++-- cake/tests/fixtures/join_a_b_fixture.php | 4 ++-- cake/tests/fixtures/join_a_c_fixture.php | 4 ++-- cake/tests/fixtures/join_a_fixture.php | 4 ++-- cake/tests/fixtures/join_b_fixture.php | 4 ++-- cake/tests/fixtures/join_c_fixture.php | 4 ++-- cake/tests/fixtures/join_thing_fixture.php | 4 ++-- cake/tests/fixtures/message_fixture.php | 4 ++-- cake/tests/fixtures/my_categories_my_products_fixture.php | 4 ++-- cake/tests/fixtures/my_categories_my_users_fixture.php | 4 ++-- cake/tests/fixtures/my_category_fixture.php | 4 ++-- cake/tests/fixtures/my_product_fixture.php | 4 ++-- cake/tests/fixtures/my_user_fixture.php | 4 ++-- cake/tests/fixtures/node_fixture.php | 4 ++-- cake/tests/fixtures/number_tree_fixture.php | 4 ++-- cake/tests/fixtures/number_tree_two_fixture.php | 4 ++-- cake/tests/fixtures/numeric_article_fixture.php | 4 ++-- cake/tests/fixtures/overall_favorite_fixture.php | 4 ++-- cake/tests/fixtures/person_fixture.php | 4 ++-- cake/tests/fixtures/portfolio_fixture.php | 4 ++-- cake/tests/fixtures/post_fixture.php | 4 ++-- cake/tests/fixtures/posts_tag_fixture.php | 4 ++-- cake/tests/fixtures/primary_model_fixture.php | 4 ++-- cake/tests/fixtures/product_fixture.php | 4 ++-- cake/tests/fixtures/project_fixture.php | 4 ++-- cake/tests/fixtures/sample_fixture.php | 4 ++-- cake/tests/fixtures/secondary_model_fixture.php | 4 ++-- cake/tests/fixtures/session_fixture.php | 4 ++-- cake/tests/fixtures/something_else_fixture.php | 4 ++-- cake/tests/fixtures/something_fixture.php | 4 ++-- cake/tests/fixtures/stories_tag_fixture.php | 4 ++-- cake/tests/fixtures/story_fixture.php | 4 ++-- cake/tests/fixtures/syfile_fixture.php | 4 ++-- cake/tests/fixtures/tag_fixture.php | 4 ++-- cake/tests/fixtures/test_plugin_article_fixture.php | 4 ++-- cake/tests/fixtures/test_plugin_comment_fixture.php | 4 ++-- cake/tests/fixtures/the_paper_monkies_fixture.php | 4 ++-- cake/tests/fixtures/thread_fixture.php | 4 ++-- cake/tests/fixtures/translate_article_fixture.php | 4 ++-- cake/tests/fixtures/translate_fixture.php | 4 ++-- cake/tests/fixtures/translate_table_fixture.php | 4 ++-- cake/tests/fixtures/translated_article_fixture.php | 4 ++-- cake/tests/fixtures/translated_item_fixture.php | 4 ++-- cake/tests/fixtures/unconventional_tree_fixture.php | 4 ++-- cake/tests/fixtures/underscore_field_fixture.php | 4 ++-- cake/tests/fixtures/user_fixture.php | 4 ++-- cake/tests/fixtures/uuid_fixture.php | 4 ++-- cake/tests/fixtures/uuid_tag_fixture.php | 4 ++-- cake/tests/fixtures/uuid_tree_fixture.php | 4 ++-- cake/tests/fixtures/uuiditem_fixture.php | 4 ++-- cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php | 4 ++-- .../fixtures/uuiditems_uuidportfolio_numericid_fixture.php | 4 ++-- cake/tests/fixtures/uuidportfolio_fixture.php | 4 ++-- cake/tests/groups/acl.group.php | 4 ++-- cake/tests/groups/cache.group.php | 4 ++-- cake/tests/groups/components.group.php | 4 ++-- cake/tests/groups/configure.group.php | 4 ++-- cake/tests/groups/console.group.php | 4 ++-- cake/tests/groups/controller.group.php | 4 ++-- cake/tests/groups/database.group.php | 4 ++-- cake/tests/groups/helpers.group.php | 4 ++-- cake/tests/groups/lib.group.php | 4 ++-- cake/tests/groups/model.group.php | 4 ++-- cake/tests/groups/no_cross_contamination.group.php | 4 ++-- cake/tests/groups/routing_system.group.php | 4 ++-- cake/tests/groups/socket.group.php | 4 ++-- cake/tests/groups/test_suite.group.php | 4 ++-- cake/tests/groups/view.group.php | 4 ++-- cake/tests/groups/xml.group.php | 4 ++-- cake/tests/lib/cake_reporter.php | 4 ++-- cake/tests/lib/cake_test_case.php | 4 ++-- cake/tests/lib/cake_test_fixture.php | 4 ++-- cake/tests/lib/cake_test_model.php | 4 ++-- cake/tests/lib/cake_web_test_case.php | 4 ++-- cake/tests/lib/cli_reporter.php | 4 ++-- cake/tests/lib/code_coverage_manager.php | 4 ++-- cake/tests/lib/content.php | 4 ++-- cake/tests/lib/footer.php | 4 ++-- cake/tests/lib/header.php | 4 ++-- cake/tests/lib/simpletest.php | 4 ++-- cake/tests/lib/test_manager.php | 4 ++-- cake/tests/lib/xdebug.php | 4 ++-- cake/tests/test_app/config/acl.ini.php | 4 ++-- cake/tests/test_app/controllers/tests_apps_controller.php | 4 ++-- .../test_app/controllers/tests_apps_posts_controller.php | 4 ++-- .../test_app/models/behaviors/persister_one_behavior.php | 4 ++-- .../test_app/models/behaviors/persister_two_behavior.php | 4 ++-- cake/tests/test_app/models/comment.php | 4 ++-- cake/tests/test_app/models/persister_one.php | 4 ++-- cake/tests/test_app/models/persister_two.php | 4 ++-- cake/tests/test_app/models/post.php | 4 ++-- .../test_plugin/controllers/components/other_component.php | 4 ++-- .../test_plugin/controllers/components/plugins_component.php | 4 ++-- .../controllers/components/test_plugin_component.php | 4 ++-- .../controllers/components/test_plugin_other_component.php | 4 ++-- .../plugins/test_plugin/controllers/tests_controller.php | 4 ++-- .../models/behaviors/test_plugin_persister_one.php | 4 ++-- .../models/behaviors/test_plugin_persister_two.php | 4 ++-- .../test_app/plugins/test_plugin/models/test_plugin_post.php | 4 ++-- .../plugins/test_plugin/test_plugin_app_controller.php | 4 ++-- .../test_app/plugins/test_plugin/test_plugin_app_model.php | 4 ++-- .../plugins/test_plugin/vendors/sample/sample_plugin.php | 4 ++-- .../test_app/plugins/test_plugin/vendors/shells/example.php | 4 ++-- cake/tests/test_app/plugins/test_plugin/vendors/welcome.php | 4 ++-- .../plugins/test_plugin/views/helpers/other_helper.php | 4 ++-- .../plugins/test_plugin/views/helpers/plugged_helper.php | 4 ++-- .../plugins/test_plugin_two/vendors/shells/example.php | 4 ++-- .../plugins/test_plugin_two/vendors/shells/welcome.php | 4 ++-- cake/tests/test_app/vendors/Test/MyTest.php | 4 ++-- cake/tests/test_app/vendors/Test/hello.php | 4 ++-- .../test_app/vendors/sample/configure_test_vendor_sample.php | 4 ++-- cake/tests/test_app/vendors/shells/sample.php | 4 ++-- cake/tests/test_app/vendors/somename/some.name.php | 4 ++-- cake/tests/test_app/vendors/welcome.php | 4 ++-- cake/tests/test_app/views/elements/email/html/default.ctp | 4 ++-- cake/tests/test_app/views/elements/email/text/default.ctp | 4 ++-- cake/tests/test_app/views/elements/email/text/wide.ctp | 4 ++-- cake/tests/test_app/views/layouts/ajax.ctp | 4 ++-- cake/tests/test_app/views/layouts/ajax2.ctp | 4 ++-- cake/tests/test_app/views/layouts/cache_layout.ctp | 4 ++-- cake/tests/test_app/views/layouts/default.ctp | 4 ++-- cake/tests/test_app/views/layouts/email/html/default.ctp | 4 ++-- cake/tests/test_app/views/layouts/email/html/thin.ctp | 4 ++-- cake/tests/test_app/views/layouts/email/text/default.ctp | 4 ++-- cake/tests/test_app/views/layouts/flash.ctp | 4 ++-- cake/tests/test_app/views/layouts/multi_cache.ctp | 4 ++-- cake/tests/test_app/views/posts/sequencial_nocache.ctp | 4 ++-- cake/tests/test_app/views/posts/test_nocache_tags.ctp | 4 ++-- index.php | 4 ++-- 481 files changed, 954 insertions(+), 954 deletions(-) diff --git a/app/config/acl.ini.php b/app/config/acl.ini.php index a9868e685..c0e3a9b7a 100644 --- a/app/config/acl.ini.php +++ b/app/config/acl.ini.php @@ -7,13 +7,13 @@ ; * PHP versions 4 and 5 ; * ; * CakePHP(tm) : Rapid Development Framework http://www.cakephp.org/ -; * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) +; * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) ; * ; * Licensed under The MIT License ; * Redistributions of files must retain the above copyright notice. ; * ; * @filesource -; * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) +; * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) ; * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project ; * @package cake ; * @subpackage cake.app.config diff --git a/app/config/bootstrap.php b/app/config/bootstrap.php index b817172c7..bede17125 100644 --- a/app/config/bootstrap.php +++ b/app/config/bootstrap.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config diff --git a/app/config/core.php b/app/config/core.php index 672a00e91..7e078fc96 100644 --- a/app/config/core.php +++ b/app/config/core.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config diff --git a/app/config/database.php.default b/app/config/database.php.default index 5c20804d4..ac3e99dfe 100644 --- a/app/config/database.php.default +++ b/app/config/database.php.default @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config diff --git a/app/config/inflections.php b/app/config/inflections.php index 07ca6d2a8..ccbb0e793 100644 --- a/app/config/inflections.php +++ b/app/config/inflections.php @@ -9,13 +9,13 @@ * PHP versions 4 and % * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config diff --git a/app/config/routes.php b/app/config/routes.php index b14e435c3..1bec77b10 100644 --- a/app/config/routes.php +++ b/app/config/routes.php @@ -10,13 +10,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config diff --git a/app/config/sql/db_acl.php b/app/config/sql/db_acl.php index 19434d0c6..dd6a1ac1b 100644 --- a/app/config/sql/db_acl.php +++ b/app/config/sql/db_acl.php @@ -9,13 +9,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config.sql diff --git a/app/config/sql/db_acl.sql b/app/config/sql/db_acl.sql index 6fc01b8ea..17707caab 100644 --- a/app/config/sql/db_acl.sql +++ b/app/config/sql/db_acl.sql @@ -1,6 +1,6 @@ # $Id$ # -# Copyright 2005-2008, Cake Software Foundation, Inc. +# Copyright 2005-2010, Cake Software Foundation, Inc. # # Licensed under The MIT License # Redistributions of files must retain the above copyright notice. diff --git a/app/config/sql/i18n.php b/app/config/sql/i18n.php index b8158dd5a..40c2957fe 100644 --- a/app/config/sql/i18n.php +++ b/app/config/sql/i18n.php @@ -9,13 +9,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config.sql diff --git a/app/config/sql/i18n.sql b/app/config/sql/i18n.sql index db1daea4a..909f79c5e 100644 --- a/app/config/sql/i18n.sql +++ b/app/config/sql/i18n.sql @@ -1,6 +1,6 @@ # $Id$ # -# Copyright 2005-2008, Cake Software Foundation, Inc. +# Copyright 2005-2010, Cake Software Foundation, Inc. # # Licensed under The MIT License # Redistributions of files must retain the above copyright notice. diff --git a/app/config/sql/sessions.php b/app/config/sql/sessions.php index 197366108..334c0b9ce 100644 --- a/app/config/sql/sessions.php +++ b/app/config/sql/sessions.php @@ -9,13 +9,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config.sql diff --git a/app/config/sql/sessions.sql b/app/config/sql/sessions.sql index 75be419a1..1564ae1d5 100644 --- a/app/config/sql/sessions.sql +++ b/app/config/sql/sessions.sql @@ -1,6 +1,6 @@ # $Id$ # -# Copyright 2005-2008, Cake Software Foundation, Inc. +# Copyright 2005-2010, Cake Software Foundation, Inc. # 1785 E. Sahara Avenue, Suite 490-204 # Las Vegas, Nevada 89104 # diff --git a/app/index.php b/app/index.php index 5724a1c4b..057c1af3a 100644 --- a/app/index.php +++ b/app/index.php @@ -4,13 +4,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app diff --git a/app/webroot/css.php b/app/webroot/css.php index 969dd0e27..15dba4ae8 100644 --- a/app/webroot/css.php +++ b/app/webroot/css.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.webroot diff --git a/app/webroot/css/cake.generic.css b/app/webroot/css/cake.generic.css index ab3e1321c..13df20602 100644 --- a/app/webroot/css/cake.generic.css +++ b/app/webroot/css/cake.generic.css @@ -4,13 +4,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.webroot.css diff --git a/app/webroot/index.php b/app/webroot/index.php index 34837799b..9d2113576 100644 --- a/app/webroot/index.php +++ b/app/webroot/index.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.webroot diff --git a/app/webroot/js/vendors.php b/app/webroot/js/vendors.php index 5fda0b7b4..5c6181290 100644 --- a/app/webroot/js/vendors.php +++ b/app/webroot/js/vendors.php @@ -9,13 +9,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.webroot.js diff --git a/app/webroot/test.php b/app/webroot/test.php index a57d15747..665def442 100644 --- a/app/webroot/test.php +++ b/app/webroot/test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs diff --git a/cake/LICENSE.txt b/cake/LICENSE.txt index e54a5572b..d699c53c7 100644 --- a/cake/LICENSE.txt +++ b/cake/LICENSE.txt @@ -1,7 +1,7 @@ The MIT License CakePHP(tm) : The Rapid Development PHP Framework (http://www.cakephp.org) -Copyright 2005-2007, Cake Software Foundation, Inc. +Copyright 2005-2010, Cake Software Foundation, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/cake/basics.php b/cake/basics.php index 0659d28ec..530dd2252 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake diff --git a/cake/bootstrap.php b/cake/bootstrap.php index f9aa7b438..1652b085f 100644 --- a/cake/bootstrap.php +++ b/cake/bootstrap.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake diff --git a/cake/config/config.php b/cake/config/config.php index baecc26de..7029f3eb7 100644 --- a/cake/config/config.php +++ b/cake/config/config.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config diff --git a/cake/config/paths.php b/cake/config/paths.php index 6a6449f0e..727b36cca 100644 --- a/cake/config/paths.php +++ b/cake/config/paths.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.app.config diff --git a/cake/config/unicode/casefolding/0080_00ff.php b/cake/config/unicode/casefolding/0080_00ff.php index 361b9f4ce..730c97086 100644 --- a/cake/config/unicode/casefolding/0080_00ff.php +++ b/cake/config/unicode/casefolding/0080_00ff.php @@ -12,13 +12,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding diff --git a/cake/config/unicode/casefolding/0100_017f.php b/cake/config/unicode/casefolding/0100_017f.php index 4f27b2b08..aa092f719 100644 --- a/cake/config/unicode/casefolding/0100_017f.php +++ b/cake/config/unicode/casefolding/0100_017f.php @@ -12,13 +12,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding diff --git a/cake/config/unicode/casefolding/0180_024F.php b/cake/config/unicode/casefolding/0180_024F.php index c3d60326e..948eb8906 100644 --- a/cake/config/unicode/casefolding/0180_024F.php +++ b/cake/config/unicode/casefolding/0180_024F.php @@ -12,13 +12,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding diff --git a/cake/config/unicode/casefolding/0250_02af.php b/cake/config/unicode/casefolding/0250_02af.php index 31d9b912d..62cf773af 100644 --- a/cake/config/unicode/casefolding/0250_02af.php +++ b/cake/config/unicode/casefolding/0250_02af.php @@ -12,13 +12,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding diff --git a/cake/config/unicode/casefolding/0370_03ff.php b/cake/config/unicode/casefolding/0370_03ff.php index 776667a88..c088320ef 100644 --- a/cake/config/unicode/casefolding/0370_03ff.php +++ b/cake/config/unicode/casefolding/0370_03ff.php @@ -12,13 +12,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding diff --git a/cake/config/unicode/casefolding/0400_04ff.php b/cake/config/unicode/casefolding/0400_04ff.php index 6e1f6e9a8..3e3cf8d98 100644 --- a/cake/config/unicode/casefolding/0400_04ff.php +++ b/cake/config/unicode/casefolding/0400_04ff.php @@ -12,13 +12,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding diff --git a/cake/config/unicode/casefolding/0500_052f.php b/cake/config/unicode/casefolding/0500_052f.php index 17853593e..1e5449ec5 100644 --- a/cake/config/unicode/casefolding/0500_052f.php +++ b/cake/config/unicode/casefolding/0500_052f.php @@ -12,13 +12,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding diff --git a/cake/config/unicode/casefolding/0530_058f.php b/cake/config/unicode/casefolding/0530_058f.php index 83000a12f..599b8516c 100644 --- a/cake/config/unicode/casefolding/0530_058f.php +++ b/cake/config/unicode/casefolding/0530_058f.php @@ -12,13 +12,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding diff --git a/cake/config/unicode/casefolding/1e00_1eff.php b/cake/config/unicode/casefolding/1e00_1eff.php index b8ad76f65..cdd24c36f 100644 --- a/cake/config/unicode/casefolding/1e00_1eff.php +++ b/cake/config/unicode/casefolding/1e00_1eff.php @@ -12,13 +12,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding diff --git a/cake/config/unicode/casefolding/1f00_1fff.php b/cake/config/unicode/casefolding/1f00_1fff.php index 2e758924c..39bebc63b 100644 --- a/cake/config/unicode/casefolding/1f00_1fff.php +++ b/cake/config/unicode/casefolding/1f00_1fff.php @@ -12,13 +12,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding diff --git a/cake/config/unicode/casefolding/2100_214f.php b/cake/config/unicode/casefolding/2100_214f.php index 42bf20709..eb801c35c 100644 --- a/cake/config/unicode/casefolding/2100_214f.php +++ b/cake/config/unicode/casefolding/2100_214f.php @@ -12,13 +12,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding diff --git a/cake/config/unicode/casefolding/2150_218f.php b/cake/config/unicode/casefolding/2150_218f.php index ac4f9d154..dcff6df50 100644 --- a/cake/config/unicode/casefolding/2150_218f.php +++ b/cake/config/unicode/casefolding/2150_218f.php @@ -12,13 +12,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding diff --git a/cake/config/unicode/casefolding/2460_24ff.php b/cake/config/unicode/casefolding/2460_24ff.php index 9efd3916f..e7e675373 100644 --- a/cake/config/unicode/casefolding/2460_24ff.php +++ b/cake/config/unicode/casefolding/2460_24ff.php @@ -12,13 +12,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding diff --git a/cake/config/unicode/casefolding/2c00_2c5f.php b/cake/config/unicode/casefolding/2c00_2c5f.php index 0b00aa577..e27abdf82 100644 --- a/cake/config/unicode/casefolding/2c00_2c5f.php +++ b/cake/config/unicode/casefolding/2c00_2c5f.php @@ -12,13 +12,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding diff --git a/cake/config/unicode/casefolding/2c60_2c7f.php b/cake/config/unicode/casefolding/2c60_2c7f.php index 91dc2e47e..3d3553a52 100644 --- a/cake/config/unicode/casefolding/2c60_2c7f.php +++ b/cake/config/unicode/casefolding/2c60_2c7f.php @@ -12,13 +12,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding diff --git a/cake/config/unicode/casefolding/2c80_2cff.php b/cake/config/unicode/casefolding/2c80_2cff.php index 8f07be272..df9879c55 100644 --- a/cake/config/unicode/casefolding/2c80_2cff.php +++ b/cake/config/unicode/casefolding/2c80_2cff.php @@ -12,13 +12,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding diff --git a/cake/config/unicode/casefolding/ff00_ffef.php b/cake/config/unicode/casefolding/ff00_ffef.php index ddcd35e46..530f0e75c 100644 --- a/cake/config/unicode/casefolding/ff00_ffef.php +++ b/cake/config/unicode/casefolding/ff00_ffef.php @@ -12,13 +12,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding diff --git a/cake/console/cake b/cake/console/cake index 1257251d6..0edff7e8f 100755 --- a/cake/console/cake +++ b/cake/console/cake @@ -5,13 +5,13 @@ # PHP versions 4 and 5 # # CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) -# Copyright 2005-2007, Cake Software Foundation, Inc. +# Copyright 2005-2010, Cake Software Foundation, Inc. # # Licensed under The MIT License # Redistributions of files must retain the above copyright notice. # # @filesource -# @copyright Copyright 2005-2007, Cake Software Foundation, Inc. +# @copyright Copyright 2005-2010, Cake Software Foundation, Inc. # @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project # @package cake # @subpackage cake.cake.console diff --git a/cake/console/cake.bat b/cake/console/cake.bat index c0a531c8e..35c1a2b83 100644 --- a/cake/console/cake.bat +++ b/cake/console/cake.bat @@ -4,13 +4,13 @@ :: PHP versions 4 and 5 :: :: CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) -:: Copyright 2005-2007, Cake Software Foundation, Inc. +:: Copyright 2005-2010, Cake Software Foundation, Inc. :: :: Licensed under The MIT License :: Redistributions of files must retain the above copyright notice. :: :: @filesource -:: @copyright Copyright 2005-2007, Cake Software Foundation, Inc. +:: @copyright Copyright 2005-2010, Cake Software Foundation, Inc. :: @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project :: @package cake :: @subpackage cake.cake.console diff --git a/cake/console/cake.php b/cake/console/cake.php index cfd118302..e90f7e555 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -9,13 +9,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. + * Copyright 2005-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console diff --git a/cake/console/error.php b/cake/console/error.php index 9c88a40b8..788fe3611 100644 --- a/cake/console/error.php +++ b/cake/console/error.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console diff --git a/cake/console/libs/acl.php b/cake/console/libs/acl.php index 15b678404..f7d8c4ae1 100644 --- a/cake/console/libs/acl.php +++ b/cake/console/libs/acl.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs diff --git a/cake/console/libs/api.php b/cake/console/libs/api.php index c370d7310..b3a34755f 100644 --- a/cake/console/libs/api.php +++ b/cake/console/libs/api.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index f891ca2a4..a80cf775e 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -10,13 +10,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs diff --git a/cake/console/libs/console.php b/cake/console/libs/console.php index 189da32e8..bf075c21b 100644 --- a/cake/console/libs/console.php +++ b/cake/console/libs/console.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs diff --git a/cake/console/libs/i18n.php b/cake/console/libs/i18n.php index f0e23b91b..70ffd61b3 100644 --- a/cake/console/libs/i18n.php +++ b/cake/console/libs/i18n.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs diff --git a/cake/console/libs/schema.php b/cake/console/libs/schema.php index 36974eb51..c7cf5cfcf 100644 --- a/cake/console/libs/schema.php +++ b/cake/console/libs/schema.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php index 4ca89a3c4..8f5c7a6eb 100644 --- a/cake/console/libs/shell.php +++ b/cake/console/libs/shell.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index d4ab58abe..74bc89213 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. + * Copyright 2005-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.tasks diff --git a/cake/console/libs/tasks/db_config.php b/cake/console/libs/tasks/db_config.php index 3126c00d9..e0844a5d9 100644 --- a/cake/console/libs/tasks/db_config.php +++ b/cake/console/libs/tasks/db_config.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.tasks diff --git a/cake/console/libs/tasks/extract.php b/cake/console/libs/tasks/extract.php index a956afd4d..6bb5a27ff 100644 --- a/cake/console/libs/tasks/extract.php +++ b/cake/console/libs/tasks/extract.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 654911932..fac911605 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.tasks diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index a23181322..34bc1b4ed 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.tasks diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php index f7a0c3021..e2836daef 100644 --- a/cake/console/libs/tasks/project.php +++ b/cake/console/libs/tasks/project.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.scripts.bake diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 416d3bd22..aa71bdb15 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.tasks diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index cd60df611..d15b5f243 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.tasks diff --git a/cake/console/libs/templates/skel/app_controller.php b/cake/console/libs/templates/skel/app_controller.php index 2412447bc..6c38cbe90 100644 --- a/cake/console/libs/templates/skel/app_controller.php +++ b/cake/console/libs/templates/skel/app_controller.php @@ -9,13 +9,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app diff --git a/cake/console/libs/templates/skel/app_helper.php b/cake/console/libs/templates/skel/app_helper.php index c57f438b8..3b751a8b4 100644 --- a/cake/console/libs/templates/skel/app_helper.php +++ b/cake/console/libs/templates/skel/app_helper.php @@ -9,13 +9,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake diff --git a/cake/console/libs/templates/skel/app_model.php b/cake/console/libs/templates/skel/app_model.php index 80938823f..b1fcdc75a 100644 --- a/cake/console/libs/templates/skel/app_model.php +++ b/cake/console/libs/templates/skel/app_model.php @@ -10,13 +10,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app diff --git a/cake/console/libs/templates/skel/config/acl.ini.php b/cake/console/libs/templates/skel/config/acl.ini.php index ee585c27a..23ba4d25f 100644 --- a/cake/console/libs/templates/skel/config/acl.ini.php +++ b/cake/console/libs/templates/skel/config/acl.ini.php @@ -7,13 +7,13 @@ ; * PHP versions 4 and 5 ; * ; * CakePHP(tm) : Rapid Development Framework http://www.cakephp.org/ -; * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) +; * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) ; * ; * Licensed under The MIT License ; * Redistributions of files must retain the above copyright notice. ; * ; * @filesource -; * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) +; * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) ; * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project ; * @package cake ; * @subpackage cake.app.config diff --git a/cake/console/libs/templates/skel/config/bootstrap.php b/cake/console/libs/templates/skel/config/bootstrap.php index b817172c7..bede17125 100644 --- a/cake/console/libs/templates/skel/config/bootstrap.php +++ b/cake/console/libs/templates/skel/config/bootstrap.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config diff --git a/cake/console/libs/templates/skel/config/core.php b/cake/console/libs/templates/skel/config/core.php index fbd02e74a..bbc34d0f8 100644 --- a/cake/console/libs/templates/skel/config/core.php +++ b/cake/console/libs/templates/skel/config/core.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config diff --git a/cake/console/libs/templates/skel/config/database.php.default b/cake/console/libs/templates/skel/config/database.php.default index 5c20804d4..ac3e99dfe 100644 --- a/cake/console/libs/templates/skel/config/database.php.default +++ b/cake/console/libs/templates/skel/config/database.php.default @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config diff --git a/cake/console/libs/templates/skel/config/inflections.php b/cake/console/libs/templates/skel/config/inflections.php index ed8c08b3d..467b09c66 100644 --- a/cake/console/libs/templates/skel/config/inflections.php +++ b/cake/console/libs/templates/skel/config/inflections.php @@ -9,13 +9,13 @@ * PHP versions 4 and % * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config diff --git a/cake/console/libs/templates/skel/config/routes.php b/cake/console/libs/templates/skel/config/routes.php index b14e435c3..1bec77b10 100644 --- a/cake/console/libs/templates/skel/config/routes.php +++ b/cake/console/libs/templates/skel/config/routes.php @@ -10,13 +10,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config diff --git a/cake/console/libs/templates/skel/config/sql/db_acl.php b/cake/console/libs/templates/skel/config/sql/db_acl.php index 19434d0c6..dd6a1ac1b 100644 --- a/cake/console/libs/templates/skel/config/sql/db_acl.php +++ b/cake/console/libs/templates/skel/config/sql/db_acl.php @@ -9,13 +9,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config.sql diff --git a/cake/console/libs/templates/skel/config/sql/db_acl.sql b/cake/console/libs/templates/skel/config/sql/db_acl.sql index 3b8089bc3..d0e3298c0 100644 --- a/cake/console/libs/templates/skel/config/sql/db_acl.sql +++ b/cake/console/libs/templates/skel/config/sql/db_acl.sql @@ -1,6 +1,6 @@ # $Id$ # -# Copyright 2005-2008, Cake Software Foundation, Inc. +# Copyright 2005-2010, Cake Software Foundation, Inc. # # Licensed under The MIT License # Redistributions of files must retain the above copyright notice. diff --git a/cake/console/libs/templates/skel/config/sql/i18n.php b/cake/console/libs/templates/skel/config/sql/i18n.php index b8158dd5a..40c2957fe 100644 --- a/cake/console/libs/templates/skel/config/sql/i18n.php +++ b/cake/console/libs/templates/skel/config/sql/i18n.php @@ -9,13 +9,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config.sql diff --git a/cake/console/libs/templates/skel/config/sql/i18n.sql b/cake/console/libs/templates/skel/config/sql/i18n.sql index 7629b609a..4c71d05e5 100644 --- a/cake/console/libs/templates/skel/config/sql/i18n.sql +++ b/cake/console/libs/templates/skel/config/sql/i18n.sql @@ -1,6 +1,6 @@ # $Id$ # -# Copyright 2005-2008, Cake Software Foundation, Inc. +# Copyright 2005-2010, Cake Software Foundation, Inc. # # Licensed under The MIT License # Redistributions of files must retain the above copyright notice. diff --git a/cake/console/libs/templates/skel/config/sql/sessions.php b/cake/console/libs/templates/skel/config/sql/sessions.php index 197366108..334c0b9ce 100644 --- a/cake/console/libs/templates/skel/config/sql/sessions.php +++ b/cake/console/libs/templates/skel/config/sql/sessions.php @@ -9,13 +9,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.config.sql diff --git a/cake/console/libs/templates/skel/config/sql/sessions.sql b/cake/console/libs/templates/skel/config/sql/sessions.sql index 75be419a1..1564ae1d5 100644 --- a/cake/console/libs/templates/skel/config/sql/sessions.sql +++ b/cake/console/libs/templates/skel/config/sql/sessions.sql @@ -1,6 +1,6 @@ # $Id$ # -# Copyright 2005-2008, Cake Software Foundation, Inc. +# Copyright 2005-2010, Cake Software Foundation, Inc. # 1785 E. Sahara Avenue, Suite 490-204 # Las Vegas, Nevada 89104 # diff --git a/cake/console/libs/templates/skel/controllers/pages_controller.php b/cake/console/libs/templates/skel/controllers/pages_controller.php index 7013b6e17..ecbb51388 100644 --- a/cake/console/libs/templates/skel/controllers/pages_controller.php +++ b/cake/console/libs/templates/skel/controllers/pages_controller.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller diff --git a/cake/console/libs/templates/skel/index.php b/cake/console/libs/templates/skel/index.php index 5724a1c4b..057c1af3a 100644 --- a/cake/console/libs/templates/skel/index.php +++ b/cake/console/libs/templates/skel/index.php @@ -4,13 +4,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app diff --git a/cake/console/libs/templates/skel/views/elements/email/html/default.ctp b/cake/console/libs/templates/skel/views/elements/email/html/default.ctp index 6e51c0fd4..49a085a29 100644 --- a/cake/console/libs/templates/skel/views/elements/email/html/default.ctp +++ b/cake/console/libs/templates/skel/views/elements/email/html/default.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.elements.email.html diff --git a/cake/console/libs/templates/skel/views/elements/email/text/default.ctp b/cake/console/libs/templates/skel/views/elements/email/text/default.ctp index cbb261c64..284acea16 100644 --- a/cake/console/libs/templates/skel/views/elements/email/text/default.ctp +++ b/cake/console/libs/templates/skel/views/elements/email/text/default.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.elements.email.text diff --git a/cake/console/libs/templates/skel/views/layouts/ajax.ctp b/cake/console/libs/templates/skel/views/layouts/ajax.ctp index ca3459af8..e6bd065e0 100644 --- a/cake/console/libs/templates/skel/views/layouts/ajax.ctp +++ b/cake/console/libs/templates/skel/views/layouts/ajax.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts diff --git a/cake/console/libs/templates/skel/views/layouts/default.ctp b/cake/console/libs/templates/skel/views/layouts/default.ctp index 8cc346713..589f4f447 100644 --- a/cake/console/libs/templates/skel/views/layouts/default.ctp +++ b/cake/console/libs/templates/skel/views/layouts/default.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.templates.skel.views.layouts diff --git a/cake/console/libs/templates/skel/views/layouts/email/html/default.ctp b/cake/console/libs/templates/skel/views/layouts/email/html/default.ctp index 1853a7b3a..63573ac05 100644 --- a/cake/console/libs/templates/skel/views/layouts/email/html/default.ctp +++ b/cake/console/libs/templates/skel/views/layouts/email/html/default.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts.email.html diff --git a/cake/console/libs/templates/skel/views/layouts/email/text/default.ctp b/cake/console/libs/templates/skel/views/layouts/email/text/default.ctp index 77fda3bd6..9a0cf7835 100644 --- a/cake/console/libs/templates/skel/views/layouts/email/text/default.ctp +++ b/cake/console/libs/templates/skel/views/layouts/email/text/default.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts.email.text diff --git a/cake/console/libs/templates/skel/views/layouts/flash.ctp b/cake/console/libs/templates/skel/views/layouts/flash.ctp index ddd63085f..d02fa8571 100644 --- a/cake/console/libs/templates/skel/views/layouts/flash.ctp +++ b/cake/console/libs/templates/skel/views/layouts/flash.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts diff --git a/cake/console/libs/templates/skel/webroot/css.php b/cake/console/libs/templates/skel/webroot/css.php index 8c5e9ab0a..e475508ee 100644 --- a/cake/console/libs/templates/skel/webroot/css.php +++ b/cake/console/libs/templates/skel/webroot/css.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.webroot diff --git a/cake/console/libs/templates/skel/webroot/css/cake.generic.css b/cake/console/libs/templates/skel/webroot/css/cake.generic.css index 4ba03cedd..29773b983 100644 --- a/cake/console/libs/templates/skel/webroot/css/cake.generic.css +++ b/cake/console/libs/templates/skel/webroot/css/cake.generic.css @@ -4,13 +4,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.webroot.css diff --git a/cake/console/libs/templates/skel/webroot/index.php b/cake/console/libs/templates/skel/webroot/index.php index 01be9dd64..1a4d7ddef 100644 --- a/cake/console/libs/templates/skel/webroot/index.php +++ b/cake/console/libs/templates/skel/webroot/index.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.webroot diff --git a/cake/console/libs/templates/skel/webroot/js/vendors.php b/cake/console/libs/templates/skel/webroot/js/vendors.php index 5fda0b7b4..5c6181290 100644 --- a/cake/console/libs/templates/skel/webroot/js/vendors.php +++ b/cake/console/libs/templates/skel/webroot/js/vendors.php @@ -9,13 +9,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.app.webroot.js diff --git a/cake/console/libs/templates/skel/webroot/test.php b/cake/console/libs/templates/skel/webroot/test.php index 1d668947b..d0c4065a2 100644 --- a/cake/console/libs/templates/skel/webroot/test.php +++ b/cake/console/libs/templates/skel/webroot/test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs diff --git a/cake/console/libs/templates/views/form.ctp b/cake/console/libs/templates/views/form.ctp index fda3eddc9..07fddcf0c 100644 --- a/cake/console/libs/templates/views/form.ctp +++ b/cake/console/libs/templates/views/form.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.templates.views diff --git a/cake/console/libs/templates/views/index.ctp b/cake/console/libs/templates/views/index.ctp index 49c69dbab..fb089f9a3 100644 --- a/cake/console/libs/templates/views/index.ctp +++ b/cake/console/libs/templates/views/index.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.templates.views diff --git a/cake/console/libs/templates/views/view.ctp b/cake/console/libs/templates/views/view.ctp index e390bb02e..1a9c73d2c 100644 --- a/cake/console/libs/templates/views/view.ctp +++ b/cake/console/libs/templates/views/view.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.templates.views diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php index b11a7ea11..03408ba8b 100644 --- a/cake/console/libs/testsuite.php +++ b/cake/console/libs/testsuite.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.console.libs diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 69e6a3f31..7c241473c 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -9,13 +9,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake diff --git a/cake/libs/cache.php b/cake/libs/cache.php index aabd27951..ee39f42ca 100644 --- a/cake/libs/cache.php +++ b/cake/libs/cache.php @@ -7,13 +7,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/cache/apc.php b/cake/libs/cache/apc.php index 8e2a781a5..dcba88221 100644 --- a/cake/libs/cache/apc.php +++ b/cake/libs/cache/apc.php @@ -7,13 +7,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.cache diff --git a/cake/libs/cache/file.php b/cake/libs/cache/file.php index abbd5a0e6..ab17230dc 100644 --- a/cake/libs/cache/file.php +++ b/cake/libs/cache/file.php @@ -7,13 +7,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.cache diff --git a/cake/libs/cache/memcache.php b/cake/libs/cache/memcache.php index 4c87c10c2..b1f97b349 100644 --- a/cake/libs/cache/memcache.php +++ b/cake/libs/cache/memcache.php @@ -7,13 +7,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.cache diff --git a/cake/libs/cache/xcache.php b/cake/libs/cache/xcache.php index 1ed9b0b5a..211e46ddb 100644 --- a/cake/libs/cache/xcache.php +++ b/cake/libs/cache/xcache.php @@ -7,13 +7,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.cache diff --git a/cake/libs/cake_log.php b/cake/libs/cake_log.php index da779b2af..852f8fcb5 100644 --- a/cake/libs/cake_log.php +++ b/cake/libs/cake_log.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/class_registry.php b/cake/libs/class_registry.php index 2f566b46c..07b3a0599 100644 --- a/cake/libs/class_registry.php +++ b/cake/libs/class_registry.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 4f3388186..b9c2914de 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/controller/app_controller.php b/cake/libs/controller/app_controller.php index e791fa9fc..d15e034d1 100644 --- a/cake/libs/controller/app_controller.php +++ b/cake/libs/controller/app_controller.php @@ -9,13 +9,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php index c40571cda..27dab4efe 100644 --- a/cake/libs/controller/component.php +++ b/cake/libs/controller/component.php @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller diff --git a/cake/libs/controller/components/acl.php b/cake/libs/controller/components/acl.php index 3501e0b63..5caceceaa 100644 --- a/cake/libs/controller/components/acl.php +++ b/cake/libs/controller/components/acl.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller.components diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index 420305d57..abebeb0f5 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -9,13 +9,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller.components diff --git a/cake/libs/controller/components/cookie.php b/cake/libs/controller/components/cookie.php index f84770922..deaa2647a 100644 --- a/cake/libs/controller/components/cookie.php +++ b/cake/libs/controller/components/cookie.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller.components diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index 55b843958..6fa466cd7 100644 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller.components diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php index 2c61f82b2..e95b6bd79 100644 --- a/cake/libs/controller/components/request_handler.php +++ b/cake/libs/controller/components/request_handler.php @@ -8,13 +8,13 @@ * should respond to the different needs of a handheld computer and a desktop machine. * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller.components diff --git a/cake/libs/controller/components/security.php b/cake/libs/controller/components/security.php index 825292e20..52f0d3d9d 100644 --- a/cake/libs/controller/components/security.php +++ b/cake/libs/controller/components/security.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller.components diff --git a/cake/libs/controller/components/session.php b/cake/libs/controller/components/session.php index f5164d4a6..08b61cbca 100644 --- a/cake/libs/controller/components/session.php +++ b/cake/libs/controller/components/session.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller.components diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index f47a5eec5..253cfe4b6 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller diff --git a/cake/libs/controller/pages_controller.php b/cake/libs/controller/pages_controller.php index 7013b6e17..ecbb51388 100644 --- a/cake/libs/controller/pages_controller.php +++ b/cake/libs/controller/pages_controller.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller diff --git a/cake/libs/controller/scaffold.php b/cake/libs/controller/scaffold.php index 165e2b562..b2e1d93af 100644 --- a/cake/libs/controller/scaffold.php +++ b/cake/libs/controller/scaffold.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index 873b8a23c..4afa34b01 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/error.php b/cake/libs/error.php index e8db8276a..195dbf7d1 100644 --- a/cake/libs/error.php +++ b/cake/libs/error.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/file.php b/cake/libs/file.php index b57cb4c72..641f2e1e5 100644 --- a/cake/libs/file.php +++ b/cake/libs/file.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/flay.php b/cake/libs/flay.php index 7d33b4a5e..ec3c213b3 100644 --- a/cake/libs/flay.php +++ b/cake/libs/flay.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/folder.php b/cake/libs/folder.php index 54856531c..5f6154c96 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/http_socket.php b/cake/libs/http_socket.php index da8bd0268..44e4dfc2b 100644 --- a/cake/libs/http_socket.php +++ b/cake/libs/http_socket.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index 5b2be8db8..6eba0bae9 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index 05b03ce4e..2a94a84e1 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/l10n.php b/cake/libs/l10n.php index 7000a808b..a0acb162d 100644 --- a/cake/libs/l10n.php +++ b/cake/libs/l10n.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/magic_db.php b/cake/libs/magic_db.php index 9d7d90bb2..37396618c 100644 --- a/cake/libs/magic_db.php +++ b/cake/libs/magic_db.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/model/app_model.php b/cake/libs/model/app_model.php index 120aa563c..a311329c8 100644 --- a/cake/libs/model/app_model.php +++ b/cake/libs/model/app_model.php @@ -9,13 +9,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model diff --git a/cake/libs/model/behavior.php b/cake/libs/model/behavior.php index 0f994c2c9..368f2a18e 100644 --- a/cake/libs/model/behavior.php +++ b/cake/libs/model/behavior.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model diff --git a/cake/libs/model/behaviors/acl.php b/cake/libs/model/behaviors/acl.php index 0b867a2ca..01de82dca 100644 --- a/cake/libs/model/behaviors/acl.php +++ b/cake/libs/model/behaviors/acl.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.libs.model.behaviors diff --git a/cake/libs/model/behaviors/containable.php b/cake/libs/model/behaviors/containable.php index b5e8eadf9..52f519ac4 100644 --- a/cake/libs/model/behaviors/containable.php +++ b/cake/libs/model/behaviors/containable.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs diff --git a/cake/libs/model/behaviors/translate.php b/cake/libs/model/behaviors/translate.php index 7e959f50c..64011295b 100644 --- a/cake/libs/model/behaviors/translate.php +++ b/cake/libs/model/behaviors/translate.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.behaviors diff --git a/cake/libs/model/behaviors/tree.php b/cake/libs/model/behaviors/tree.php index fd4a89993..addd8c6c2 100644 --- a/cake/libs/model/behaviors/tree.php +++ b/cake/libs/model/behaviors/tree.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.libs.model.behaviors diff --git a/cake/libs/model/connection_manager.php b/cake/libs/model/connection_manager.php index a0db47226..428a77e32 100644 --- a/cake/libs/model/connection_manager.php +++ b/cake/libs/model/connection_manager.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model diff --git a/cake/libs/model/datasources/datasource.php b/cake/libs/model/datasources/datasource.php index fa7b6632d..835ba3a1d 100644 --- a/cake/libs/model/datasources/datasource.php +++ b/cake/libs/model/datasources/datasource.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources diff --git a/cake/libs/model/datasources/dbo/dbo_adodb.php b/cake/libs/model/datasources/dbo/dbo_adodb.php index 7feda9885..94badf16b 100644 --- a/cake/libs/model/datasources/dbo/dbo_adodb.php +++ b/cake/libs/model/datasources/dbo/dbo_adodb.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources.dbo diff --git a/cake/libs/model/datasources/dbo/dbo_db2.php b/cake/libs/model/datasources/dbo/dbo_db2.php index 0942dee85..100b28535 100644 --- a/cake/libs/model/datasources/dbo/dbo_db2.php +++ b/cake/libs/model/datasources/dbo/dbo_db2.php @@ -16,7 +16,7 @@ * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources.dbo diff --git a/cake/libs/model/datasources/dbo/dbo_firebird.php b/cake/libs/model/datasources/dbo/dbo_firebird.php index dc9cec15f..f1c29e5b9 100644 --- a/cake/libs/model/datasources/dbo/dbo_firebird.php +++ b/cake/libs/model/datasources/dbo/dbo_firebird.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.dbo diff --git a/cake/libs/model/datasources/dbo/dbo_mssql.php b/cake/libs/model/datasources/dbo/dbo_mssql.php index df0eaa66c..18c138364 100644 --- a/cake/libs/model/datasources/dbo/dbo_mssql.php +++ b/cake/libs/model/datasources/dbo/dbo_mssql.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources.dbo diff --git a/cake/libs/model/datasources/dbo/dbo_mysql.php b/cake/libs/model/datasources/dbo/dbo_mysql.php index 741a8c072..94962a8b7 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysql.php +++ b/cake/libs/model/datasources/dbo/dbo_mysql.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources.dbo diff --git a/cake/libs/model/datasources/dbo/dbo_mysqli.php b/cake/libs/model/datasources/dbo/dbo_mysqli.php index cb78e110d..cc506e5a2 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysqli.php +++ b/cake/libs/model/datasources/dbo/dbo_mysqli.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources.dbo diff --git a/cake/libs/model/datasources/dbo/dbo_odbc.php b/cake/libs/model/datasources/dbo/dbo_odbc.php index c6af41d25..64ab17d51 100644 --- a/cake/libs/model/datasources/dbo/dbo_odbc.php +++ b/cake/libs/model/datasources/dbo/dbo_odbc.php @@ -9,13 +9,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.dbo diff --git a/cake/libs/model/datasources/dbo/dbo_oracle.php b/cake/libs/model/datasources/dbo/dbo_oracle.php index 92c81e897..f74c18766 100644 --- a/cake/libs/model/datasources/dbo/dbo_oracle.php +++ b/cake/libs/model/datasources/dbo/dbo_oracle.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources.dbo diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index 9dc21da27..e2c0d8ce3 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -9,13 +9,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources.dbo diff --git a/cake/libs/model/datasources/dbo/dbo_sqlite.php b/cake/libs/model/datasources/dbo/dbo_sqlite.php index 1423aadcf..dea7385bc 100644 --- a/cake/libs/model/datasources/dbo/dbo_sqlite.php +++ b/cake/libs/model/datasources/dbo/dbo_sqlite.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources.dbo diff --git a/cake/libs/model/datasources/dbo/dbo_sybase.php b/cake/libs/model/datasources/dbo/dbo_sybase.php index 45e8fd057..5e30bfe3b 100644 --- a/cake/libs/model/datasources/dbo/dbo_sybase.php +++ b/cake/libs/model/datasources/dbo/dbo_sybase.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources.dbo diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 444f0244a..5de4db2ee 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources diff --git a/cake/libs/model/db_acl.php b/cake/libs/model/db_acl.php index a2a943cf6..aae5f718d 100644 --- a/cake/libs/model/db_acl.php +++ b/cake/libs/model/db_acl.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index c7fd52c6c..01b05c186 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -8,13 +8,13 @@ * PHP versions 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model diff --git a/cake/libs/model/schema.php b/cake/libs/model/schema.php index d1a455290..5de4a5e84 100644 --- a/cake/libs/model/schema.php +++ b/cake/libs/model/schema.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model diff --git a/cake/libs/multibyte.php b/cake/libs/multibyte.php index 1dfcd456b..74c884e95 100644 --- a/cake/libs/multibyte.php +++ b/cake/libs/multibyte.php @@ -7,13 +7,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/object.php b/cake/libs/object.php index 61c0896cd..7a8ddfd33 100644 --- a/cake/libs/object.php +++ b/cake/libs/object.php @@ -9,13 +9,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/overloadable.php b/cake/libs/overloadable.php index a3b170a08..c58a4986b 100644 --- a/cake/libs/overloadable.php +++ b/cake/libs/overloadable.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/overloadable_php4.php b/cake/libs/overloadable_php4.php index b60411c53..1e0750a17 100644 --- a/cake/libs/overloadable_php4.php +++ b/cake/libs/overloadable_php4.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/overloadable_php5.php b/cake/libs/overloadable_php5.php index 906b6b378..d78a8ab91 100644 --- a/cake/libs/overloadable_php5.php +++ b/cake/libs/overloadable_php5.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/router.php b/cake/libs/router.php index d1d95ca08..dc22a29ef 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/sanitize.php b/cake/libs/sanitize.php index 8ed84a455..d81ab567c 100644 --- a/cake/libs/sanitize.php +++ b/cake/libs/sanitize.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/security.php b/cake/libs/security.php index 15ec7c1bb..72b453a03 100644 --- a/cake/libs/security.php +++ b/cake/libs/security.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/session.php b/cake/libs/session.php index 005fe9b30..cc4d41524 100644 --- a/cake/libs/session.php +++ b/cake/libs/session.php @@ -11,13 +11,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/set.php b/cake/libs/set.php index cb9990c07..8a83d3c7f 100644 --- a/cake/libs/set.php +++ b/cake/libs/set.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/socket.php b/cake/libs/socket.php index c5c945aa0..9308b0a2c 100644 --- a/cake/libs/socket.php +++ b/cake/libs/socket.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/string.php b/cake/libs/string.php index 286017bdb..279e84732 100644 --- a/cake/libs/string.php +++ b/cake/libs/string.php @@ -7,13 +7,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/validation.php b/cake/libs/validation.php index 22a1d1f62..5939bfa06 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/view/elements/dump.ctp b/cake/libs/view/elements/dump.ctp index 54c59acf6..9b1f807a3 100644 --- a/cake/libs/view/elements/dump.ctp +++ b/cake/libs/view/elements/dump.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.elements diff --git a/cake/libs/view/elements/email/html/default.ctp b/cake/libs/view/elements/email/html/default.ctp index 6e51c0fd4..49a085a29 100644 --- a/cake/libs/view/elements/email/html/default.ctp +++ b/cake/libs/view/elements/email/html/default.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.elements.email.html diff --git a/cake/libs/view/elements/email/text/default.ctp b/cake/libs/view/elements/email/text/default.ctp index cbb261c64..284acea16 100644 --- a/cake/libs/view/elements/email/text/default.ctp +++ b/cake/libs/view/elements/email/text/default.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.elements.email.text diff --git a/cake/libs/view/errors/error404.ctp b/cake/libs/view/errors/error404.ctp index b849db72f..aa6dcd9ab 100644 --- a/cake/libs/view/errors/error404.ctp +++ b/cake/libs/view/errors/error404.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors diff --git a/cake/libs/view/errors/missing_action.ctp b/cake/libs/view/errors/missing_action.ctp index 0de1c6cc3..00b65e886 100644 --- a/cake/libs/view/errors/missing_action.ctp +++ b/cake/libs/view/errors/missing_action.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors diff --git a/cake/libs/view/errors/missing_component_class.ctp b/cake/libs/view/errors/missing_component_class.ctp index ec154de02..7171c32c9 100644 --- a/cake/libs/view/errors/missing_component_class.ctp +++ b/cake/libs/view/errors/missing_component_class.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors diff --git a/cake/libs/view/errors/missing_component_file.ctp b/cake/libs/view/errors/missing_component_file.ctp index 3b8b874fb..fa44f497e 100644 --- a/cake/libs/view/errors/missing_component_file.ctp +++ b/cake/libs/view/errors/missing_component_file.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors diff --git a/cake/libs/view/errors/missing_connection.ctp b/cake/libs/view/errors/missing_connection.ctp index 1a1c1ad4a..66fd3500e 100644 --- a/cake/libs/view/errors/missing_connection.ctp +++ b/cake/libs/view/errors/missing_connection.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors diff --git a/cake/libs/view/errors/missing_controller.ctp b/cake/libs/view/errors/missing_controller.ctp index 676747284..acad3e50a 100644 --- a/cake/libs/view/errors/missing_controller.ctp +++ b/cake/libs/view/errors/missing_controller.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors diff --git a/cake/libs/view/errors/missing_helper_class.ctp b/cake/libs/view/errors/missing_helper_class.ctp index e1f464cdd..9718ae33c 100644 --- a/cake/libs/view/errors/missing_helper_class.ctp +++ b/cake/libs/view/errors/missing_helper_class.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors diff --git a/cake/libs/view/errors/missing_helper_file.ctp b/cake/libs/view/errors/missing_helper_file.ctp index 34d6d5dc7..5c33ca213 100644 --- a/cake/libs/view/errors/missing_helper_file.ctp +++ b/cake/libs/view/errors/missing_helper_file.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors diff --git a/cake/libs/view/errors/missing_layout.ctp b/cake/libs/view/errors/missing_layout.ctp index cb8445a44..c86a48d8b 100644 --- a/cake/libs/view/errors/missing_layout.ctp +++ b/cake/libs/view/errors/missing_layout.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors diff --git a/cake/libs/view/errors/missing_model.ctp b/cake/libs/view/errors/missing_model.ctp index c2d64e95f..bcd421fb8 100644 --- a/cake/libs/view/errors/missing_model.ctp +++ b/cake/libs/view/errors/missing_model.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors diff --git a/cake/libs/view/errors/missing_scaffolddb.ctp b/cake/libs/view/errors/missing_scaffolddb.ctp index 443199224..f694fbc7b 100644 --- a/cake/libs/view/errors/missing_scaffolddb.ctp +++ b/cake/libs/view/errors/missing_scaffolddb.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors diff --git a/cake/libs/view/errors/missing_table.ctp b/cake/libs/view/errors/missing_table.ctp index 1bdc59f69..e8be76f3d 100644 --- a/cake/libs/view/errors/missing_table.ctp +++ b/cake/libs/view/errors/missing_table.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors diff --git a/cake/libs/view/errors/missing_view.ctp b/cake/libs/view/errors/missing_view.ctp index 737da88c0..aefdae41b 100644 --- a/cake/libs/view/errors/missing_view.ctp +++ b/cake/libs/view/errors/missing_view.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors diff --git a/cake/libs/view/errors/private_action.ctp b/cake/libs/view/errors/private_action.ctp index 6d9e92c70..35d630529 100644 --- a/cake/libs/view/errors/private_action.ctp +++ b/cake/libs/view/errors/private_action.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors diff --git a/cake/libs/view/errors/scaffold_error.ctp b/cake/libs/view/errors/scaffold_error.ctp index 9ce156af7..09dc0eb52 100644 --- a/cake/libs/view/errors/scaffold_error.ctp +++ b/cake/libs/view/errors/scaffold_error.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index 3cdec2c2f..d4a873f76 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view diff --git a/cake/libs/view/helpers/ajax.php b/cake/libs/view/helpers/ajax.php index d2eda08db..c2bbb5ba0 100644 --- a/cake/libs/view/helpers/ajax.php +++ b/cake/libs/view/helpers/ajax.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers diff --git a/cake/libs/view/helpers/app_helper.php b/cake/libs/view/helpers/app_helper.php index c57f438b8..3b751a8b4 100644 --- a/cake/libs/view/helpers/app_helper.php +++ b/cake/libs/view/helpers/app_helper.php @@ -9,13 +9,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake diff --git a/cake/libs/view/helpers/cache.php b/cake/libs/view/helpers/cache.php index f27663b4f..58757c77e 100644 --- a/cake/libs/view/helpers/cache.php +++ b/cake/libs/view/helpers/cache.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 6e47d44cf..62982ee75 100644 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php index 43b885a34..044a511a7 100644 --- a/cake/libs/view/helpers/html.php +++ b/cake/libs/view/helpers/html.php @@ -6,13 +6,13 @@ * Simplifies the construction of HTML elements. * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers diff --git a/cake/libs/view/helpers/javascript.php b/cake/libs/view/helpers/javascript.php index 29ee2281a..f07a6cedc 100644 --- a/cake/libs/view/helpers/javascript.php +++ b/cake/libs/view/helpers/javascript.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index b13bc9c33..c8f46a439 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.libs.view.helpers diff --git a/cake/libs/view/helpers/number.php b/cake/libs/view/helpers/number.php index 6c814e0f8..5e240d679 100644 --- a/cake/libs/view/helpers/number.php +++ b/cake/libs/view/helpers/number.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index 9fa185ddc..92c814a33 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -6,13 +6,13 @@ * Generates pagination links * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers diff --git a/cake/libs/view/helpers/rss.php b/cake/libs/view/helpers/rss.php index 5b8cb8362..6de685ebb 100644 --- a/cake/libs/view/helpers/rss.php +++ b/cake/libs/view/helpers/rss.php @@ -6,13 +6,13 @@ * Simplifies the output of RSS feeds. * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers diff --git a/cake/libs/view/helpers/session.php b/cake/libs/view/helpers/session.php index d78170ab1..e69658e84 100644 --- a/cake/libs/view/helpers/session.php +++ b/cake/libs/view/helpers/session.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers diff --git a/cake/libs/view/helpers/text.php b/cake/libs/view/helpers/text.php index fb687a1bb..737681ef9 100644 --- a/cake/libs/view/helpers/text.php +++ b/cake/libs/view/helpers/text.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers diff --git a/cake/libs/view/helpers/time.php b/cake/libs/view/helpers/time.php index fbd5cef7e..e9d0feca9 100644 --- a/cake/libs/view/helpers/time.php +++ b/cake/libs/view/helpers/time.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers diff --git a/cake/libs/view/helpers/xml.php b/cake/libs/view/helpers/xml.php index 53fd1382c..ab6810eb7 100644 --- a/cake/libs/view/helpers/xml.php +++ b/cake/libs/view/helpers/xml.php @@ -6,13 +6,13 @@ * Simplifies the output of XML documents. * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers diff --git a/cake/libs/view/layouts/ajax.ctp b/cake/libs/view/layouts/ajax.ctp index ca3459af8..e6bd065e0 100644 --- a/cake/libs/view/layouts/ajax.ctp +++ b/cake/libs/view/layouts/ajax.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts diff --git a/cake/libs/view/layouts/default.ctp b/cake/libs/view/layouts/default.ctp index 3b6fac081..9be4e143d 100644 --- a/cake/libs/view/layouts/default.ctp +++ b/cake/libs/view/layouts/default.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts diff --git a/cake/libs/view/layouts/email/html/default.ctp b/cake/libs/view/layouts/email/html/default.ctp index a41315a3a..1467a8847 100644 --- a/cake/libs/view/layouts/email/html/default.ctp +++ b/cake/libs/view/layouts/email/html/default.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts.email.html diff --git a/cake/libs/view/layouts/email/text/default.ctp b/cake/libs/view/layouts/email/text/default.ctp index 4b0b62c41..502a393fc 100644 --- a/cake/libs/view/layouts/email/text/default.ctp +++ b/cake/libs/view/layouts/email/text/default.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts.email.text diff --git a/cake/libs/view/layouts/flash.ctp b/cake/libs/view/layouts/flash.ctp index d896896eb..44b388f28 100644 --- a/cake/libs/view/layouts/flash.ctp +++ b/cake/libs/view/layouts/flash.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts diff --git a/cake/libs/view/media.php b/cake/libs/view/media.php index 5be837840..1738036fd 100644 --- a/cake/libs/view/media.php +++ b/cake/libs/view/media.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view diff --git a/cake/libs/view/pages/home.ctp b/cake/libs/view/pages/home.ctp index 46af7f332..61c427c60 100644 --- a/cake/libs/view/pages/home.ctp +++ b/cake/libs/view/pages/home.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.pages diff --git a/cake/libs/view/scaffolds/edit.ctp b/cake/libs/view/scaffolds/edit.ctp index 6705b4bf4..36b4e845e 100644 --- a/cake/libs/view/scaffolds/edit.ctp +++ b/cake/libs/view/scaffolds/edit.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.scaffolds diff --git a/cake/libs/view/scaffolds/index.ctp b/cake/libs/view/scaffolds/index.ctp index c5b9e0e7f..c67553b46 100644 --- a/cake/libs/view/scaffolds/index.ctp +++ b/cake/libs/view/scaffolds/index.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.templates.views diff --git a/cake/libs/view/scaffolds/view.ctp b/cake/libs/view/scaffolds/view.ctp index a497ca673..5b3572c0e 100644 --- a/cake/libs/view/scaffolds/view.ctp +++ b/cake/libs/view/scaffolds/view.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.scaffolds diff --git a/cake/libs/view/theme.php b/cake/libs/view/theme.php index 4167c810f..594cdb117 100644 --- a/cake/libs/view/theme.php +++ b/cake/libs/view/theme.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index 655e6d266..44f9437fe 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view diff --git a/cake/libs/xml.php b/cake/libs/xml.php index 574bfe2bb..ad8cf15e0 100644 --- a/cake/libs/xml.php +++ b/cake/libs/xml.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/tests/cases/basics.test.php b/cake/tests/cases/basics.test.php index 800cb7dc3..8920c0bc3 100644 --- a/cake/tests/cases/basics.test.php +++ b/cake/tests/cases/basics.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases diff --git a/cake/tests/cases/console/cake.test.php b/cake/tests/cases/console/cake.test.php index 6eda913f8..949fede8a 100644 --- a/cake/tests/cases/console/cake.test.php +++ b/cake/tests/cases/console/cake.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2007, Cake Software Foundation, Inc. + * Copyright 2005-2010, Cake Software Foundation, Inc. * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2007, Cake Software Foundation, Inc. + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.console diff --git a/cake/tests/cases/console/libs/acl.test.php b/cake/tests/cases/console/libs/acl.test.php index f27a69436..55dff3402 100644 --- a/cake/tests/cases/console/libs/acl.test.php +++ b/cake/tests/cases/console/libs/acl.test.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.cases.console.libs.tasks diff --git a/cake/tests/cases/console/libs/api.test.php b/cake/tests/cases/console/libs/api.test.php index b5568fce7..1d089b179 100644 --- a/cake/tests/cases/console/libs/api.test.php +++ b/cake/tests/cases/console/libs/api.test.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.cases.console.libs.tasks diff --git a/cake/tests/cases/console/libs/schema.test.php b/cake/tests/cases/console/libs/schema.test.php index 063910dbf..e4cf0a856 100644 --- a/cake/tests/cases/console/libs/schema.test.php +++ b/cake/tests/cases/console/libs/schema.test.php @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2009, Cake Software Foundation, Inc. + * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2009, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.cases.console.libs.Shells diff --git a/cake/tests/cases/console/libs/shell.test.php b/cake/tests/cases/console/libs/shell.test.php index b832088e5..ec50f577b 100644 --- a/cake/tests/cases/console/libs/shell.test.php +++ b/cake/tests/cases/console/libs/shell.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.cases.console.libs diff --git a/cake/tests/cases/console/libs/tasks/extract.test.php b/cake/tests/cases/console/libs/tasks/extract.test.php index d393a5275..37e79dc27 100644 --- a/cake/tests/cases/console/libs/tasks/extract.test.php +++ b/cake/tests/cases/console/libs/tasks/extract.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.cases.console.libs.tasks diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index a2e7f5c54..f61262f21 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2009, Cake Software Foundation, Inc. + * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2009, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.cases.console.libs.tasks diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index 548f29606..b646dc554 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.cases.console.libs.tasks diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index bc6515f01..98f6312fb 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases diff --git a/cake/tests/cases/libs/cache.test.php b/cake/tests/cases/libs/cache.test.php index 37d5ec633..82ed7762f 100644 --- a/cake/tests/cases/libs/cache.test.php +++ b/cake/tests/cases/libs/cache.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/cache/apc.test.php b/cake/tests/cases/libs/cache/apc.test.php index 5dd30c502..2f75cf9e2 100644 --- a/cake/tests/cases/libs/cache/apc.test.php +++ b/cake/tests/cases/libs/cache/apc.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.cache diff --git a/cake/tests/cases/libs/cache/file.test.php b/cake/tests/cases/libs/cache/file.test.php index 89ee671bc..4bc0ab3d0 100644 --- a/cake/tests/cases/libs/cache/file.test.php +++ b/cake/tests/cases/libs/cache/file.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.cache diff --git a/cake/tests/cases/libs/cache/memcache.test.php b/cake/tests/cases/libs/cache/memcache.test.php index d26f360e8..aa56459ec 100644 --- a/cake/tests/cases/libs/cache/memcache.test.php +++ b/cake/tests/cases/libs/cache/memcache.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.cache diff --git a/cake/tests/cases/libs/cache/xcache.test.php b/cake/tests/cases/libs/cache/xcache.test.php index 842cbfa7b..818d10ada 100644 --- a/cake/tests/cases/libs/cache/xcache.test.php +++ b/cake/tests/cases/libs/cache/xcache.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.cache diff --git a/cake/tests/cases/libs/cake_log.test.php b/cake/tests/cases/libs/cake_log.test.php index 05dc39452..8ab46ca9a 100644 --- a/cake/tests/cases/libs/cake_log.test.php +++ b/cake/tests/cases/libs/cake_log.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/cake_test_case.test.php b/cake/tests/cases/libs/cake_test_case.test.php index 930683c75..5340f8f5d 100644 --- a/cake/tests/cases/libs/cake_test_case.test.php +++ b/cake/tests/cases/libs/cake_test_case.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.libs. diff --git a/cake/tests/cases/libs/cake_test_fixture.test.php b/cake/tests/cases/libs/cake_test_fixture.test.php index d5844bc6c..b2e438abb 100644 --- a/cake/tests/cases/libs/cake_test_fixture.test.php +++ b/cake/tests/cases/libs/cake_test_fixture.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs diff --git a/cake/tests/cases/libs/class_registry.test.php b/cake/tests/cases/libs/class_registry.test.php index d40ed0e83..e8dd6886d 100644 --- a/cake/tests/cases/libs/class_registry.test.php +++ b/cake/tests/cases/libs/class_registry.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/code_coverage_manager.test.php b/cake/tests/cases/libs/code_coverage_manager.test.php index 9a1e6c41e..af1ae0b73 100644 --- a/cake/tests/cases/libs/code_coverage_manager.test.php +++ b/cake/tests/cases/libs/code_coverage_manager.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/configure.test.php b/cake/tests/cases/libs/configure.test.php index 54f1aa59c..af0f26402 100644 --- a/cake/tests/cases/libs/configure.test.php +++ b/cake/tests/cases/libs/configure.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/controller/component.test.php b/cake/tests/cases/libs/controller/component.test.php index 8ab7227c2..cf1386cd7 100644 --- a/cake/tests/cases/libs/controller/component.test.php +++ b/cake/tests/cases/libs/controller/component.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller diff --git a/cake/tests/cases/libs/controller/components/acl.test.php b/cake/tests/cases/libs/controller/components/acl.test.php index 755d7ae19..2daff3f67 100644 --- a/cake/tests/cases/libs/controller/components/acl.test.php +++ b/cake/tests/cases/libs/controller/components/acl.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller.components diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php index 481b2dd5f..04bb9acce 100644 --- a/cake/tests/cases/libs/controller/components/auth.test.php +++ b/cake/tests/cases/libs/controller/components/auth.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.cases.libs.controller.components diff --git a/cake/tests/cases/libs/controller/components/cookie.test.php b/cake/tests/cases/libs/controller/components/cookie.test.php index 5d8d87aa0..c5ebef42b 100644 --- a/cake/tests/cases/libs/controller/components/cookie.test.php +++ b/cake/tests/cases/libs/controller/components/cookie.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller.components diff --git a/cake/tests/cases/libs/controller/components/email.test.php b/cake/tests/cases/libs/controller/components/email.test.php index 8baf95e4b..32c97be30 100644 --- a/cake/tests/cases/libs/controller/components/email.test.php +++ b/cake/tests/cases/libs/controller/components/email.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.cases.libs.controller.components diff --git a/cake/tests/cases/libs/controller/components/request_handler.test.php b/cake/tests/cases/libs/controller/components/request_handler.test.php index e0adee344..24ce58218 100644 --- a/cake/tests/cases/libs/controller/components/request_handler.test.php +++ b/cake/tests/cases/libs/controller/components/request_handler.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller.components diff --git a/cake/tests/cases/libs/controller/components/security.test.php b/cake/tests/cases/libs/controller/components/security.test.php index cc7798aa4..111aa0cb9 100644 --- a/cake/tests/cases/libs/controller/components/security.test.php +++ b/cake/tests/cases/libs/controller/components/security.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller.components diff --git a/cake/tests/cases/libs/controller/components/session.test.php b/cake/tests/cases/libs/controller/components/session.test.php index b79f043c9..4b6dd69ba 100644 --- a/cake/tests/cases/libs/controller/components/session.test.php +++ b/cake/tests/cases/libs/controller/components/session.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller.components diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index 4b978a03e..a522bc252 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller diff --git a/cake/tests/cases/libs/controller/controller_merge_vars.test.php b/cake/tests/cases/libs/controller/controller_merge_vars.test.php index 4ca4db328..b0a5a3733 100644 --- a/cake/tests/cases/libs/controller/controller_merge_vars.test.php +++ b/cake/tests/cases/libs/controller/controller_merge_vars.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller diff --git a/cake/tests/cases/libs/controller/pages_controller.test.php b/cake/tests/cases/libs/controller/pages_controller.test.php index 66980e744..50fdd5177 100644 --- a/cake/tests/cases/libs/controller/pages_controller.test.php +++ b/cake/tests/cases/libs/controller/pages_controller.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller diff --git a/cake/tests/cases/libs/controller/scaffold.test.php b/cake/tests/cases/libs/controller/scaffold.test.php index 72cab3eb9..729523253 100644 --- a/cake/tests/cases/libs/controller/scaffold.test.php +++ b/cake/tests/cases/libs/controller/scaffold.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller diff --git a/cake/tests/cases/libs/debugger.test.php b/cake/tests/cases/libs/debugger.test.php index 8f57cbbd0..0dd77a6b6 100644 --- a/cake/tests/cases/libs/debugger.test.php +++ b/cake/tests/cases/libs/debugger.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/error.test.php b/cake/tests/cases/libs/error.test.php index e3d233e1e..2a13f5e56 100644 --- a/cake/tests/cases/libs/error.test.php +++ b/cake/tests/cases/libs/error.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/file.test.php b/cake/tests/cases/libs/file.test.php index f0d64a7bf..2a395d0ac 100644 --- a/cake/tests/cases/libs/file.test.php +++ b/cake/tests/cases/libs/file.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/flay.test.php b/cake/tests/cases/libs/flay.test.php index 79e55c95e..c064ff5e3 100644 --- a/cake/tests/cases/libs/flay.test.php +++ b/cake/tests/cases/libs/flay.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/folder.test.php b/cake/tests/cases/libs/folder.test.php index 0793630c2..c01cb86a8 100644 --- a/cake/tests/cases/libs/folder.test.php +++ b/cake/tests/cases/libs/folder.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/http_socket.test.php b/cake/tests/cases/libs/http_socket.test.php index 581e1c697..49e3ed58e 100644 --- a/cake/tests/cases/libs/http_socket.test.php +++ b/cake/tests/cases/libs/http_socket.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/i18n.test.php b/cake/tests/cases/libs/i18n.test.php index 01b271871..3d395d26e 100644 --- a/cake/tests/cases/libs/i18n.test.php +++ b/cake/tests/cases/libs/i18n.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/inflector.test.php b/cake/tests/cases/libs/inflector.test.php index 3823dbc72..d99bdcb2b 100644 --- a/cake/tests/cases/libs/inflector.test.php +++ b/cake/tests/cases/libs/inflector.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/l10n.test.php b/cake/tests/cases/libs/l10n.test.php index 48df8fa3c..5687571fe 100644 --- a/cake/tests/cases/libs/l10n.test.php +++ b/cake/tests/cases/libs/l10n.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/magic_db.test.php b/cake/tests/cases/libs/magic_db.test.php index 7ab7b642e..1be3c30cb 100644 --- a/cake/tests/cases/libs/magic_db.test.php +++ b/cake/tests/cases/libs/magic_db.test.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/tests/cases/libs/model/behaviors/acl.test.php b/cake/tests/cases/libs/model/behaviors/acl.test.php index 4c8f70750..102d75884 100644 --- a/cake/tests/cases/libs/model/behaviors/acl.test.php +++ b/cake/tests/cases/libs/model/behaviors/acl.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.libs.tests.model.behaviors.acl diff --git a/cake/tests/cases/libs/model/behaviors/containable.test.php b/cake/tests/cases/libs/model/behaviors/containable.test.php index d5ae197c8..99aa304c2 100644 --- a/cake/tests/cases/libs/model/behaviors/containable.test.php +++ b/cake/tests/cases/libs/model/behaviors/containable.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model.behaviors diff --git a/cake/tests/cases/libs/model/behaviors/translate.test.php b/cake/tests/cases/libs/model/behaviors/translate.test.php index 3ec69f02b..3914dec46 100644 --- a/cake/tests/cases/libs/model/behaviors/translate.test.php +++ b/cake/tests/cases/libs/model/behaviors/translate.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model.behaviors diff --git a/cake/tests/cases/libs/model/behaviors/tree.test.php b/cake/tests/cases/libs/model/behaviors/tree.test.php index 86834122b..8f58ac003 100644 --- a/cake/tests/cases/libs/model/behaviors/tree.test.php +++ b/cake/tests/cases/libs/model/behaviors/tree.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model.behaviors diff --git a/cake/tests/cases/libs/model/connection_manager.test.php b/cake/tests/cases/libs/model/connection_manager.test.php index 4bc226854..00b850b02 100644 --- a/cake/tests/cases/libs/model/connection_manager.test.php +++ b/cake/tests/cases/libs/model/connection_manager.test.php @@ -6,13 +6,13 @@ * * PHP versions 4 and 5 * - * Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_adodb.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_adodb.test.php index 45f71fe16..55acd701e 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_adodb.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_adodb.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources.dbo diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php index b883abce8..fa969cb86 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php index 26a9bc9c0..1f4a4f919 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php index 2e1e87a66..0431f7d7f 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php index 6b835890a..af956e4dc 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php index ff6588668..2c2b628d9 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php index 2f1ea4ad6..e4e0fbcf7 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index 3dbe92991..321574ee6 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model.datasources diff --git a/cake/tests/cases/libs/model/db_acl.test.php b/cake/tests/cases/libs/model/db_acl.test.php index 82d4d15ad..2de13d0a0 100644 --- a/cake/tests/cases/libs/model/db_acl.test.php +++ b/cake/tests/cases/libs/model/db_acl.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller.components.dbacl.models diff --git a/cake/tests/cases/libs/model/model.test.php b/cake/tests/cases/libs/model/model.test.php index 1c688c781..bf420f6a4 100644 --- a/cake/tests/cases/libs/model/model.test.php +++ b/cake/tests/cases/libs/model/model.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model diff --git a/cake/tests/cases/libs/model/model_delete.test.php b/cake/tests/cases/libs/model/model_delete.test.php index 2be205e92..0742d80d0 100644 --- a/cake/tests/cases/libs/model/model_delete.test.php +++ b/cake/tests/cases/libs/model/model_delete.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model diff --git a/cake/tests/cases/libs/model/model_integration.test.php b/cake/tests/cases/libs/model/model_integration.test.php index cc1d8b20c..43cd16e47 100644 --- a/cake/tests/cases/libs/model/model_integration.test.php +++ b/cake/tests/cases/libs/model/model_integration.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model diff --git a/cake/tests/cases/libs/model/model_read.test.php b/cake/tests/cases/libs/model/model_read.test.php index 2a183d159..2f52bc525 100644 --- a/cake/tests/cases/libs/model/model_read.test.php +++ b/cake/tests/cases/libs/model/model_read.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model diff --git a/cake/tests/cases/libs/model/model_validation.test.php b/cake/tests/cases/libs/model/model_validation.test.php index 54aa474e3..7f452bedd 100644 --- a/cake/tests/cases/libs/model/model_validation.test.php +++ b/cake/tests/cases/libs/model/model_validation.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model diff --git a/cake/tests/cases/libs/model/model_write.test.php b/cake/tests/cases/libs/model/model_write.test.php index 31388b2d6..ea216e5f9 100644 --- a/cake/tests/cases/libs/model/model_write.test.php +++ b/cake/tests/cases/libs/model/model_write.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model diff --git a/cake/tests/cases/libs/model/models.php b/cake/tests/cases/libs/model/models.php index cb2089679..27829184f 100644 --- a/cake/tests/cases/libs/model/models.php +++ b/cake/tests/cases/libs/model/models.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model diff --git a/cake/tests/cases/libs/model/schema.test.php b/cake/tests/cases/libs/model/schema.test.php index fc35f5c13..2a00095d1 100644 --- a/cake/tests/cases/libs/model/schema.test.php +++ b/cake/tests/cases/libs/model/schema.test.php @@ -7,13 +7,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/multibyte.test.php b/cake/tests/cases/libs/multibyte.test.php index dd0ea371c..b33cc3798 100644 --- a/cake/tests/cases/libs/multibyte.test.php +++ b/cake/tests/cases/libs/multibyte.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/object.test.php b/cake/tests/cases/libs/object.test.php index 3ce6fbbfd..de63a517d 100644 --- a/cake/tests/cases/libs/object.test.php +++ b/cake/tests/cases/libs/object.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/overloadable.test.php b/cake/tests/cases/libs/overloadable.test.php index ed06e8cc7..0b6c9c235 100644 --- a/cake/tests/cases/libs/overloadable.test.php +++ b/cake/tests/cases/libs/overloadable.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 3e58f0ae1..2f34423c6 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/sanitize.test.php b/cake/tests/cases/libs/sanitize.test.php index 1899f16c7..f32371bf1 100644 --- a/cake/tests/cases/libs/sanitize.test.php +++ b/cake/tests/cases/libs/sanitize.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/security.test.php b/cake/tests/cases/libs/security.test.php index f00af06b7..320f4a508 100644 --- a/cake/tests/cases/libs/security.test.php +++ b/cake/tests/cases/libs/security.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/session.test.php b/cake/tests/cases/libs/session.test.php index f74d626f8..9af6d79d4 100644 --- a/cake/tests/cases/libs/session.test.php +++ b/cake/tests/cases/libs/session.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/set.test.php b/cake/tests/cases/libs/set.test.php index 2b758e49e..6f41670c7 100644 --- a/cake/tests/cases/libs/set.test.php +++ b/cake/tests/cases/libs/set.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/socket.test.php b/cake/tests/cases/libs/socket.test.php index 931f2b531..e401917bc 100644 --- a/cake/tests/cases/libs/socket.test.php +++ b/cake/tests/cases/libs/socket.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/string.test.php b/cake/tests/cases/libs/string.test.php index 1e15a89be..0f6896fa5 100644 --- a/cake/tests/cases/libs/string.test.php +++ b/cake/tests/cases/libs/string.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/test_manager.test.php b/cake/tests/cases/libs/test_manager.test.php index b8eb5de29..f26f8bc0c 100644 --- a/cake/tests/cases/libs/test_manager.test.php +++ b/cake/tests/cases/libs/test_manager.test.php @@ -8,7 +8,7 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. + * Copyright 2005-2010, Cake Software Foundation, Inc. * 1785 E. Sahara Avenue, Suite 490-204 * Las Vegas, Nevada 89104 * @@ -16,7 +16,7 @@ * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/validation.test.php b/cake/tests/cases/libs/validation.test.php index 4c7721cbc..45e85da10 100644 --- a/cake/tests/cases/libs/validation.test.php +++ b/cake/tests/cases/libs/validation.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/view/helper.test.php b/cake/tests/cases/libs/view/helper.test.php index e380650b9..8be56b040 100644 --- a/cake/tests/cases/libs/view/helper.test.php +++ b/cake/tests/cases/libs/view/helper.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/view/helpers/ajax.test.php b/cake/tests/cases/libs/view/helpers/ajax.test.php index 439846e0d..133389350 100644 --- a/cake/tests/cases/libs/view/helpers/ajax.test.php +++ b/cake/tests/cases/libs/view/helpers/ajax.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/cache.test.php b/cake/tests/cases/libs/view/helpers/cache.test.php index 66b913642..f6b265e6e 100644 --- a/cake/tests/cases/libs/view/helpers/cache.test.php +++ b/cake/tests/cases/libs/view/helpers/cache.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index c1d90823a..c94ea6c2d 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/cake/tests/cases/libs/view/helpers/html.test.php index 635e908bf..39249c7c3 100644 --- a/cake/tests/cases/libs/view/helpers/html.test.php +++ b/cake/tests/cases/libs/view/helpers/html.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/javascript.test.php b/cake/tests/cases/libs/view/helpers/javascript.test.php index e44a0271a..b5d298f80 100644 --- a/cake/tests/cases/libs/view/helpers/javascript.test.php +++ b/cake/tests/cases/libs/view/helpers/javascript.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index d0307089b..8978b4201 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/number.test.php b/cake/tests/cases/libs/view/helpers/number.test.php index ccc54540b..4784a6198 100644 --- a/cake/tests/cases/libs/view/helpers/number.test.php +++ b/cake/tests/cases/libs/view/helpers/number.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/paginator.test.php b/cake/tests/cases/libs/view/helpers/paginator.test.php index 3b8817ab8..22744f2a1 100644 --- a/cake/tests/cases/libs/view/helpers/paginator.test.php +++ b/cake/tests/cases/libs/view/helpers/paginator.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/rss.test.php b/cake/tests/cases/libs/view/helpers/rss.test.php index 0f49570ff..49c534911 100644 --- a/cake/tests/cases/libs/view/helpers/rss.test.php +++ b/cake/tests/cases/libs/view/helpers/rss.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/session.test.php b/cake/tests/cases/libs/view/helpers/session.test.php index eb6e295e7..9c56ddc81 100644 --- a/cake/tests/cases/libs/view/helpers/session.test.php +++ b/cake/tests/cases/libs/view/helpers/session.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/text.test.php b/cake/tests/cases/libs/view/helpers/text.test.php index bd2b08526..283e17df0 100644 --- a/cake/tests/cases/libs/view/helpers/text.test.php +++ b/cake/tests/cases/libs/view/helpers/text.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/time.test.php b/cake/tests/cases/libs/view/helpers/time.test.php index 997d3092b..149e895c0 100644 --- a/cake/tests/cases/libs/view/helpers/time.test.php +++ b/cake/tests/cases/libs/view/helpers/time.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/xml.test.php b/cake/tests/cases/libs/view/helpers/xml.test.php index 3be7a729c..6ffa9c2a7 100644 --- a/cake/tests/cases/libs/view/helpers/xml.test.php +++ b/cake/tests/cases/libs/view/helpers/xml.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/theme.test.php b/cake/tests/cases/libs/view/theme.test.php index 6f68cbf1f..f5f0598f2 100644 --- a/cake/tests/cases/libs/view/theme.test.php +++ b/cake/tests/cases/libs/view/theme.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/view/view.test.php b/cake/tests/cases/libs/view/view.test.php index 103a4b736..03174e592 100644 --- a/cake/tests/cases/libs/view/view.test.php +++ b/cake/tests/cases/libs/view/view.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/xml.test.php b/cake/tests/cases/libs/xml.test.php index e92133ba0..e252ed188 100644 --- a/cake/tests/cases/libs/xml.test.php +++ b/cake/tests/cases/libs/xml.test.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/fixtures/account_fixture.php b/cake/tests/fixtures/account_fixture.php index 5bd0e28c4..0b725813e 100644 --- a/cake/tests/fixtures/account_fixture.php +++ b/cake/tests/fixtures/account_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/aco_action_fixture.php b/cake/tests/fixtures/aco_action_fixture.php index 2c35d5fe6..a07a22fb0 100644 --- a/cake/tests/fixtures/aco_action_fixture.php +++ b/cake/tests/fixtures/aco_action_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/aco_fixture.php b/cake/tests/fixtures/aco_fixture.php index 5a8a1446d..98f4c5ea6 100644 --- a/cake/tests/fixtures/aco_fixture.php +++ b/cake/tests/fixtures/aco_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/aco_two_fixture.php b/cake/tests/fixtures/aco_two_fixture.php index c5c3708a5..09e383005 100644 --- a/cake/tests/fixtures/aco_two_fixture.php +++ b/cake/tests/fixtures/aco_two_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/advertisement_fixture.php b/cake/tests/fixtures/advertisement_fixture.php index f5062336a..2bd0cc7df 100644 --- a/cake/tests/fixtures/advertisement_fixture.php +++ b/cake/tests/fixtures/advertisement_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/another_article_fixture.php b/cake/tests/fixtures/another_article_fixture.php index ec3d19c0c..cf34b1262 100644 --- a/cake/tests/fixtures/another_article_fixture.php +++ b/cake/tests/fixtures/another_article_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/apple_fixture.php b/cake/tests/fixtures/apple_fixture.php index d8d3e1250..cce8ea937 100644 --- a/cake/tests/fixtures/apple_fixture.php +++ b/cake/tests/fixtures/apple_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/aro_fixture.php b/cake/tests/fixtures/aro_fixture.php index 26180de0e..87bb73a57 100644 --- a/cake/tests/fixtures/aro_fixture.php +++ b/cake/tests/fixtures/aro_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/aro_two_fixture.php b/cake/tests/fixtures/aro_two_fixture.php index 8d2337bc5..fc583b173 100644 --- a/cake/tests/fixtures/aro_two_fixture.php +++ b/cake/tests/fixtures/aro_two_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/aros_aco_fixture.php b/cake/tests/fixtures/aros_aco_fixture.php index be181c6fb..7bb651499 100644 --- a/cake/tests/fixtures/aros_aco_fixture.php +++ b/cake/tests/fixtures/aros_aco_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/aros_aco_two_fixture.php b/cake/tests/fixtures/aros_aco_two_fixture.php index 74866e5fe..fcc1ab654 100644 --- a/cake/tests/fixtures/aros_aco_two_fixture.php +++ b/cake/tests/fixtures/aros_aco_two_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/article_featured_fixture.php b/cake/tests/fixtures/article_featured_fixture.php index 67b967499..d45178504 100644 --- a/cake/tests/fixtures/article_featured_fixture.php +++ b/cake/tests/fixtures/article_featured_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/article_featureds_tags_fixture.php b/cake/tests/fixtures/article_featureds_tags_fixture.php index e1ac130f6..c1b6641d7 100644 --- a/cake/tests/fixtures/article_featureds_tags_fixture.php +++ b/cake/tests/fixtures/article_featureds_tags_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/article_fixture.php b/cake/tests/fixtures/article_fixture.php index fe2721d74..64dd4b38d 100644 --- a/cake/tests/fixtures/article_fixture.php +++ b/cake/tests/fixtures/article_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/articles_tag_fixture.php b/cake/tests/fixtures/articles_tag_fixture.php index a19bcd142..f7307c634 100644 --- a/cake/tests/fixtures/articles_tag_fixture.php +++ b/cake/tests/fixtures/articles_tag_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/attachment_fixture.php b/cake/tests/fixtures/attachment_fixture.php index de0d8b492..17ae330fe 100644 --- a/cake/tests/fixtures/attachment_fixture.php +++ b/cake/tests/fixtures/attachment_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/auth_user_custom_field_fixture.php b/cake/tests/fixtures/auth_user_custom_field_fixture.php index ebc2c3f29..759290a14 100644 --- a/cake/tests/fixtures/auth_user_custom_field_fixture.php +++ b/cake/tests/fixtures/auth_user_custom_field_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/auth_user_fixture.php b/cake/tests/fixtures/auth_user_fixture.php index d16c7759e..7766fdb5a 100644 --- a/cake/tests/fixtures/auth_user_fixture.php +++ b/cake/tests/fixtures/auth_user_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/author_fixture.php b/cake/tests/fixtures/author_fixture.php index 96ee0ea44..de8178d38 100644 --- a/cake/tests/fixtures/author_fixture.php +++ b/cake/tests/fixtures/author_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/basket_fixture.php b/cake/tests/fixtures/basket_fixture.php index c20014ff3..ee3182294 100644 --- a/cake/tests/fixtures/basket_fixture.php +++ b/cake/tests/fixtures/basket_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/bid_fixture.php b/cake/tests/fixtures/bid_fixture.php index 9b118cca8..84cb61fe9 100644 --- a/cake/tests/fixtures/bid_fixture.php +++ b/cake/tests/fixtures/bid_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/binary_test_fixture.php b/cake/tests/fixtures/binary_test_fixture.php index b9c09cbe2..889d05b9e 100644 --- a/cake/tests/fixtures/binary_test_fixture.php +++ b/cake/tests/fixtures/binary_test_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/book_fixture.php b/cake/tests/fixtures/book_fixture.php index 823408c8f..b86499c58 100644 --- a/cake/tests/fixtures/book_fixture.php +++ b/cake/tests/fixtures/book_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/cache_test_model_fixture.php b/cake/tests/fixtures/cache_test_model_fixture.php index ff4f855c0..b4009c3f5 100644 --- a/cake/tests/fixtures/cache_test_model_fixture.php +++ b/cake/tests/fixtures/cache_test_model_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/callback_fixture.php b/cake/tests/fixtures/callback_fixture.php index 6ef3d1eb5..824fd8e46 100644 --- a/cake/tests/fixtures/callback_fixture.php +++ b/cake/tests/fixtures/callback_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/category_fixture.php b/cake/tests/fixtures/category_fixture.php index 5cb04f106..b0830e184 100644 --- a/cake/tests/fixtures/category_fixture.php +++ b/cake/tests/fixtures/category_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/category_thread_fixture.php b/cake/tests/fixtures/category_thread_fixture.php index 5da10d7d8..6804ef246 100644 --- a/cake/tests/fixtures/category_thread_fixture.php +++ b/cake/tests/fixtures/category_thread_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/cd_fixture.php b/cake/tests/fixtures/cd_fixture.php index 16b74f565..241fd7a1e 100644 --- a/cake/tests/fixtures/cd_fixture.php +++ b/cake/tests/fixtures/cd_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/comment_fixture.php b/cake/tests/fixtures/comment_fixture.php index b2283c9af..f8c22966c 100644 --- a/cake/tests/fixtures/comment_fixture.php +++ b/cake/tests/fixtures/comment_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/content_account_fixture.php b/cake/tests/fixtures/content_account_fixture.php index 8eb7be738..a4b8c4f35 100644 --- a/cake/tests/fixtures/content_account_fixture.php +++ b/cake/tests/fixtures/content_account_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/content_fixture.php b/cake/tests/fixtures/content_fixture.php index b7e3131cd..88b0eb249 100644 --- a/cake/tests/fixtures/content_fixture.php +++ b/cake/tests/fixtures/content_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/counter_cache_post_fixture.php b/cake/tests/fixtures/counter_cache_post_fixture.php index 4f696eb3a..5fa7a50b8 100644 --- a/cake/tests/fixtures/counter_cache_post_fixture.php +++ b/cake/tests/fixtures/counter_cache_post_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/counter_cache_post_nonstandard_primary_key_fixture.php b/cake/tests/fixtures/counter_cache_post_nonstandard_primary_key_fixture.php index 15c577dc2..3d7ba8084 100644 --- a/cake/tests/fixtures/counter_cache_post_nonstandard_primary_key_fixture.php +++ b/cake/tests/fixtures/counter_cache_post_nonstandard_primary_key_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/counter_cache_user_fixture.php b/cake/tests/fixtures/counter_cache_user_fixture.php index 4739dab0a..1e22b5764 100644 --- a/cake/tests/fixtures/counter_cache_user_fixture.php +++ b/cake/tests/fixtures/counter_cache_user_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/counter_cache_user_nonstandard_primary_key_fixture.php b/cake/tests/fixtures/counter_cache_user_nonstandard_primary_key_fixture.php index e7bb7658b..80b103f1e 100644 --- a/cake/tests/fixtures/counter_cache_user_nonstandard_primary_key_fixture.php +++ b/cake/tests/fixtures/counter_cache_user_nonstandard_primary_key_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/data_test_fixture.php b/cake/tests/fixtures/data_test_fixture.php index afed9aa9b..c3d92e545 100644 --- a/cake/tests/fixtures/data_test_fixture.php +++ b/cake/tests/fixtures/data_test_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/datatype_fixture.php b/cake/tests/fixtures/datatype_fixture.php index 281da2f48..28cd7cdcc 100644 --- a/cake/tests/fixtures/datatype_fixture.php +++ b/cake/tests/fixtures/datatype_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/dependency_fixture.php b/cake/tests/fixtures/dependency_fixture.php index 8b1720798..cf8b05706 100644 --- a/cake/tests/fixtures/dependency_fixture.php +++ b/cake/tests/fixtures/dependency_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/device_fixture.php b/cake/tests/fixtures/device_fixture.php index 3b0638d15..6a6dd80ea 100644 --- a/cake/tests/fixtures/device_fixture.php +++ b/cake/tests/fixtures/device_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/device_type_category_fixture.php b/cake/tests/fixtures/device_type_category_fixture.php index ee33c18b2..1f78c2aeb 100644 --- a/cake/tests/fixtures/device_type_category_fixture.php +++ b/cake/tests/fixtures/device_type_category_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/device_type_fixture.php b/cake/tests/fixtures/device_type_fixture.php index cb8970a57..0ccaf6dfa 100644 --- a/cake/tests/fixtures/device_type_fixture.php +++ b/cake/tests/fixtures/device_type_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/document_directory_fixture.php b/cake/tests/fixtures/document_directory_fixture.php index ff67dfa47..93583552f 100644 --- a/cake/tests/fixtures/document_directory_fixture.php +++ b/cake/tests/fixtures/document_directory_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/document_fixture.php b/cake/tests/fixtures/document_fixture.php index fde15f92d..aa7c1b1fa 100644 --- a/cake/tests/fixtures/document_fixture.php +++ b/cake/tests/fixtures/document_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/exterior_type_category_fixture.php b/cake/tests/fixtures/exterior_type_category_fixture.php index 0905c3eca..c86e9bc39 100644 --- a/cake/tests/fixtures/exterior_type_category_fixture.php +++ b/cake/tests/fixtures/exterior_type_category_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/feature_set_fixture.php b/cake/tests/fixtures/feature_set_fixture.php index 533601535..8a0c51264 100644 --- a/cake/tests/fixtures/feature_set_fixture.php +++ b/cake/tests/fixtures/feature_set_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/featured_fixture.php b/cake/tests/fixtures/featured_fixture.php index 3f3e83372..78e838bfe 100644 --- a/cake/tests/fixtures/featured_fixture.php +++ b/cake/tests/fixtures/featured_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/film_file_fixture.php b/cake/tests/fixtures/film_file_fixture.php index 1483947a3..e815980fd 100644 --- a/cake/tests/fixtures/film_file_fixture.php +++ b/cake/tests/fixtures/film_file_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/flag_tree_fixture.php b/cake/tests/fixtures/flag_tree_fixture.php index d81744261..8a4b408ee 100644 --- a/cake/tests/fixtures/flag_tree_fixture.php +++ b/cake/tests/fixtures/flag_tree_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/fruit_fixture.php b/cake/tests/fixtures/fruit_fixture.php index bf90baea8..e8bf6fb91 100644 --- a/cake/tests/fixtures/fruit_fixture.php +++ b/cake/tests/fixtures/fruit_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/fruits_uuid_tag_fixture.php b/cake/tests/fixtures/fruits_uuid_tag_fixture.php index 7c84c660d..9640e6d01 100644 --- a/cake/tests/fixtures/fruits_uuid_tag_fixture.php +++ b/cake/tests/fixtures/fruits_uuid_tag_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/home_fixture.php b/cake/tests/fixtures/home_fixture.php index f88b8f7b0..cc788b642 100644 --- a/cake/tests/fixtures/home_fixture.php +++ b/cake/tests/fixtures/home_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/image_fixture.php b/cake/tests/fixtures/image_fixture.php index e30862fc9..76a78367c 100644 --- a/cake/tests/fixtures/image_fixture.php +++ b/cake/tests/fixtures/image_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/item_fixture.php b/cake/tests/fixtures/item_fixture.php index 1602fb698..bb2ba55b5 100644 --- a/cake/tests/fixtures/item_fixture.php +++ b/cake/tests/fixtures/item_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/items_portfolio_fixture.php b/cake/tests/fixtures/items_portfolio_fixture.php index fb7dd71bb..63ea6ee5c 100644 --- a/cake/tests/fixtures/items_portfolio_fixture.php +++ b/cake/tests/fixtures/items_portfolio_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/join_a_b_fixture.php b/cake/tests/fixtures/join_a_b_fixture.php index c1a5db5df..4949e482b 100644 --- a/cake/tests/fixtures/join_a_b_fixture.php +++ b/cake/tests/fixtures/join_a_b_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/join_a_c_fixture.php b/cake/tests/fixtures/join_a_c_fixture.php index 2fc335b3e..a05b539c2 100644 --- a/cake/tests/fixtures/join_a_c_fixture.php +++ b/cake/tests/fixtures/join_a_c_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/join_a_fixture.php b/cake/tests/fixtures/join_a_fixture.php index a4401e452..8e23c7894 100644 --- a/cake/tests/fixtures/join_a_fixture.php +++ b/cake/tests/fixtures/join_a_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/join_b_fixture.php b/cake/tests/fixtures/join_b_fixture.php index 16294ce97..0bba28773 100644 --- a/cake/tests/fixtures/join_b_fixture.php +++ b/cake/tests/fixtures/join_b_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/join_c_fixture.php b/cake/tests/fixtures/join_c_fixture.php index 333f3e28b..404291744 100644 --- a/cake/tests/fixtures/join_c_fixture.php +++ b/cake/tests/fixtures/join_c_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/join_thing_fixture.php b/cake/tests/fixtures/join_thing_fixture.php index 59ebe680c..e580e9387 100644 --- a/cake/tests/fixtures/join_thing_fixture.php +++ b/cake/tests/fixtures/join_thing_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/message_fixture.php b/cake/tests/fixtures/message_fixture.php index 94b53d5ca..807e9e089 100644 --- a/cake/tests/fixtures/message_fixture.php +++ b/cake/tests/fixtures/message_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/my_categories_my_products_fixture.php b/cake/tests/fixtures/my_categories_my_products_fixture.php index b570340fc..36b2ab05a 100644 --- a/cake/tests/fixtures/my_categories_my_products_fixture.php +++ b/cake/tests/fixtures/my_categories_my_products_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/my_categories_my_users_fixture.php b/cake/tests/fixtures/my_categories_my_users_fixture.php index d708d8dc5..166c7983f 100644 --- a/cake/tests/fixtures/my_categories_my_users_fixture.php +++ b/cake/tests/fixtures/my_categories_my_users_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/my_category_fixture.php b/cake/tests/fixtures/my_category_fixture.php index c333890c3..66e837eff 100644 --- a/cake/tests/fixtures/my_category_fixture.php +++ b/cake/tests/fixtures/my_category_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/my_product_fixture.php b/cake/tests/fixtures/my_product_fixture.php index 9e2f7948a..ddb42aa48 100644 --- a/cake/tests/fixtures/my_product_fixture.php +++ b/cake/tests/fixtures/my_product_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/my_user_fixture.php b/cake/tests/fixtures/my_user_fixture.php index 1806851a8..62c58c8cc 100644 --- a/cake/tests/fixtures/my_user_fixture.php +++ b/cake/tests/fixtures/my_user_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/node_fixture.php b/cake/tests/fixtures/node_fixture.php index a75ac25ae..ff77dfccd 100644 --- a/cake/tests/fixtures/node_fixture.php +++ b/cake/tests/fixtures/node_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/number_tree_fixture.php b/cake/tests/fixtures/number_tree_fixture.php index 4e1b973e8..98978bc67 100644 --- a/cake/tests/fixtures/number_tree_fixture.php +++ b/cake/tests/fixtures/number_tree_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/number_tree_two_fixture.php b/cake/tests/fixtures/number_tree_two_fixture.php index 244191c32..e45e29d80 100644 --- a/cake/tests/fixtures/number_tree_two_fixture.php +++ b/cake/tests/fixtures/number_tree_two_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/numeric_article_fixture.php b/cake/tests/fixtures/numeric_article_fixture.php index 44fdce11c..0b7f32ba3 100644 --- a/cake/tests/fixtures/numeric_article_fixture.php +++ b/cake/tests/fixtures/numeric_article_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/overall_favorite_fixture.php b/cake/tests/fixtures/overall_favorite_fixture.php index b36ba1b44..2f0889e83 100644 --- a/cake/tests/fixtures/overall_favorite_fixture.php +++ b/cake/tests/fixtures/overall_favorite_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/person_fixture.php b/cake/tests/fixtures/person_fixture.php index 160befaeb..493b4e708 100644 --- a/cake/tests/fixtures/person_fixture.php +++ b/cake/tests/fixtures/person_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/portfolio_fixture.php b/cake/tests/fixtures/portfolio_fixture.php index 7b4bcb584..26b07de51 100644 --- a/cake/tests/fixtures/portfolio_fixture.php +++ b/cake/tests/fixtures/portfolio_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/post_fixture.php b/cake/tests/fixtures/post_fixture.php index 9277517ed..1db461778 100644 --- a/cake/tests/fixtures/post_fixture.php +++ b/cake/tests/fixtures/post_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/posts_tag_fixture.php b/cake/tests/fixtures/posts_tag_fixture.php index 2c4ae6c7f..a86a0253c 100644 --- a/cake/tests/fixtures/posts_tag_fixture.php +++ b/cake/tests/fixtures/posts_tag_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/primary_model_fixture.php b/cake/tests/fixtures/primary_model_fixture.php index 8c0b3e7bc..0901632a5 100644 --- a/cake/tests/fixtures/primary_model_fixture.php +++ b/cake/tests/fixtures/primary_model_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/product_fixture.php b/cake/tests/fixtures/product_fixture.php index 9355030eb..ccdbf5aa8 100644 --- a/cake/tests/fixtures/product_fixture.php +++ b/cake/tests/fixtures/product_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/project_fixture.php b/cake/tests/fixtures/project_fixture.php index 6f48b05b8..428ed823a 100644 --- a/cake/tests/fixtures/project_fixture.php +++ b/cake/tests/fixtures/project_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/sample_fixture.php b/cake/tests/fixtures/sample_fixture.php index 87448938a..126d8872d 100644 --- a/cake/tests/fixtures/sample_fixture.php +++ b/cake/tests/fixtures/sample_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/secondary_model_fixture.php b/cake/tests/fixtures/secondary_model_fixture.php index 8c7ccfc3a..75e061f1c 100644 --- a/cake/tests/fixtures/secondary_model_fixture.php +++ b/cake/tests/fixtures/secondary_model_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/session_fixture.php b/cake/tests/fixtures/session_fixture.php index 1dc3c751a..2fb0fcf2f 100644 --- a/cake/tests/fixtures/session_fixture.php +++ b/cake/tests/fixtures/session_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/something_else_fixture.php b/cake/tests/fixtures/something_else_fixture.php index 7b6dbd2cd..2206f4d4b 100644 --- a/cake/tests/fixtures/something_else_fixture.php +++ b/cake/tests/fixtures/something_else_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/something_fixture.php b/cake/tests/fixtures/something_fixture.php index cecfb3f9d..654233c0c 100644 --- a/cake/tests/fixtures/something_fixture.php +++ b/cake/tests/fixtures/something_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/stories_tag_fixture.php b/cake/tests/fixtures/stories_tag_fixture.php index b39566abb..140cc047d 100644 --- a/cake/tests/fixtures/stories_tag_fixture.php +++ b/cake/tests/fixtures/stories_tag_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/story_fixture.php b/cake/tests/fixtures/story_fixture.php index c8e90de6d..333e87958 100644 --- a/cake/tests/fixtures/story_fixture.php +++ b/cake/tests/fixtures/story_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/syfile_fixture.php b/cake/tests/fixtures/syfile_fixture.php index 8e5a075ad..0e2c52eba 100644 --- a/cake/tests/fixtures/syfile_fixture.php +++ b/cake/tests/fixtures/syfile_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/tag_fixture.php b/cake/tests/fixtures/tag_fixture.php index afc205e57..036e75618 100644 --- a/cake/tests/fixtures/tag_fixture.php +++ b/cake/tests/fixtures/tag_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/test_plugin_article_fixture.php b/cake/tests/fixtures/test_plugin_article_fixture.php index 148fea15d..7df32099c 100644 --- a/cake/tests/fixtures/test_plugin_article_fixture.php +++ b/cake/tests/fixtures/test_plugin_article_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/test_plugin_comment_fixture.php b/cake/tests/fixtures/test_plugin_comment_fixture.php index 847d2ce4b..1d74823e0 100644 --- a/cake/tests/fixtures/test_plugin_comment_fixture.php +++ b/cake/tests/fixtures/test_plugin_comment_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/the_paper_monkies_fixture.php b/cake/tests/fixtures/the_paper_monkies_fixture.php index f8efce2db..87ef21f1f 100644 --- a/cake/tests/fixtures/the_paper_monkies_fixture.php +++ b/cake/tests/fixtures/the_paper_monkies_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/thread_fixture.php b/cake/tests/fixtures/thread_fixture.php index 118aa0ff2..6382968b0 100644 --- a/cake/tests/fixtures/thread_fixture.php +++ b/cake/tests/fixtures/thread_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/translate_article_fixture.php b/cake/tests/fixtures/translate_article_fixture.php index 549872c34..9c13a28a3 100644 --- a/cake/tests/fixtures/translate_article_fixture.php +++ b/cake/tests/fixtures/translate_article_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/translate_fixture.php b/cake/tests/fixtures/translate_fixture.php index 17b97a956..28539aad9 100644 --- a/cake/tests/fixtures/translate_fixture.php +++ b/cake/tests/fixtures/translate_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/translate_table_fixture.php b/cake/tests/fixtures/translate_table_fixture.php index 1a645e375..4ef2f8d34 100644 --- a/cake/tests/fixtures/translate_table_fixture.php +++ b/cake/tests/fixtures/translate_table_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/translated_article_fixture.php b/cake/tests/fixtures/translated_article_fixture.php index bce536975..7be3e78f5 100644 --- a/cake/tests/fixtures/translated_article_fixture.php +++ b/cake/tests/fixtures/translated_article_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/translated_item_fixture.php b/cake/tests/fixtures/translated_item_fixture.php index f8b93ce8a..37e6dbef9 100644 --- a/cake/tests/fixtures/translated_item_fixture.php +++ b/cake/tests/fixtures/translated_item_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/unconventional_tree_fixture.php b/cake/tests/fixtures/unconventional_tree_fixture.php index 87b517842..3685b5a2d 100644 --- a/cake/tests/fixtures/unconventional_tree_fixture.php +++ b/cake/tests/fixtures/unconventional_tree_fixture.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/underscore_field_fixture.php b/cake/tests/fixtures/underscore_field_fixture.php index c87ace540..f71aa2cf1 100644 --- a/cake/tests/fixtures/underscore_field_fixture.php +++ b/cake/tests/fixtures/underscore_field_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/user_fixture.php b/cake/tests/fixtures/user_fixture.php index bb8478034..2d34ff5ec 100644 --- a/cake/tests/fixtures/user_fixture.php +++ b/cake/tests/fixtures/user_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/uuid_fixture.php b/cake/tests/fixtures/uuid_fixture.php index 12a0dd99f..b0eb51be6 100644 --- a/cake/tests/fixtures/uuid_fixture.php +++ b/cake/tests/fixtures/uuid_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/uuid_tag_fixture.php b/cake/tests/fixtures/uuid_tag_fixture.php index 0665b4649..cb4c6203e 100644 --- a/cake/tests/fixtures/uuid_tag_fixture.php +++ b/cake/tests/fixtures/uuid_tag_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/uuid_tree_fixture.php b/cake/tests/fixtures/uuid_tree_fixture.php index d17ffc51c..7fa73e5d1 100644 --- a/cake/tests/fixtures/uuid_tree_fixture.php +++ b/cake/tests/fixtures/uuid_tree_fixture.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/uuiditem_fixture.php b/cake/tests/fixtures/uuiditem_fixture.php index bbc9b0592..540b30984 100644 --- a/cake/tests/fixtures/uuiditem_fixture.php +++ b/cake/tests/fixtures/uuiditem_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php b/cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php index c3c961282..1c22f17cb 100644 --- a/cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php +++ b/cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php b/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php index 9938db735..c70684bfd 100644 --- a/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php +++ b/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/uuidportfolio_fixture.php b/cake/tests/fixtures/uuidportfolio_fixture.php index 96c65d978..6006e0dbc 100644 --- a/cake/tests/fixtures/uuidportfolio_fixture.php +++ b/cake/tests/fixtures/uuidportfolio_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/groups/acl.group.php b/cake/tests/groups/acl.group.php index 7dad05ff2..a3882d0ab 100644 --- a/cake/tests/groups/acl.group.php +++ b/cake/tests/groups/acl.group.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/cache.group.php b/cake/tests/groups/cache.group.php index 85b40cc02..4dd0d69c3 100644 --- a/cake/tests/groups/cache.group.php +++ b/cake/tests/groups/cache.group.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/components.group.php b/cake/tests/groups/components.group.php index ad4c2e538..16817efcf 100644 --- a/cake/tests/groups/components.group.php +++ b/cake/tests/groups/components.group.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/configure.group.php b/cake/tests/groups/configure.group.php index e1e8f35fd..bc0d02642 100644 --- a/cake/tests/groups/configure.group.php +++ b/cake/tests/groups/configure.group.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/console.group.php b/cake/tests/groups/console.group.php index 9cc199124..bc8f72009 100644 --- a/cake/tests/groups/console.group.php +++ b/cake/tests/groups/console.group.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/controller.group.php b/cake/tests/groups/controller.group.php index 8bbc801ac..2103124db 100644 --- a/cake/tests/groups/controller.group.php +++ b/cake/tests/groups/controller.group.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/database.group.php b/cake/tests/groups/database.group.php index b3ffa3e81..147d077a3 100644 --- a/cake/tests/groups/database.group.php +++ b/cake/tests/groups/database.group.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/helpers.group.php b/cake/tests/groups/helpers.group.php index a7dfbba70..5761386f1 100644 --- a/cake/tests/groups/helpers.group.php +++ b/cake/tests/groups/helpers.group.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/lib.group.php b/cake/tests/groups/lib.group.php index 999ba7da2..367b7ee10 100644 --- a/cake/tests/groups/lib.group.php +++ b/cake/tests/groups/lib.group.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/model.group.php b/cake/tests/groups/model.group.php index 6cf32d93a..c1e6c4ab0 100644 --- a/cake/tests/groups/model.group.php +++ b/cake/tests/groups/model.group.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/no_cross_contamination.group.php b/cake/tests/groups/no_cross_contamination.group.php index 7a72c88a3..71c0dcf8e 100644 --- a/cake/tests/groups/no_cross_contamination.group.php +++ b/cake/tests/groups/no_cross_contamination.group.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/routing_system.group.php b/cake/tests/groups/routing_system.group.php index 1afb59f12..a4b9dea60 100644 --- a/cake/tests/groups/routing_system.group.php +++ b/cake/tests/groups/routing_system.group.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/socket.group.php b/cake/tests/groups/socket.group.php index 6645dcb24..ea3a0a608 100644 --- a/cake/tests/groups/socket.group.php +++ b/cake/tests/groups/socket.group.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2007, Cake Software Foundation, Inc. + * Copyright 2005-2010, Cake Software Foundation, Inc. * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2007, Cake Software Foundation, Inc. + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/test_suite.group.php b/cake/tests/groups/test_suite.group.php index bccb39955..1dae0759e 100644 --- a/cake/tests/groups/test_suite.group.php +++ b/cake/tests/groups/test_suite.group.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2007, Cake Software Foundation, Inc. + * Copyright 2005-2010, Cake Software Foundation, Inc. * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2007, Cake Software Foundation, Inc. + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/view.group.php b/cake/tests/groups/view.group.php index f79efc0d2..60a7f0828 100644 --- a/cake/tests/groups/view.group.php +++ b/cake/tests/groups/view.group.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/xml.group.php b/cake/tests/groups/xml.group.php index 757153346..15a6a66e0 100644 --- a/cake/tests/groups/xml.group.php +++ b/cake/tests/groups/xml.group.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/lib/cake_reporter.php b/cake/tests/lib/cake_reporter.php index b5e93bf22..8e44b12b5 100644 --- a/cake/tests/lib/cake_reporter.php +++ b/cake/tests/lib/cake_reporter.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index c0d0bc451..857bca729 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs diff --git a/cake/tests/lib/cake_test_fixture.php b/cake/tests/lib/cake_test_fixture.php index cd12f9a32..1c2227ecc 100644 --- a/cake/tests/lib/cake_test_fixture.php +++ b/cake/tests/lib/cake_test_fixture.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs diff --git a/cake/tests/lib/cake_test_model.php b/cake/tests/lib/cake_test_model.php index bfc22bd2a..bf2cb68bd 100644 --- a/cake/tests/lib/cake_test_model.php +++ b/cake/tests/lib/cake_test_model.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs diff --git a/cake/tests/lib/cake_web_test_case.php b/cake/tests/lib/cake_web_test_case.php index b12f2e426..da5a12589 100644 --- a/cake/tests/lib/cake_web_test_case.php +++ b/cake/tests/lib/cake_web_test_case.php @@ -6,13 +6,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.lib diff --git a/cake/tests/lib/cli_reporter.php b/cake/tests/lib/cli_reporter.php index 97ceea592..7902ef998 100644 --- a/cake/tests/lib/cli_reporter.php +++ b/cake/tests/lib/cli_reporter.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index 1000c675c..56e685526 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.lib diff --git a/cake/tests/lib/content.php b/cake/tests/lib/content.php index 8c4c9aa07..c07a96260 100644 --- a/cake/tests/lib/content.php +++ b/cake/tests/lib/content.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.lib diff --git a/cake/tests/lib/footer.php b/cake/tests/lib/footer.php index 8408c75e9..5509a2719 100644 --- a/cake/tests/lib/footer.php +++ b/cake/tests/lib/footer.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.lib diff --git a/cake/tests/lib/header.php b/cake/tests/lib/header.php index 1fd6d9989..6d37b39f5 100644 --- a/cake/tests/lib/header.php +++ b/cake/tests/lib/header.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.lib diff --git a/cake/tests/lib/simpletest.php b/cake/tests/lib/simpletest.php index 35eb6e8cf..5a06b7a11 100644 --- a/cake/tests/lib/simpletest.php +++ b/cake/tests/lib/simpletest.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index 00e540571..6f21d2f5a 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.lib diff --git a/cake/tests/lib/xdebug.php b/cake/tests/lib/xdebug.php index b285e700d..f954f5600 100644 --- a/cake/tests/lib/xdebug.php +++ b/cake/tests/lib/xdebug.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs diff --git a/cake/tests/test_app/config/acl.ini.php b/cake/tests/test_app/config/acl.ini.php index 9ac2b5d60..b7b95abcd 100644 --- a/cake/tests/test_app/config/acl.ini.php +++ b/cake/tests/test_app/config/acl.ini.php @@ -7,13 +7,13 @@ ; * PHP versions 4 and 5 ; * ; * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) -; * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) +; * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) ; * ; * Licensed under The MIT License ; * Redistributions of files must retain the above copyright notice. ; * ; * @filesource -; * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) +; * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) ; * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project ; * @package cake ; * @subpackage cake.app.config diff --git a/cake/tests/test_app/controllers/tests_apps_controller.php b/cake/tests/test_app/controllers/tests_apps_controller.php index 4800490f5..1eac7d061 100644 --- a/cake/tests/test_app/controllers/tests_apps_controller.php +++ b/cake/tests/test_app/controllers/tests_apps_controller.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers diff --git a/cake/tests/test_app/controllers/tests_apps_posts_controller.php b/cake/tests/test_app/controllers/tests_apps_posts_controller.php index c8ef7953f..1634b1b5c 100644 --- a/cake/tests/test_app/controllers/tests_apps_posts_controller.php +++ b/cake/tests/test_app/controllers/tests_apps_posts_controller.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers diff --git a/cake/tests/test_app/models/behaviors/persister_one_behavior.php b/cake/tests/test_app/models/behaviors/persister_one_behavior.php index 63f5998a6..e41957460 100644 --- a/cake/tests/test_app/models/behaviors/persister_one_behavior.php +++ b/cake/tests/test_app/models/behaviors/persister_one_behavior.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.tests.test_app.models diff --git a/cake/tests/test_app/models/behaviors/persister_two_behavior.php b/cake/tests/test_app/models/behaviors/persister_two_behavior.php index c032fc3e2..cebd79858 100644 --- a/cake/tests/test_app/models/behaviors/persister_two_behavior.php +++ b/cake/tests/test_app/models/behaviors/persister_two_behavior.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.tests.test_app.models diff --git a/cake/tests/test_app/models/comment.php b/cake/tests/test_app/models/comment.php index 75c1450a5..5eb6eba63 100644 --- a/cake/tests/test_app/models/comment.php +++ b/cake/tests/test_app/models/comment.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.libs. diff --git a/cake/tests/test_app/models/persister_one.php b/cake/tests/test_app/models/persister_one.php index 37fd2b4ef..6f0fbf48d 100644 --- a/cake/tests/test_app/models/persister_one.php +++ b/cake/tests/test_app/models/persister_one.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.test_app.models diff --git a/cake/tests/test_app/models/persister_two.php b/cake/tests/test_app/models/persister_two.php index 36d2423da..0fb3ceb65 100644 --- a/cake/tests/test_app/models/persister_two.php +++ b/cake/tests/test_app/models/persister_two.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.test_app.models diff --git a/cake/tests/test_app/models/post.php b/cake/tests/test_app/models/post.php index f2ea630d6..71280e0db 100644 --- a/cake/tests/test_app/models/post.php +++ b/cake/tests/test_app/models/post.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.libs. diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/components/other_component.php b/cake/tests/test_app/plugins/test_plugin/controllers/components/other_component.php index ab3cb7b22..8c8c6269b 100644 --- a/cake/tests/test_app/plugins/test_plugin/controllers/components/other_component.php +++ b/cake/tests/test_app/plugins/test_plugin/controllers/components/other_component.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php b/cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php index 6a80527d9..d66e4eb3c 100644 --- a/cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php +++ b/cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php b/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php index 23a462bf9..3d98a2961 100644 --- a/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php +++ b/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php b/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php index 560e0702f..321831152 100644 --- a/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php +++ b/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php b/cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php index 565a4cd9a..10e43fa0a 100644 --- a/cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php +++ b/cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers diff --git a/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php b/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php index 5530fd286..7ffe580ed 100644 --- a/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php +++ b/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.tests.test_app.models diff --git a/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php b/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php index 89f2def32..0d5eb05fb 100644 --- a/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php +++ b/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.tests.test_app.models diff --git a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php index 52c8a35e3..b72cd1eb0 100644 --- a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php +++ b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2006-2008, Cake Software Foundation, Inc. + * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.tests.test_app.plugins.test_plugin diff --git a/cake/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php b/cake/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php index 56ad96b9c..46a40ecb0 100644 --- a/cake/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php +++ b/cake/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php b/cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php index b6510715b..1ce17fe7e 100644 --- a/cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php +++ b/cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php b/cake/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php index d4152137e..f263537c6 100644 --- a/cake/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php +++ b/cake/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.vendors.sample diff --git a/cake/tests/test_app/plugins/test_plugin/vendors/shells/example.php b/cake/tests/test_app/plugins/test_plugin/vendors/shells/example.php index d363e9217..e4f71f8ba 100644 --- a/cake/tests/test_app/plugins/test_plugin/vendors/shells/example.php +++ b/cake/tests/test_app/plugins/test_plugin/vendors/shells/example.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.vendors.shells diff --git a/cake/tests/test_app/plugins/test_plugin/vendors/welcome.php b/cake/tests/test_app/plugins/test_plugin/vendors/welcome.php index b5122b327..e116ba975 100644 --- a/cake/tests/test_app/plugins/test_plugin/vendors/welcome.php +++ b/cake/tests/test_app/plugins/test_plugin/vendors/welcome.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.vendors diff --git a/cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php b/cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php index 9ec662708..952a42824 100644 --- a/cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php +++ b/cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers diff --git a/cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php b/cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php index 084eee80e..7611e129f 100644 --- a/cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php +++ b/cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers diff --git a/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/example.php b/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/example.php index 9e4b23fd3..f4e0635e5 100644 --- a/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/example.php +++ b/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/example.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin_two.vendors.shells diff --git a/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/welcome.php b/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/welcome.php index 57f09f3ee..5fb0dde2b 100644 --- a/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/welcome.php +++ b/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/welcome.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin_two.vendors.shells diff --git a/cake/tests/test_app/vendors/Test/MyTest.php b/cake/tests/test_app/vendors/Test/MyTest.php index 2705dffc2..7662a2d88 100644 --- a/cake/tests/test_app/vendors/Test/MyTest.php +++ b/cake/tests/test_app/vendors/Test/MyTest.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.vendors.somename diff --git a/cake/tests/test_app/vendors/Test/hello.php b/cake/tests/test_app/vendors/Test/hello.php index d96fa7047..061237d5f 100644 --- a/cake/tests/test_app/vendors/Test/hello.php +++ b/cake/tests/test_app/vendors/Test/hello.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.vendors.Test diff --git a/cake/tests/test_app/vendors/sample/configure_test_vendor_sample.php b/cake/tests/test_app/vendors/sample/configure_test_vendor_sample.php index 252c860d7..1776b67b0 100644 --- a/cake/tests/test_app/vendors/sample/configure_test_vendor_sample.php +++ b/cake/tests/test_app/vendors/sample/configure_test_vendor_sample.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.vendors.sample diff --git a/cake/tests/test_app/vendors/shells/sample.php b/cake/tests/test_app/vendors/shells/sample.php index 738c57911..474a855ad 100644 --- a/cake/tests/test_app/vendors/shells/sample.php +++ b/cake/tests/test_app/vendors/shells/sample.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.vendors.shells diff --git a/cake/tests/test_app/vendors/somename/some.name.php b/cake/tests/test_app/vendors/somename/some.name.php index 442fabcd0..4507ebb35 100644 --- a/cake/tests/test_app/vendors/somename/some.name.php +++ b/cake/tests/test_app/vendors/somename/some.name.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.vendors.somename diff --git a/cake/tests/test_app/vendors/welcome.php b/cake/tests/test_app/vendors/welcome.php index edb18261b..25abe89a6 100644 --- a/cake/tests/test_app/vendors/welcome.php +++ b/cake/tests/test_app/vendors/welcome.php @@ -8,13 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.vendors diff --git a/cake/tests/test_app/views/elements/email/html/default.ctp b/cake/tests/test_app/views/elements/email/html/default.ctp index 35146fe4a..374923ef3 100644 --- a/cake/tests/test_app/views/elements/email/html/default.ctp +++ b/cake/tests/test_app/views/elements/email/html/default.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.elements.email.html diff --git a/cake/tests/test_app/views/elements/email/text/default.ctp b/cake/tests/test_app/views/elements/email/text/default.ctp index cbb261c64..284acea16 100644 --- a/cake/tests/test_app/views/elements/email/text/default.ctp +++ b/cake/tests/test_app/views/elements/email/text/default.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.elements.email.text diff --git a/cake/tests/test_app/views/elements/email/text/wide.ctp b/cake/tests/test_app/views/elements/email/text/wide.ctp index f2ee2792d..d9365aa06 100644 --- a/cake/tests/test_app/views/elements/email/text/wide.ctp +++ b/cake/tests/test_app/views/elements/email/text/wide.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.elements.email.text diff --git a/cake/tests/test_app/views/layouts/ajax.ctp b/cake/tests/test_app/views/layouts/ajax.ctp index ca3459af8..e6bd065e0 100644 --- a/cake/tests/test_app/views/layouts/ajax.ctp +++ b/cake/tests/test_app/views/layouts/ajax.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts diff --git a/cake/tests/test_app/views/layouts/ajax2.ctp b/cake/tests/test_app/views/layouts/ajax2.ctp index 060d614a6..c975fdfe2 100644 --- a/cake/tests/test_app/views/layouts/ajax2.ctp +++ b/cake/tests/test_app/views/layouts/ajax2.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts diff --git a/cake/tests/test_app/views/layouts/cache_layout.ctp b/cake/tests/test_app/views/layouts/cache_layout.ctp index dee02a716..ae9a16593 100644 --- a/cake/tests/test_app/views/layouts/cache_layout.ctp +++ b/cake/tests/test_app/views/layouts/cache_layout.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts diff --git a/cake/tests/test_app/views/layouts/default.ctp b/cake/tests/test_app/views/layouts/default.ctp index bf0d3f30c..50e5c0300 100644 --- a/cake/tests/test_app/views/layouts/default.ctp +++ b/cake/tests/test_app/views/layouts/default.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.pages diff --git a/cake/tests/test_app/views/layouts/email/html/default.ctp b/cake/tests/test_app/views/layouts/email/html/default.ctp index 1853a7b3a..63573ac05 100644 --- a/cake/tests/test_app/views/layouts/email/html/default.ctp +++ b/cake/tests/test_app/views/layouts/email/html/default.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts.email.html diff --git a/cake/tests/test_app/views/layouts/email/html/thin.ctp b/cake/tests/test_app/views/layouts/email/html/thin.ctp index 2cd9e4020..f568046be 100644 --- a/cake/tests/test_app/views/layouts/email/html/thin.ctp +++ b/cake/tests/test_app/views/layouts/email/html/thin.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts.email.html diff --git a/cake/tests/test_app/views/layouts/email/text/default.ctp b/cake/tests/test_app/views/layouts/email/text/default.ctp index 77fda3bd6..9a0cf7835 100644 --- a/cake/tests/test_app/views/layouts/email/text/default.ctp +++ b/cake/tests/test_app/views/layouts/email/text/default.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts.email.text diff --git a/cake/tests/test_app/views/layouts/flash.ctp b/cake/tests/test_app/views/layouts/flash.ctp index 95fc61fb8..3f17a4764 100644 --- a/cake/tests/test_app/views/layouts/flash.ctp +++ b/cake/tests/test_app/views/layouts/flash.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts diff --git a/cake/tests/test_app/views/layouts/multi_cache.ctp b/cake/tests/test_app/views/layouts/multi_cache.ctp index 7c07d9be5..658537659 100644 --- a/cake/tests/test_app/views/layouts/multi_cache.ctp +++ b/cake/tests/test_app/views/layouts/multi_cache.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts diff --git a/cake/tests/test_app/views/posts/sequencial_nocache.ctp b/cake/tests/test_app/views/posts/sequencial_nocache.ctp index 247be625f..b0b8d556f 100644 --- a/cake/tests/test_app/views/posts/sequencial_nocache.ctp +++ b/cake/tests/test_app/views/posts/sequencial_nocache.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.pages diff --git a/cake/tests/test_app/views/posts/test_nocache_tags.ctp b/cake/tests/test_app/views/posts/test_nocache_tags.ctp index db0e7397c..9dd64d8cb 100644 --- a/cake/tests/test_app/views/posts/test_nocache_tags.ctp +++ b/cake/tests/test_app/views/posts/test_nocache_tags.ctp @@ -5,13 +5,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.pages diff --git a/index.php b/index.php index c6a3a1b18..de5df8cfc 100644 --- a/index.php +++ b/index.php @@ -10,13 +10,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @filesource - * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake * @since CakePHP(tm) v 0.2.9 From 67b69b3106b373a9e6819c464d292c730a411ce3 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Wed, 13 Jan 2010 23:47:31 -0500 Subject: [PATCH 1475/2083] Fixing failing tests due to deleted assets. --- cake/tests/cases/libs/view/helpers/html.test.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/cake/tests/cases/libs/view/helpers/html.test.php index 1f88bab7b..2b29ff8ea 100644 --- a/cake/tests/cases/libs/view/helpers/html.test.php +++ b/cake/tests/cases/libs/view/helpers/html.test.php @@ -301,23 +301,23 @@ function testImageTag() { * * @return void */ - function testImageTagWithTimestampping() { + function testImageWithTimestampping() { Configure::write('Asset.timestamp', 'force'); - $result = $this->Html->image('cake.icon.gif'); - $this->assertTags($result, array('img' => array('src' => 'preg:/img\/cake\.icon\.gif\?\d+/', 'alt' => ''))); + $result = $this->Html->image('cake.icon.png'); + $this->assertTags($result, array('img' => array('src' => 'preg:/img\/cake\.icon\.png\?\d+/', 'alt' => ''))); Configure::write('debug', 0); Configure::write('Asset.timestamp', 'force'); - $result = $this->Html->image('cake.icon.gif'); - $this->assertTags($result, array('img' => array('src' => 'preg:/img\/cake\.icon\.gif\?\d+/', 'alt' => ''))); + $result = $this->Html->image('cake.icon.png'); + $this->assertTags($result, array('img' => array('src' => 'preg:/img\/cake\.icon\.png\?\d+/', 'alt' => ''))); $webroot = $this->Html->webroot; $this->Html->webroot = '/testing/longer/'; - $result = $this->Html->image('cake.icon.gif'); + $result = $this->Html->image('cake.icon.png'); $expected = array( - 'img' => array('src' => 'preg:/\/testing\/longer\/img\/cake\.icon\.gif\?[0-9]+/', 'alt' => '') + 'img' => array('src' => 'preg:/\/testing\/longer\/img\/cake\.icon\.png\?[0-9]+/', 'alt' => '') ); $this->assertTags($result, $expected); $this->Html->webroot = $webroot; From ebf99de965c115c2213d22a731c6b8930e344012 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Wed, 13 Jan 2010 23:16:51 -0500 Subject: [PATCH 1476/2083] Removing the magical addition of SessionComponent to components array. This makes components more declarative, and removes magic that cannot be undone by the end developer. --- cake/libs/controller/component.php | 3 --- cake/libs/controller/controller.php | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php index 6c26a9ddd..b6e3a2c93 100644 --- a/cake/libs/controller/component.php +++ b/cake/libs/controller/component.php @@ -185,9 +185,6 @@ function shutdown(&$controller) { function _loadComponents(&$object, $parent = null) { $base = $this->__controllerVars['base']; $normal = Set::normalize($object->components); - if ($parent == null) { - $normal = Set::merge(array('Session' => null), $normal); - } foreach ((array)$normal as $component => $config) { $plugin = isset($this->__controllerVars['plugin']) ? $this->__controllerVars['plugin'] . '.' : null; list($plugin, $component) = pluginSplit($component, true, $plugin); diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 6f12da1e4..397eae4ab 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -229,7 +229,7 @@ class Controller extends Object { * @access public * @link http://book.cakephp.org/view/53/components-helpers-and-uses */ - var $components = array(); + var $components = array('Session'); /** * The name of the View class this controller sends output to. From 540e81b1b0a33bf6fc3de2a1bbb279be16adce7c Mon Sep 17 00:00:00 2001 From: Mark Story Date: Wed, 13 Jan 2010 23:33:56 -0500 Subject: [PATCH 1477/2083] Fixing component and controller test cases to work with less magical session component. --- cake/tests/cases/libs/controller/component.test.php | 2 +- cake/tests/cases/libs/controller/components/auth.test.php | 8 +++++--- .../tests/cases/libs/controller/components/email.test.php | 2 +- .../cases/libs/controller/components/security.test.php | 2 +- cake/tests/cases/libs/controller/controller.test.php | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cake/tests/cases/libs/controller/component.test.php b/cake/tests/cases/libs/controller/component.test.php index eaa19895f..50e63d9b9 100644 --- a/cake/tests/cases/libs/controller/component.test.php +++ b/cake/tests/cases/libs/controller/component.test.php @@ -452,7 +452,7 @@ function testComponentsWithParams() { $this->assertTrue(is_a($Controller->ParamTest, 'ParamTestComponent')); $this->assertTrue(is_a($Controller->ParamTest->Banana, 'BananaComponent')); $this->assertTrue(is_a($Controller->Orange, 'OrangeComponent')); - $this->assertTrue(is_a($Controller->Session, 'SessionComponent')); + $this->assertFalse(isset($Controller->Session)); $this->assertEqual($Controller->Orange->settings, array('colour' => 'blood orange')); $this->assertEqual($Controller->ParamTest->test, 'value'); $this->assertEqual($Controller->ParamTest->flag, true); diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php index 874fb1e13..9f819fd01 100644 --- a/cake/tests/cases/libs/controller/components/auth.test.php +++ b/cake/tests/cases/libs/controller/components/auth.test.php @@ -237,7 +237,7 @@ class AuthTestController extends Controller { * @var array * @access public */ - var $components = array('Auth', 'Acl'); + var $components = array('Session', 'Auth', 'Acl'); /** * testUrl property @@ -382,7 +382,7 @@ class AjaxAuthController extends Controller { * @var array * @access public */ - var $components = array('TestAuth'); + var $components = array('Session', 'TestAuth'); /** * uses property @@ -514,6 +514,7 @@ function endTest() { $_ENV = $this->_env; Configure::write('Acl', $this->_acl); Configure::write('Security.salt', $this->_securitySalt); + $this->Controller->Session->delete('Auth'); $this->Controller->Session->delete('Message.auth'); ClassRegistry::flush(); @@ -1539,7 +1540,8 @@ function testComponentSettings() { 'loginAction' => array('controller' => 'people', 'action' => 'login'), 'userModel' => 'AuthUserCustomField', 'sessionKey' => 'AltAuth.AuthUserCustomField' - ) + ), + 'Session' ); $this->Controller->Component->init($this->Controller); $this->Controller->Component->initialize($this->Controller); diff --git a/cake/tests/cases/libs/controller/components/email.test.php b/cake/tests/cases/libs/controller/components/email.test.php index 073d120db..8c86600f4 100644 --- a/cake/tests/cases/libs/controller/components/email.test.php +++ b/cake/tests/cases/libs/controller/components/email.test.php @@ -150,7 +150,7 @@ class EmailTestController extends Controller { * @var array * @access public */ - var $components = array('EmailTest'); + var $components = array('Session', 'EmailTest'); /** * pageTitle property diff --git a/cake/tests/cases/libs/controller/components/security.test.php b/cake/tests/cases/libs/controller/components/security.test.php index 6f5976d6f..cb83f947c 100644 --- a/cake/tests/cases/libs/controller/components/security.test.php +++ b/cake/tests/cases/libs/controller/components/security.test.php @@ -60,7 +60,7 @@ class SecurityTestController extends Controller { * @var array * @access public */ - var $components = array('TestSecurity'); + var $components = array('Session', 'TestSecurity'); /** * failed property diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index d07930815..3b8bdfec8 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -1077,7 +1077,7 @@ function testMergeVarsNotGreedy() { $Controller->uses = array(); $Controller->constructClasses(); - $this->assertTrue(isset($Controller->Session)); + $this->assertFalse(isset($Controller->Session)); } /** From 32832f481005623518d93ec1b26f72f6dc83b938 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Wed, 13 Jan 2010 23:35:56 -0500 Subject: [PATCH 1478/2083] Fixing Pagescontroller test and removal of pageTitle from controller. --- cake/tests/cases/libs/controller/pages_controller.test.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cake/tests/cases/libs/controller/pages_controller.test.php b/cake/tests/cases/libs/controller/pages_controller.test.php index a1b5f5a87..7e24151ad 100644 --- a/cake/tests/cases/libs/controller/pages_controller.test.php +++ b/cake/tests/cases/libs/controller/pages_controller.test.php @@ -53,21 +53,21 @@ function testDisplay() { return; } - App::build(array('views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS))); + App::build(array( + 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS, TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS) + )); $Pages =& new PagesController(); $Pages->viewPath = 'posts'; $Pages->display('index'); $this->assertPattern('/posts index/', $Pages->output); $this->assertEqual($Pages->viewVars['page'], 'index'); - $this->assertEqual($Pages->pageTitle, 'Index'); $Pages->viewPath = 'themed'; $Pages->display('test_theme', 'posts', 'index'); $this->assertPattern('/posts index themed view/', $Pages->output); $this->assertEqual($Pages->viewVars['page'], 'test_theme'); $this->assertEqual($Pages->viewVars['subpage'], 'posts'); - $this->assertEqual($Pages->pageTitle, 'Index'); } } ?> \ No newline at end of file From a85da639565d7df877d4175f90afd8a40be08a65 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Wed, 13 Jan 2010 23:48:57 -0500 Subject: [PATCH 1479/2083] Fixing merge var test case for non magic session component. --- cake/tests/cases/libs/controller/controller_merge_vars.test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/controller/controller_merge_vars.test.php b/cake/tests/cases/libs/controller/controller_merge_vars.test.php index 9009f00f6..200ce40f9 100644 --- a/cake/tests/cases/libs/controller/controller_merge_vars.test.php +++ b/cake/tests/cases/libs/controller/controller_merge_vars.test.php @@ -233,6 +233,6 @@ function testMergeVarsNotGreedy() { $Controller->uses = array(); $Controller->constructClasses(); - $this->assertTrue(isset($Controller->Session)); + $this->assertFalse(isset($Controller->Session)); } } \ No newline at end of file From a56bc5585caf00824c740b58961998f66401c86e Mon Sep 17 00:00:00 2001 From: Mark Story Date: Wed, 13 Jan 2010 23:55:09 -0500 Subject: [PATCH 1480/2083] Removing SessionHelper's magical inclusion into the helpers array. Use of SessionHelper must now be explicitly done. Tests updated. --- cake/libs/controller/controller.php | 2 +- cake/libs/view/view.php | 4 ---- cake/tests/cases/libs/view/view.test.php | 12 ++++++------ 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 397eae4ab..98e1b3a6c 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -93,7 +93,7 @@ class Controller extends Object { * @access protected * @link http://book.cakephp.org/view/53/components-helpers-and-uses */ - var $helpers = array('Html', 'Form'); + var $helpers = array('Session', 'Html', 'Form'); /** * Parameters received in the current request: GET and POST data, information diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index e435eb23b..05917c107 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -732,10 +732,6 @@ function _render($___viewFn, $___dataForView, $loadHelpers = true, $cached = fal * @return array */ function &_loadHelpers(&$loaded, $helpers, $parent = null) { - if (empty($loaded)) { - $helpers[] = 'Session'; - } - foreach ($helpers as $i => $helper) { $options = array(); diff --git a/cake/tests/cases/libs/view/view.test.php b/cake/tests/cases/libs/view/view.test.php index 42e315819..235081efe 100644 --- a/cake/tests/cases/libs/view/view.test.php +++ b/cake/tests/cases/libs/view/view.test.php @@ -583,7 +583,7 @@ function testLoadHelpers() { * @return void */ function testHelperCallbackTriggering() { - $this->PostsController->helpers = array('Html', 'CallbackMock'); + $this->PostsController->helpers = array('Session', 'Html', 'CallbackMock'); $View =& new TestView($this->PostsController); $loaded = array(); $View->loaded = $View->loadHelpers($loaded, $this->PostsController->helpers); @@ -601,7 +601,7 @@ function testHelperCallbackTriggering() { * @return void */ function testBeforeLayout() { - $this->PostsController->helpers = array('TestAfter', 'Html'); + $this->PostsController->helpers = array('Session', 'TestAfter', 'Html'); $View =& new View($this->PostsController); $out = $View->render('index'); $this->assertEqual($View->loaded['testAfter']->property, 'Valuation'); @@ -614,7 +614,7 @@ function testBeforeLayout() { * @return void */ function testAfterLayout() { - $this->PostsController->helpers = array('TestAfter', 'Html'); + $this->PostsController->helpers = array('Session', 'TestAfter', 'Html'); $this->PostsController->set('variable', 'values'); $View =& new View($this->PostsController); @@ -633,7 +633,7 @@ function testAfterLayout() { * @return void */ function testRenderLoadHelper() { - $this->PostsController->helpers = array('Html', 'Form', 'Ajax'); + $this->PostsController->helpers = array('Session', 'Html', 'Form', 'Ajax'); $View = new TestView($this->PostsController); $result = $View->_render($View->getViewFileName('index'), array()); @@ -694,7 +694,7 @@ function testRender() { $this->assertTrue($View->render(false, 'flash')); - $this->PostsController->helpers = array('Cache', 'Html'); + $this->PostsController->helpers = array('Session', 'Cache', 'Html'); $this->PostsController->constructClasses(); $this->PostsController->cacheAction = array('index' => 3600); $this->PostsController->params['action'] = 'index'; @@ -737,7 +737,7 @@ function testRenderLayoutWithMockCacheHelper() { */ function testViewVarOverwritingLocalHelperVar() { $Controller = new ViewPostsController(); - $Controller->helpers = array('Html'); + $Controller->helpers = array('Session', 'Html'); $Controller->set('html', 'I am some test html'); $View = new View($Controller); $result = $View->render('helper_overwrite', false); From 1980a46b46289d568c4274ecf2ae414f37e7d7da Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 14 Jan 2010 00:09:14 -0500 Subject: [PATCH 1481/2083] Updating tests to reflect SessionHelper's loss of magic inclusion. --- cake/tests/cases/libs/controller/controller.test.php | 2 +- cake/tests/cases/libs/controller/scaffold.test.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index 3b8bdfec8..1bbd3c6f8 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -318,7 +318,7 @@ class TestController extends AppController { * @var array * @access public */ - var $helpers = array('Xml'); + var $helpers = array('Session', 'Xml'); /** * components property diff --git a/cake/tests/cases/libs/controller/scaffold.test.php b/cake/tests/cases/libs/controller/scaffold.test.php index a7d1fe1f3..7604792b2 100644 --- a/cake/tests/cases/libs/controller/scaffold.test.php +++ b/cake/tests/cases/libs/controller/scaffold.test.php @@ -495,11 +495,12 @@ function testEditScaffold() { $this->assertPattern('/Edit Scaffold Mock<\/legend>/', $result); $this->assertPattern('/input type="hidden" name="data\[ScaffoldMock\]\[id\]" value="1" id="ScaffoldMockId"/', $result); - $this->assertPattern('/input name="data\[ScaffoldMock\]\[user_id\]" type="text" maxlength="11" value="1" id="ScaffoldMockUserId"/', $result); + $this->assertPattern('/select name="data\[ScaffoldMock\]\[user_id\]" id="ScaffoldMockUserId"/', $result); $this->assertPattern('/input name="data\[ScaffoldMock\]\[title\]" type="text" maxlength="255" value="First Article" id="ScaffoldMockTitle"/', $result); $this->assertPattern('/input name="data\[ScaffoldMock\]\[published\]" type="text" maxlength="1" value="Y" id="ScaffoldMockPublished"/', $result); $this->assertPattern('/textarea name="data\[ScaffoldMock\]\[body\]" cols="30" rows="6" id="ScaffoldMockBody"/', $result); $this->assertPattern('/
  • ]*>Delete<\/a>\s*<\/li>/', $result); + debug($result); } /** From a980f7236474991d50b9d80bbdfb1158ff709ab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Thu, 14 Jan 2010 09:54:45 -0430 Subject: [PATCH 1482/2083] Refactoring I18n::translate() to return time format string or arrays when category is LC_TIME Tests added --- cake/libs/i18n.php | 36 +++++++++++++++++++++++++++++ cake/tests/cases/libs/i18n.test.php | 8 +++++++ 2 files changed, 44 insertions(+) diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index 4ea024a83..ffdc8422a 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -164,6 +164,10 @@ function translate($singular, $plural = null, $domain = null, $category = 6, $co $_this->__cache = true; } + if ($_this->category == 'LC_TIME') { + return $_this->__translateTime($singular,$domain); + } + if (!isset($count)) { $plurals = 0; } elseif (!empty($_this->__domains[$_this->category][$_this->__lang][$domain]["%plural-c"]) && $_this->__noLocale === false) { @@ -448,6 +452,14 @@ function __loadPo($file, $domain) { return $this->__domains[$this->category][$this->__lang][$domain] = array_merge($merge ,$translations); } +/** + * Parses a locale definition file following the POSIX standard + * + * @param string $file file to load + * @param string $domain Domain where locale definitions will be stored + * @return void + * @access private + */ function __loadLocaleDefinition($file, $domain = null) { $_this =& I18N::getInstance(); $comment = '#'; @@ -503,6 +515,13 @@ function __loadLocaleDefinition($file, $domain = null) { } } +/** + * Auxiliary function to parse a symbol from a locale definition file + * + * @param string $string Symbol to be parsed + * @return string parsed symbol + * @access private + */ function __parseLiteralValue($string) { $string = $string[1]; if (substr($string,0,2) === $this->__escape . 'x') { @@ -524,6 +543,23 @@ function __parseLiteralValue($string) { return $string; } +/** + * Returns a Time format definition from corresponding domain + * + * @param string $format Format to be translated + * @param string $domain Domain where format is stored + * @return mixed translated format string if only value or array of translated strings for corresponding format. + * @access private + */ + function __translateTime($format,$domain) { + if (!empty($this->__domains['LC_TIME'][$this->__lang][$domain][$format])) { + if (($trans = $this->__domains[$this->category][$this->__lang][$domain][$format])) { + return $trans; + } + } + return $format; + } + /** * Object destructor * diff --git a/cake/tests/cases/libs/i18n.test.php b/cake/tests/cases/libs/i18n.test.php index 23fab7bef..53ba2f8a0 100644 --- a/cake/tests/cases/libs/i18n.test.php +++ b/cake/tests/cases/libs/i18n.test.php @@ -2594,6 +2594,14 @@ function testTimeDefinition() { $result = __c('d_fmt', 5, true); $expected = '%m/%d/%Y'; $this->assertEqual($result,$expected); + + $result = __c('am_pm',5,true); + $expected = array('AM','PM'); + $this->assertEqual($result,$expected); + + $result = __c('abmon',5,true); + $expected = array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'); + $this->assertEqual($result,$expected); } /** From 0b3758dc91fcc52a4bc21f43519552d6655e2c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Thu, 14 Jan 2010 14:11:57 -0430 Subject: [PATCH 1483/2083] Bug fix in I18n Changing calls from date to strftime in TimeHelper Implementing TimeHelper::converSpecifiers() to conver format strings to be windows safe and I18n friendly Implementing TimeHelper::i18nFormat() to format dates with preferred locale date format Changing TimeHelper::format() to handle inversion of first two parameters, while being backwards compatible. If called with the first parameter as a time string it will call TimeHelper::i18nFormat() --- cake/libs/i18n.php | 4 +- cake/libs/view/helpers/time.php | 176 ++++++++++++++++-- .../cases/libs/view/helpers/time.test.php | 132 +++++++++++++ cake/tests/test_app/locale/time_test/LC_TIME | 42 +++++ 4 files changed, 334 insertions(+), 20 deletions(-) create mode 100644 cake/tests/test_app/locale/time_test/LC_TIME diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index ffdc8422a..a98227527 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -307,7 +307,7 @@ function __bindTextDomain($domain) { $this->__loadPo($f, $domain); $this->__noLocale = false; break 2; - } elseif (file_exists($localeDef) && ($f = fopen($localeDef, "r"))) { + } elseif (is_file($localeDef) && ($f = fopen($localeDef, "r"))) { $this->__loadLocaleDefinition($f, $domain); $this->__noLocale = false; return $domain; @@ -455,7 +455,7 @@ function __loadPo($file, $domain) { /** * Parses a locale definition file following the POSIX standard * - * @param string $file file to load + * @param resource $file file handler * @param string $domain Domain where locale definitions will be stored * @return void * @access private diff --git a/cake/libs/view/helpers/time.php b/cake/libs/view/helpers/time.php index d885fa800..9c62ca8fd 100644 --- a/cake/libs/view/helpers/time.php +++ b/cake/libs/view/helpers/time.php @@ -28,6 +28,110 @@ */ class TimeHelper extends AppHelper { +/** + * Converts a string representing the format for the function strftime and returns a + * windows safe and i18n aware format. + * + * @param string $format Format with specifiers for strftime function. Accepts the special specifier %S which mimics th modifier S for date() + * @param string UNIX timestamp + * @return string windows safe and date() function compatible format for strftime + */ + function convertSpecifiers($format, $time = null) { + if (!$time) { + $time = time(); + } + $this->__time = $time; + return preg_replace_callback('/\%(\w+)/',array($this,'__translateSpecifier'),$format); + } + +/** + * Auxiliary function to translate a matched specifier element from a regular expresion into + * a windows safe and i18n aware specifier + * + * @param array $specifier match from regular expression + * @return string converted element + */ + function __translateSpecifier($specifier) { + switch ($specifier[1]) { + case 'a': + $abday = __c('abday',5,true); + if (is_array($abday)) { + return $abday[date('w',$this->__time)]; + } + break; + case 'A': + $day = __c('day',5,true); + if (is_array($day)) { + return $day[date('w',$this->__time)]; + } + break; + case 'c': + $format = __c('d_t_fmt',5,true); + if ($format != 'd_t_fmt') { + return $this->convertSpecifiers($format,$this->__time); + } + break; + case 'C': + return sprintf("%02d", date('Y', $this->__time) / 100); + case 'D': + return '%m/%d/%y'; + case 'eS' : + return date('jS',$this->__time); + case 'b': + case 'h': + $months = __c('abmon',5,true); + if (is_array($months)) { + return $months[date('n',$this->__time) -1]; + } + return '%b'; + case 'B': + $months = __c('mon',5,true); + if (is_array($months)) { + return $months[date('n',$this->__time) -1]; + } + break; + case 'n': + return "\n"; + case 'p': + case 'P': + $default = array('am' => 0, 'pm' => 1); + $meridiem = $default[date('a',$this->__time)]; + $format = __c('am_pm',5,true); + if (is_array($format)) { + $meridiem = $format[$meridiem]; + return ($specifier[1] == 'P') ? strtolower($meridiem) : strtoupper($meridiem); + } + break; + case 'r': + $complete = __c('t_fmt_ampm',5,true); + if ($complete != 't_fmt_ampm') { + return str_replace('%p',$this->__translateSpecifier(array('%p','p')),$complete); + } + break; + case 'R': + return date('H:i', $this->__time); + case 't': + return "\t"; + case 'T': + return '%H:%M:%S'; + case 'u': + return ($weekDay = date('w', $this->__time)) ? $weekDay : 7; + case 'x': + $format = __c('d_fmt',5,true); + if ($format != 'd_fmt') { + return $this->convertSpecifiers($format,$this->__time); + } + break; + case 'X': + $format = __c('t_fmt',5,true); + if ($format != 't_fmt') { + return $this->convertSpecifiers($format,$this->__time); + } + break; + } + return $specifier[0]; + } + /** * Converts given time (in server's time zone) to user's local time, given his/her offset from GMT. * @@ -62,7 +166,7 @@ function fromString($dateString, $userOffset = null) { if (empty($dateString)) { return false; } - if (is_int($dateString) || is_numeric($dateString)) { + if (is_integer($dateString) || is_numeric($dateString)) { $date = intval($dateString); } else { $date = strtotime($dateString); @@ -86,8 +190,9 @@ function nice($dateString = null, $userOffset = null) { } else { $date = time(); } - - return date("D, M jS Y, H:i", $date); + $format = $this->convertSpecifiers('%a, %b %eS %Y, %H:%M',$date); + $ret = strftime($format, $date); + return $this->output($ret); } /** @@ -105,16 +210,18 @@ function nice($dateString = null, $userOffset = null) { function niceShort($dateString = null, $userOffset = null) { $date = $dateString ? $this->fromString($dateString, $userOffset) : time(); - $y = $this->isThisYear($date) ? '' : ' Y'; + $y = $this->isThisYear($date) ? '' : ' %Y'; if ($this->isToday($date)) { - $ret = sprintf(__('Today, %s',true), date("H:i", $date)); + $ret = sprintf(__('Today, %s',true), strftime("%H:%M", $date)); } elseif ($this->wasYesterday($date)) { - $ret = sprintf(__('Yesterday, %s',true), date("H:i", $date)); + $ret = sprintf(__('Yesterday, %s',true), strftime("%H:%M", $date)); } else { - $ret = date("M jS{$y}, H:i", $date); + $format = $this->convertSpecifiers("%b %eS{$y}, %H:%M",$date); + $ret = strftime($format, $date); } - return $ret; + + return $this->output($ret); } /** @@ -132,7 +239,8 @@ function daysAsSql($begin, $end, $fieldName, $userOffset = null) { $begin = date('Y-m-d', $begin) . ' 00:00:00'; $end = date('Y-m-d', $end) . ' 23:59:59'; - return "($fieldName >= '$begin') AND ($fieldName <= '$end')"; + $ret ="($fieldName >= '$begin') AND ($fieldName <= '$end')"; + return $this->output($ret); } /** @@ -146,7 +254,8 @@ function daysAsSql($begin, $end, $fieldName, $userOffset = null) { */ function dayAsSql($dateString, $fieldName, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); - return $this->daysAsSql($dateString, $dateString, $fieldName); + $ret = $this->daysAsSql($dateString, $dateString, $fieldName); + return $this->output($ret); } /** @@ -250,7 +359,7 @@ function toQuarter($dateString, $range = false) { break; } } - return $date; + return $this->output($date); } /** @@ -261,7 +370,8 @@ function toQuarter($dateString, $range = false) { * @return integer Unix timestamp */ function toUnix($dateString, $userOffset = null) { - return $this->fromString($dateString, $userOffset); + $ret = $this->fromString($dateString, $userOffset); + return $this->output($ret); } /** @@ -273,7 +383,8 @@ function toUnix($dateString, $userOffset = null) { */ function toAtom($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); - return date('Y-m-d\TH:i:s\Z', $date); + $ret = date('Y-m-d\TH:i:s\Z', $date); + return $this->output($ret); } /** @@ -285,7 +396,8 @@ function toAtom($dateString, $userOffset = null) { */ function toRSS($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); - return date("r", $date); + $ret = date("r", $date); + return $this->output($ret); } /** @@ -465,7 +577,7 @@ function timeAgoInWords($dateTime, $options = array()) { $relativeDate = sprintf(__('%s ago', true), $relativeDate); } } - return $relativeDate; + return $this->output($relativeDate); } /** @@ -532,18 +644,46 @@ function gmt($string = null) { /** * Returns a formatted date string, given either a UNIX timestamp or a valid strtotime() date string. * - * @param string $format date format string. defaults to 'd-m-Y' + * @param string $format date format string. * @param string $dateString Datetime string * @param boolean $invalid flag to ignore results of fromString == false * @param int $userOffset User's offset from GMT (in hours) * @return string Formatted date string */ - function format($format = 'd-m-Y', $date, $invalid = false, $userOffset = null) { + function format($format, $date = null, $invalid = false, $userOffset = null) { + $time = $this->fromString($date, $userOffset); + $_time = $this->fromString($format, $userOffset); + + if (is_numeric($_time) && $time === false) { + $format = $date; + return $this->i18nFormat($_time,$format,$invalid,$userOffset); + } + if ($time === false && $invalid !== false) { + return $invalid; + } + return date($format, $time); + } + +/** + * Returns a formatted date string, given either a UNIX timestamp or a valid strtotime() date string. + * It take in account the default date format for the current language if a LC_TIME file is used. + * You must set the correct locale using setlocale() in order to translate day and month names + * @param string $dateString Datetime string + * @param string $format strftime format string. + * @param boolean $invalid flag to ignore results of fromString == false + * @param int $userOffset User's offset from GMT (in hours) + * @return string Formatted and translated date string + */ + function i18nFormat($date, $format = null, $invalid = false, $userOffset = null) { $date = $this->fromString($date, $userOffset); if ($date === false && $invalid !== false) { return $invalid; } - return date($format, $date); + if (empty($format)) { + $format = '%x'; + } + $format = $this->convertSpecifiers($format,$date); + return strftime($format,$date); } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/time.test.php b/cake/tests/cases/libs/view/helpers/time.test.php index b4f0dd5df..cee35196e 100644 --- a/cake/tests/cases/libs/view/helpers/time.test.php +++ b/cake/tests/cases/libs/view/helpers/time.test.php @@ -650,5 +650,137 @@ function testFromString() { $expected = $this->Time->convert(strtotime('+1 hour'), $timezone); $this->assertEqual($result, $expected); } + +/** + * test converting time specifiers using a time definition localfe file + * + * @access public + * @return void + */ + function testConvertSpecifiers() { + App::build(array( + 'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS) + ), true); + Configure::write('Config.language', 'time_test'); + $time = 1263485619; // Thu Jan 14 11:43:39 2010 + + $result = $this->Time->convertSpecifiers('%a',$time); + $expected = 'jue'; + $this->assertEqual($result, $expected); + + $result = $this->Time->convertSpecifiers('%A',$time); + $expected = 'jueves'; + $this->assertEqual($result, $expected); + + $result = $this->Time->convertSpecifiers('%c',$time); + $expected = 'jue %d ene %Y %H:%M:%S %Z'; + $this->assertEqual($result, $expected); + + $result = $this->Time->convertSpecifiers('%C',$time); + $expected = '20'; + $this->assertEqual($result, $expected); + + $result = $this->Time->convertSpecifiers('%D',$time); + $expected = '%m/%d/%y'; + $this->assertEqual($result, $expected); + + $result = $this->Time->convertSpecifiers('%b',$time); + $expected = 'ene'; + $this->assertEqual($result, $expected); + + $result = $this->Time->convertSpecifiers('%h',$time); + $expected = 'ene'; + $this->assertEqual($result, $expected); + + $result = $this->Time->convertSpecifiers('%B',$time); + $expected = 'enero'; + $this->assertEqual($result, $expected); + + $result = $this->Time->convertSpecifiers('%n',$time); + $expected = "\n"; + $this->assertEqual($result, $expected); + + $result = $this->Time->convertSpecifiers('%n',$time); + $expected = "\n"; + $this->assertEqual($result, $expected); + + $result = $this->Time->convertSpecifiers('%p',$time); + $expected = 'AM'; + $this->assertEqual($result, $expected); + + $result = $this->Time->convertSpecifiers('%P',$time); + $expected = 'am'; + $this->assertEqual($result, $expected); + + $result = $this->Time->convertSpecifiers('%r',$time); + $expected = '%I:%M:%S AM'; + $this->assertEqual($result, $expected); + + $result = $this->Time->convertSpecifiers('%R',$time); + $expected = '11:43'; + $this->assertEqual($result, $expected); + + $result = $this->Time->convertSpecifiers('%t',$time); + $expected = "\t"; + $this->assertEqual($result, $expected); + + $result = $this->Time->convertSpecifiers('%T',$time); + $expected = '%H:%M:%S'; + $this->assertEqual($result, $expected); + + $result = $this->Time->convertSpecifiers('%u',$time); + $expected = 4; + $this->assertEqual($result, $expected); + + $result = $this->Time->convertSpecifiers('%x',$time); + $expected = '%d/%m/%y'; + $this->assertEqual($result, $expected); + + $result = $this->Time->convertSpecifiers('%X',$time); + $expected = '%H:%M:%S'; + $this->assertEqual($result, $expected); + } + +/** + * test formatting dates taking in account preferred i18n locale file + * + * @access public + * @return void + */ + function testI18nFormat() { + App::build(array( + 'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS) + ), true); + Configure::write('Config.language', 'time_test'); + $time = 1263493768; //Thu Jan 14 13:59:28 2010 + + $result = $this->Time->i18nFormat($time); + $expected = '14/01/10'; + $this->assertEqual($result,$expected); + + $result = $this->Time->i18nFormat($time,'%c'); + $expected = 'jue 14 ene 2010 13:59:28 VET'; + $this->assertEqual($result,$expected); + + $result = $this->Time->i18nFormat($time,'Time is %r, and date is %x'); + $expected = 'Time is 01:59:28 PM, and date is 14/01/10'; + $this->assertEqual($result,$expected); + + $result = $this->Time->i18nFormat('invalid date','%x','Date invalid'); + $expected = 'Date invalid'; + $this->assertEqual($result,$expected); + } + +/** + * test new format() syntax which inverts first and secod parameters + * + * @access public + * @return void + */ + function testFormatNewSyntax() { + $time = time(); + $this->assertEqual($this->Time->format($time),$this->Time->i18nFormat($time)); + $this->assertEqual($this->Time->format($time,'%c'),$this->Time->i18nFormat($time,'%c')); + } } ?> \ No newline at end of file diff --git a/cake/tests/test_app/locale/time_test/LC_TIME b/cake/tests/test_app/locale/time_test/LC_TIME new file mode 100644 index 000000000..63c105f89 --- /dev/null +++ b/cake/tests/test_app/locale/time_test/LC_TIME @@ -0,0 +1,42 @@ +escape_char / +comment_char % +abday "";"";/ + "";"";/ + "";"";/ + "" +day "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "" +abmon "";"";/ + "";"";/ + "";"";/ + "";"";/ + "";"";/ + "";"" +mon "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "";/ + "" +d_t_fmt "" +d_fmt "" +t_fmt "" +am_pm "";"" +t_fmt_ampm "/ +" +date_fmt "/ +/ +" +% FIXME: found in CLDR +first_weekday 2 From 09b466f8aab0b4a26a5f5f10eb5e183ffc5846b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Thu, 14 Jan 2010 15:38:48 -0430 Subject: [PATCH 1484/2083] Fixing whitespace and removig calls to Helper::output() introduced by error --- cake/libs/i18n.php | 16 ++--- cake/libs/view/helpers/time.php | 60 +++++++++---------- cake/tests/cases/libs/i18n.test.php | 14 ++--- .../cases/libs/view/helpers/time.test.php | 56 ++++++++--------- 4 files changed, 72 insertions(+), 74 deletions(-) diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index a98227527..358989fc7 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -524,21 +524,21 @@ function __loadLocaleDefinition($file, $domain = null) { */ function __parseLiteralValue($string) { $string = $string[1]; - if (substr($string,0,2) === $this->__escape . 'x') { + if (substr($string, 0, 2) === $this->__escape . 'x') { $delimiter = $this->__escape . 'x'; - return join('',array_map('chr',array_map('hexdec',array_filter(explode($delimiter,$string))))); + return join('',array_map('chr', array_map('hexdec',array_filter(explode($delimiter, $string))))); } - if (substr($string,0,2) === $this->__escape . 'd') { + if (substr($string, 0, 2) === $this->__escape . 'd') { $delimiter = $this->__escape . 'd'; - return join('',array_map('chr',array_filter(explode($delimiter,$string)))); + return join('',array_map('chr', array_filter(explode($delimiter, $string)))); } if ($string[0] === $this->__escape && isset($string[1]) && is_numeric($string[1])) { $delimiter = $this->__escape; - return join('',array_map('chr',array_filter(explode($delimiter,$string)))); + return join('', array_map('chr', array_filter(explode($delimiter, $string)))); } - if (substr($string,0,3) === 'U00') { + if (substr($string, 0, 3) === 'U00') { $delimiter = 'U00'; - return join('',array_map('chr',array_map('hexdec',array_filter(explode($delimiter,$string))))); + return join('', array_map('chr', array_map('hexdec', array_filter(explode($delimiter, $string))))); } return $string; } @@ -551,7 +551,7 @@ function __parseLiteralValue($string) { * @return mixed translated format string if only value or array of translated strings for corresponding format. * @access private */ - function __translateTime($format,$domain) { + function __translateTime($format, $domain) { if (!empty($this->__domains['LC_TIME'][$this->__lang][$domain][$format])) { if (($trans = $this->__domains[$this->category][$this->__lang][$domain][$format])) { return $trans; diff --git a/cake/libs/view/helpers/time.php b/cake/libs/view/helpers/time.php index 9c62ca8fd..0f54facb6 100644 --- a/cake/libs/view/helpers/time.php +++ b/cake/libs/view/helpers/time.php @@ -41,7 +41,7 @@ function convertSpecifiers($format, $time = null) { $time = time(); } $this->__time = $time; - return preg_replace_callback('/\%(\w+)/',array($this,'__translateSpecifier'),$format); + return preg_replace_callback('/\%(\w+)/', array($this, '__translateSpecifier'), $format); } /** @@ -54,21 +54,21 @@ function convertSpecifiers($format, $time = null) { function __translateSpecifier($specifier) { switch ($specifier[1]) { case 'a': - $abday = __c('abday',5,true); + $abday = __c('abday', 5, true); if (is_array($abday)) { - return $abday[date('w',$this->__time)]; + return $abday[date('w', $this->__time)]; } break; case 'A': $day = __c('day',5,true); if (is_array($day)) { - return $day[date('w',$this->__time)]; + return $day[date('w', $this->__time)]; } break; case 'c': $format = __c('d_t_fmt',5,true); if ($format != 'd_t_fmt') { - return $this->convertSpecifiers($format,$this->__time); + return $this->convertSpecifiers($format, $this->__time); } break; case 'C': @@ -76,18 +76,18 @@ function __translateSpecifier($specifier) { case 'D': return '%m/%d/%y'; case 'eS' : - return date('jS',$this->__time); + return date('jS', $this->__time); case 'b': case 'h': - $months = __c('abmon',5,true); + $months = __c('abmon', 5, true); if (is_array($months)) { - return $months[date('n',$this->__time) -1]; + return $months[date('n', $this->__time) -1]; } return '%b'; case 'B': $months = __c('mon',5,true); if (is_array($months)) { - return $months[date('n',$this->__time) -1]; + return $months[date('n', $this->__time) -1]; } break; case 'n': @@ -96,16 +96,16 @@ function __translateSpecifier($specifier) { case 'P': $default = array('am' => 0, 'pm' => 1); $meridiem = $default[date('a',$this->__time)]; - $format = __c('am_pm',5,true); + $format = __c('am_pm', 5, true); if (is_array($format)) { $meridiem = $format[$meridiem]; return ($specifier[1] == 'P') ? strtolower($meridiem) : strtoupper($meridiem); } break; case 'r': - $complete = __c('t_fmt_ampm',5,true); + $complete = __c('t_fmt_ampm', 5, true); if ($complete != 't_fmt_ampm') { - return str_replace('%p',$this->__translateSpecifier(array('%p','p')),$complete); + return str_replace('%p',$this->__translateSpecifier(array('%p', 'p')),$complete); } break; case 'R': @@ -117,15 +117,15 @@ function __translateSpecifier($specifier) { case 'u': return ($weekDay = date('w', $this->__time)) ? $weekDay : 7; case 'x': - $format = __c('d_fmt',5,true); + $format = __c('d_fmt', 5, true); if ($format != 'd_fmt') { - return $this->convertSpecifiers($format,$this->__time); + return $this->convertSpecifiers($format, $this->__time); } break; case 'X': $format = __c('t_fmt',5,true); if ($format != 't_fmt') { - return $this->convertSpecifiers($format,$this->__time); + return $this->convertSpecifiers($format, $this->__time); } break; } @@ -190,9 +190,8 @@ function nice($dateString = null, $userOffset = null) { } else { $date = time(); } - $format = $this->convertSpecifiers('%a, %b %eS %Y, %H:%M',$date); - $ret = strftime($format, $date); - return $this->output($ret); + $format = $this->convertSpecifiers('%a, %b %eS %Y, %H:%M', $date); + return strftime($format, $date); } /** @@ -217,11 +216,11 @@ function niceShort($dateString = null, $userOffset = null) { } elseif ($this->wasYesterday($date)) { $ret = sprintf(__('Yesterday, %s',true), strftime("%H:%M", $date)); } else { - $format = $this->convertSpecifiers("%b %eS{$y}, %H:%M",$date); + $format = $this->convertSpecifiers("%b %eS{$y}, %H:%M", $date); $ret = strftime($format, $date); } - return $this->output($ret); + return $ret; } /** @@ -239,8 +238,7 @@ function daysAsSql($begin, $end, $fieldName, $userOffset = null) { $begin = date('Y-m-d', $begin) . ' 00:00:00'; $end = date('Y-m-d', $end) . ' 23:59:59'; - $ret ="($fieldName >= '$begin') AND ($fieldName <= '$end')"; - return $this->output($ret); + return "($fieldName >= '$begin') AND ($fieldName <= '$end')"; } /** @@ -255,7 +253,7 @@ function daysAsSql($begin, $end, $fieldName, $userOffset = null) { function dayAsSql($dateString, $fieldName, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); $ret = $this->daysAsSql($dateString, $dateString, $fieldName); - return $this->output($ret); + return $ret; } /** @@ -359,7 +357,7 @@ function toQuarter($dateString, $range = false) { break; } } - return $this->output($date); + return $date; } /** @@ -371,7 +369,7 @@ function toQuarter($dateString, $range = false) { */ function toUnix($dateString, $userOffset = null) { $ret = $this->fromString($dateString, $userOffset); - return $this->output($ret); + return $ret; } /** @@ -384,7 +382,7 @@ function toUnix($dateString, $userOffset = null) { function toAtom($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); $ret = date('Y-m-d\TH:i:s\Z', $date); - return $this->output($ret); + return $ret; } /** @@ -397,7 +395,7 @@ function toAtom($dateString, $userOffset = null) { function toRSS($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); $ret = date("r", $date); - return $this->output($ret); + return $ret; } /** @@ -577,7 +575,7 @@ function timeAgoInWords($dateTime, $options = array()) { $relativeDate = sprintf(__('%s ago', true), $relativeDate); } } - return $this->output($relativeDate); + return $relativeDate; } /** @@ -656,7 +654,7 @@ function format($format, $date = null, $invalid = false, $userOffset = null) { if (is_numeric($_time) && $time === false) { $format = $date; - return $this->i18nFormat($_time,$format,$invalid,$userOffset); + return $this->i18nFormat($_time, $format, $invalid, $userOffset); } if ($time === false && $invalid !== false) { return $invalid; @@ -682,8 +680,8 @@ function i18nFormat($date, $format = null, $invalid = false, $userOffset = null) if (empty($format)) { $format = '%x'; } - $format = $this->convertSpecifiers($format,$date); - return strftime($format,$date); + $format = $this->convertSpecifiers($format, $date); + return strftime($format, $date); } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/i18n.test.php b/cake/tests/cases/libs/i18n.test.php index 53ba2f8a0..69b26fceb 100644 --- a/cake/tests/cases/libs/i18n.test.php +++ b/cake/tests/cases/libs/i18n.test.php @@ -2593,15 +2593,15 @@ function testTimeDefinition() { Configure::write('Config.language', 'po'); $result = __c('d_fmt', 5, true); $expected = '%m/%d/%Y'; - $this->assertEqual($result,$expected); + $this->assertEqual($result, $expected); - $result = __c('am_pm',5,true); - $expected = array('AM','PM'); - $this->assertEqual($result,$expected); + $result = __c('am_pm', 5, true); + $expected = array('AM', 'PM'); + $this->assertEqual($result, $expected); - $result = __c('abmon',5,true); - $expected = array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'); - $this->assertEqual($result,$expected); + $result = __c('abmon', 5, true); + $expected = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); + $this->assertEqual($result, $expected); } /** diff --git a/cake/tests/cases/libs/view/helpers/time.test.php b/cake/tests/cases/libs/view/helpers/time.test.php index cee35196e..7b70d4ed7 100644 --- a/cake/tests/cases/libs/view/helpers/time.test.php +++ b/cake/tests/cases/libs/view/helpers/time.test.php @@ -664,79 +664,79 @@ function testConvertSpecifiers() { Configure::write('Config.language', 'time_test'); $time = 1263485619; // Thu Jan 14 11:43:39 2010 - $result = $this->Time->convertSpecifiers('%a',$time); + $result = $this->Time->convertSpecifiers('%a', $time); $expected = 'jue'; $this->assertEqual($result, $expected); - $result = $this->Time->convertSpecifiers('%A',$time); + $result = $this->Time->convertSpecifiers('%A', $time); $expected = 'jueves'; $this->assertEqual($result, $expected); - $result = $this->Time->convertSpecifiers('%c',$time); + $result = $this->Time->convertSpecifiers('%c', $time); $expected = 'jue %d ene %Y %H:%M:%S %Z'; $this->assertEqual($result, $expected); - $result = $this->Time->convertSpecifiers('%C',$time); + $result = $this->Time->convertSpecifiers('%C', $time); $expected = '20'; $this->assertEqual($result, $expected); - $result = $this->Time->convertSpecifiers('%D',$time); + $result = $this->Time->convertSpecifiers('%D', $time); $expected = '%m/%d/%y'; $this->assertEqual($result, $expected); - $result = $this->Time->convertSpecifiers('%b',$time); + $result = $this->Time->convertSpecifiers('%b', $time); $expected = 'ene'; $this->assertEqual($result, $expected); - $result = $this->Time->convertSpecifiers('%h',$time); + $result = $this->Time->convertSpecifiers('%h', $time); $expected = 'ene'; $this->assertEqual($result, $expected); - $result = $this->Time->convertSpecifiers('%B',$time); + $result = $this->Time->convertSpecifiers('%B', $time); $expected = 'enero'; $this->assertEqual($result, $expected); - $result = $this->Time->convertSpecifiers('%n',$time); + $result = $this->Time->convertSpecifiers('%n', $time); $expected = "\n"; $this->assertEqual($result, $expected); - $result = $this->Time->convertSpecifiers('%n',$time); + $result = $this->Time->convertSpecifiers('%n', $time); $expected = "\n"; $this->assertEqual($result, $expected); - $result = $this->Time->convertSpecifiers('%p',$time); + $result = $this->Time->convertSpecifiers('%p', $time); $expected = 'AM'; $this->assertEqual($result, $expected); - $result = $this->Time->convertSpecifiers('%P',$time); + $result = $this->Time->convertSpecifiers('%P', $time); $expected = 'am'; $this->assertEqual($result, $expected); - $result = $this->Time->convertSpecifiers('%r',$time); + $result = $this->Time->convertSpecifiers('%r', $time); $expected = '%I:%M:%S AM'; $this->assertEqual($result, $expected); - $result = $this->Time->convertSpecifiers('%R',$time); + $result = $this->Time->convertSpecifiers('%R', $time); $expected = '11:43'; $this->assertEqual($result, $expected); - $result = $this->Time->convertSpecifiers('%t',$time); + $result = $this->Time->convertSpecifiers('%t', $time); $expected = "\t"; $this->assertEqual($result, $expected); - $result = $this->Time->convertSpecifiers('%T',$time); + $result = $this->Time->convertSpecifiers('%T', $time); $expected = '%H:%M:%S'; $this->assertEqual($result, $expected); - $result = $this->Time->convertSpecifiers('%u',$time); + $result = $this->Time->convertSpecifiers('%u', $time); $expected = 4; $this->assertEqual($result, $expected); - $result = $this->Time->convertSpecifiers('%x',$time); + $result = $this->Time->convertSpecifiers('%x', $time); $expected = '%d/%m/%y'; $this->assertEqual($result, $expected); - $result = $this->Time->convertSpecifiers('%X',$time); + $result = $this->Time->convertSpecifiers('%X', $time); $expected = '%H:%M:%S'; $this->assertEqual($result, $expected); } @@ -756,19 +756,19 @@ function testI18nFormat() { $result = $this->Time->i18nFormat($time); $expected = '14/01/10'; - $this->assertEqual($result,$expected); + $this->assertEqual($result, $expected); - $result = $this->Time->i18nFormat($time,'%c'); + $result = $this->Time->i18nFormat($time, '%c'); $expected = 'jue 14 ene 2010 13:59:28 VET'; - $this->assertEqual($result,$expected); + $this->assertEqual($result, $expected); - $result = $this->Time->i18nFormat($time,'Time is %r, and date is %x'); + $result = $this->Time->i18nFormat($time, 'Time is %r, and date is %x'); $expected = 'Time is 01:59:28 PM, and date is 14/01/10'; - $this->assertEqual($result,$expected); + $this->assertEqual($result, $expected); - $result = $this->Time->i18nFormat('invalid date','%x','Date invalid'); + $result = $this->Time->i18nFormat('invalid date', '%x', 'Date invalid'); $expected = 'Date invalid'; - $this->assertEqual($result,$expected); + $this->assertEqual($result, $expected); } /** @@ -779,8 +779,8 @@ function testI18nFormat() { */ function testFormatNewSyntax() { $time = time(); - $this->assertEqual($this->Time->format($time),$this->Time->i18nFormat($time)); - $this->assertEqual($this->Time->format($time,'%c'),$this->Time->i18nFormat($time,'%c')); + $this->assertEqual($this->Time->format($time), $this->Time->i18nFormat($time)); + $this->assertEqual($this->Time->format($time, '%c'), $this->Time->i18nFormat($time, '%c')); } } ?> \ No newline at end of file From 543f40c91ea2ea9c2c2a1b5413b8d46bea9ebf30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Thu, 14 Jan 2010 15:42:30 -0430 Subject: [PATCH 1485/2083] Simplifying returns --- cake/libs/view/helpers/time.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/cake/libs/view/helpers/time.php b/cake/libs/view/helpers/time.php index 0f54facb6..80b915081 100644 --- a/cake/libs/view/helpers/time.php +++ b/cake/libs/view/helpers/time.php @@ -252,8 +252,7 @@ function daysAsSql($begin, $end, $fieldName, $userOffset = null) { */ function dayAsSql($dateString, $fieldName, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); - $ret = $this->daysAsSql($dateString, $dateString, $fieldName); - return $ret; + return $this->daysAsSql($dateString, $dateString, $fieldName); } /** @@ -368,8 +367,7 @@ function toQuarter($dateString, $range = false) { * @return integer Unix timestamp */ function toUnix($dateString, $userOffset = null) { - $ret = $this->fromString($dateString, $userOffset); - return $ret; + return $this->fromString($dateString, $userOffset); } /** @@ -381,8 +379,7 @@ function toUnix($dateString, $userOffset = null) { */ function toAtom($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); - $ret = date('Y-m-d\TH:i:s\Z', $date); - return $ret; + return date('Y-m-d\TH:i:s\Z', $date); } /** @@ -394,8 +391,7 @@ function toAtom($dateString, $userOffset = null) { */ function toRSS($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); - $ret = date("r", $date); - return $ret; + return date("r", $date); } /** @@ -635,8 +631,7 @@ function gmt($string = null) { $day = intval(date("j", $string)); $year = intval(date("Y", $string)); - $return = gmmktime($hour, $minute, $second, $month, $day, $year); - return $return; + return gmmktime($hour, $minute, $second, $month, $day, $year); } /** From 5395397c956a0e197e682101884e699cc4fe2805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Thu, 14 Jan 2010 15:50:27 -0430 Subject: [PATCH 1486/2083] Updating doc blocks --- cake/libs/view/helpers/time.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cake/libs/view/helpers/time.php b/cake/libs/view/helpers/time.php index 80b915081..e4b9f7cb6 100644 --- a/cake/libs/view/helpers/time.php +++ b/cake/libs/view/helpers/time.php @@ -636,9 +636,11 @@ function gmt($string = null) { /** * Returns a formatted date string, given either a UNIX timestamp or a valid strtotime() date string. + * This function also accepts a time string and a format string as first and second parameters. + * In that case this function behaves as a wrapper for TimeHelper::i18nFormat() * - * @param string $format date format string. - * @param string $dateString Datetime string + * @param string $format date format string (or a DateTime string) + * @param string $dateString Datetime string (or a date format string) * @param boolean $invalid flag to ignore results of fromString == false * @param int $userOffset User's offset from GMT (in hours) * @return string Formatted date string @@ -660,7 +662,6 @@ function format($format, $date = null, $invalid = false, $userOffset = null) { /** * Returns a formatted date string, given either a UNIX timestamp or a valid strtotime() date string. * It take in account the default date format for the current language if a LC_TIME file is used. - * You must set the correct locale using setlocale() in order to translate day and month names * @param string $dateString Datetime string * @param string $format strftime format string. * @param boolean $invalid flag to ignore results of fromString == false From c196c2cbdfb59c1a05e79a8e4bc2c6f1b26f8e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Thu, 14 Jan 2010 15:57:58 -0430 Subject: [PATCH 1487/2083] More whitespace fixes --- cake/libs/i18n.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index 358989fc7..bd10c574a 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -526,11 +526,11 @@ function __parseLiteralValue($string) { $string = $string[1]; if (substr($string, 0, 2) === $this->__escape . 'x') { $delimiter = $this->__escape . 'x'; - return join('',array_map('chr', array_map('hexdec',array_filter(explode($delimiter, $string))))); + return join('', array_map('chr', array_map('hexdec',array_filter(explode($delimiter, $string))))); } if (substr($string, 0, 2) === $this->__escape . 'd') { $delimiter = $this->__escape . 'd'; - return join('',array_map('chr', array_filter(explode($delimiter, $string)))); + return join('', array_map('chr', array_filter(explode($delimiter, $string)))); } if ($string[0] === $this->__escape && isset($string[1]) && is_numeric($string[1])) { $delimiter = $this->__escape; From 137704e3979ede57a3bad3559910edc4bd60d91a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Perras?= Date: Thu, 14 Jan 2010 12:57:43 -0500 Subject: [PATCH 1488/2083] Optimization to Model::save(). --- cake/libs/model/model.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 37b81245e..d08734425 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -303,7 +303,7 @@ class Model extends Overloadable { * SQL expressions. Fields added to this property will be read as other fields in a model * but will not be saveable. * - * `var $virtualFields = array('two' => '1 + 1');` + * `var $virtualFields = array('two' => '1 + 1');` * * Is a simplistic example of how to set virtualFields * @@ -397,14 +397,14 @@ class Model extends Overloadable { * eg. `ParentThread` * * ### Overriding Model's __construct method. - * - * When overriding Model::__construct() be careful to include and pass in all 3 of the + * + * When overriding Model::__construct() be careful to include and pass in all 3 of the * arguments to `parent::__construct($id, $table, $ds);` * * ### Dynamically creating models * * You can dynamically create model instances using the the $id array syntax. - * + * * {{{ * $Post = new Model(array('table' => 'posts', 'name' => 'Post', 'ds' => 'connection2')); * }}} @@ -1089,7 +1089,7 @@ function isVirtualField($field) { } /** - * Returns the expression for a model virtual field + * Returns the expression for a model virtual field * * @param mixed $name Name of field to look for * @return mixed If $field is string expression bound to virtual field $field @@ -1393,7 +1393,7 @@ function save($data = null, $validate = true, $fieldList = array()) { } if (!empty($joined) && $success === true) { - $this->__saveMulti($joined, $this->id); + $this->__saveMulti($joined, $this->id, $db); } if ($success && $count > 0) { @@ -1423,9 +1423,7 @@ function save($data = null, $validate = true, $fieldList = array()) { * @param mixed $id ID of record in this model * @access private */ - function __saveMulti($joined, $id) { - $db =& ConnectionManager::getDataSource($this->useDbConfig); - + function __saveMulti($joined, $id, &$db) { foreach ($joined as $assoc => $data) { if (isset($this->hasAndBelongsToMany[$assoc])) { From 199a14f3be249ab818b748e8cc8ae383d1e21edd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Perras?= Date: Thu, 14 Jan 2010 13:47:38 -0500 Subject: [PATCH 1489/2083] Updating Model::exists() to be more side-effect free. Model::exists() no longer monkeys with the internal state of Model::$__exists. The optional $reset parameter has also been removed, as it is no longer needed. --- cake/libs/model/model.php | 39 ++++++++------------------------------- 1 file changed, 8 insertions(+), 31 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index d08734425..e8ee3cf48 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -312,14 +312,6 @@ class Model extends Overloadable { */ var $virtualFields = array(); -/** - * Whether or not the model record exists, set by Model::exists(). - * - * @var bool - * @access private - */ - var $__exists = null; - /** * Default list of association keys. * @@ -1123,7 +1115,6 @@ function create($data = array(), $filterKey = false) { $defaults = array(); $this->id = false; $this->data = array(); - $this->__exists = null; $this->validationErrors = array(); if ($data !== null && $data !== false) { @@ -1284,10 +1275,10 @@ function save($data = null, $validate = true, $fieldList = array()) { } } - $this->exists(); + $exists = $this->exists(); $dateFields = array('modified', 'updated'); - if (!$this->__exists) { + if (!$exists) { $dateFields[] = 'created'; } if (isset($this->data[$this->alias])) { @@ -1325,11 +1316,11 @@ function save($data = null, $validate = true, $fieldList = array()) { return false; } } - $fields = $values = array(); if (isset($this->data[$this->alias][$this->primaryKey]) && empty($this->data[$this->alias][$this->primaryKey])) { unset($this->data[$this->alias][$this->primaryKey]); } + $fields = $values = array(); foreach ($this->data as $n => $v) { if (isset($this->hasAndBelongsToMany[$n])) { @@ -1355,7 +1346,7 @@ function save($data = null, $validate = true, $fieldList = array()) { } $count = count($fields); - if (!$this->__exists && $count > 0) { + if (!$exists && $count > 0) { $this->id = false; } $success = true; @@ -1408,7 +1399,6 @@ function save($data = null, $validate = true, $fieldList = array()) { $success = Set::merge($success, $this->data); } $this->data = false; - $this->__exists = null; $this->_clearCache(); $this->validationErrors = array(); } @@ -1862,7 +1852,6 @@ function delete($id = null, $cascade = true) { $this->afterDelete(); $this->_clearCache(); $this->id = false; - $this->__exists = null; return true; } } @@ -2017,28 +2006,16 @@ function __collectForeignKeys($type = 'belongsTo') { /** * Returns true if a record with the currently set ID exists. * - * @param boolean $reset if true will force database query * @return boolean True if such a record exists * @access public */ - function exists($reset = false) { - if (is_array($reset)) { - extract($reset, EXTR_OVERWRITE); - } - + function exists() { if ($this->getID() === false || $this->useTable === false) { return false; } - if (!empty($this->__exists) && $reset !== true) { - return $this->__exists; - } $conditions = array($this->alias . '.' . $this->primaryKey => $this->getID()); $query = array('conditions' => $conditions, 'recursive' => -1, 'callbacks' => false); - - if (is_array($reset)) { - $query = array_merge($query, $reset); - } - return $this->__exists = ($this->find('count', $query) > 0); + return ($this->find('count', $query) > 0); } /** @@ -2546,7 +2523,7 @@ function invalidFields($options = array()) { } $Validation =& Validation::getInstance(); - $this->exists(); + $exists = $this->exists(); $_validate = $this->validate; $whitelist = $this->whitelist; @@ -2591,7 +2568,7 @@ function invalidFields($options = array()) { if ( empty($validator['on']) || ($validator['on'] == 'create' && - !$this->__exists) || ($validator['on'] == 'update' && $this->__exists + !$exists) || ($validator['on'] == 'update' && $exists )) { $required = ( (!isset($data[$fieldName]) && $validator['required'] === true) || From adb0c809a0aa4cda88ebb8a1cd73b94fbc5146fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Perras?= Date: Thu, 14 Jan 2010 16:42:16 -0500 Subject: [PATCH 1490/2083] Refactoring Model::exists() to be independent of Model::$useTable. Fixes #199. Model::exists() now makes no check whatsoever on the value of Model::$useTable. This means that, as with a database-backed dbo, Model::exists() will call Model::find('count') (which in turn calls DataSource::read()) to determine if the record identified by Model::$id already exists in the datasource. --- cake/libs/model/model.php | 6 ++++- .../libs/model/model_integration.test.php | 26 ++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index e8ee3cf48..b936fc7d7 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -2006,11 +2006,15 @@ function __collectForeignKeys($type = 'belongsTo') { /** * Returns true if a record with the currently set ID exists. * + * Internally calls Model::getID() to obtain the current record ID to verify, + * and then performs a Model::find('count') on the currently configured datasource + * to ascertain the existence of the record in persistent storage. + * * @return boolean True if such a record exists * @access public */ function exists() { - if ($this->getID() === false || $this->useTable === false) { + if ($this->getID() === false) { return false; } $conditions = array($this->alias . '.' . $this->primaryKey => $this->getID()); diff --git a/cake/tests/cases/libs/model/model_integration.test.php b/cake/tests/cases/libs/model/model_integration.test.php index 1bf2d24bc..de7efb4c4 100644 --- a/cake/tests/cases/libs/model/model_integration.test.php +++ b/cake/tests/cases/libs/model/model_integration.test.php @@ -876,7 +876,7 @@ function testLoadModelSecondIteration() { } /** - * ensure that __exists is reset on create + * ensure that exists() does not persist between method calls reset on create * * @return void */ @@ -897,6 +897,30 @@ function testResetOfExistsOnCreate() { $this->assertEqual($result['Article']['title'], 'Staying alive'); } +/** + * testUseTableFalseExistsCheck method + * + * @return void + */ + function testUseTableFalseExistsCheck() { + $this->loadFixtures('Article'); + $Article =& new Article(); + $Article->id = 1337; + $result = $Article->exists(); + $this->assertFalse($result); + + $Article->useTable = false; + $Article->id = null; + $result = $Article->exists(); + $this->assertFalse($result); + + // An article with primary key of '1' has been loaded by the fixtures. + $Article->useTable = false; + $Article->id = 1; + $result = $Article->exists(); + $this->assertTrue($result); + } + /** * testPluginAssociations method * From eb7e10db5033c77f98ee3e6f3812d0e5c4a8182d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Perras?= Date: Thu, 14 Jan 2010 17:47:22 -0500 Subject: [PATCH 1491/2083] Updating Inflector::slug() handling of $map argument. Fixes #18. When passing a $map to Inflector::slug(), the $map values will now overwrite any default mappings that Inflector::slug defines. Modified pre-existing test-case for Inflector::slug() when using a $map. --- cake/libs/inflector.php | 3 +-- cake/tests/cases/libs/inflector.test.php | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index d847bbd9d..de50a8230 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -521,7 +521,6 @@ function slug($string, $replacement = '_', $map = array()) { $map = $replacement; $replacement = '_'; } - $quotedReplacement = preg_quote($replacement, '/'); $default = array( @@ -544,7 +543,7 @@ function slug($string, $replacement = '_', $map = array()) { sprintf('/^[%s]+|[%s]+$/', $quotedReplacement, $quotedReplacement) => '', ); - $map = array_merge($default, $map); + $map = array_merge($map, $default); return preg_replace(array_keys($map), array_values($map), $string); } } diff --git a/cake/tests/cases/libs/inflector.test.php b/cake/tests/cases/libs/inflector.test.php index f83cb8389..585133eec 100644 --- a/cake/tests/cases/libs/inflector.test.php +++ b/cake/tests/cases/libs/inflector.test.php @@ -236,12 +236,24 @@ function testInflectorSlug() { * @return void */ function testInflectorSlugWithMap() { - $result = Inflector::slug('replace every r', array('/r/' => '_')); - $expected = '_eplace_eve_y__'; + $result = Inflector::slug('replace every r', array('/r/' => '1')); + $expected = '1eplace_eve1y_1'; $this->assertEqual($result, $expected); - $result = Inflector::slug('replace every r', '_', array('/r/' => '_')); - $expected = '_eplace_eve_y__'; + $result = Inflector::slug('replace every r', '_', array('/r/' => '1')); + $expected = '1eplace_eve1y_1'; + $this->assertEqual($result, $expected); + } + +/** + * testInflectorSlugWithMapOverridingDefault method + * + * @access public + * @return void + */ + function testInflectorSlugWithMapOverridingDefault() { + $result = Inflector::slug('Testing æ ø Ã¥', '-', array('/Ã¥/' => 'aa', '/ø/' => 'oe')); + $expected = 'Testing-ae-oe-aa'; $this->assertEqual($result, $expected); } From 259b59cae159dbd98d65a1be88b853df1060c89e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Perras?= Date: Thu, 14 Jan 2010 18:14:20 -0500 Subject: [PATCH 1492/2083] Adding optional $reset parameter to Inflector::rules(). Fixes #91. Inflector::rules() now has an optional 3rd parameter, $reset, which can be set to true if you desire to remove the default inflections defined in Inflector. Note that the reset will only affect those inflection types which you have explicitly re-defined in the $rules parameter. --- cake/libs/inflector.php | 24 +++++++++++++++--------- cake/tests/cases/libs/inflector.test.php | 23 +++++++++++++++++++++++ 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index de50a8230..4d18c2eff 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -273,24 +273,30 @@ function _cache($type, $key, $value = false) { * * @param string $type The type of inflection, either 'singular' or 'plural' * @param array $rules Array of rules to be added. Example usage: - * Inflector::rules('plural', array('/^(inflect)or$/i' => '\1ables')); - * Inflector::rules('plural', array( - * 'rules' => array('/^(inflect)ors$/i' => '\1ables'), - * 'uninflected' => array('dontinflectme'), - * 'irregular' => array('red' => 'redlings') - * )); + * Inflector::rules('plural', array('/^(inflect)or$/i' => '\1ables')); + * Inflector::rules('plural', array( + * 'rules' => array('/^(inflect)ors$/i' => '\1ables'), + * 'uninflected' => array('dontinflectme'), + * 'irregular' => array('red' => 'redlings') + * )); + * @param boolean $reset If true, will unset default inflections for all + * new rules that are being defined in $rules. * @access public * @return void * @static */ - function rules($type, $rules = array()) { + function rules($type, $rules, $reset = false) { $_this =& Inflector::getInstance(); $type = '_'.$type; foreach ($rules as $rule => $pattern) { if (is_array($pattern)) { - $_this->{$type}[$rule] = array_merge($pattern, $_this->{$type}[$rule]); - unset($rules[$rule], $_this->{$type}['cache' . ucfirst($rule)], $_this->{$type}['merged'][$rule]); + if ($reset) { + $_this->{$type}[$rule] = $pattern; + } else { + $_this->{$type}[$rule] = array_merge($pattern, $_this->{$type}[$rule]); + } + unset($rules[$rule], $_this->{$type}['cache' . ucfirst($rule)], $_this->{$type}['merged'][$rule]); } } $_this->{$type}['rules'] = array_merge($rules, $_this->{$type}['rules']); diff --git a/cake/tests/cases/libs/inflector.test.php b/cake/tests/cases/libs/inflector.test.php index 585133eec..ac32d3385 100644 --- a/cake/tests/cases/libs/inflector.test.php +++ b/cake/tests/cases/libs/inflector.test.php @@ -381,6 +381,29 @@ function testCustomSingularRule() { $this->assertEqual(Inflector::singularize('singulars'), 'singulars'); } + function testCustomRuleWithReset() { + $uninflected = array('atlas', 'lapis', 'onibus', 'pires', 'virus', '.*x'); + $pluralIrregular = array('as' => 'ases'); + + Inflector::rules('singular', array( + 'rules' => array('/^(.*)(a|e|o|u)is$/i' => '\1\2l'), + 'uninflected' => $uninflected, + ), true); + + Inflector::rules('plural', array( + 'rules' => array( + '/^(.*)(a|e|o|u)l$/i' => '\1\2is', + ), + 'uninflected' => $uninflected, + 'irregular' => $pluralIrregular + ), true); + + $this->assertEqual(Inflector::pluralize('Alcool'), 'Alcoois'); + $this->assertEqual(Inflector::pluralize('Atlas'), 'Atlas'); + $this->assertEqual(Inflector::singularize('Alcoois'), 'Alcool'); + $this->assertEqual(Inflector::singularize('Atlas'), 'Atlas'); + } + /** * tearDown method * From 5c47d8dd7acd36364284a2a87b8f32c0022702a6 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 14 Jan 2010 20:15:54 -0500 Subject: [PATCH 1493/2083] Trimming trailing whitespace from files. Refs #201 --- cake/config/config.php | 2 +- cake/console/libs/console.php | 2 +- cake/console/libs/tasks/controller.php | 2 +- cake/libs/cache/memcache.php | 2 +- cake/libs/controller/controller.php | 2 +- cake/libs/model/connection_manager.php | 2 +- cake/libs/multibyte.php | 32 +++++++++---------- cake/libs/sanitize.php | 2 +- cake/libs/validation.php | 2 +- cake/libs/view/helpers/paginator.php | 2 +- .../libs/controller/components/auth.test.php | 2 +- cake/tests/cases/libs/folder.test.php | 2 +- .../libs/model/behaviors/containable.test.php | 2 +- cake/tests/fixtures/aco_action_fixture.php | 2 +- cake/tests/fixtures/advertisement_fixture.php | 2 +- .../fixtures/another_article_fixture.php | 2 +- cake/tests/fixtures/apple_fixture.php | 2 +- cake/tests/fixtures/aro_fixture.php | 2 +- cake/tests/fixtures/aro_two_fixture.php | 2 +- cake/tests/fixtures/aros_aco_fixture.php | 2 +- cake/tests/fixtures/aros_aco_two_fixture.php | 2 +- .../fixtures/article_featured_fixture.php | 2 +- .../article_featureds_tags_fixture.php | 2 +- cake/tests/fixtures/article_fixture.php | 2 +- cake/tests/fixtures/articles_tag_fixture.php | 2 +- cake/tests/fixtures/attachment_fixture.php | 2 +- .../auth_user_custom_field_fixture.php | 2 +- cake/tests/fixtures/auth_user_fixture.php | 2 +- cake/tests/fixtures/author_fixture.php | 2 +- cake/tests/fixtures/bid_fixture.php | 2 +- cake/tests/fixtures/binary_test_fixture.php | 2 +- .../fixtures/cache_test_model_fixture.php | 2 +- cake/tests/fixtures/callback_fixture.php | 2 +- cake/tests/fixtures/category_fixture.php | 2 +- .../fixtures/category_thread_fixture.php | 2 +- cake/tests/fixtures/comment_fixture.php | 2 +- cake/tests/fixtures/data_test_fixture.php | 2 +- cake/tests/fixtures/datatype_fixture.php | 2 +- cake/tests/fixtures/dependency_fixture.php | 2 +- cake/tests/fixtures/device_fixture.php | 2 +- .../fixtures/device_type_category_fixture.php | 2 +- cake/tests/fixtures/device_type_fixture.php | 2 +- .../fixtures/document_directory_fixture.php | 2 +- cake/tests/fixtures/document_fixture.php | 2 +- .../exterior_type_category_fixture.php | 2 +- cake/tests/fixtures/feature_set_fixture.php | 2 +- cake/tests/fixtures/featured_fixture.php | 2 +- cake/tests/fixtures/flag_tree_fixture.php | 2 +- cake/tests/fixtures/home_fixture.php | 2 +- cake/tests/fixtures/image_fixture.php | 2 +- cake/tests/fixtures/item_fixture.php | 2 +- .../fixtures/items_portfolio_fixture.php | 2 +- cake/tests/fixtures/join_a_b_fixture.php | 2 +- cake/tests/fixtures/join_a_c_fixture.php | 2 +- cake/tests/fixtures/join_a_fixture.php | 2 +- cake/tests/fixtures/join_b_fixture.php | 2 +- cake/tests/fixtures/join_c_fixture.php | 2 +- cake/tests/fixtures/join_thing_fixture.php | 2 +- cake/tests/fixtures/message_fixture.php | 2 +- cake/tests/fixtures/my_product_fixture.php | 2 +- cake/tests/fixtures/node_fixture.php | 2 +- cake/tests/fixtures/number_tree_fixture.php | 2 +- .../fixtures/numeric_article_fixture.php | 2 +- cake/tests/fixtures/person_fixture.php | 2 +- cake/tests/fixtures/portfolio_fixture.php | 2 +- cake/tests/fixtures/post_fixture.php | 2 +- cake/tests/fixtures/posts_tag_fixture.php | 2 +- cake/tests/fixtures/primary_model_fixture.php | 2 +- cake/tests/fixtures/project_fixture.php | 2 +- .../fixtures/secondary_model_fixture.php | 2 +- cake/tests/fixtures/session_fixture.php | 2 +- .../tests/fixtures/something_else_fixture.php | 2 +- cake/tests/fixtures/something_fixture.php | 2 +- cake/tests/fixtures/stories_tag_fixture.php | 2 +- cake/tests/fixtures/story_fixture.php | 2 +- cake/tests/fixtures/syfile_fixture.php | 2 +- cake/tests/fixtures/tag_fixture.php | 2 +- .../fixtures/test_plugin_article_fixture.php | 2 +- .../fixtures/test_plugin_comment_fixture.php | 2 +- .../fixtures/the_paper_monkies_fixture.php | 2 +- cake/tests/fixtures/thread_fixture.php | 2 +- .../fixtures/translate_article_fixture.php | 2 +- .../fixtures/translate_table_fixture.php | 2 +- .../fixtures/translated_article_fixture.php | 2 +- .../fixtures/translated_item_fixture.php | 2 +- .../fixtures/underscore_field_fixture.php | 2 +- cake/tests/fixtures/user_fixture.php | 2 +- cake/tests/fixtures/uuid_fixture.php | 2 +- cake/tests/groups/controller.group.php | 2 +- 89 files changed, 104 insertions(+), 104 deletions(-) diff --git a/cake/config/config.php b/cake/config/config.php index baecc26de..fd3d4de16 100644 --- a/cake/config/config.php +++ b/cake/config/config.php @@ -23,4 +23,4 @@ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ return $config['Cake.version'] = '1.2.5'; -?> +?> \ No newline at end of file diff --git a/cake/console/libs/console.php b/cake/console/libs/console.php index 189da32e8..b6a350dc3 100644 --- a/cake/console/libs/console.php +++ b/cake/console/libs/console.php @@ -335,4 +335,4 @@ function __loadRoutes() { return true; } } -?> +?> \ No newline at end of file diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index d4ab58abe..53aa8a627 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -582,4 +582,4 @@ function help() { $this->_stop(); } } -?> +?> \ No newline at end of file diff --git a/cake/libs/cache/memcache.php b/cake/libs/cache/memcache.php index 4c87c10c2..64b80f373 100644 --- a/cake/libs/cache/memcache.php +++ b/cake/libs/cache/memcache.php @@ -160,4 +160,4 @@ function connect($host, $port = 11211) { return true; } } -?> +?> \ No newline at end of file diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index f47a5eec5..2c3fde9d2 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -1182,4 +1182,4 @@ function _scaffoldError($method) { return false; } } -?> +?> \ No newline at end of file diff --git a/cake/libs/model/connection_manager.php b/cake/libs/model/connection_manager.php index a0db47226..5987b535e 100644 --- a/cake/libs/model/connection_manager.php +++ b/cake/libs/model/connection_manager.php @@ -262,4 +262,4 @@ function __destruct() { } } } -?> +?> \ No newline at end of file diff --git a/cake/libs/multibyte.php b/cake/libs/multibyte.php index 1dfcd456b..f7e76465e 100644 --- a/cake/libs/multibyte.php +++ b/cake/libs/multibyte.php @@ -36,7 +36,7 @@ * @param string $needle The string to find in $haystack. * @param integer $offset The position in $haystack to start searching. * @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used. - * @return integer|boolean The numeric position of the first occurrence of $needle in the $haystack string, or false + * @return integer|boolean The numeric position of the first occurrence of $needle in the $haystack string, or false * if $needle is not found. */ if (!function_exists('mb_stripos')) { @@ -51,7 +51,7 @@ function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { * @param string $needle The string to find in $haystack. * @param boolean $part Determines which portion of $haystack this function returns. * If set to true, it returns all of $haystack from the beginning to the first occurrence of $needle. - * If set to false, it returns all of $haystack from the first occurrence of $needle to the end, + * If set to false, it returns all of $haystack from the first occurrence of $needle to the end, * Default value is false. * @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used. * @return string|boolean The portion of $haystack, or false if $needle is not found. @@ -96,7 +96,7 @@ function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { * @param string $needle The string to find in $haystack. * @param boolean $part Determines which portion of $haystack this function returns. * If set to true, it returns all of $haystack from the beginning to the last occurrence of $needle. - * If set to false, it returns all of $haystack from the last occurrence of $needle to the end, + * If set to false, it returns all of $haystack from the last occurrence of $needle to the end, * Default value is false. * @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used. * @return string|boolean The portion of $haystack. or false if $needle is not found. @@ -113,7 +113,7 @@ function mb_strrchr($haystack, $needle, $part = false, $encoding = null) { * @param string $needle The string to find in $haystack. * @param boolean $part Determines which portion of $haystack this function returns. * If set to true, it returns all of $haystack from the beginning to the last occurrence of $needle. - * If set to false, it returns all of $haystack from the last occurrence of $needle to the end, + * If set to false, it returns all of $haystack from the last occurrence of $needle to the end, * Default value is false. * @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used. * @return string|boolean The portion of $haystack. or false if $needle is not found. @@ -130,7 +130,7 @@ function mb_strrichr($haystack, $needle, $part = false, $encoding = null) { * @param string $needle The string to find in $haystack. * @param integer $offset The position in $haystack to start searching. * @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used. - * @return integer|boolean The numeric position of the last occurrence of $needle in the $haystack string, + * @return integer|boolean The numeric position of the last occurrence of $needle in the $haystack string, * or false if $needle is not found. */ if (!function_exists('mb_strripos')) { @@ -146,7 +146,7 @@ function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { * @param integer $offset May be specified to begin searching an arbitrary number of characters into the string. * Negative values will stop searching at an arbitrary point prior to the end of the string. * @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used. - * @return integer|boolean The numeric position of the last occurrence of $needle in the $haystack string. + * @return integer|boolean The numeric position of the last occurrence of $needle in the $haystack string. * If $needle is not found, it returns false. */ if (!function_exists('mb_strrpos')) { @@ -161,7 +161,7 @@ function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { * @param string $needle The string to find in $haystack * @param boolean $part Determines which portion of $haystack this function returns. * If set to true, it returns all of $haystack from the beginning to the first occurrence of $needle. - * If set to false, it returns all of $haystack from the first occurrence of $needle to the end, + * If set to false, it returns all of $haystack from the first occurrence of $needle to the end, * Default value is FALSE. * @param string $encoding Character encoding name to use. If it is omitted, internal character encoding is used. * @return string|boolean The portion of $haystack, or true if $needle is not found. @@ -228,9 +228,9 @@ function mb_substr($string, $start, $length = null, $encoding = null) { * @param string $str The string being encoded * @param string $charset specifies the name of the character set in which str is represented in. * The default value is determined by the current NLS setting (mbstring.language). - * @param string $transfer_encoding specifies the scheme of MIME encoding. + * @param string $transfer_encoding specifies the scheme of MIME encoding. * It should be either "B" (Base64) or "Q" (Quoted-Printable). Falls back to "B" if not given. - * @param string $linefeed specifies the EOL (end-of-line) marker with which + * @param string $linefeed specifies the EOL (end-of-line) marker with which * mb_encode_mimeheader() performs line-folding * (a » RFC term, the act of breaking a line longer than a certain length into multiple lines. * The length is currently hard-coded to 74 characters). Falls back to "\r\n" (CRLF) if not given. @@ -358,7 +358,7 @@ function ascii($array) { * @param multi-byte string $haystack The string from which to get the position of the first occurrence of $needle. * @param multi-byte string $needle The string to find in $haystack. * @param integer $offset The position in $haystack to start searching. - * @return integer|boolean The numeric position of the first occurrence of $needle in the $haystack string, + * @return integer|boolean The numeric position of the first occurrence of $needle in the $haystack string, * or false if $needle is not found. * @access public * @static @@ -378,7 +378,7 @@ function stripos($haystack, $needle, $offset = 0) { * @param string $needle The string to find in $haystack. * @param boolean $part Determines which portion of $haystack this function returns. * If set to true, it returns all of $haystack from the beginning to the first occurrence of $needle. - * If set to false, it returns all of $haystack from the first occurrence of $needle to the end, + * If set to false, it returns all of $haystack from the first occurrence of $needle to the end, * Default value is false. * @return int|boolean The portion of $haystack, or false if $needle is not found. * @access public @@ -560,7 +560,7 @@ function strrchr($haystack, $needle, $part = false) { * @param string $needle The string to find in $haystack. * @param boolean $part Determines which portion of $haystack this function returns. * If set to true, it returns all of $haystack from the beginning to the last occurrence of $needle. - * If set to false, it returns all of $haystack from the last occurrence of $needle to the end, + * If set to false, it returns all of $haystack from the last occurrence of $needle to the end, * Default value is false. * @return string|boolean The portion of $haystack. or false if $needle is not found. * @access public @@ -622,7 +622,7 @@ function strrichr($haystack, $needle, $part = false) { * @param string $haystack The string from which to get the position of the last occurrence of $needle. * @param string $needle The string to find in $haystack. * @param integer $offset The position in $haystack to start searching. - * @return integer|boolean The numeric position of the last occurrence of $needle in the $haystack string, + * @return integer|boolean The numeric position of the last occurrence of $needle in the $haystack string, * or false if $needle is not found. * @access public * @static @@ -675,7 +675,7 @@ function strripos($haystack, $needle, $offset = 0) { * @param string $needle The string to find in $haystack. * @param integer $offset May be specified to begin searching an arbitrary number of characters into the string. * Negative values will stop searching at an arbitrary point prior to the end of the string. - * @return integer|boolean The numeric position of the last occurrence of $needle in the $haystack string. + * @return integer|boolean The numeric position of the last occurrence of $needle in the $haystack string. * If $needle is not found, it returns false. * @access public * @static @@ -726,7 +726,7 @@ function strrpos($haystack, $needle, $offset = 0) { * @param string $needle The string to find in $haystack * @param boolean $part Determines which portion of $haystack this function returns. * If set to true, it returns all of $haystack from the beginning to the first occurrence of $needle. - * If set to false, it returns all of $haystack from the first occurrence of $needle to the end, + * If set to false, it returns all of $haystack from the first occurrence of $needle to the end, * Default value is FALSE. * @return string|boolean The portion of $haystack, or true if $needle is not found. * @access public @@ -1138,4 +1138,4 @@ function checkMultibyte($string) { return false; } } -?> +?> \ No newline at end of file diff --git a/cake/libs/sanitize.php b/cake/libs/sanitize.php index 8ed84a455..caaa2807d 100644 --- a/cake/libs/sanitize.php +++ b/cake/libs/sanitize.php @@ -305,4 +305,4 @@ function formatColumns(&$model) { } } } -?> +?> \ No newline at end of file diff --git a/cake/libs/validation.php b/cake/libs/validation.php index 22a1d1f62..060e42f7b 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -926,4 +926,4 @@ function __reset() { $this->errors = array(); } } -?> +?> \ No newline at end of file diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index 9fa185ddc..db2857bd8 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -703,4 +703,4 @@ function last($last = 'last >>', $options = array()) { return $out; } } -?> +?> \ No newline at end of file diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php index 481b2dd5f..51825db08 100644 --- a/cake/tests/cases/libs/controller/components/auth.test.php +++ b/cake/tests/cases/libs/controller/components/auth.test.php @@ -1263,4 +1263,4 @@ function testShutDown() { $this->assertFalse($this->Controller->Session->read('Auth.redirect')); } } -?> +?> \ No newline at end of file diff --git a/cake/tests/cases/libs/folder.test.php b/cake/tests/cases/libs/folder.test.php index 0793630c2..057392fc5 100644 --- a/cake/tests/cases/libs/folder.test.php +++ b/cake/tests/cases/libs/folder.test.php @@ -715,4 +715,4 @@ function testMove() { $Folder->delete(); } } -?> +?> \ No newline at end of file diff --git a/cake/tests/cases/libs/model/behaviors/containable.test.php b/cake/tests/cases/libs/model/behaviors/containable.test.php index d5ae197c8..fc1cb8f6f 100644 --- a/cake/tests/cases/libs/model/behaviors/containable.test.php +++ b/cake/tests/cases/libs/model/behaviors/containable.test.php @@ -3571,4 +3571,4 @@ function __bindings(&$Model, $extra = array(), $output = true) { return $debug; } } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/aco_action_fixture.php b/cake/tests/fixtures/aco_action_fixture.php index 2c35d5fe6..956dac6f2 100644 --- a/cake/tests/fixtures/aco_action_fixture.php +++ b/cake/tests/fixtures/aco_action_fixture.php @@ -62,4 +62,4 @@ class AcoActionFixture extends CakeTestFixture { var $records = array(); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/advertisement_fixture.php b/cake/tests/fixtures/advertisement_fixture.php index f5062336a..c01a75049 100644 --- a/cake/tests/fixtures/advertisement_fixture.php +++ b/cake/tests/fixtures/advertisement_fixture.php @@ -62,4 +62,4 @@ class AdvertisementFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/another_article_fixture.php b/cake/tests/fixtures/another_article_fixture.php index ec3d19c0c..8a34c33b8 100644 --- a/cake/tests/fixtures/another_article_fixture.php +++ b/cake/tests/fixtures/another_article_fixture.php @@ -63,4 +63,4 @@ class AnotherArticleFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/apple_fixture.php b/cake/tests/fixtures/apple_fixture.php index d8d3e1250..2b58510fc 100644 --- a/cake/tests/fixtures/apple_fixture.php +++ b/cake/tests/fixtures/apple_fixture.php @@ -71,4 +71,4 @@ class AppleFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/aro_fixture.php b/cake/tests/fixtures/aro_fixture.php index 26180de0e..1c4ea9a68 100644 --- a/cake/tests/fixtures/aro_fixture.php +++ b/cake/tests/fixtures/aro_fixture.php @@ -67,4 +67,4 @@ class AroFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/aro_two_fixture.php b/cake/tests/fixtures/aro_two_fixture.php index 8d2337bc5..f02728ddc 100644 --- a/cake/tests/fixtures/aro_two_fixture.php +++ b/cake/tests/fixtures/aro_two_fixture.php @@ -73,4 +73,4 @@ class AroTwoFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/aros_aco_fixture.php b/cake/tests/fixtures/aros_aco_fixture.php index be181c6fb..357bcf0b6 100644 --- a/cake/tests/fixtures/aros_aco_fixture.php +++ b/cake/tests/fixtures/aros_aco_fixture.php @@ -62,4 +62,4 @@ class ArosAcoFixture extends CakeTestFixture { var $records = array(); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/aros_aco_two_fixture.php b/cake/tests/fixtures/aros_aco_two_fixture.php index 74866e5fe..2cca76c53 100644 --- a/cake/tests/fixtures/aros_aco_two_fixture.php +++ b/cake/tests/fixtures/aros_aco_two_fixture.php @@ -83,4 +83,4 @@ class ArosAcoTwoFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/article_featured_fixture.php b/cake/tests/fixtures/article_featured_fixture.php index 67b967499..134e2445e 100644 --- a/cake/tests/fixtures/article_featured_fixture.php +++ b/cake/tests/fixtures/article_featured_fixture.php @@ -66,4 +66,4 @@ class ArticleFeaturedFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/article_featureds_tags_fixture.php b/cake/tests/fixtures/article_featureds_tags_fixture.php index e1ac130f6..bc369892a 100644 --- a/cake/tests/fixtures/article_featureds_tags_fixture.php +++ b/cake/tests/fixtures/article_featureds_tags_fixture.php @@ -51,4 +51,4 @@ class ArticleFeaturedsTagsFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/article_fixture.php b/cake/tests/fixtures/article_fixture.php index fe2721d74..18d0cddeb 100644 --- a/cake/tests/fixtures/article_fixture.php +++ b/cake/tests/fixtures/article_fixture.php @@ -66,4 +66,4 @@ class ArticleFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/articles_tag_fixture.php b/cake/tests/fixtures/articles_tag_fixture.php index a19bcd142..cdd32fa35 100644 --- a/cake/tests/fixtures/articles_tag_fixture.php +++ b/cake/tests/fixtures/articles_tag_fixture.php @@ -63,4 +63,4 @@ class ArticlesTagFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/attachment_fixture.php b/cake/tests/fixtures/attachment_fixture.php index de0d8b492..47e1325bf 100644 --- a/cake/tests/fixtures/attachment_fixture.php +++ b/cake/tests/fixtures/attachment_fixture.php @@ -62,4 +62,4 @@ class AttachmentFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/auth_user_custom_field_fixture.php b/cake/tests/fixtures/auth_user_custom_field_fixture.php index ebc2c3f29..14d2919fc 100644 --- a/cake/tests/fixtures/auth_user_custom_field_fixture.php +++ b/cake/tests/fixtures/auth_user_custom_field_fixture.php @@ -67,4 +67,4 @@ class AuthUserCustomFieldFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/auth_user_fixture.php b/cake/tests/fixtures/auth_user_fixture.php index d16c7759e..033909a92 100644 --- a/cake/tests/fixtures/auth_user_fixture.php +++ b/cake/tests/fixtures/auth_user_fixture.php @@ -67,4 +67,4 @@ class AuthUserFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/author_fixture.php b/cake/tests/fixtures/author_fixture.php index 96ee0ea44..464a5bdbf 100644 --- a/cake/tests/fixtures/author_fixture.php +++ b/cake/tests/fixtures/author_fixture.php @@ -65,4 +65,4 @@ class AuthorFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/bid_fixture.php b/cake/tests/fixtures/bid_fixture.php index 9b118cca8..7c981ec1b 100644 --- a/cake/tests/fixtures/bid_fixture.php +++ b/cake/tests/fixtures/bid_fixture.php @@ -63,4 +63,4 @@ class BidFixture extends CakeTestFixture { array('message_id' => 2, 'name' => 'Bid 2.2') ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/binary_test_fixture.php b/cake/tests/fixtures/binary_test_fixture.php index b9c09cbe2..dc7f82ab9 100644 --- a/cake/tests/fixtures/binary_test_fixture.php +++ b/cake/tests/fixtures/binary_test_fixture.php @@ -57,4 +57,4 @@ class BinaryTestFixture extends CakeTestFixture { var $records = array(); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/cache_test_model_fixture.php b/cake/tests/fixtures/cache_test_model_fixture.php index ff4f855c0..e2cac8758 100644 --- a/cake/tests/fixtures/cache_test_model_fixture.php +++ b/cake/tests/fixtures/cache_test_model_fixture.php @@ -51,4 +51,4 @@ class CacheTestModelFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/callback_fixture.php b/cake/tests/fixtures/callback_fixture.php index 6ef3d1eb5..b047898c2 100644 --- a/cake/tests/fixtures/callback_fixture.php +++ b/cake/tests/fixtures/callback_fixture.php @@ -64,4 +64,4 @@ class CallbackFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/category_fixture.php b/cake/tests/fixtures/category_fixture.php index 5cb04f106..2343545af 100644 --- a/cake/tests/fixtures/category_fixture.php +++ b/cake/tests/fixtures/category_fixture.php @@ -69,4 +69,4 @@ class CategoryFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/category_thread_fixture.php b/cake/tests/fixtures/category_thread_fixture.php index 5da10d7d8..c58b7584d 100644 --- a/cake/tests/fixtures/category_thread_fixture.php +++ b/cake/tests/fixtures/category_thread_fixture.php @@ -68,4 +68,4 @@ class CategoryThreadFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/comment_fixture.php b/cake/tests/fixtures/comment_fixture.php index b2283c9af..065c015b1 100644 --- a/cake/tests/fixtures/comment_fixture.php +++ b/cake/tests/fixtures/comment_fixture.php @@ -69,4 +69,4 @@ class CommentFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/data_test_fixture.php b/cake/tests/fixtures/data_test_fixture.php index afed9aa9b..e3dd8f9f5 100644 --- a/cake/tests/fixtures/data_test_fixture.php +++ b/cake/tests/fixtures/data_test_fixture.php @@ -61,4 +61,4 @@ class DataTestFixture extends CakeTestFixture { var $records = array(); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/datatype_fixture.php b/cake/tests/fixtures/datatype_fixture.php index 281da2f48..5a5781ae2 100644 --- a/cake/tests/fixtures/datatype_fixture.php +++ b/cake/tests/fixtures/datatype_fixture.php @@ -59,4 +59,4 @@ class DatatypeFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/dependency_fixture.php b/cake/tests/fixtures/dependency_fixture.php index 8b1720798..155fe9639 100644 --- a/cake/tests/fixtures/dependency_fixture.php +++ b/cake/tests/fixtures/dependency_fixture.php @@ -62,4 +62,4 @@ class DependencyFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/device_fixture.php b/cake/tests/fixtures/device_fixture.php index 3b0638d15..94bba1ea2 100644 --- a/cake/tests/fixtures/device_fixture.php +++ b/cake/tests/fixtures/device_fixture.php @@ -62,4 +62,4 @@ class DeviceFixture extends CakeTestFixture { array('device_type_id' => 1, 'name' => 'Device 3', 'typ' => 2) ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/device_type_category_fixture.php b/cake/tests/fixtures/device_type_category_fixture.php index ee33c18b2..1bf658a8e 100644 --- a/cake/tests/fixtures/device_type_category_fixture.php +++ b/cake/tests/fixtures/device_type_category_fixture.php @@ -58,4 +58,4 @@ class DeviceTypeCategoryFixture extends CakeTestFixture { array('name' => 'DeviceTypeCategory 1') ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/device_type_fixture.php b/cake/tests/fixtures/device_type_fixture.php index cb8970a57..76f63d55e 100644 --- a/cake/tests/fixtures/device_type_fixture.php +++ b/cake/tests/fixtures/device_type_fixture.php @@ -65,4 +65,4 @@ class DeviceTypeFixture extends CakeTestFixture { array('device_type_category_id' => 1, 'feature_set_id' => 1, 'exterior_type_category_id' => 1, 'image_id' => 1, 'extra1_id' => 1, 'extra2_id' => 1, 'name' => 'DeviceType 1', 'order' => 0) ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/document_directory_fixture.php b/cake/tests/fixtures/document_directory_fixture.php index ff67dfa47..48c2c3625 100644 --- a/cake/tests/fixtures/document_directory_fixture.php +++ b/cake/tests/fixtures/document_directory_fixture.php @@ -58,4 +58,4 @@ class DocumentDirectoryFixture extends CakeTestFixture { array('name' => 'DocumentDirectory 1') ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/document_fixture.php b/cake/tests/fixtures/document_fixture.php index fde15f92d..41077b84c 100644 --- a/cake/tests/fixtures/document_fixture.php +++ b/cake/tests/fixtures/document_fixture.php @@ -59,4 +59,4 @@ class DocumentFixture extends CakeTestFixture { array('document_directory_id' => 1, 'name' => 'Document 1') ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/exterior_type_category_fixture.php b/cake/tests/fixtures/exterior_type_category_fixture.php index 0905c3eca..cff6e90bf 100644 --- a/cake/tests/fixtures/exterior_type_category_fixture.php +++ b/cake/tests/fixtures/exterior_type_category_fixture.php @@ -59,4 +59,4 @@ class ExteriorTypeCategoryFixture extends CakeTestFixture { array('image_id' => 1, 'name' => 'ExteriorTypeCategory 1') ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/feature_set_fixture.php b/cake/tests/fixtures/feature_set_fixture.php index 533601535..68b970a81 100644 --- a/cake/tests/fixtures/feature_set_fixture.php +++ b/cake/tests/fixtures/feature_set_fixture.php @@ -58,4 +58,4 @@ class FeatureSetFixture extends CakeTestFixture { array('name' => 'FeatureSet 1') ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/featured_fixture.php b/cake/tests/fixtures/featured_fixture.php index 3f3e83372..446b4fa00 100644 --- a/cake/tests/fixtures/featured_fixture.php +++ b/cake/tests/fixtures/featured_fixture.php @@ -65,4 +65,4 @@ class FeaturedFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/flag_tree_fixture.php b/cake/tests/fixtures/flag_tree_fixture.php index d81744261..f059f2bb9 100644 --- a/cake/tests/fixtures/flag_tree_fixture.php +++ b/cake/tests/fixtures/flag_tree_fixture.php @@ -56,4 +56,4 @@ class FlagTreeFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/home_fixture.php b/cake/tests/fixtures/home_fixture.php index f88b8f7b0..88aa97ef3 100644 --- a/cake/tests/fixtures/home_fixture.php +++ b/cake/tests/fixtures/home_fixture.php @@ -64,4 +64,4 @@ class HomeFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/image_fixture.php b/cake/tests/fixtures/image_fixture.php index e30862fc9..3a64666ef 100644 --- a/cake/tests/fixtures/image_fixture.php +++ b/cake/tests/fixtures/image_fixture.php @@ -62,4 +62,4 @@ class ImageFixture extends CakeTestFixture { array('name' => 'Image 5') ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/item_fixture.php b/cake/tests/fixtures/item_fixture.php index 1602fb698..f8dcaf566 100644 --- a/cake/tests/fixtures/item_fixture.php +++ b/cake/tests/fixtures/item_fixture.php @@ -65,4 +65,4 @@ class ItemFixture extends CakeTestFixture { array('syfile_id' => 6, 'published' => 0, 'name' => 'Item 6') ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/items_portfolio_fixture.php b/cake/tests/fixtures/items_portfolio_fixture.php index fb7dd71bb..35673afce 100644 --- a/cake/tests/fixtures/items_portfolio_fixture.php +++ b/cake/tests/fixtures/items_portfolio_fixture.php @@ -64,4 +64,4 @@ class ItemsPortfolioFixture extends CakeTestFixture { array('item_id' => 6, 'portfolio_id' => 2) ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/join_a_b_fixture.php b/cake/tests/fixtures/join_a_b_fixture.php index c1a5db5df..297aa1dfb 100644 --- a/cake/tests/fixtures/join_a_b_fixture.php +++ b/cake/tests/fixtures/join_a_b_fixture.php @@ -65,4 +65,4 @@ class JoinABFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/join_a_c_fixture.php b/cake/tests/fixtures/join_a_c_fixture.php index 2fc335b3e..b6a4ebcbf 100644 --- a/cake/tests/fixtures/join_a_c_fixture.php +++ b/cake/tests/fixtures/join_a_c_fixture.php @@ -65,4 +65,4 @@ class JoinACFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/join_a_fixture.php b/cake/tests/fixtures/join_a_fixture.php index a4401e452..babc8bef8 100644 --- a/cake/tests/fixtures/join_a_fixture.php +++ b/cake/tests/fixtures/join_a_fixture.php @@ -64,4 +64,4 @@ class JoinAFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/join_b_fixture.php b/cake/tests/fixtures/join_b_fixture.php index 16294ce97..37b45e316 100644 --- a/cake/tests/fixtures/join_b_fixture.php +++ b/cake/tests/fixtures/join_b_fixture.php @@ -62,4 +62,4 @@ class JoinBFixture extends CakeTestFixture { array('name' => 'Join B 3', 'created' => '2008-01-03 10:55:03', 'updated' => '2008-01-03 10:55:03') ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/join_c_fixture.php b/cake/tests/fixtures/join_c_fixture.php index 333f3e28b..e37fd5c0d 100644 --- a/cake/tests/fixtures/join_c_fixture.php +++ b/cake/tests/fixtures/join_c_fixture.php @@ -62,4 +62,4 @@ class JoinCFixture extends CakeTestFixture { array('name' => 'Join C 3', 'created' => '2008-01-03 10:56:13', 'updated' => '2008-01-03 10:56:13') ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/join_thing_fixture.php b/cake/tests/fixtures/join_thing_fixture.php index 59ebe680c..ae08e035f 100644 --- a/cake/tests/fixtures/join_thing_fixture.php +++ b/cake/tests/fixtures/join_thing_fixture.php @@ -65,4 +65,4 @@ class JoinThingFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/message_fixture.php b/cake/tests/fixtures/message_fixture.php index 94b53d5ca..19814c066 100644 --- a/cake/tests/fixtures/message_fixture.php +++ b/cake/tests/fixtures/message_fixture.php @@ -61,4 +61,4 @@ class MessageFixture extends CakeTestFixture { array('thread_id' => 3, 'name' => 'Thread 3, Message 1') ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/my_product_fixture.php b/cake/tests/fixtures/my_product_fixture.php index 9e2f7948a..66c365a8c 100644 --- a/cake/tests/fixtures/my_product_fixture.php +++ b/cake/tests/fixtures/my_product_fixture.php @@ -60,4 +60,4 @@ class MyProductFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/node_fixture.php b/cake/tests/fixtures/node_fixture.php index a75ac25ae..9fe27b02b 100644 --- a/cake/tests/fixtures/node_fixture.php +++ b/cake/tests/fixtures/node_fixture.php @@ -64,4 +64,4 @@ class NodeFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/number_tree_fixture.php b/cake/tests/fixtures/number_tree_fixture.php index 4e1b973e8..a007ed362 100644 --- a/cake/tests/fixtures/number_tree_fixture.php +++ b/cake/tests/fixtures/number_tree_fixture.php @@ -55,4 +55,4 @@ class NumberTreeFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/numeric_article_fixture.php b/cake/tests/fixtures/numeric_article_fixture.php index 44fdce11c..ee1b33dc7 100644 --- a/cake/tests/fixtures/numeric_article_fixture.php +++ b/cake/tests/fixtures/numeric_article_fixture.php @@ -62,4 +62,4 @@ class NumericArticleFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/person_fixture.php b/cake/tests/fixtures/person_fixture.php index 160befaeb..837ec5d11 100644 --- a/cake/tests/fixtures/person_fixture.php +++ b/cake/tests/fixtures/person_fixture.php @@ -70,4 +70,4 @@ class PersonFixture extends CakeTestFixture { array('name' => 'father - grand father', 'mother_id' => 0, 'father_id' => 0) ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/portfolio_fixture.php b/cake/tests/fixtures/portfolio_fixture.php index 7b4bcb584..75f7e8bf3 100644 --- a/cake/tests/fixtures/portfolio_fixture.php +++ b/cake/tests/fixtures/portfolio_fixture.php @@ -61,4 +61,4 @@ class PortfolioFixture extends CakeTestFixture { array('seller_id' => 2, 'name' => 'Portfolio 1') ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/post_fixture.php b/cake/tests/fixtures/post_fixture.php index 9277517ed..4c7367687 100644 --- a/cake/tests/fixtures/post_fixture.php +++ b/cake/tests/fixtures/post_fixture.php @@ -65,4 +65,4 @@ class PostFixture extends CakeTestFixture { array('author_id' => 1, 'title' => 'Third Post', 'body' => 'Third Post Body', 'published' => 'Y', 'created' => '2007-03-18 10:43:23', 'updated' => '2007-03-18 10:45:31') ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/posts_tag_fixture.php b/cake/tests/fixtures/posts_tag_fixture.php index 2c4ae6c7f..276d7d31e 100644 --- a/cake/tests/fixtures/posts_tag_fixture.php +++ b/cake/tests/fixtures/posts_tag_fixture.php @@ -63,4 +63,4 @@ class PostsTagFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/primary_model_fixture.php b/cake/tests/fixtures/primary_model_fixture.php index 8c0b3e7bc..75cfcfd43 100644 --- a/cake/tests/fixtures/primary_model_fixture.php +++ b/cake/tests/fixtures/primary_model_fixture.php @@ -59,4 +59,4 @@ class PrimaryModelFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/project_fixture.php b/cake/tests/fixtures/project_fixture.php index 6f48b05b8..ed12d54e3 100644 --- a/cake/tests/fixtures/project_fixture.php +++ b/cake/tests/fixtures/project_fixture.php @@ -60,4 +60,4 @@ class ProjectFixture extends CakeTestFixture { array('name' => 'Project 3') ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/secondary_model_fixture.php b/cake/tests/fixtures/secondary_model_fixture.php index 8c7ccfc3a..57b33d2e6 100644 --- a/cake/tests/fixtures/secondary_model_fixture.php +++ b/cake/tests/fixtures/secondary_model_fixture.php @@ -59,4 +59,4 @@ class SecondaryModelFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/session_fixture.php b/cake/tests/fixtures/session_fixture.php index 1dc3c751a..ccfea5860 100644 --- a/cake/tests/fixtures/session_fixture.php +++ b/cake/tests/fixtures/session_fixture.php @@ -57,4 +57,4 @@ class SessionFixture extends CakeTestFixture { */ var $records = array(); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/something_else_fixture.php b/cake/tests/fixtures/something_else_fixture.php index 7b6dbd2cd..aa6667adc 100644 --- a/cake/tests/fixtures/something_else_fixture.php +++ b/cake/tests/fixtures/something_else_fixture.php @@ -65,4 +65,4 @@ class SomethingElseFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/something_fixture.php b/cake/tests/fixtures/something_fixture.php index cecfb3f9d..3bb36bfab 100644 --- a/cake/tests/fixtures/something_fixture.php +++ b/cake/tests/fixtures/something_fixture.php @@ -65,4 +65,4 @@ class SomethingFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/stories_tag_fixture.php b/cake/tests/fixtures/stories_tag_fixture.php index b39566abb..2bbfc97e1 100644 --- a/cake/tests/fixtures/stories_tag_fixture.php +++ b/cake/tests/fixtures/stories_tag_fixture.php @@ -59,4 +59,4 @@ class StoriesTagFixture extends CakeTestFixture { array('story' => 1, 'tag_id' => 1) ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/story_fixture.php b/cake/tests/fixtures/story_fixture.php index c8e90de6d..6a50a2745 100644 --- a/cake/tests/fixtures/story_fixture.php +++ b/cake/tests/fixtures/story_fixture.php @@ -59,4 +59,4 @@ class StoryFixture extends CakeTestFixture { array('title' => 'Second Story') ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/syfile_fixture.php b/cake/tests/fixtures/syfile_fixture.php index 8e5a075ad..7521aaff6 100644 --- a/cake/tests/fixtures/syfile_fixture.php +++ b/cake/tests/fixtures/syfile_fixture.php @@ -66,4 +66,4 @@ class SyfileFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/tag_fixture.php b/cake/tests/fixtures/tag_fixture.php index afc205e57..a381b798b 100644 --- a/cake/tests/fixtures/tag_fixture.php +++ b/cake/tests/fixtures/tag_fixture.php @@ -63,4 +63,4 @@ class TagFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/test_plugin_article_fixture.php b/cake/tests/fixtures/test_plugin_article_fixture.php index 148fea15d..eee616596 100644 --- a/cake/tests/fixtures/test_plugin_article_fixture.php +++ b/cake/tests/fixtures/test_plugin_article_fixture.php @@ -66,4 +66,4 @@ class TestPluginArticleFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/test_plugin_comment_fixture.php b/cake/tests/fixtures/test_plugin_comment_fixture.php index 847d2ce4b..fa77c6119 100644 --- a/cake/tests/fixtures/test_plugin_comment_fixture.php +++ b/cake/tests/fixtures/test_plugin_comment_fixture.php @@ -69,4 +69,4 @@ class TestPluginCommentFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/the_paper_monkies_fixture.php b/cake/tests/fixtures/the_paper_monkies_fixture.php index f8efce2db..7966b39ea 100644 --- a/cake/tests/fixtures/the_paper_monkies_fixture.php +++ b/cake/tests/fixtures/the_paper_monkies_fixture.php @@ -57,4 +57,4 @@ class ThePaperMonkiesFixture extends CakeTestFixture { var $records = array(); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/thread_fixture.php b/cake/tests/fixtures/thread_fixture.php index 118aa0ff2..1781e8e05 100644 --- a/cake/tests/fixtures/thread_fixture.php +++ b/cake/tests/fixtures/thread_fixture.php @@ -61,4 +61,4 @@ class ThreadFixture extends CakeTestFixture { array('project_id' => 2, 'name' => 'Project 2, Thread 1') ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/translate_article_fixture.php b/cake/tests/fixtures/translate_article_fixture.php index 549872c34..fb56a815c 100644 --- a/cake/tests/fixtures/translate_article_fixture.php +++ b/cake/tests/fixtures/translate_article_fixture.php @@ -87,4 +87,4 @@ class TranslateArticleFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/translate_table_fixture.php b/cake/tests/fixtures/translate_table_fixture.php index 1a645e375..633b556d5 100644 --- a/cake/tests/fixtures/translate_table_fixture.php +++ b/cake/tests/fixtures/translate_table_fixture.php @@ -70,4 +70,4 @@ class TranslateTableFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/translated_article_fixture.php b/cake/tests/fixtures/translated_article_fixture.php index bce536975..1fc7f6d98 100644 --- a/cake/tests/fixtures/translated_article_fixture.php +++ b/cake/tests/fixtures/translated_article_fixture.php @@ -64,4 +64,4 @@ class TranslatedArticleFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/translated_item_fixture.php b/cake/tests/fixtures/translated_item_fixture.php index f8b93ce8a..43ac7fff8 100644 --- a/cake/tests/fixtures/translated_item_fixture.php +++ b/cake/tests/fixtures/translated_item_fixture.php @@ -61,4 +61,4 @@ class TranslatedItemFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/underscore_field_fixture.php b/cake/tests/fixtures/underscore_field_fixture.php index c87ace540..5e7fde739 100644 --- a/cake/tests/fixtures/underscore_field_fixture.php +++ b/cake/tests/fixtures/underscore_field_fixture.php @@ -66,4 +66,4 @@ class UnderscoreFieldFixture extends CakeTestFixture { } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/user_fixture.php b/cake/tests/fixtures/user_fixture.php index bb8478034..739c455f4 100644 --- a/cake/tests/fixtures/user_fixture.php +++ b/cake/tests/fixtures/user_fixture.php @@ -65,4 +65,4 @@ class UserFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/fixtures/uuid_fixture.php b/cake/tests/fixtures/uuid_fixture.php index 12a0dd99f..295cb5748 100644 --- a/cake/tests/fixtures/uuid_fixture.php +++ b/cake/tests/fixtures/uuid_fixture.php @@ -65,4 +65,4 @@ class UuidFixture extends CakeTestFixture { ); } -?> +?> \ No newline at end of file diff --git a/cake/tests/groups/controller.group.php b/cake/tests/groups/controller.group.php index 8bbc801ac..074c20510 100644 --- a/cake/tests/groups/controller.group.php +++ b/cake/tests/groups/controller.group.php @@ -52,4 +52,4 @@ function ControllerGroupTest() { TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'controller' . DS . 'controller_merge_vars'); } } -?> +?> \ No newline at end of file From f2cc41bb3a360d460c1fe4b16d077656ec2dbf37 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 14 Jan 2010 22:15:06 -0500 Subject: [PATCH 1494/2083] Fixing php4 issues for AclShell test case. --- cake/console/libs/acl.php | 10 ++++++---- cake/libs/controller/components/acl.php | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cake/console/libs/acl.php b/cake/console/libs/acl.php index 6bd6bc0bf..68c234062 100644 --- a/cake/console/libs/acl.php +++ b/cake/console/libs/acl.php @@ -92,7 +92,7 @@ function startup() { require_once (CONFIGS.'database.php'); if (!in_array($this->command, array('initdb'))) { - $this->Acl = new AclComponent(); + $this->Acl =& new AclComponent(); $controller = null; $this->Acl->startup($controller); } @@ -257,9 +257,9 @@ function check() { extract($this->__getParams()); if ($this->Acl->check($aro, $aco, $action)) { - $this->out(sprintf(__("%s is allowed.", true), $aro), true); + $this->out(sprintf(__("%s is allowed.", true), $aroName), true); } else { - $this->out(sprintf(__("%s is not allowed.", true), $aro), true); + $this->out(sprintf(__("%s is not allowed.", true), $aroName), true); } } @@ -560,6 +560,8 @@ function _getNodeId($class, $identifier) { function __getParams() { $aro = is_numeric($this->args[0]) ? intval($this->args[0]) : $this->args[0]; $aco = is_numeric($this->args[1]) ? intval($this->args[1]) : $this->args[1]; + $aroName = $aro; + $acoName = $aco; if (is_string($aro)) { $aro = $this->parseIdentifier($aro); @@ -574,7 +576,7 @@ function __getParams() { $action = '*'; } } - return compact('aro', 'aco', 'action'); + return compact('aro', 'aco', 'action', 'aroName', 'acoName'); } /** diff --git a/cake/libs/controller/components/acl.php b/cake/libs/controller/components/acl.php index 93be871b4..1e15fcb78 100644 --- a/cake/libs/controller/components/acl.php +++ b/cake/libs/controller/components/acl.php @@ -225,8 +225,8 @@ function __construct() { * @access public */ function initialize(&$component) { - $component->Aro = $this->Aro; - $component->Aco = $this->Aco; + $component->Aro =& $this->Aro; + $component->Aco =& $this->Aco; } /** From af4e9ba76e747678ece720a1530e3ed7d5123aab Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 14 Jan 2010 22:18:26 -0500 Subject: [PATCH 1495/2083] Fixing php4 reference issues in CakeSchema. --- cake/libs/model/cake_schema.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cake/libs/model/cake_schema.php b/cake/libs/model/cake_schema.php index 42c2cb482..42d865703 100644 --- a/cake/libs/model/cake_schema.php +++ b/cake/libs/model/cake_schema.php @@ -161,7 +161,7 @@ function after($event = array()) { * @return array Set of name and tables * @access public */ - function load($options = array()) { + function &load($options = array()) { if (is_string($options)) { $options = array('path' => $options); } @@ -183,8 +183,8 @@ function load($options = array()) { $Schema =& new $class($options); return $Schema; } - - return false; + $false = false; + return $false; } /** From 2093f05ce7b38b106c6f22a77a472c29063f58dd Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 14 Jan 2010 22:33:14 -0500 Subject: [PATCH 1496/2083] Fixing php4 compatibility issues in CakeLog. --- cake/libs/cake_log.php | 14 +++++++------- cake/tests/cases/libs/cake_log.test.php | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cake/libs/cake_log.php b/cake/libs/cake_log.php index d0d586775..610624fd5 100644 --- a/cake/libs/cake_log.php +++ b/cake/libs/cake_log.php @@ -63,7 +63,7 @@ class CakeLog { function &getInstance() { static $instance = array(); if (!isset($instance[0])) { - $instance[0] = new CakeLog(); + $instance[0] =& new CakeLog(); } return $instance[0]; } @@ -82,7 +82,7 @@ function config($key, $config) { trigger_error(__('Missing logger classname', true), E_USER_WARNING); return false; } - $self = CakeLog::getInstance(); + $self =& CakeLog::getInstance(); $className = $self->_getLogger($config['engine']); if (!$className) { return false; @@ -113,7 +113,7 @@ function _getLogger($loggerName) { trigger_error(sprintf(__('Could not load logger class %s', true), $loggerName), E_USER_WARNING); return false; } - if (!method_exists($loggerName, 'write')) { + if (!is_callable(array($loggerName, 'write'))) { trigger_error( sprintf(__('logger class %s does not implement a write method.', true), $loggerName), E_USER_WARNING @@ -130,7 +130,7 @@ function _getLogger($loggerName) { * @static */ function configured() { - $self = CakeLog::getInstance(); + $self =& CakeLog::getInstance(); return array_keys($self->_streams); } @@ -143,7 +143,7 @@ function configured() { * @static */ function drop($streamName) { - $self = CakeLog::getInstance(); + $self =& CakeLog::getInstance(); unset($self->_streams[$streamName]); } @@ -157,7 +157,7 @@ function _autoConfig() { if (!class_exists('FileLog')) { App::import('Core', 'log/FileLog'); } - $this->_streams['default'] = new FileLog(array('path' => LOGS)); + $this->_streams['default'] =& new FileLog(array('path' => LOGS)); } /** @@ -188,7 +188,7 @@ function write($type, $message) { if (is_int($type) && isset($levels[$type])) { $type = $levels[$type]; } - $self = CakeLog::getInstance(); + $self =& CakeLog::getInstance(); if (empty($self->_streams)) { $self->_autoConfig(); } diff --git a/cake/tests/cases/libs/cake_log.test.php b/cake/tests/cases/libs/cake_log.test.php index 55909c70e..32c75f3eb 100644 --- a/cake/tests/cases/libs/cake_log.test.php +++ b/cake/tests/cases/libs/cake_log.test.php @@ -175,7 +175,7 @@ function testLoggingWithErrorHandling() { $result = file(LOGS . 'debug.log'); $this->assertEqual(count($result), 1); $this->assertPattern( - '/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} Notice: Notice \(8\): Undefined variable: out in \[.+ line \d+\]$/', + '/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} Notice: Notice \(8\): Undefined variable:\s+out in \[.+ line \d+\]$/', $result[0] ); @unlink(LOGS . 'debug.log'); From 5d280ea9779fb47b70377e70c9a01d08c039c34c Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 14 Jan 2010 22:47:49 -0500 Subject: [PATCH 1497/2083] Making CodeCoverageManager and CakeSession tests run in php4. Removing test case for removed method. --- cake/tests/cases/libs/cake_session.test.php | 1 + .../cases/libs/code_coverage_manager.test.php | 168 +----------------- 2 files changed, 4 insertions(+), 165 deletions(-) diff --git a/cake/tests/cases/libs/cake_session.test.php b/cake/tests/cases/libs/cake_session.test.php index 506e896b7..81e94d266 100644 --- a/cake/tests/cases/libs/cake_session.test.php +++ b/cake/tests/cases/libs/cake_session.test.php @@ -167,6 +167,7 @@ function testStarted() { $this->assertTrue($this->Session->started()); unset($_SESSION); + $_SESSION = null; $this->assertFalse($this->Session->started()); $this->assertTrue($this->Session->start()); } diff --git a/cake/tests/cases/libs/code_coverage_manager.test.php b/cake/tests/cases/libs/code_coverage_manager.test.php index a2e730c60..57510e835 100644 --- a/cake/tests/cases/libs/code_coverage_manager.test.php +++ b/cake/tests/cases/libs/code_coverage_manager.test.php @@ -96,9 +96,9 @@ function remove($var) { $contents[1] = array_filter($contents[1], "remove"); foreach ($contents[1] as $file) { - CodeCoverageManager::init('libs'.DS.$file, $reporter); + CodeCoverageManager::init('libs' . DS . $file, $reporter); CodeCoverageManager::report(false); - $this->assertNoErrors('libs'.DS.$file); + $this->assertNoErrors('libs' . DS . $file); } } } @@ -139,173 +139,11 @@ function testGetTestObjectFileNameFromTestCaseFile() { $this->assertIdentical(APP.'plugins'.DS.'bugs'.DS.'models'.DS.'some_file.php', $expected); $manager->pluginTest = false; - $manager->reporter = new CLIReporter; + $manager->reporter = new CakeCliReporter; $expected = $manager->__testObjectFileFromCaseFile('libs/set.test.php', false); $this->assertIdentical(ROOT.DS.'cake'.DS.'libs'.DS.'set.php', $expected); } -/** - * testOfHtmlReport method - * - * @access public - * @return void - */ - function testOfHtmlReport() { - $manager =& CodeCoverageManager::getInstance(); - $code = <<value = func_get_arg(0); - } else { - \$this->value = func_get_args(); - } - } - -/** - * Returns the contents of the Set object - * - * @return array - * @access public - */ - function &get() { - return \$this->value; - } - -/** - * This function can be thought of as a hybrid between PHP's array_merge and array_merge_recursive. The difference - * to the two is that if an array key contains another array then the function behaves recursive (unlike array_merge) - * but does not do if for keys containing strings (unlike array_merge_recursive). See the unit test for more information. - * - * Note: This function will work with an unlimited amount of arguments and typecasts non-array parameters into arrays. - * - * @param array \$arr1 Array to be merged - * @param array \$arr2 Array to merge with - * @return array Merged array - * @access public - */ - function merge(\$arr1, \$arr2 = null) { - \$args = func_get_args(); - - if (isset(\$this) && is_a(\$this, 'set')) { - \$backtrace = debug_backtrace(); - \$previousCall = strtolower(\$backtrace[1]['class'].'::'.\$backtrace[1]['function']); - if (\$previousCall != 'set::merge') { - \$r =& \$this->value; - array_unshift(\$args, null); - } - } - if (!isset(\$r)) { - \$r = (array)current(\$args); - } - - while ((\$arg = next(\$args)) !== false) { - if (is_a(\$arg, 'set')) { - \$arg = \$arg->get(); - } - - foreach ((array)\$arg as \$key => \$val) { - if (is_array(\$val) && isset(\$r[\$key]) && is_array(\$r[\$key])) { - \$r[\$key] = Set::merge(\$r[\$key], \$val); - } elseif (is_int(\$key)) { - - } else { - \$r[\$key] = \$val; - } - } - } - return \$r; - } -PHP; - - $testObjectFile = explode("\n", $code); - $coverageData = array( - 0 => 1, - 1 => 1, - 2 => -2, - 3 => -2, - 4 => -2, - 5 => -2, - 6 => -2, - 7 => -2, - 8 => -1, - 9 => -2, - 10 => -2, - 11 => -2, - 12 => -2, - 13 => -2, - 14 => 1, - 15 => 1, - 16 => -1, - 17 => 1, - 18 => 1, - 19 => -1, - 20 => 1, - 21 => -2, - 22 => -2, - 23 => -2, - 24 => -2, - 25 => -2, - 26 => -2, - 27 => 1, - 28 => -1, - 29 => 1, - 30 => 1, - 31 => -2, - 32 => -2, - 33 => -2, - 34 => -2, - 35 => -2, - 36 => -2, - 37 => -2, - 38 => -2, - 39 => -2, - 40 => -2, - 41 => -2, - 42 => -2, - 43 => -1, - ); - $execCodeLines = range(0, 72); - $result = explode("", $report = $manager->reportCaseHtml($testObjectFile, $coverageData, $execCodeLines)); - - foreach ($result as $num => $line) { - $num++; - if (array_key_exists($num, $coverageData)) { - if ($coverageData[$num] == 1) { - $this->assertTrue(strpos($line, 'covered') !== false, $num.': '.$line." fails"); - } - - if (!array_key_exists($num, $execCodeLines) || $coverageData[$num] == -2) { - $this->assertTrue(strpos($line, 'ignored') !== false, $num.': '.$line." fails"); - } - - if ($coverageData[$num] == -1) { - $this->assertTrue(strpos($line, 'uncovered') !== false, $num.': '.$line." fails"); - } - } - } - } - /** * testOfHtmlDiffReport method * From 5212406ea72584336117f177f7d56e19447101be Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 14 Jan 2010 22:48:19 -0500 Subject: [PATCH 1498/2083] Making xml data test php5 only as Xml::compare() is non-functional in php4 --- .../libs/controller/components/auth.test.php | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php index 9f819fd01..676907417 100644 --- a/cake/tests/cases/libs/controller/components/auth.test.php +++ b/cake/tests/cases/libs/controller/components/auth.test.php @@ -1244,16 +1244,18 @@ function testHashPasswords() { $expected['AuthUser']['password'] = Security::hash($expected['AuthUser']['password'], null, true); $this->assertEqual($return, $expected); - $xml = array( - 'User' => array( - 'username' => 'batman@batcave.com', - 'password' => 'bruceWayne', - ) - ); - $data = new Xml($xml); - $return = $this->Controller->Auth->hashPasswords($data); - $expected = $data; - $this->assertEqual($return, $expected); + if (PHP5) { + $xml = array( + 'User' => array( + 'username' => 'batman@batcave.com', + 'password' => 'bruceWayne', + ) + ); + $data =& new Xml($xml); + $return = $this->Controller->Auth->hashPasswords($data); + $expected = $data; + $this->assertEqual($return, $expected); + } } /** From 96c56d7446cd6fc6ccc0b9486cd2e465d7bd5bf0 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 14 Jan 2010 22:54:17 -0500 Subject: [PATCH 1499/2083] Fixing failing tests in php4 caused by missing & operators. --- cake/libs/controller/controller.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 98e1b3a6c..55a31f08a 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -1031,18 +1031,18 @@ function paginate($object = null, $scope = array(), $whitelist = array()) { } if ($assoc && isset($this->{$object}->{$assoc})) { - $object = $this->{$object}->{$assoc}; + $object =& $this->{$object}->{$assoc}; } elseif ( $assoc && isset($this->{$this->modelClass}) && isset($this->{$this->modelClass}->{$assoc} )) { - $object = $this->{$this->modelClass}->{$assoc}; + $object =& $this->{$this->modelClass}->{$assoc}; } elseif (isset($this->{$object})) { - $object = $this->{$object}; + $object =& $this->{$object}; } elseif ( isset($this->{$this->modelClass}) && isset($this->{$this->modelClass}->{$object} )) { - $object = $this->{$this->modelClass}->{$object}; + $object =& $this->{$this->modelClass}->{$object}; } } elseif (empty($object) || $object === null) { if (isset($this->{$this->modelClass})) { From f2dc2078c236bdcb324b8629ab4f50159b9f0d91 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 14 Jan 2010 22:56:34 -0500 Subject: [PATCH 1500/2083] Making PagesController include SessionHelper. --- cake/libs/controller/pages_controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/controller/pages_controller.php b/cake/libs/controller/pages_controller.php index c614a0595..2f0b0c631 100644 --- a/cake/libs/controller/pages_controller.php +++ b/cake/libs/controller/pages_controller.php @@ -44,7 +44,7 @@ class PagesController extends AppController { * @var array * @access public */ - var $helpers = array('Html'); + var $helpers = array('Html', 'Session'); /** * This controller does not use a model From d4d9ed7bfe114afa0eb88c1f42f8033569c5f6c7 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 14 Jan 2010 23:06:48 -0500 Subject: [PATCH 1501/2083] Fixing test cases and php4 compatibility in Debugger. --- cake/libs/debugger.php | 12 +++++------ cake/tests/cases/libs/debugger.test.php | 28 ++++++++++++------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index 064688d26..f7c04f013 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -213,7 +213,7 @@ function &getInstance($class = null) { * @link http://book.cakephp.org/view/460/Using-the-Debugger-Class */ function dump($var) { - $_this = Debugger::getInstance(); + $_this =& Debugger::getInstance(); pr($_this->exportVar($var)); } @@ -228,7 +228,7 @@ function dump($var) { * @link http://book.cakephp.org/view/460/Using-the-Debugger-Class */ function log($var, $level = LOG_DEBUG) { - $_this = Debugger::getInstance(); + $_this =& Debugger::getInstance(); $source = $_this->trace(array('start' => 1)) . "\n"; CakeLog::write($level, "\n" . $source . $_this->exportVar($var)); } @@ -249,7 +249,7 @@ function handleError($code, $description, $file = null, $line = null, $context = return; } - $_this = Debugger::getInstance(); + $_this =& Debugger::getInstance(); if (empty($file)) { $file = '[internal]'; @@ -327,7 +327,7 @@ function handleError($code, $description, $file = null, $line = null, $context = * @link http://book.cakephp.org/view/460/Using-the-Debugger-Class */ function trace($options = array()) { - $_this = Debugger::getInstance(); + $_this =& Debugger::getInstance(); $defaults = array( 'depth' => 999, 'format' => $_this->_outputFormat, @@ -472,7 +472,7 @@ function excerpt($file, $line, $context = 2) { * @link http://book.cakephp.org/view/460/Using-the-Debugger-Class */ function exportVar($var, $recursion = 0) { - $_this = Debugger::getInstance(); + $_this =& Debugger::getInstance(); switch (strtolower(gettype($var))) { case 'boolean': return ($var) ? 'true' : 'false'; @@ -556,7 +556,7 @@ function __object($var) { * @access protected */ function output($format = null, $strings = array()) { - $_this = Debugger::getInstance(); + $_this =& Debugger::getInstance(); $data = null; if (is_null($format)) { diff --git a/cake/tests/cases/libs/debugger.test.php b/cake/tests/cases/libs/debugger.test.php index 175fbadf2..8dc91a068 100644 --- a/cake/tests/cases/libs/debugger.test.php +++ b/cake/tests/cases/libs/debugger.test.php @@ -117,19 +117,19 @@ function testOutput() { $result = Debugger::output(true); $this->assertEqual($result[0]['error'], 'Notice'); - $this->assertEqual($result[0]['description'], 'Undefined variable: out'); - $this->assertPattern('/DebuggerTest::testOutput/', $result[0]['trace']); - $this->assertPattern('/SimpleInvoker::invoke/', $result[0]['trace']); + $this->assertPattern('/Undefined variable\:\s+out/', $result[0]['description']); + $this->assertPattern('/DebuggerTest::testOutput/i', $result[0]['trace']); + $this->assertPattern('/SimpleInvoker::invoke/i', $result[0]['trace']); ob_start(); Debugger::output('txt'); $other .= ''; $result = ob_get_clean(); - $this->assertPattern('/Undefined variable: other/', $result); + $this->assertPattern('/Undefined variable:\s+other/', $result); $this->assertPattern('/Context:/', $result); - $this->assertPattern('/DebuggerTest::testOutput/', $result); - $this->assertPattern('/SimpleInvoker::invoke/', $result); + $this->assertPattern('/DebuggerTest::testOutput/i', $result); + $this->assertPattern('/SimpleInvoker::invoke/i', $result); ob_start(); Debugger::output('html'); @@ -137,7 +137,7 @@ function testOutput() { $result = ob_get_clean(); $this->assertPattern('/
    .+<\/pre>/', $result);
     		$this->assertPattern('/Notice<\/b>/', $result);
    -		$this->assertPattern('/variable: wrong/', $result);
    +		$this->assertPattern('/variable:\s+wrong/', $result);
     
     		ob_start();
     		Debugger::output('js');
    @@ -154,7 +154,7 @@ function testOutput() {
     			'b' => array(), 'Notice', '/b', ' (8)',
     		));
     
    -		$this->assertPattern('/Undefined variable: buzz/', $result[1]);
    +		$this->assertPattern('/Undefined variable:\s+buzz/', $result[1]);
     		$this->assertPattern('/]+>Code/', $result[1]);
     		$this->assertPattern('/]+>Context/', $result[2]);
     		set_error_handler('simpleTestErrorHandler');
    @@ -185,14 +185,14 @@ function testChangeOutputFormats() {
     		ob_start();
     		$foo .= '';
     		$result = ob_get_clean();
    -		set_error_handler('simpleTestErrorHandler');
    +		set_error_handler('SimpleTestErrorHandler');
     
     		$data = array(
     			'error' => array(),
     			'code' => array(), '8', '/code',
     			'file' => array(), 'preg:/[^<]+/', '/file',
     			'line' => array(), '' . (intval(__LINE__) + -8), '/line',
    -			'Undefined variable: foo',
    +			'preg:/Undefined variable:\s+foo/',
     			'/error'
     		);
     		$this->assertTags($result, $data, true);
    @@ -255,8 +255,8 @@ function testExportVar() {
     		View::$__scripts = array
     		View::$__paths = array
     		View::$webroot = NULL';
    -		$result = str_replace(array("\t", "\r\n", "\n"), "", $result);
    -		$expected =  str_replace(array("\t", "\r\n", "\n"), "", $expected);
    +		$result = str_replace(array("\t", "\r\n", "\n"), "", strtolower($result));
    +		$expected =  str_replace(array("\t", "\r\n", "\n"), "", strtolower($expected));
     		$this->assertEqual($result, $expected);
     	}
     
    @@ -273,14 +273,14 @@ function testLog() {
     
     		Debugger::log('cool');
     		$result = file_get_contents(LOGS . 'debug.log');
    -		$this->assertPattern('/DebuggerTest\:\:testLog/', $result);
    +		$this->assertPattern('/DebuggerTest\:\:testLog/i', $result);
     		$this->assertPattern('/"cool"/', $result);
     
     		unlink(TMP . 'logs' . DS . 'debug.log');
     
     		Debugger::log(array('whatever', 'here'));
     		$result = file_get_contents(TMP . 'logs' . DS . 'debug.log');
    -		$this->assertPattern('/DebuggerTest\:\:testLog/', $result);
    +		$this->assertPattern('/DebuggerTest\:\:testLog/i', $result);
     		$this->assertPattern('/\[main\]/', $result);
     		$this->assertPattern('/array/', $result);
     		$this->assertPattern('/"whatever",/', $result);
    
    From 036d7e6e131a90926932d77f82076fa0309d05cb Mon Sep 17 00:00:00 2001
    From: Mark Story 
    Date: Thu, 14 Jan 2010 23:07:15 -0500
    Subject: [PATCH 1502/2083] Updating helper syntax.
    
    ---
     cake/tests/test_app/views/layouts/default.ctp | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/cake/tests/test_app/views/layouts/default.ctp b/cake/tests/test_app/views/layouts/default.ctp
    index 2ffad72a7..bc442c7d2 100644
    --- a/cake/tests/test_app/views/layouts/default.ctp
    +++ b/cake/tests/test_app/views/layouts/default.ctp
    @@ -38,7 +38,7 @@
     		
     		
    - flash();?> + Session->flash();?> From 547aa76c92bce8dea0979010e177a0d8fd8434f2 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 14 Jan 2010 23:07:48 -0500 Subject: [PATCH 1503/2083] Fixing method_exists() use for php4, as method_exists cannot be used with class/method names in php4. --- cake/libs/view/helpers/paginator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index dd77f3d7b..8b326efc5 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -91,7 +91,7 @@ function __construct($config = array()) { App::import('Helper', $ajaxProvider); $classname = $ajaxProvider . 'Helper'; - if (!method_exists($classname, 'link')) { + if (!is_callable(array($classname, 'link'))) { $message = sprintf( __('%s does not implement a link() method, it is incompatible with PaginatorHelper', true), $classname From 3a38e0869fdecdecadf89ca27ca8909ec62c9bc3 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 14 Jan 2010 23:17:24 -0500 Subject: [PATCH 1504/2083] Fixing php4 issues in ErrorHandler and ErrorHandler testcase. --- cake/libs/error.php | 4 ++-- cake/tests/cases/libs/error.test.php | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cake/libs/error.php b/cake/libs/error.php index abe8a5063..9beb1d599 100644 --- a/cake/libs/error.php +++ b/cake/libs/error.php @@ -112,8 +112,8 @@ function __construct($method, $messages) { if (strtolower($parentClass) != 'errorhandler') { $method = 'error404'; } - $parentMethods = get_class_methods($parentClass); - if (in_array($method, $parentMethods)) { + $parentMethods = array_map('strtolower', get_class_methods($parentClass)); + if (in_array(strtolower($method), $parentMethods)) { $method = 'error404'; } if (isset($code) && $code == 500) { diff --git a/cake/tests/cases/libs/error.test.php b/cake/tests/cases/libs/error.test.php index c8c2c116a..d9ddfdd34 100644 --- a/cake/tests/cases/libs/error.test.php +++ b/cake/tests/cases/libs/error.test.php @@ -279,19 +279,21 @@ function testSubclassMethodsNotBeingConvertedToError() { $back = Configure::read('debug'); Configure::write('debug', 2); ob_start(); - $ErrorHandler = new MyCustomErrorHandler('missingWidgetThing', array('message' => 'doh!')); + $ErrorHandler =& new MyCustomErrorHandler('missingWidgetThing', array('message' => 'doh!')); $result = ob_get_clean(); $this->assertEqual($result, 'widget thing is missing'); Configure::write('debug', 0); ob_start(); - $ErrorHandler = new MyCustomErrorHandler('missingWidgetThing', array('message' => 'doh!')); + $ErrorHandler =& new MyCustomErrorHandler('missingWidgetThing', array('message' => 'doh!')); $result = ob_get_clean(); $this->assertEqual($result, 'widget thing is missing', 'Method declared in subclass converted to error404. %s'); Configure::write('debug', 0); ob_start(); - $ErrorHandler = new MyCustomErrorHandler('missingController', array('message' => 'Page not found')); + $ErrorHandler =& new MyCustomErrorHandler('missingController', array( + 'className' => 'Missing', 'message' => 'Page not found' + )); $result = ob_get_clean(); $this->assertPattern('/Not Found/', $result, 'Method declared in error handler not converted to error404. %s'); From 371ac3971aa6c665a1cf51bf9fc64d05d928568b Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 14 Jan 2010 23:38:24 -0500 Subject: [PATCH 1505/2083] Fixing php4 compatibility in model_read test. --- .../cases/libs/model/model_read.test.php | 172 +++++++++--------- 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/cake/tests/cases/libs/model/model_read.test.php b/cake/tests/cases/libs/model/model_read.test.php index 6bc4606f8..1ed9fd9e1 100755 --- a/cake/tests/cases/libs/model/model_read.test.php +++ b/cake/tests/cases/libs/model/model_read.test.php @@ -7171,98 +7171,98 @@ function testFindQueryTypeInCallbacks() { * @access public * @return void */ - function testVirtualFields() { - $this->loadFixtures('Post','Author'); - $Post = ClassRegistry::init('Post'); - $Post->virtualFields = array('two' => "1 + 1"); - $result = $Post->find('first'); - $this->assertEqual($result['Post']['two'], 2); - - $Post->Author->virtualFields = array('false' => '1 = 2'); - $result = $Post->find('first'); - $this->assertEqual($result['Post']['two'], 2); - $this->assertEqual($result['Author']['false'],false); - - $result = $Post->find('first',array('fields' => array('author_id'))); - $this->assertFalse(isset($result['Post']['two'])); - $this->assertFalse(isset($result['Author']['false'])); - - $result = $Post->find('first',array('fields' => array('author_id', 'two'))); - $this->assertEqual($result['Post']['two'], 2); - $this->assertFalse(isset($result['Author']['false'])); - - $result = $Post->find('first',array('fields' => array('two'))); - $this->assertEqual($result['Post']['two'], 2); - - $Post->id = 1; - $result = $Post->field('two'); - $this->assertEqual($result, 2); - - $result = $Post->find('first',array( - 'conditions' => array('two' => 2), - 'limit' => 1 - )); - $this->assertEqual($result['Post']['two'], 2); + function testVirtualFields() { + $this->loadFixtures('Post','Author'); + $Post =& ClassRegistry::init('Post'); + $Post->virtualFields = array('two' => "1 + 1"); + $result = $Post->find('first'); + $this->assertEqual($result['Post']['two'], 2); + + $Post->Author->virtualFields = array('false' => '1 = 2'); + $result = $Post->find('first'); + $this->assertEqual($result['Post']['two'], 2); + $this->assertEqual($result['Author']['false'], false); + + $result = $Post->find('first',array('fields' => array('author_id'))); + $this->assertFalse(isset($result['Post']['two'])); + $this->assertFalse(isset($result['Author']['false'])); + + $result = $Post->find('first',array('fields' => array('author_id', 'two'))); + $this->assertEqual($result['Post']['two'], 2); + $this->assertFalse(isset($result['Author']['false'])); + + $result = $Post->find('first',array('fields' => array('two'))); + $this->assertEqual($result['Post']['two'], 2); + + $Post->id = 1; + $result = $Post->field('two'); + $this->assertEqual($result, 2); + + $result = $Post->find('first',array( + 'conditions' => array('two' => 2), + 'limit' => 1 + )); + $this->assertEqual($result['Post']['two'], 2); - $result = $Post->find('first',array( - 'conditions' => array('two <' => 3), - 'limit' => 1 - )); - $this->assertEqual($result['Post']['two'], 2); + $result = $Post->find('first',array( + 'conditions' => array('two <' => 3), + 'limit' => 1 + )); + $this->assertEqual($result['Post']['two'], 2); - $result = $Post->find('first',array( - 'conditions' => array('NOT' => array('two >' => 3)), - 'limit' => 1 - )); - $this->assertEqual($result['Post']['two'], 2); + $result = $Post->find('first',array( + 'conditions' => array('NOT' => array('two >' => 3)), + 'limit' => 1 + )); + $this->assertEqual($result['Post']['two'], 2); - $dbo =& $Post->getDataSource(); - $Post->virtualFields = array('other_field' => 'Post.id + 1'); - $result = $Post->find('first',array( - 'conditions' => array('other_field' => 3), - 'limit' => 1 - )); - $this->assertEqual($result['Post']['id'], 2); + $dbo =& $Post->getDataSource(); + $Post->virtualFields = array('other_field' => 'Post.id + 1'); + $result = $Post->find('first',array( + 'conditions' => array('other_field' => 3), + 'limit' => 1 + )); + $this->assertEqual($result['Post']['id'], 2); - $Post->virtualFields = array('other_field' => 'Post.id + 1'); - $result = $Post->find('all',array( - 'fields' => array($dbo->calculate($Post, 'max',array('other_field'))) - )); - $this->assertEqual($result[0][0]['other_field'], 4); - - ClassRegistry::flush(); - $Writing = ClassRegistry::init(array('class' => 'Post', 'alias' => 'Writing'), 'Model'); - $Writing->virtualFields = array('two' => "1 + 1"); - $result = $Writing->find('first'); - $this->assertEqual($result['Writing']['two'], 2); - - $Post->create(); - $Post->virtualFields = array('other_field' => 'COUNT(Post.id) + 1'); - $result = $Post->field('other_field'); - $this->assertEqual($result, 4); - - ClassRegistry::flush(); - $Post = ClassRegistry::init('Post'); - - $Post->create(); - $Post->virtualFields = array( - 'year' => 'YEAR(Post.created)', - 'unique_test_field' => 'COUNT(Post.id)' - ); + $Post->virtualFields = array('other_field' => 'Post.id + 1'); + $result = $Post->find('all',array( + 'fields' => array($dbo->calculate($Post, 'max',array('other_field'))) + )); + $this->assertEqual($result[0][0]['other_field'], 4); + + ClassRegistry::flush(); + $Writing =& ClassRegistry::init(array('class' => 'Post', 'alias' => 'Writing'), 'Model'); + $Writing->virtualFields = array('two' => "1 + 1"); + $result = $Writing->find('first'); + $this->assertEqual($result['Writing']['two'], 2); + + $Post->create(); + $Post->virtualFields = array('other_field' => 'COUNT(Post.id) + 1'); + $result = $Post->field('other_field'); + $this->assertEqual($result, 4); - $expectation = array( - 'Post' => array( - 'year' => 2007, - 'unique_test_field' => 3 - ) - ); + ClassRegistry::flush(); + $Post =& ClassRegistry::init('Post'); - $result = $Post->find('first', array( - 'fields' => array_keys($Post->virtualFields), - 'group' => array('year') - )); + $Post->create(); + $Post->virtualFields = array( + 'year' => 'YEAR(Post.created)', + 'unique_test_field' => 'COUNT(Post.id)' + ); - $this->assertEqual($result, $expectation); - } + $expectation = array( + 'Post' => array( + 'year' => 2007, + 'unique_test_field' => 3 + ) + ); + + $result = $Post->find('first', array( + 'fields' => array_keys($Post->virtualFields), + 'group' => array('year') + )); + + $this->assertEqual($result, $expectation); + } } ?> \ No newline at end of file From 741f507c23309e4a12a8c7125233df9d501759c6 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 14 Jan 2010 23:38:39 -0500 Subject: [PATCH 1506/2083] Fixing reference errors in php4. --- cake/libs/router.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index 92193b429..9003bda8c 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -1041,7 +1041,7 @@ function normalize($url = '/') { * @access public * @static */ - function requestRoute() { + function &requestRoute() { $self =& Router::getInstance(); return $self->__currentRoute[0]; } @@ -1053,7 +1053,7 @@ function requestRoute() { * @access public * @static */ - function currentRoute() { + function ¤tRoute() { $self =& Router::getInstance(); return $self->__currentRoute[count($self->__currentRoute) - 1]; } From 276d183bddd88d6675b55fdb5a85083e14fe34ca Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 14 Jan 2010 23:40:18 -0500 Subject: [PATCH 1507/2083] Adding conditional to php5 only function use. --- cake/tests/cases/libs/set.test.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cake/tests/cases/libs/set.test.php b/cake/tests/cases/libs/set.test.php index c0f55d2a2..20188aff1 100644 --- a/cake/tests/cases/libs/set.test.php +++ b/cake/tests/cases/libs/set.test.php @@ -2404,9 +2404,11 @@ function testApply() { $expected = 9; $this->assertEqual($result, $expected); - $result = Set::apply('/Movie/rating', $data, 'array_product'); - $expected = 15; - $this->assertEqual($result, $expected); + if (PHP5) { + $result = Set::apply('/Movie/rating', $data, 'array_product'); + $expected = 15; + $this->assertEqual($result, $expected); + } $result = Set::apply('/Movie/title', $data, 'ucfirst', array('type' => 'map')); $expected = array('Movie 3', 'Movie 1', 'Movie 2'); From b97ac84a34b38d39ffe1b13923f7a9021b355e3e Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 14 Jan 2010 23:41:35 -0500 Subject: [PATCH 1508/2083] Fixing method_exists use in Validation for php4 compatibility. --- cake/libs/validation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/validation.php b/cake/libs/validation.php index eeb23030f..e34dbbfa4 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -927,7 +927,7 @@ function _pass($method, $check, $classPrefix) { trigger_error(sprintf(__('Could not find %s class, unable to complete validation.', true), $className), E_USER_WARNING); return false; } - if (!method_exists($className, $method)) { + if (!is_callable(array($className, $method))) { trigger_error(sprintf(__('Method %s does not exist on %s unable to complete validation.', true), $method, $className), E_USER_WARNING); return false; } From f1a069041594d86cc3ad2ccde25b4af5571b3f3f Mon Sep 17 00:00:00 2001 From: Mark Story Date: Fri, 15 Jan 2010 00:02:24 -0500 Subject: [PATCH 1509/2083] Fixing issues in JsHelper with PHP4 compatibility. Seems passing arrays by reference doesn't work very well. --- cake/libs/view/helpers/js.php | 10 +++++----- cake/tests/cases/libs/view/helpers/js.test.php | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index aa36fe26a..f15050409 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -299,7 +299,7 @@ function link($title, $url = null, $options = array()) { if (!isset($options['id'])) { $options['id'] = 'link-' . intval(mt_rand()); } - $htmlOptions = $this->_getHtmlOptions($options); + list($options, $htmlOptions) = $this->_getHtmlOptions($options); $out = $this->Html->link($title, $url, $htmlOptions); $this->get('#' . $htmlOptions['id']); $requestString = ''; @@ -366,7 +366,7 @@ function submit($caption = null, $options = array()) { $options['id'] = 'submit-' . intval(mt_rand()); } $formOptions = array('div'); - $htmlOptions = $this->_getHtmlOptions($options, $formOptions); + list($options, $htmlOptions) = $this->_getHtmlOptions($options, $formOptions); $out = $this->Form->submit($caption, $htmlOptions); $this->get('#' . $htmlOptions['id']); @@ -401,10 +401,10 @@ function submit($caption = null, $options = array()) { * * @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. + * @return array Array of js options and Htmloptions * @access public */ - function _getHtmlOptions(&$options, $additional = array()) { + function _getHtmlOptions($options, $additional = array()) { $htmlKeys = array_merge(array('class', 'id', 'escape', 'onblur', 'onfocus', 'rel', 'title'), $additional); $htmlOptions = array(); foreach ($htmlKeys as $key) { @@ -417,7 +417,7 @@ function _getHtmlOptions(&$options, $additional = array()) { $htmlOptions = array_merge($htmlOptions, $options['htmlAttributes']); unset($options['htmlAttributes']); } - return $htmlOptions; + return array($options, $htmlOptions); } } diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index e80d110bc..97c6a8b4a 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -279,6 +279,9 @@ function testWriteScriptsInFile() { @unlink(WWW_ROOT . $filename[1]); } + function getTests() { + return array('start', 'startCase', 'testLinkWithMock', 'endCase', 'end'); + } /** * test link() From 34c4af549c834c971cd488d3b6b47fd670f966ac Mon Sep 17 00:00:00 2001 From: Mark Story Date: Fri, 15 Jan 2010 00:09:59 -0500 Subject: [PATCH 1510/2083] Adding missing reference operators for php4 compatibility. --- cake/tests/cases/libs/view/view.test.php | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cake/tests/cases/libs/view/view.test.php b/cake/tests/cases/libs/view/view.test.php index 235081efe..0178cb9e6 100644 --- a/cake/tests/cases/libs/view/view.test.php +++ b/cake/tests/cases/libs/view/view.test.php @@ -634,7 +634,7 @@ function testAfterLayout() { */ function testRenderLoadHelper() { $this->PostsController->helpers = array('Session', 'Html', 'Form', 'Ajax'); - $View = new TestView($this->PostsController); + $View =& new TestView($this->PostsController); $result = $View->_render($View->getViewFileName('index'), array()); $this->assertEqual($result, 'posts index'); @@ -646,7 +646,7 @@ function testRenderLoadHelper() { $this->assertTrue(is_object($helpers['ajax']->Html)); $this->PostsController->helpers = array('Html', 'Form', 'Ajax', 'TestPlugin.PluggedHelper'); - $View = new TestView($this->PostsController); + $View =& new TestView($this->PostsController); $result = $View->_render($View->getViewFileName('index'), array()); $this->assertEqual($result, 'posts index'); @@ -674,7 +674,7 @@ function testRenderLoadHelper() { * @return void */ function testRender() { - $View = new TestView($this->PostsController); + $View =& new TestView($this->PostsController); $result = str_replace(array("\t", "\r\n", "\n"), "", $View->render('index')); $this->assertPattern("//", $result); @@ -686,7 +686,7 @@ function testRender() { $this->PostsController->set('pause', 3); $this->PostsController->set('page_title', 'yo what up'); - $View = new TestView($this->PostsController); + $View =& new TestView($this->PostsController); $result = str_replace(array("\t", "\r\n", "\n"), "", $View->render(false, 'flash')); $this->assertPattern("/<title>yo what up<\/title>/", $result); @@ -700,7 +700,7 @@ function testRender() { $this->PostsController->params['action'] = 'index'; Configure::write('Cache.check', true); - $View = new TestView($this->PostsController); + $View =& new TestView($this->PostsController); $result = str_replace(array("\t", "\r\n", "\n"), "", $View->render('index')); $this->assertPattern("/<meta http-equiv=\"Content-Type\" content=\"text\/html; charset=utf-8\" \/><title>/", $result); @@ -717,9 +717,9 @@ function testRenderLayoutWithMockCacheHelper() { $_check = Configure::read('Cache.check'); Configure::write('Cache.check', true); - $Controller = new ViewPostsController(); + $Controller =& new ViewPostsController(); $Controller->cacheAction = '1 day'; - $View = new View($Controller); + $View =& new View($Controller); $View->loaded['cache'] = new ViewTestMockCacheHelper(); $View->loaded['cache']->expectCallCount('cache', 2); @@ -736,10 +736,10 @@ function testRenderLayoutWithMockCacheHelper() { * @return void */ function testViewVarOverwritingLocalHelperVar() { - $Controller = new ViewPostsController(); + $Controller =& new ViewPostsController(); $Controller->helpers = array('Session', 'Html'); $Controller->set('html', 'I am some test html'); - $View = new View($Controller); + $View =& new View($Controller); $result = $View->render('helper_overwrite', false); $this->assertPattern('/I am some test html/', $result); @@ -753,7 +753,7 @@ function testViewVarOverwritingLocalHelperVar() { * @return void */ function testViewFileName() { - $View = new TestView($this->PostsController); + $View =& new TestView($this->PostsController); $result = $View->getViewFileName('index'); $this->assertPattern('/posts(\/|\\\)index.ctp/', $result); @@ -785,7 +785,7 @@ function testRenderCache() { return; } $view = 'test_view'; - $View = new View($this->PostsController); + $View =& new View($this->PostsController); $path = CACHE . 'views' . DS . 'view_cache_'.$view; $cacheText = '<!--cachetime:'.time().'-->some cacheText'; @@ -857,7 +857,7 @@ function testRenderNocache() { * @return void */ function testSet() { - $View = new TestView($this->PostsController); + $View =& new TestView($this->PostsController); $View->viewVars = array(); $View->set('somekey', 'someValue'); $this->assertIdentical($View->viewVars, array('somekey' => 'someValue')); @@ -883,7 +883,7 @@ function testSet() { * @return void */ function testEntityReference() { - $View = new TestView($this->PostsController); + $View =& new TestView($this->PostsController); $View->model = 'Post'; $View->field = 'title'; $this->assertEqual($View->entity(), array('Post', 'title')); @@ -913,7 +913,7 @@ function testBadExt() { $this->assertPattern("/posts(\/|\\\)this_is_missing.whatever/", $result); $this->PostsController->ext = ".bad"; - $View = new TestView($this->PostsController); + $View =& new TestView($this->PostsController); $result = str_replace(array("\t", "\r\n", "\n"), "", $View->render('index')); $this->assertPattern("/<meta http-equiv=\"Content-Type\" content=\"text\/html; charset=utf-8\" \/><title>/", $result); From f11068b831ef73b32a6ee345aeb4a21abfd3dc46 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 15 Jan 2010 13:26:47 -0500 Subject: [PATCH 1511/2083] Trimming trailing whitespace from files. Refs #201 --- cake/config/config.php | 2 +- cake/console/libs/tasks/model.php | 2 +- cake/tests/cases/libs/view/helpers/js.test.php | 2 +- cake/tests/lib/code_coverage_manager.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cake/config/config.php b/cake/config/config.php index 754b623ae..d633f71a6 100644 --- a/cake/config/config.php +++ b/cake/config/config.php @@ -20,4 +20,4 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ return $config['Cake.version'] = '1.3.0-alpha'; -?> +?> \ No newline at end of file diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 08ddb3b97..92827c646 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -915,4 +915,4 @@ function bakeFixture($className, $useTable = null) { $this->Fixture->bake($className, $useTable); } } -?> +?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index 97c6a8b4a..1e3a16437 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -772,4 +772,4 @@ function testOptionParsing() { } } -?> +?> \ No newline at end of file diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index 946842901..5ddeaab84 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -801,4 +801,4 @@ function __array_strpos($arr, $needle, $reverse = false) { return false; } } -?> +?> \ No newline at end of file From 813a7779e0f897fa61690be1429dd24a19973108 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 15 Jan 2010 13:28:09 -0500 Subject: [PATCH 1512/2083] Removing inflections.php from skel directory. --- .../templates/skel/config/inflections.php | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 cake/console/templates/skel/config/inflections.php diff --git a/cake/console/templates/skel/config/inflections.php b/cake/console/templates/skel/config/inflections.php deleted file mode 100644 index 085462b3b..000000000 --- a/cake/console/templates/skel/config/inflections.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -/** - * Custom Inflected Words. - * - * This file is used to hold words that are not matched in the normail Inflector::pluralize() and - * Inflector::singularize() - * - * PHP versions 4 and % - * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @package cake - * @subpackage cake.app.config - * @since CakePHP(tm) v 1.0.0.2312 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) - */ - -/** - * This is a key => value array of regex used to match words. - * If key matches then the value is returned. - * - * $pluralRules = array('/(s)tatus$/i' => '\1\2tatuses', '/^(ox)$/i' => '\1\2en', '/([m|l])ouse$/i' => '\1ice'); - */ - $pluralRules = array(); - -/** - * This is a key only array of plural words that should not be inflected. - * Notice the last comma - * - * $uninflectedPlural = array('.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox'); - */ - $uninflectedPlural = array(); - -/** - * This is a key => value array of plural irregular words. - * If key matches then the value is returned. - * - * $irregularPlural = array('atlas' => 'atlases', 'beef' => 'beefs', 'brother' => 'brothers') - */ - $irregularPlural = array(); - -/** - * This is a key => value array of regex used to match words. - * If key matches then the value is returned. - * - * $singularRules = array('/(s)tatuses$/i' => '\1\2tatus', '/(matr)ices$/i' =>'\1ix','/(vert|ind)ices$/i') - */ - $singularRules = array(); - -?> \ No newline at end of file From 1a8c3fd40588b532429cc38c5408cbfc4b00e627 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 15 Jan 2010 16:17:34 -0500 Subject: [PATCH 1513/2083] Fixing infinite loops caused by stale caches. --- cake/tests/cases/libs/object.test.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/object.test.php b/cake/tests/cases/libs/object.test.php index e54ba9150..8d722a0d6 100644 --- a/cake/tests/cases/libs/object.test.php +++ b/cake/tests/cases/libs/object.test.php @@ -662,7 +662,9 @@ function testRequestAction() { 'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS), 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS), 'controllers' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'controllers' . DS) - ), true); + )); + App::objects('plugin', null, false); + Router::reload(); $result = $this->object->requestAction('/tests_apps/index', array('return')); $expected = 'This is the TestsAppsController index view'; @@ -716,6 +718,9 @@ function testRequestAction() { $result = $this->object->requestAction(array('controller'=>'request_action', 'action'=>'paginate_request_action'), array('pass' => array(5), 'named' => array('param' => 'value'))); $this->assertTrue($result); + + App::build(); + App::objects('plugin', null, false); } /** From 4f5ce7f94cbbe1e99306e26c5dbedf49f28dc80e Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 15 Jan 2010 16:18:19 -0500 Subject: [PATCH 1514/2083] Adding additional plugin 'shortcut' dispatching tests. --- cake/tests/cases/dispatcher.test.php | 37 ++++++++++++++++++---------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index 2b99cd827..2917dc49d 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -1516,17 +1516,10 @@ function testAutomaticPluginControllerDispatch() { $controller = $Dispatcher->dispatch($url, array('return' => 1)); - $expected = 'my_plugin'; - $this->assertIdentical($controller->plugin, $expected); - - $expected = 'MyPlugin'; - $this->assertIdentical($controller->name, $expected); - - $expected = 'add'; - $this->assertIdentical($controller->action, $expected); - - $expected = array('param' => 'value', 'param2' => 'value2'); - $this->assertEqual($controller->params['named'], $expected); + $this->assertIdentical($controller->plugin, 'my_plugin'); + $this->assertIdentical($controller->name, 'MyPlugin'); + $this->assertIdentical($controller->action, 'add'); + $this->assertEqual($controller->params['named'], array('param' => 'value', 'param2' => 'value2')); Router::reload(); @@ -1678,6 +1671,8 @@ function testPluginShortCutUrlsWithControllerThatNeedsToBeLoaded() { App::build(array( 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) ), true); + App::objects('plugin', null, false); + $Dispatcher =& new TestDispatcher(); $Dispatcher->base = false; @@ -1687,6 +1682,21 @@ function testPluginShortCutUrlsWithControllerThatNeedsToBeLoaded() { $this->assertEqual($controller->params['plugin'], 'test_plugin'); $this->assertEqual($controller->params['action'], 'index'); $this->assertFalse(isset($controller->params['pass'][0])); + + $url = '/test_plugin/tests/index'; + $controller = $Dispatcher->dispatch($url, array('return' => 1)); + $this->assertEqual($controller->params['controller'], 'tests'); + $this->assertEqual($controller->params['plugin'], 'test_plugin'); + $this->assertEqual($controller->params['action'], 'index'); + $this->assertFalse(isset($controller->params['pass'][0])); + + $url = '/test_plugin/tests/index/some_param'; + $controller = $Dispatcher->dispatch($url, array('return' => 1)); + $this->assertEqual($controller->params['controller'], 'tests'); + $this->assertEqual($controller->params['plugin'], 'test_plugin'); + $this->assertEqual($controller->params['action'], 'index'); + $this->assertEqual($controller->params['pass'][0], 'some_param'); + App::build(); } @@ -1985,7 +1995,7 @@ function testFullPageCachingDispatch() { 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS), ), true); - $dispatcher =& new Dispatcher(); + $dispatcher =& new TestDispatcher(); $dispatcher->base = false; $url = '/'; @@ -2119,7 +2129,7 @@ function testCachedRegisteringViewObject() { 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS) )); - $dispatcher =& new Dispatcher(); + $dispatcher =& new TestDispatcher(); $dispatcher->base = false; $url = 'test_cached_pages/cache_form'; @@ -2139,6 +2149,7 @@ function testCachedRegisteringViewObject() { $this->assertEqual($result, $expected); $filename = $this->__cachePath($dispatcher->here); + @unlink($filename); ClassRegistry::flush(); } From 1f5d579ab614f4d4b566d7720ad55dbcf8d80b1d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 15 Jan 2010 16:19:23 -0500 Subject: [PATCH 1515/2083] Removing the ability to set layout, and viewPath with Request parameters. This feature was untested and undocumented. Furthermore, it should not be the responsibility of the dispatcher to set these parameters. --- cake/dispatcher.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/cake/dispatcher.php b/cake/dispatcher.php index ef63a3243..4dda2be43 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -167,16 +167,6 @@ function dispatch($url = null, $additionalParams = array()) { if (!empty($this->params['bare'])) { $controller->autoLayout = false; } - if (array_key_exists('layout', $this->params)) { - if (empty($this->params['layout'])) { - $controller->autoLayout = false; - } else { - $controller->layout = $this->params['layout']; - } - } - if (isset($this->params['viewPath'])) { - $controller->viewPath = $this->params['viewPath']; - } return $this->_invoke($controller, $this->params); } From 2441849fa008cb9aa2f77cd695c8a6f79f72c6a8 Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Sat, 16 Jan 2010 03:26:26 +0530 Subject: [PATCH 1516/2083] Replacing constant CIPHER_SEED with Configure class variable 'Security.cipher_seed' and renaming Security class method 'checkSessionKey' to 'checkSecurityKeys' --- app/config/core.php | 7 ++++++- cake/console/templates/default/views/home.ctp | 2 +- cake/console/templates/skel/config/core.php | 7 ++++++- cake/libs/controller/components/auth.php | 2 +- cake/libs/debugger.php | 8 ++++++-- cake/libs/security.php | 6 +----- cake/libs/view/pages/home.ctp | 2 +- cake/tests/test_app/views/pages/home.ctp | 2 +- 8 files changed, 23 insertions(+), 13 deletions(-) diff --git a/app/config/core.php b/app/config/core.php index 903c0205a..c127be2d1 100644 --- a/app/config/core.php +++ b/app/config/core.php @@ -74,7 +74,7 @@ * The value of the define determines the names of the routes * and their associated controller actions: * - * Set to an array of prefixes you want to use in your application. Use for + * Set to an array of prefixes you want to use in your application. Use for * admin or other prefixed routes. * * Routing.prefixes = array('admin', 'manager'); @@ -197,6 +197,11 @@ */ Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi'); +/** + * A random numeric string (digits only) used to encrypt/decrypt strings. + */ + Configure::write('Security.cipher_seed', '76859309657453542496749683645'); + /** * Apply timestamps with the last modified time to static assets (js, css, images). * Will append a querystring parameter containing the time the file was modified. This is diff --git a/cake/console/templates/default/views/home.ctp b/cake/console/templates/default/views/home.ctp index 0e478c4f1..eeaec4a24 100644 --- a/cake/console/templates/default/views/home.ctp +++ b/cake/console/templates/default/views/home.ctp @@ -3,7 +3,7 @@ $output = "<h2>Sweet, \"" . Inflector::humanize($app) . "\" got Baked by CakePHP $output .=" <?php if (Configure::read() > 0): - Debugger::checkSessionKey(); + Debugger::checkSecurityKeys(); endif; ?> <p> diff --git a/cake/console/templates/skel/config/core.php b/cake/console/templates/skel/config/core.php index a8b506d14..15ec7aec3 100644 --- a/cake/console/templates/skel/config/core.php +++ b/cake/console/templates/skel/config/core.php @@ -85,7 +85,7 @@ /** * Uncomment the define below to use CakePHP prefix routes. * - * Set to an array of prefixes you want to use in your application. Use for + * Set to an array of prefixes you want to use in your application. Use for * admin or other prefixed routes. * * Routing.prefixes = array('admin', 'manager'); @@ -206,6 +206,11 @@ */ Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi'); +/** + * A random numeric string (digits only) used to encrypt/decrypt strings. + */ + Configure::write('Security.cipher_seed', '76859309657453542496749683645'); + /** * Compress CSS output by removing comments, whitespace, repeating tags, etc. * This requires a/var/cache directory to be writable by the web server for caching. diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index b391b972b..bdbeb7146 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -278,7 +278,7 @@ function initialize(&$controller, $settings = array()) { $this->_set($settings); if (Configure::read() > 0) { App::import('Debugger'); - Debugger::checkSessionKey(); + Debugger::checkSecurityKeys(); } } diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index f7c04f013..ff01586cc 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -664,15 +664,19 @@ function _output($data = array()) { } /** - * Verifies that the application's salt value has been changed from the default value. + * Verifies that the application's salt and cipher seed value has been changed from the default value. * * @access public * @static */ - function checkSessionKey() { + function checkSecurityKeys() { if (Configure::read('Security.salt') == 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi') { trigger_error(__('Please change the value of \'Security.salt\' in app/config/core.php to a salt value specific to your application', true), E_USER_NOTICE); } + + if (Configure::read('Security.cipher_seed') == '76859309657453542496749683645') { + trigger_error(__('Please change the value of \'Security.cipher_seed\' in app/config/core.php to a numeric (digits only) seed value specific to your application', true), E_USER_NOTICE); + } } /** diff --git a/cake/libs/security.php b/cake/libs/security.php index b93f9934e..5bfc387bf 100644 --- a/cake/libs/security.php +++ b/cake/libs/security.php @@ -174,11 +174,7 @@ function cipher($text, $key) { return ''; } - if (!defined('CIPHER_SEED')) { - //This is temporary will change later - define('CIPHER_SEED', '76859309657453542496749683645'); - } - srand(CIPHER_SEED); + srand(Configure::read('Security.cipher_seed')); $out = ''; for ($i = 0; $i < strlen($text); $i++) { diff --git a/cake/libs/view/pages/home.ctp b/cake/libs/view/pages/home.ctp index 37951f8c9..adb658685 100644 --- a/cake/libs/view/pages/home.ctp +++ b/cake/libs/view/pages/home.ctp @@ -25,7 +25,7 @@ endif; echo $this->Html->link(__('Read the changelog', true), 'http://code.cakephp.org/wiki/changelog/1_3_0-alpha'); if (Configure::read() > 0): - Debugger::checkSessionKey(); + Debugger::checkSecurityKeys(); endif; ?> <p> diff --git a/cake/tests/test_app/views/pages/home.ctp b/cake/tests/test_app/views/pages/home.ctp index b9b6f00ed..1d394b49f 100644 --- a/cake/tests/test_app/views/pages/home.ctp +++ b/cake/tests/test_app/views/pages/home.ctp @@ -2,7 +2,7 @@ <?php if (Configure::read() > 0): - Debugger::checkSessionKey(); + Debugger::checkSecurityKeys(); endif; ?> <p> From 476ef19fff9235d118183e948b9e9f9319a348e1 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 15 Jan 2010 17:16:51 -0500 Subject: [PATCH 1517/2083] Removing gettests from jsHelper test case. --- cake/tests/cases/libs/view/helpers/js.test.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index 1e3a16437..525ea7b1c 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -279,9 +279,6 @@ function testWriteScriptsInFile() { @unlink(WWW_ROOT . $filename[1]); } - function getTests() { - return array('start', 'startCase', 'testLinkWithMock', 'endCase', 'end'); - } /** * test link() From 3bd4cc07a6af7d102cfafc90ae3195d58dbd0836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Fri, 15 Jan 2010 17:40:49 -0430 Subject: [PATCH 1518/2083] Fixes to make TimeHelper and test cases more compatible with PHP 4 --- cake/libs/view/helpers/time.php | 3 + .../cases/libs/view/helpers/time.test.php | 65 +++++++++---------- 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/cake/libs/view/helpers/time.php b/cake/libs/view/helpers/time.php index e4b9f7cb6..1431fd52c 100644 --- a/cake/libs/view/helpers/time.php +++ b/cake/libs/view/helpers/time.php @@ -174,6 +174,9 @@ function fromString($dateString, $userOffset = null) { if ($userOffset !== null) { return $this->convert($date, $userOffset); } + if ($date === -1) { + return false; + } return $date; } diff --git a/cake/tests/cases/libs/view/helpers/time.test.php b/cake/tests/cases/libs/view/helpers/time.test.php index 7b70d4ed7..d90fd4562 100644 --- a/cake/tests/cases/libs/view/helpers/time.test.php +++ b/cake/tests/cases/libs/view/helpers/time.test.php @@ -86,34 +86,34 @@ function testToQuarter() { * @return void */ function testTimeAgoInWords() { - $result = $this->Time->timeAgoInWords(strtotime('4 months, 2 weeks, 3 days'), array('end' => '8 years'), true); + $result = $this->Time->timeAgoInWords(strtotime('+4 months +2 weeks +3 days'), array('end' => '8 years'), true); $this->assertEqual($result, '4 months, 2 weeks, 3 days'); - $result = $this->Time->timeAgoInWords(strtotime('4 months, 2 weeks, 2 days'), array('end' => '8 years'), true); + $result = $this->Time->timeAgoInWords(strtotime('+4 months +2 weeks +2 days'), array('end' => '8 years'), true); $this->assertEqual($result, '4 months, 2 weeks, 2 days'); - $result = $this->Time->timeAgoInWords(strtotime('4 months, 2 weeks, 1 day'), array('end' => '8 years'), true); + $result = $this->Time->timeAgoInWords(strtotime('+4 months +2 weeks +1 day'), array('end' => '8 years'), true); $this->assertEqual($result, '4 months, 2 weeks, 1 day'); - $result = $this->Time->timeAgoInWords(strtotime('3 months, 2 weeks, 1 day'), array('end' => '8 years'), true); + $result = $this->Time->timeAgoInWords(strtotime('+3 months +2 weeks +1 day'), array('end' => '8 years'), true); $this->assertEqual($result, '3 months, 2 weeks, 1 day'); - $result = $this->Time->timeAgoInWords(strtotime('3 months, 2 weeks'), array('end' => '8 years'), true); + $result = $this->Time->timeAgoInWords(strtotime('+3 months +2 weeks'), array('end' => '8 years'), true); $this->assertEqual($result, '3 months, 2 weeks'); - $result = $this->Time->timeAgoInWords(strtotime('3 months, 1 week, 6 days'), array('end' => '8 years'), true); + $result = $this->Time->timeAgoInWords(strtotime('+3 months +1 week +6 days'), array('end' => '8 years'), true); $this->assertEqual($result, '3 months, 1 week, 6 days'); - $result = $this->Time->timeAgoInWords(strtotime('2 months, 2 weeks, 1 day'), array('end' => '8 years'), true); + $result = $this->Time->timeAgoInWords(strtotime('+2 months +2 weeks +1 day'), array('end' => '8 years'), true); $this->assertEqual($result, '2 months, 2 weeks, 1 day'); - $result = $this->Time->timeAgoInWords(strtotime('2 months, 2 weeks'), array('end' => '8 years'), true); + $result = $this->Time->timeAgoInWords(strtotime('+2 months +2 weeks'), array('end' => '8 years'), true); $this->assertEqual($result, '2 months, 2 weeks'); - $result = $this->Time->timeAgoInWords(strtotime('2 months, 1 week, 6 days'), array('end' => '8 years'), true); + $result = $this->Time->timeAgoInWords(strtotime('+2 months +1 week +6 days'), array('end' => '8 years'), true); $this->assertEqual($result, '2 months, 1 week, 6 days'); - $result = $this->Time->timeAgoInWords(strtotime('1 month, 1 week, 6 days'), array('end' => '8 years'), true); + $result = $this->Time->timeAgoInWords(strtotime('+1 month +1 week +6 days'), array('end' => '8 years'), true); $this->assertEqual($result, '1 month, 1 week, 6 days'); for($i = 0; $i < 200; $i ++) { @@ -157,8 +157,8 @@ function testTimeAgoInWords() { $relative_date .= ($relative_date ? ', -' : '-') . $seconds . ' second' . ($seconds != 1 ? 's' : ''); } - if (date('j/n/y', strtotime($relative_date)) != '1/1/70') { - $result = $this->Time->timeAgoInWords(strtotime($relative_date), array('end' => '8 years'), true); + if (date('j/n/y', strtotime(str_replace(',','',$relative_date))) != '1/1/70') { + $result = $this->Time->timeAgoInWords(strtotime(str_replace(',','',$relative_date)), array('end' => '8 years'), true); if ($relative_date == '0 seconds') { $relative_date = '0 seconds ago'; } @@ -211,9 +211,8 @@ function testTimeAgoInWords() { $relative_date .= ($relative_date ? ', ' : '') . $seconds . ' second' . ($seconds != 1 ? 's' : ''); } - if (date('j/n/y', strtotime($relative_date)) != '1/1/70') { - // echo $relative_date."<br />"; - $result = $this->Time->timeAgoInWords(strtotime($relative_date), array('end' => '8 years'), true); + if (date('j/n/y', strtotime(str_replace(',','',$relative_date))) != '1/1/70') { + $result = $this->Time->timeAgoInWords(strtotime(str_replace(',','',$relative_date)), array('end' => '8 years'), true); if ($relative_date == '0 seconds') { $relative_date = '0 seconds ago'; } @@ -223,7 +222,7 @@ function testTimeAgoInWords() { } } - $result = $this->Time->timeAgoInWords(strtotime('-2 years, -5 months, -2 days'), array('end' => '3 years'), true); + $result = $this->Time->timeAgoInWords(strtotime('-2 years -5 months -2 days'), array('end' => '3 years'), true); $this->assertEqual($result, '2 years, 5 months, 2 days ago'); $result = $this->Time->timeAgoInWords('2007-9-25'); @@ -235,44 +234,44 @@ function testTimeAgoInWords() { $result = $this->Time->timeAgoInWords('2007-9-25', 'Y-m-d', true); $this->assertEqual($result, 'on 2007-09-25'); - $result = $this->Time->timeAgoInWords(strtotime('-2 weeks, -2 days'), 'Y-m-d', false); + $result = $this->Time->timeAgoInWords(strtotime('-2 weeks -2 days'), 'Y-m-d', false); $this->assertEqual($result, '2 weeks, 2 days ago'); - $result = $this->Time->timeAgoInWords(strtotime('2 weeks, 2 days'), 'Y-m-d', true); + $result = $this->Time->timeAgoInWords(strtotime('+2 weeks +2 days'), 'Y-m-d', true); $this->assertPattern('/^2 weeks, [1|2] day(s)?$/', $result); - $result = $this->Time->timeAgoInWords(strtotime('2 months, 2 days'), array('end' => '1 month')); - $this->assertEqual($result, 'on ' . date('j/n/y', strtotime('2 months, 2 days'))); + $result = $this->Time->timeAgoInWords(strtotime('+2 months +2 days'), array('end' => '1 month')); + $this->assertEqual($result, 'on ' . date('j/n/y', strtotime('+2 months +2 days'))); - $result = $this->Time->timeAgoInWords(strtotime('2 months, 2 days'), array('end' => '3 month')); + $result = $this->Time->timeAgoInWords(strtotime('+2 months +2 days'), array('end' => '3 month')); $this->assertPattern('/2 months/', $result); - $result = $this->Time->timeAgoInWords(strtotime('2 months, 12 days'), array('end' => '3 month')); + $result = $this->Time->timeAgoInWords(strtotime('+2 months +12 days'), array('end' => '3 month')); $this->assertPattern('/2 months, 1 week/', $result); - $result = $this->Time->timeAgoInWords(strtotime('3 months, 5 days'), array('end' => '4 month')); + $result = $this->Time->timeAgoInWords(strtotime('+3 months +5 days'), array('end' => '4 month')); $this->assertEqual($result, '3 months, 5 days'); - $result = $this->Time->timeAgoInWords(strtotime('-2 months, -2 days'), array('end' => '3 month')); + $result = $this->Time->timeAgoInWords(strtotime('-2 months -2 days'), array('end' => '3 month')); $this->assertEqual($result, '2 months, 2 days ago'); - $result = $this->Time->timeAgoInWords(strtotime('-2 months, -2 days'), array('end' => '3 month')); + $result = $this->Time->timeAgoInWords(strtotime('-2 months -2 days'), array('end' => '3 month')); $this->assertEqual($result, '2 months, 2 days ago'); - $result = $this->Time->timeAgoInWords(strtotime('2 months, 2 days'), array('end' => '3 month')); + $result = $this->Time->timeAgoInWords(strtotime('+2 months +2 days'), array('end' => '3 month')); $this->assertPattern('/2 months/', $result); - $result = $this->Time->timeAgoInWords(strtotime('2 months, 2 days'), array('end' => '1 month', 'format' => 'Y-m-d')); - $this->assertEqual($result, 'on ' . date('Y-m-d', strtotime('2 months, 2 days'))); + $result = $this->Time->timeAgoInWords(strtotime('+2 months +2 days'), array('end' => '1 month', 'format' => 'Y-m-d')); + $this->assertEqual($result, 'on ' . date('Y-m-d', strtotime('+2 months +2 days'))); - $result = $this->Time->timeAgoInWords(strtotime('-2 months, -2 days'), array('end' => '1 month', 'format' => 'Y-m-d')); - $this->assertEqual($result, 'on ' . date('Y-m-d', strtotime('-2 months, -2 days'))); + $result = $this->Time->timeAgoInWords(strtotime('-2 months -2 days'), array('end' => '1 month', 'format' => 'Y-m-d')); + $this->assertEqual($result, 'on ' . date('Y-m-d', strtotime('-2 months -2 days'))); - $result = $this->Time->timeAgoInWords(strtotime('-13 months, -5 days'), array('end' => '2 years')); + $result = $this->Time->timeAgoInWords(strtotime('-13 months -5 days'), array('end' => '2 years')); $this->assertEqual($result, '1 year, 1 month, 5 days ago'); - $fourHours = $this->Time->timeAgoInWords(strtotime('-5 days, -2 hours'), array('userOffset' => -4)); - $result = $this->Time->timeAgoInWords(strtotime('-5 days, -2 hours'), array('userOffset' => 4)); + $fourHours = $this->Time->timeAgoInWords(strtotime('-5 days -2 hours'), array('userOffset' => -4)); + $result = $this->Time->timeAgoInWords(strtotime('-5 days -2 hours'), array('userOffset' => 4)); $this->assertEqual($fourHours, $result); $result = $this->Time->timeAgoInWords(strtotime('-2 hours')); From 1acc4c879ad4fb03f1c962540bfb81121f0c879b Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 16 Jan 2010 18:15:38 -0500 Subject: [PATCH 1519/2083] Removing debug() from scaffold test. --- cake/tests/cases/libs/controller/scaffold.test.php | 1 - 1 file changed, 1 deletion(-) diff --git a/cake/tests/cases/libs/controller/scaffold.test.php b/cake/tests/cases/libs/controller/scaffold.test.php index 7604792b2..af4d3d0ff 100644 --- a/cake/tests/cases/libs/controller/scaffold.test.php +++ b/cake/tests/cases/libs/controller/scaffold.test.php @@ -500,7 +500,6 @@ function testEditScaffold() { $this->assertPattern('/input name="data\[ScaffoldMock\]\[published\]" type="text" maxlength="1" value="Y" id="ScaffoldMockPublished"/', $result); $this->assertPattern('/textarea name="data\[ScaffoldMock\]\[body\]" cols="30" rows="6" id="ScaffoldMockBody"/', $result); $this->assertPattern('/<li><a href="\/scaffold_mock\/delete\/1"[^>]*>Delete<\/a>\s*<\/li>/', $result); - debug($result); } /** From 826dbc466ff8f451fb11e6dde08c307a3e61869d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 16 Jan 2010 18:26:06 -0500 Subject: [PATCH 1520/2083] Fixing failing test caused by merge with 1.2 --- cake/libs/model/cake_schema.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cake/libs/model/cake_schema.php b/cake/libs/model/cake_schema.php index 152d9cd33..82b2e8913 100644 --- a/cake/libs/model/cake_schema.php +++ b/cake/libs/model/cake_schema.php @@ -486,10 +486,13 @@ function compare($old, $new = null) { if (isset($old[$table]['indexes']) && isset($new[$table]['indexes'])) { $diff = $this->_compareIndexes($new[$table]['indexes'], $old[$table]['indexes']); if ($diff) { - if (isset($tables[$table]['drop']['indexes']) && isset($diff['drop'])) { + if (!isset($tables[$table])) { + $tables[$table] = array(); + } + if (isset($diff['drop'])) { $tables[$table]['drop']['indexes'] = $diff['drop']; } - if (isset($tables[$table]['add']['indexes']) && isset($diff['add'])) { + if ($diff && isset($diff['add'])) { $tables[$table]['add']['indexes'] = $diff['add']; } } From 8cae1e850adaafb319ebc3b64fab53b188e92830 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 16 Jan 2010 18:50:04 -0500 Subject: [PATCH 1521/2083] Fixing spacing. --- cake/libs/i18n.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index bd10c574a..2ebdd8662 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -496,15 +496,15 @@ function __loadLocaleDefinition($file, $domain = null) { continue; } - $mustEscape = array($escape.',',$escape.';',$escape.'<',$escape.'>',$escape.$escape); - $replacements = array_map('crc32',$mustEscape); - $value = str_replace($mustEscape,$replacements,$value); - $value = explode(';',$value); + $mustEscape = array($escape . ',' , $escape . ';', $escape . '<', $escape . '>', $escape . $escape); + $replacements = array_map('crc32', $mustEscape); + $value = str_replace($mustEscape, $replacements, $value); + $value = explode(';', $value); $_this->__escape = $escape; foreach ($value as $i => $val) { - $val = trim($val,'"'); - $val = preg_replace_callback('/(?:<)?(.[^>]*)(?:>)?/',array(&$this,'__parseLiteralValue'),$val); - $val = str_replace($replacements,$mustEscape,$val); + $val = trim($val, '"'); + $val = preg_replace_callback('/(?:<)?(.[^>]*)(?:>)?/', array(&$this, '__parseLiteralValue'), $val); + $val = str_replace($replacements, $mustEscape, $val); $value[$i] = $val; } if (count($value) == 1) { From 34fed29d05461c1ceae23fab1cec9c6a9c49fe05 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 16 Jan 2010 19:19:12 -0500 Subject: [PATCH 1522/2083] Renaming session test case. Adding missing doc block to inflector test case. Updating Set::map reverse test to reflect changes in Model. Removing Inflector from lib group as the reset test breaks many other tests. Adding a table property to the session fixture. --- cake/tests/cases/libs/cake_session.test.php | 4 ++-- cake/tests/cases/libs/inflector.test.php | 5 +++++ cake/tests/cases/libs/set.test.php | 2 +- cake/tests/fixtures/session_fixture.php | 7 +++++++ cake/tests/groups/lib.group.php | 2 +- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/cake/tests/cases/libs/cake_session.test.php b/cake/tests/cases/libs/cake_session.test.php index 81e94d266..99811c2e2 100644 --- a/cake/tests/cases/libs/cake_session.test.php +++ b/cake/tests/cases/libs/cake_session.test.php @@ -22,12 +22,12 @@ } /** - * SessionTest class + * CakeSessionTest class * * @package cake * @subpackage cake.tests.cases.libs */ -class SessionTest extends CakeTestCase { +class CakeSessionTest extends CakeTestCase { /** * Fixtures used in the SessionTest diff --git a/cake/tests/cases/libs/inflector.test.php b/cake/tests/cases/libs/inflector.test.php index ac32d3385..4d911ffdc 100644 --- a/cake/tests/cases/libs/inflector.test.php +++ b/cake/tests/cases/libs/inflector.test.php @@ -381,6 +381,11 @@ function testCustomSingularRule() { $this->assertEqual(Inflector::singularize('singulars'), 'singulars'); } +/** + * Test resetting inflection rules. + * + * @return void + */ function testCustomRuleWithReset() { $uninflected = array('atlas', 'lapis', 'onibus', 'pires', 'virus', '.*x'); $pluralIrregular = array('as' => 'ases'); diff --git a/cake/tests/cases/libs/set.test.php b/cake/tests/cases/libs/set.test.php index 20188aff1..fd1b1aa50 100644 --- a/cake/tests/cases/libs/set.test.php +++ b/cake/tests/cases/libs/set.test.php @@ -1824,7 +1824,7 @@ function testMapReverse() { 'useDbConfig' => 'default', 'useTable' => false, 'displayField' => null, 'id' => false, 'data' => array(), 'table' => 'models', 'primaryKey' => 'id', '_schema' => null, 'validate' => array(), 'validationErrors' => array(), 'tablePrefix' => null, 'name' => 'Model', 'alias' => 'Model', 'tableToModel' => array(), 'logTransactions' => false, 'transactional' => false, 'cacheQueries' => false, 'belongsTo' => array(), 'hasOne' => array(), 'hasMany' => array(), 'hasAndBelongsToMany' => array(), 'actsAs' => null, 'whitelist' => array(), 'cacheSources' => true, - 'findQueryType' => null, 'recursive' => 1, 'order' => null, '__exists' => null, + 'findQueryType' => null, 'recursive' => 1, 'order' => null, 'virtualFields' => array(), '__associationKeys' => array( 'belongsTo' => array('className', 'foreignKey', 'conditions', 'fields', 'order', 'counterCache'), 'hasOne' => array('className', 'foreignKey', 'conditions', 'fields', 'order', 'dependent'), diff --git a/cake/tests/fixtures/session_fixture.php b/cake/tests/fixtures/session_fixture.php index 2d8958b11..56adfe207 100644 --- a/cake/tests/fixtures/session_fixture.php +++ b/cake/tests/fixtures/session_fixture.php @@ -34,6 +34,13 @@ class SessionFixture extends CakeTestFixture { */ var $name = 'Session'; +/** + * table property. + * + * @var string + */ + // var $table = 'sessions'; + /** * fields property * diff --git a/cake/tests/groups/lib.group.php b/cake/tests/groups/lib.group.php index bae925e4f..49b3830cc 100644 --- a/cake/tests/groups/lib.group.php +++ b/cake/tests/groups/lib.group.php @@ -44,7 +44,7 @@ class LibGroupTest extends TestSuite { */ function LibGroupTest() { TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'basics'); - TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'inflector'); + // TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'inflector'); TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'cake_session'); TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'debugger'); TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'error'); From b50b5922fd4fff06f5e1a93bdb4a181890d6bff0 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Sun, 17 Jan 2010 11:38:45 +1100 Subject: [PATCH 1523/2083] Adjusting EmailComponent Boundary creation to occur for all generated email. Fixes #14. --- cake/libs/controller/components/email.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index 8eb16fec4..1b13a95f8 100644 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -505,8 +505,8 @@ function __createHeader() { } } + $this->__createBoundary(); if (!empty($this->attachments)) { - $this->__createBoundary(); $this->__header[] = 'MIME-Version: 1.0'; $this->__header[] = 'Content-Type: multipart/mixed; boundary="' . $this->__boundary . '"'; $this->__header[] = 'This part of the E-mail should never be seen. If'; From c4ef4290041dfec61aa26653b5c04c76aff91893 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 16 Jan 2010 19:41:52 -0500 Subject: [PATCH 1524/2083] Changing require to require_once to make tests less order dependent. --- cake/tests/cases/console/libs/tasks/extract.test.php | 5 ++--- cake/tests/cases/console/libs/tasks/project.test.php | 4 +--- cake/tests/cases/console/libs/tasks/test.test.php | 7 +++---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/cake/tests/cases/console/libs/tasks/extract.test.php b/cake/tests/cases/console/libs/tasks/extract.test.php index 349ffe86f..0777a733f 100644 --- a/cake/tests/cases/console/libs/tasks/extract.test.php +++ b/cake/tests/cases/console/libs/tasks/extract.test.php @@ -33,9 +33,8 @@ ob_end_clean(); } -if (!class_exists('ExtractTask')) { - require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'extract.php'; -} +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'extract.php'; + Mock::generatePartial( 'ShellDispatcher', 'TestExtractTaskMockShellDispatcher', diff --git a/cake/tests/cases/console/libs/tasks/project.test.php b/cake/tests/cases/console/libs/tasks/project.test.php index 0f80b3431..37096a205 100644 --- a/cake/tests/cases/console/libs/tasks/project.test.php +++ b/cake/tests/cases/console/libs/tasks/project.test.php @@ -32,9 +32,7 @@ ob_end_clean(); } -if (!class_exists('ProjectTask')) { - require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'project.php'; -} +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'project.php'; Mock::generatePartial( 'ShellDispatcher', 'TestProjectTaskMockShellDispatcher', diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index d6c9dae97..6166b300c 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -34,10 +34,9 @@ ob_end_clean(); } -if (!class_exists('TestTask')) { - require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'test.php'; - require CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php'; -} +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'test.php'; +require_once CAKE . 'console' . DS . 'libs' . DS . 'tasks' . DS . 'template.php'; + Mock::generatePartial( 'ShellDispatcher', 'TestTestTaskMockShellDispatcher', From f1276ce337524a80200ff2bae430db8acbf55a11 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 16 Jan 2010 20:14:16 -0500 Subject: [PATCH 1525/2083] Fixing several issues in the CodeCoverageManager test case. --- .../cases/libs/code_coverage_manager.test.php | 69 +++++++++++-------- 1 file changed, 40 insertions(+), 29 deletions(-) diff --git a/cake/tests/cases/libs/code_coverage_manager.test.php b/cake/tests/cases/libs/code_coverage_manager.test.php index 57510e835..b8f3a52bf 100644 --- a/cake/tests/cases/libs/code_coverage_manager.test.php +++ b/cake/tests/cases/libs/code_coverage_manager.test.php @@ -63,46 +63,57 @@ function endCase() { * @return void */ function testNoTestCaseSupplied() { - if (PHP_SAPI != 'cli') { - $reporter =& new CakeHtmlReporter(null, array('group' => false, 'app' => false, 'plugin' => false)); - - CodeCoverageManager::init(substr(md5(microtime()), 0, 5), $reporter); - CodeCoverageManager::report(false); - $this->assertError(); + if ($this->skipIf(PHP_SAPI == 'cli', 'Is cli, cannot run this test %s')) { + return; + } + $reporter =& new CakeHtmlReporter(null, array('group' => false, 'app' => false, 'plugin' => false)); - CodeCoverageManager::init('tests' . DS . 'lib' . DS . basename(__FILE__), $reporter); - CodeCoverageManager::report(false); - $this->assertError(); + CodeCoverageManager::init(substr(md5(microtime()), 0, 5), $reporter); + CodeCoverageManager::report(false); + $this->assertError(); - $path = LIBS; - if (strpos(LIBS, ROOT) === false) { - $path = ROOT.DS.LIBS; - } - App::import('Core', 'Folder'); - $folder = new Folder(); - $folder->cd($path); - $contents = $folder->read(); + CodeCoverageManager::init('tests' . DS . 'lib' . DS . basename(__FILE__), $reporter); + CodeCoverageManager::report(false); + $this->assertError(); + } /** - * remove method + * Test that test cases don't cause errors * - * @param mixed $var - * @access public * @return void */ - function remove($var) { - return ($var != basename(__FILE__)); - } - $contents[1] = array_filter($contents[1], "remove"); + function testNoTestCaseSuppliedNoErrors() { + if ($this->skipIf(PHP_SAPI == 'cli', 'Is cli, cannot run this test %s')) { + return; + } + $reporter =& new CakeHtmlReporter(null, array('group' => false, 'app' => false, 'plugin' => false)); + $path = LIBS; + if (strpos(LIBS, ROOT) === false) { + $path = ROOT.DS.LIBS; + } + App::import('Core', 'Folder'); + $folder = new Folder(); + $folder->cd($path); + $contents = $folder->read(); - foreach ($contents[1] as $file) { - CodeCoverageManager::init('libs' . DS . $file, $reporter); - CodeCoverageManager::report(false); - $this->assertNoErrors('libs' . DS . $file); - } + $contents[1] = array_filter($contents[1], array(&$this, '_basenameFilter')); + + foreach ($contents[1] as $file) { + CodeCoverageManager::init('libs' . DS . $file, $reporter); + CodeCoverageManager::report(false); + $this->assertNoErrors('libs' . DS . $file); } } +/** + * Remove file names that don't share a basename with the current file. + * + * @return void + */ + function _basenameFilter($var) { + return ($var != basename(__FILE__)); + } + /** * testGetTestObjectFileNameFromTestCaseFile method * From 0e09fee3b1988aacb176beea461e7aaab526e7f0 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 16 Jan 2010 20:14:57 -0500 Subject: [PATCH 1526/2083] Correcting timehelper tests to use correct timestamp for indicated times. Making timezone output more resilient. --- cake/tests/cases/libs/view/helpers/time.test.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cake/tests/cases/libs/view/helpers/time.test.php b/cake/tests/cases/libs/view/helpers/time.test.php index d90fd4562..df14c1fca 100644 --- a/cake/tests/cases/libs/view/helpers/time.test.php +++ b/cake/tests/cases/libs/view/helpers/time.test.php @@ -661,7 +661,7 @@ function testConvertSpecifiers() { 'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS) ), true); Configure::write('Config.language', 'time_test'); - $time = 1263485619; // Thu Jan 14 11:43:39 2010 + $time = 1263487419; // Thu Jan 14 11:43:39 2010 $result = $this->Time->convertSpecifiers('%a', $time); $expected = 'jue'; @@ -751,14 +751,14 @@ function testI18nFormat() { 'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS) ), true); Configure::write('Config.language', 'time_test'); - $time = 1263493768; //Thu Jan 14 13:59:28 2010 + $time = 1263495568; //Thu Jan 14 13:59:28 2010 $result = $this->Time->i18nFormat($time); $expected = '14/01/10'; $this->assertEqual($result, $expected); $result = $this->Time->i18nFormat($time, '%c'); - $expected = 'jue 14 ene 2010 13:59:28 VET'; + $expected = 'jue 14 ene 2010 13:59:28 ' . strftime('%Z'); $this->assertEqual($result, $expected); $result = $this->Time->i18nFormat($time, 'Time is %r, and date is %x'); From 3be28fc749bcda19ff5c70de9ab1ea9b710d6782 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 16 Jan 2010 20:18:20 -0500 Subject: [PATCH 1527/2083] Fixing errors in CakeTestCase::testAction tests case caused by changes in test suite not always forcing an output parameter. --- cake/tests/cases/libs/cake_test_case.test.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/cake/tests/cases/libs/cake_test_case.test.php b/cake/tests/cases/libs/cake_test_case.test.php index a9c472f28..8d957b56b 100644 --- a/cake/tests/cases/libs/cake_test_case.test.php +++ b/cake/tests/cases/libs/cake_test_case.test.php @@ -343,7 +343,6 @@ function testTestAction() { 'method' => 'get', )); $this->assertTrue(isset($result['params']['url']['url'])); - $this->assertTrue(isset($result['params']['url']['output'])); $this->assertEqual(array_keys($result['params']['named']), array('var1', 'var2')); $result = $this->Case->testAction('/tests_apps_posts/url_var/gogo/val2', array( @@ -361,7 +360,6 @@ function testTestAction() { 'blue' => 'mana' ) )); - $this->assertTrue(isset($result['params']['url']['output'])); $this->assertTrue(isset($result['params']['url']['red'])); $this->assertTrue(isset($result['params']['url']['blue'])); $this->assertTrue(isset($result['params']['url']['url'])); From 5203397a6a2631fd14077f8eb8b151950284be4a Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 16 Jan 2010 20:24:27 -0500 Subject: [PATCH 1528/2083] Adding error expectation to model_write test. Models using useTable = false, will still issue count queries to their datasources when exists() is called. --- cake/tests/cases/libs/model/model_write.test.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cake/tests/cases/libs/model/model_write.test.php b/cake/tests/cases/libs/model/model_write.test.php index 769a79f85..d55731887 100644 --- a/cake/tests/cases/libs/model/model_write.test.php +++ b/cake/tests/cases/libs/model/model_write.test.php @@ -2558,8 +2558,12 @@ function testRecordExists() { $TestModel =& new TheVoid(); $this->assertFalse($TestModel->exists()); + $TestModel->id = 5; + $this->expectError(); + ob_start(); $this->assertFalse($TestModel->exists()); + $output = ob_get_clean(); } /** From f10d7dde75ff50b3f6c251590e6c73524d3d7284 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 16 Jan 2010 20:38:08 -0500 Subject: [PATCH 1529/2083] Updating version numbers. to 1.3.0-beta --- cake/VERSION.txt | 2 +- cake/config/config.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/VERSION.txt b/cake/VERSION.txt index cf90295bd..9a5527022 100644 --- a/cake/VERSION.txt +++ b/cake/VERSION.txt @@ -17,4 +17,4 @@ // @license MIT License (http://www.opensource.org/licenses/mit-license.php) // +--------------------------------------------------------------------------------------------+ // //////////////////////////////////////////////////////////////////////////////////////////////////// -1.3.0-alpha \ No newline at end of file +1.3.0-beta \ No newline at end of file diff --git a/cake/config/config.php b/cake/config/config.php index d633f71a6..56bb88e14 100644 --- a/cake/config/config.php +++ b/cake/config/config.php @@ -19,5 +19,5 @@ * @since CakePHP(tm) v 1.1.11.4062 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -return $config['Cake.version'] = '1.3.0-alpha'; +return $config['Cake.version'] = '1.3.0-beta'; ?> \ No newline at end of file From ab666f8ea74a2592ce80cbe45d64e95a92fec4ae Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Sun, 17 Jan 2010 14:50:09 +1100 Subject: [PATCH 1530/2083] Revert "Adjusting EmailComponent Boundary creation to occur for all generated email. Fixes #14." This reverts commit b50b5922fd4fff06f5e1a93bdb4a181890d6bff0. --- cake/libs/controller/components/email.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index 1b13a95f8..8eb16fec4 100644 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -505,8 +505,8 @@ function __createHeader() { } } - $this->__createBoundary(); if (!empty($this->attachments)) { + $this->__createBoundary(); $this->__header[] = 'MIME-Version: 1.0'; $this->__header[] = 'Content-Type: multipart/mixed; boundary="' . $this->__boundary . '"'; $this->__header[] = 'This part of the E-mail should never be seen. If'; From 0ac99eddb52327b38d1a6aa7fcf33148e663ce80 Mon Sep 17 00:00:00 2001 From: Juan Basso <jrbasso@gmail.com> Date: Mon, 11 Jan 2010 18:05:49 -0200 Subject: [PATCH 1531/2083] Replacing "echo sprintf" by "printf" where possible. Fixes #209. Signed-off-by: Mark Story <mark@mark-story.com> --- cake/console/templates/default/views/home.ctp | 4 ++-- cake/libs/view/errors/error404.ctp | 2 +- cake/libs/view/errors/error500.ctp | 2 +- cake/libs/view/errors/missing_action.ctp | 14 +++++++------- cake/libs/view/errors/missing_behavior_class.ctp | 6 +++--- cake/libs/view/errors/missing_behavior_file.ctp | 6 +++--- cake/libs/view/errors/missing_component_class.ctp | 6 +++--- cake/libs/view/errors/missing_component_file.ctp | 4 ++-- cake/libs/view/errors/missing_connection.ctp | 6 +++--- cake/libs/view/errors/missing_controller.ctp | 6 +++--- cake/libs/view/errors/missing_helper_class.ctp | 6 +++--- cake/libs/view/errors/missing_helper_file.ctp | 6 +++--- cake/libs/view/errors/missing_layout.ctp | 6 +++--- cake/libs/view/errors/missing_model.ctp | 6 +++--- cake/libs/view/errors/missing_scaffolddb.ctp | 4 ++-- cake/libs/view/errors/missing_table.ctp | 4 ++-- cake/libs/view/errors/missing_view.ctp | 6 +++--- cake/libs/view/errors/private_action.ctp | 6 +++--- cake/libs/view/errors/scaffold_error.ctp | 2 +- cake/libs/view/pages/home.ctp | 4 ++-- cake/libs/view/scaffolds/view.ctp | 6 +++--- cake/tests/test_app/views/pages/home.ctp | 4 ++-- .../test_app/views/posts/test_nocache_tags.ctp | 2 +- 23 files changed, 59 insertions(+), 59 deletions(-) diff --git a/cake/console/templates/default/views/home.ctp b/cake/console/templates/default/views/home.ctp index eeaec4a24..01cd41a3d 100644 --- a/cake/console/templates/default/views/home.ctp +++ b/cake/console/templates/default/views/home.ctp @@ -24,7 +24,7 @@ endif; \$settings = Cache::settings(); if (!empty(\$settings)): echo '<span class=\"notice success\">'; - echo sprintf(__('The %s is being used for caching. To change the config edit APP/config/core.php ', true), '<em>'. \$settings['engine'] . 'Engine</em>'); + printf(__('The %s is being used for caching. To change the config edit APP/config/core.php ', true), '<em>'. \$settings['engine'] . 'Engine</em>'); echo '</span>'; else: echo '<span class=\"notice\">'; @@ -75,7 +75,7 @@ $output .= "<?php endif;?>\n"; $output .= "<h3><?php __('Editing this Page') ?></h3>\n"; $output .= "<p>\n"; $output .= "<?php\n"; -$output .= "\techo sprintf(__('To change the content of this page, edit: %s\n"; +$output .= "\tprintf(__('To change the content of this page, edit: %s\n"; $output .= "\t\tTo change its layout, edit: %s\n"; $output .= "\t\tYou can also add some CSS styles for your pages at: %s', true),\n"; $output .= "\t\tAPP . 'views' . DS . 'pages' . DS . 'home.ctp.<br />', APP . 'views' . DS . 'layouts' . DS . 'default.ctp.<br />', APP . 'webroot' . DS . 'css');\n"; diff --git a/cake/libs/view/errors/error404.ctp b/cake/libs/view/errors/error404.ctp index af8ab4cfc..c3a8e91b8 100644 --- a/cake/libs/view/errors/error404.ctp +++ b/cake/libs/view/errors/error404.ctp @@ -20,5 +20,5 @@ <h2><?php echo $name; ?></h2> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('The requested address %s was not found on this server.', true), "<strong>'{$message}'</strong>")?> + <?php printf(__('The requested address %s was not found on this server.', true), "<strong>'{$message}'</strong>"); ?> </p> \ No newline at end of file diff --git a/cake/libs/view/errors/error500.ctp b/cake/libs/view/errors/error500.ctp index 6d54ac5d9..64e1bcc36 100644 --- a/cake/libs/view/errors/error500.ctp +++ b/cake/libs/view/errors/error500.ctp @@ -20,5 +20,5 @@ <h2><?php echo $name; ?></h2> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('An Internal Error Has Occurred.', true), "<strong>'{$message}'</strong>")?> + <?php printf(__('An Internal Error Has Occurred.', true), "<strong>'{$message}'</strong>"); ?> </p> diff --git a/cake/libs/view/errors/missing_action.ctp b/cake/libs/view/errors/missing_action.ctp index 9c59f8b11..a2496e692 100644 --- a/cake/libs/view/errors/missing_action.ctp +++ b/cake/libs/view/errors/missing_action.ctp @@ -17,14 +17,14 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ ?> -<h2><?php echo sprintf(__('Missing Method in %s', true), $controller);?></h2> +<h2><?php printf(__('Missing Method in %s', true), $controller); ?></h2> <p class="error"> - <strong><?php __('Error') ?>: </strong> - <?php echo sprintf(__('The action %1$s is not defined in controller %2$s', true), '<em>' . $action . '</em>', '<em>' . $controller . '</em>');?> + <strong><?php __('Error'); ?>: </strong> + <?php printf(__('The action %1$s is not defined in controller %2$s', true), '<em>' . $action . '</em>', '<em>' . $controller . '</em>'); ?> </p> <p class="error"> - <strong><?php __('Error') ?>: </strong> - <?php echo sprintf(__('Create %1$s%2$s in file: %3$s.', true), '<em>' . $controller . '::</em>', '<em>' . $action . '()</em>', APP_DIR . DS . 'controllers' . DS . Inflector::underscore($controller) . '.php');?> + <strong><?php __('Error'); ?>: </strong> + <?php printf(__('Create %1$s%2$s in file: %3$s.', true), '<em>' . $controller . '::</em>', '<em>' . $action . '()</em>', APP_DIR . DS . 'controllers' . DS . Inflector::underscore($controller) . '.php'); ?> </p> <pre> <?php @@ -41,6 +41,6 @@ class <?php echo $controller;?> extends AppController { ?> </pre> <p class="notice"> - <strong><?php __('Notice') ?>: </strong> - <?php echo sprintf(__('If you want to customize this error message, create %s.', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_action.ctp');?> + <strong><?php __('Notice'); ?>: </strong> + <?php printf(__('If you want to customize this error message, create %s.', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_action.ctp'); ?> </p> \ No newline at end of file diff --git a/cake/libs/view/errors/missing_behavior_class.ctp b/cake/libs/view/errors/missing_behavior_class.ctp index 3b9c8529e..954ecaf9e 100644 --- a/cake/libs/view/errors/missing_behavior_class.ctp +++ b/cake/libs/view/errors/missing_behavior_class.ctp @@ -20,11 +20,11 @@ <h2><?php __('Missing Behavior Class'); ?></h2> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('The behavior class <em>%s</em> can not be found or does not exist.', true), $behaviorClass);?> + <?php printf(__('The behavior class <em>%s</em> can not be found or does not exist.', true), $behaviorClass); ?> </p> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('Create the class below in file: %s', true), APP_DIR . DS . 'models' . DS . 'behaviors' . DS . $file);?> + <?php printf(__('Create the class below in file: %s', true), APP_DIR . DS . 'models' . DS . 'behaviors' . DS . $file); ?> </p> <pre> <?php @@ -35,5 +35,5 @@ class <?php echo $behaviorClass;?> extends ModelBehavior { </pre> <p class="notice"> <strong><?php __('Notice'); ?>: </strong> - <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_behavior_class.ctp');?> + <?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_behavior_class.ctp'); ?> </p> \ No newline at end of file diff --git a/cake/libs/view/errors/missing_behavior_file.ctp b/cake/libs/view/errors/missing_behavior_file.ctp index 8ce04deec..2e468df60 100644 --- a/cake/libs/view/errors/missing_behavior_file.ctp +++ b/cake/libs/view/errors/missing_behavior_file.ctp @@ -20,11 +20,11 @@ <h2><?php __('Missing Behavior File'); ?></h2> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('The Behavior file %s can not be found or does not exist.', true), APP_DIR . DS . 'models' . DS . 'behaviors' . DS . $file);?> + <?php printf(__('The Behavior file %s can not be found or does not exist.', true), APP_DIR . DS . 'models' . DS . 'behaviors' . DS . $file); ?> </p> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('Create the class below in file: %s', true), APP_DIR . DS . 'models' . DS . 'behaviors' . DS . $file);?> + <?php printf(__('Create the class below in file: %s', true), APP_DIR . DS . 'models' . DS . 'behaviors' . DS . $file); ?> </p> <pre> <?php @@ -35,5 +35,5 @@ class <?php echo $behaviorClass;?> extends ModelBehavior { </pre> <p class="notice"> <strong><?php __('Notice'); ?>: </strong> - <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_behavior_file.ctp');?> + <?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_behavior_file.ctp'); ?> </p> diff --git a/cake/libs/view/errors/missing_component_class.ctp b/cake/libs/view/errors/missing_component_class.ctp index bc0bf8d4d..f01a216c1 100644 --- a/cake/libs/view/errors/missing_component_class.ctp +++ b/cake/libs/view/errors/missing_component_class.ctp @@ -20,11 +20,11 @@ <h2><?php __('Missing Component Class'); ?></h2> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('Component class %1$s in %2$s was not found.', true), '<em>' . $component . 'Component</em>', '<em>' . $controller . 'Controller</em>');?> + <?php printf(__('Component class %1$s in %2$s was not found.', true), '<em>' . $component . 'Component</em>', '<em>' . $controller . 'Controller</em>'); ?> </p> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('Create the class %s in file: %s', true), '<em>' . $component . 'Component</em>', APP_DIR . DS . 'controllers' . DS . 'components' . DS . $file);?> + <?php printf(__('Create the class %s in file: %s', true), '<em>' . $component . 'Component</em>', APP_DIR . DS . 'controllers' . DS . 'components' . DS . $file); ?> </p> <pre> <?php @@ -35,5 +35,5 @@ class <?php echo $component;?>Component extends Object {<br /> </pre> <p class="notice"> <strong><?php __('Notice'); ?>: </strong> - <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_component_class.ctp');?> + <?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_component_class.ctp'); ?> </p> \ No newline at end of file diff --git a/cake/libs/view/errors/missing_component_file.ctp b/cake/libs/view/errors/missing_component_file.ctp index a5f302845..79185490c 100644 --- a/cake/libs/view/errors/missing_component_file.ctp +++ b/cake/libs/view/errors/missing_component_file.ctp @@ -24,7 +24,7 @@ </p> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('Create the class %s in file: %s', true), '<em>' . $component . 'Component</em>', APP_DIR . DS . 'controllers' . DS . 'components' . DS . $file);?> + <?php printf(__('Create the class %s in file: %s', true), '<em>' . $component . 'Component</em>', APP_DIR . DS . 'controllers' . DS . 'components' . DS . $file); ?> </p> <pre> <?php @@ -35,5 +35,5 @@ class <?php echo $component;?>Component extends Object {<br /> </pre> <p class="notice"> <strong><?php __('Notice'); ?>: </strong> - <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_component_file.ctp');?> + <?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_component_file.ctp'); ?> </p> \ No newline at end of file diff --git a/cake/libs/view/errors/missing_connection.ctp b/cake/libs/view/errors/missing_connection.ctp index 1766c2069..ef0498188 100644 --- a/cake/libs/view/errors/missing_connection.ctp +++ b/cake/libs/view/errors/missing_connection.ctp @@ -20,13 +20,13 @@ <h2><?php __('Missing Database Connection'); ?></h2> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('%s requires a database connection', true), $model);?> + <?php printf(__('%s requires a database connection', true), $model); ?> </p> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('Confirm you have created the file : %s.', true), APP_DIR . DS . 'config' . DS . 'database.php');?> + <?php printf(__('Confirm you have created the file : %s.', true), APP_DIR . DS . 'config' . DS . 'database.php'); ?> </p> <p class="notice"> <strong><?php __('Notice'); ?>: </strong> - <?php echo sprintf(__('If you want to customize this error message, create %s.', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . basename(__FILE__));?> + <?php printf(__('If you want to customize this error message, create %s.', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . basename(__FILE__)); ?> </p> \ No newline at end of file diff --git a/cake/libs/view/errors/missing_controller.ctp b/cake/libs/view/errors/missing_controller.ctp index 5b81c9ff7..1ce2f7041 100644 --- a/cake/libs/view/errors/missing_controller.ctp +++ b/cake/libs/view/errors/missing_controller.ctp @@ -20,11 +20,11 @@ <h2><?php __('Missing Controller'); ?></h2> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('%s could not be found.', true), '<em>' . $controller . '</em>');?> + <?php printf(__('%s could not be found.', true), '<em>' . $controller . '</em>'); ?> </p> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('Create the class %s below in file: %s', true), '<em>' . $controller . '</em>', APP_DIR . DS . 'controllers' . DS . Inflector::underscore($controller) . '.php');?> + <?php printf(__('Create the class %s below in file: %s', true), '<em>' . $controller . '</em>', APP_DIR . DS . 'controllers' . DS . Inflector::underscore($controller) . '.php'); ?> </p> <pre> <?php @@ -36,5 +36,5 @@ class <?php echo $controller;?> extends AppController { </pre> <p class="notice"> <strong><?php __('Notice'); ?>: </strong> - <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_controller.ctp');?> + <?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_controller.ctp'); ?> </p> \ No newline at end of file diff --git a/cake/libs/view/errors/missing_helper_class.ctp b/cake/libs/view/errors/missing_helper_class.ctp index 8c78c4620..443c085e3 100644 --- a/cake/libs/view/errors/missing_helper_class.ctp +++ b/cake/libs/view/errors/missing_helper_class.ctp @@ -20,11 +20,11 @@ <h2><?php __('Missing Helper Class'); ?></h2> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('The helper class <em>%s</em> can not be found or does not exist.', true), $helperClass);?> + <?php printf(__('The helper class <em>%s</em> can not be found or does not exist.', true), $helperClass); ?> </p> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('Create the class below in file: %s', true), APP_DIR . DS . 'views' . DS . 'helpers' . DS . $file);?> + <?php printf(__('Create the class below in file: %s', true), APP_DIR . DS . 'views' . DS . 'helpers' . DS . $file); ?> </p> <pre> <?php @@ -35,5 +35,5 @@ class <?php echo $helperClass;?> extends AppHelper { </pre> <p class="notice"> <strong><?php __('Notice'); ?>: </strong> - <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_helper_class.ctp');?> + <?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_helper_class.ctp'); ?> </p> \ No newline at end of file diff --git a/cake/libs/view/errors/missing_helper_file.ctp b/cake/libs/view/errors/missing_helper_file.ctp index f38554d07..d72f38ce6 100644 --- a/cake/libs/view/errors/missing_helper_file.ctp +++ b/cake/libs/view/errors/missing_helper_file.ctp @@ -20,11 +20,11 @@ <h2><?php __('Missing Helper File'); ?></h2> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('The helper file %s can not be found or does not exist.', true), APP_DIR . DS . 'views' . DS . 'helpers' . DS . $file);?> + <?php printf(__('The helper file %s can not be found or does not exist.', true), APP_DIR . DS . 'views' . DS . 'helpers' . DS . $file); ?> </p> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('Create the class below in file: %s', true), APP_DIR . DS . 'views' . DS . 'helpers' . DS . $file);?> + <?php printf(__('Create the class below in file: %s', true), APP_DIR . DS . 'views' . DS . 'helpers' . DS . $file); ?> </p> <pre> <?php @@ -35,5 +35,5 @@ class <?php echo $helperClass;?> extends AppHelper { </pre> <p class="notice"> <strong><?php __('Notice'); ?>: </strong> - <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_helper_file.ctp');?> + <?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_helper_file.ctp'); ?> </p> diff --git a/cake/libs/view/errors/missing_layout.ctp b/cake/libs/view/errors/missing_layout.ctp index ba09332b2..9472c576a 100644 --- a/cake/libs/view/errors/missing_layout.ctp +++ b/cake/libs/view/errors/missing_layout.ctp @@ -20,13 +20,13 @@ <h2><?php __('Missing Layout'); ?></h2> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('The layout file %s can not be found or does not exist.', true), '<em>' . $file . '</em>');?> + <?php printf(__('The layout file %s can not be found or does not exist.', true), '<em>' . $file . '</em>'); ?> </p> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('Confirm you have created the file: %s', true), '<em>' . $file . '</em>');?> + <?php printf(__('Confirm you have created the file: %s', true), '<em>' . $file . '</em>'); ?> </p> <p class="notice"> <strong><?php __('Notice'); ?>: </strong> - <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_layout.ctp');?> + <?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_layout.ctp'); ?> </p> \ No newline at end of file diff --git a/cake/libs/view/errors/missing_model.ctp b/cake/libs/view/errors/missing_model.ctp index b902e64f4..de6f1e8d5 100644 --- a/cake/libs/view/errors/missing_model.ctp +++ b/cake/libs/view/errors/missing_model.ctp @@ -20,11 +20,11 @@ <h2><?php __('Missing Model'); ?></h2> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('<em>%s</em> could not be found.', true), $model);?> + <?php printf(__('<em>%s</em> could not be found.', true), $model); ?> </p> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('Create the class %s in file: %s', true), '<em>' . $model . '</em>', APP_DIR . DS . 'models' . DS . Inflector::underscore($model) . '.php');?> + <?php printf(__('Create the class %s in file: %s', true), '<em>' . $model . '</em>', APP_DIR . DS . 'models' . DS . Inflector::underscore($model) . '.php'); ?> </p> <pre> <?php @@ -37,5 +37,5 @@ class <?php echo $model;?> extends AppModel { </pre> <p class="notice"> <strong><?php __('Notice'); ?>: </strong> - <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_model.ctp');?> + <?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_model.ctp'); ?> </p> \ No newline at end of file diff --git a/cake/libs/view/errors/missing_scaffolddb.ctp b/cake/libs/view/errors/missing_scaffolddb.ctp index 3ea902ac3..83f567790 100644 --- a/cake/libs/view/errors/missing_scaffolddb.ctp +++ b/cake/libs/view/errors/missing_scaffolddb.ctp @@ -24,9 +24,9 @@ </p> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('Confirm you have created the file: %s', true), APP_DIR . DS . 'config' . DS . 'database.php');?> + <?php printf(__('Confirm you have created the file: %s', true), APP_DIR . DS . 'config' . DS . 'database.php'); ?> </p> <p class="notice"> <strong><?php __('Notice'); ?>: </strong> - <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_scaffolddb.ctp');?> + <?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_scaffolddb.ctp'); ?> </p> \ No newline at end of file diff --git a/cake/libs/view/errors/missing_table.ctp b/cake/libs/view/errors/missing_table.ctp index 1b76680da..e00ddbd08 100644 --- a/cake/libs/view/errors/missing_table.ctp +++ b/cake/libs/view/errors/missing_table.ctp @@ -20,9 +20,9 @@ <h2><?php __('Missing Database Table'); ?></h2> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('Database table %1$s for model %2$s was not found.', true), '<em>' . $table . '</em>', '<em>' . $model . '</em>');?> + <?php printf(__('Database table %1$s for model %2$s was not found.', true), '<em>' . $table . '</em>', '<em>' . $model . '</em>'); ?> </p> <p class="notice"> <strong><?php __('Notice'); ?>: </strong> - <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_table.ctp');?> + <?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_table.ctp'); ?> </p> \ No newline at end of file diff --git a/cake/libs/view/errors/missing_view.ctp b/cake/libs/view/errors/missing_view.ctp index 0279503ce..5347a5149 100644 --- a/cake/libs/view/errors/missing_view.ctp +++ b/cake/libs/view/errors/missing_view.ctp @@ -20,13 +20,13 @@ <h2><?php __('Missing View'); ?></h2> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('The view for %1$s%2$s was not found.', true), '<em>' . $controller . 'Controller::</em>', '<em>' . $action . '()</em>');?> + <?php printf(__('The view for %1$s%2$s was not found.', true), '<em>' . $controller . 'Controller::</em>', '<em>' . $action . '()</em>'); ?> </p> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('Confirm you have created the file: %s', true), $file);?> + <?php printf(__('Confirm you have created the file: %s', true), $file); ?> </p> <p class="notice"> <strong><?php __('Notice'); ?>: </strong> - <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_view.ctp');?> + <?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_view.ctp'); ?> </p> \ No newline at end of file diff --git a/cake/libs/view/errors/private_action.ctp b/cake/libs/view/errors/private_action.ctp index d3982b9c4..8a40680e9 100644 --- a/cake/libs/view/errors/private_action.ctp +++ b/cake/libs/view/errors/private_action.ctp @@ -17,12 +17,12 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ ?> -<h2><?php echo sprintf(__('Private Method in %s', true), $controller);?></h2> +<h2><?php printf(__('Private Method in %s', true), $controller); ?></h2> <p class="error"> <strong><?php __('Error'); ?>: </strong> - <?php echo sprintf(__('%s%s cannot be accessed directly.', true), '<em>' . $controller . '::</em>', '<em>' . $action . '()</em>');?> + <?php printf(__('%s%s cannot be accessed directly.', true), '<em>' . $controller . '::</em>', '<em>' . $action . '()</em>'); ?> </p> <p class="notice"> <strong><?php __('Notice'); ?>: </strong> - <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'private_action.ctp');?> + <?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'private_action.ctp'); ?> </p> \ No newline at end of file diff --git a/cake/libs/view/errors/scaffold_error.ctp b/cake/libs/view/errors/scaffold_error.ctp index 4f71381ac..cf3da41a4 100644 --- a/cake/libs/view/errors/scaffold_error.ctp +++ b/cake/libs/view/errors/scaffold_error.ctp @@ -24,7 +24,7 @@ </p> <p class="notice"> <strong><?php __('Notice'); ?>: </strong> - <?php echo sprintf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'scaffold_error.ctp');?> + <?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'scaffold_error.ctp'); ?> </p> <pre> <?php diff --git a/cake/libs/view/pages/home.ctp b/cake/libs/view/pages/home.ctp index adb658685..62597da76 100644 --- a/cake/libs/view/pages/home.ctp +++ b/cake/libs/view/pages/home.ctp @@ -20,7 +20,7 @@ if (Configure::read() == 0): $this->cakeError('error404'); endif; ?> -<h2><?php echo sprintf(__('Release Notes for CakePHP %s.', true), Configure::version()); ?></h2> +<h2><?php printf(__('Release Notes for CakePHP %s.', true), Configure::version()); ?></h2> <?php echo $this->Html->link(__('Read the changelog', true), 'http://code.cakephp.org/wiki/changelog/1_3_0-alpha'); @@ -46,7 +46,7 @@ endif; $settings = Cache::settings(); if (!empty($settings)): echo '<span class="notice success">'; - echo sprintf(__('The %s is being used for caching. To change the config edit APP/config/core.php ', true), '<em>'. $settings['engine'] . 'Engine</em>'); + printf(__('The %s is being used for caching. To change the config edit APP/config/core.php ', true), '<em>'. $settings['engine'] . 'Engine</em>'); echo '</span>'; else: echo '<span class="notice">'; diff --git a/cake/libs/view/scaffolds/view.ctp b/cake/libs/view/scaffolds/view.ctp index 03d1ba08e..4bc9d293c 100644 --- a/cake/libs/view/scaffolds/view.ctp +++ b/cake/libs/view/scaffolds/view.ctp @@ -18,7 +18,7 @@ */ ?> <div class="<?php echo $pluralVar;?> view"> -<h2><?php echo sprintf(__("View %s", true), $singularHumanName);?></h2> +<h2><?php printf(__("View %s", true), $singularHumanName); ?></h2> <dl> <?php $i = 0; @@ -72,7 +72,7 @@ foreach ($scaffoldFields as $_field) { if (!empty($associations['hasOne'])) : foreach ($associations['hasOne'] as $_alias => $_details): ?> <div class="related"> - <h3><?php echo sprintf(__("Related %s", true), Inflector::humanize($_details['controller']));?></h3> + <h3><?php printf(__("Related %s", true), Inflector::humanize($_details['controller'])); ?></h3> <?php if (!empty(${$singularVar}[$_alias])):?> <dl> <?php @@ -111,7 +111,7 @@ foreach ($relations as $_alias => $_details): $otherSingularVar = Inflector::variable($_alias); ?> <div class="related"> - <h3><?php echo sprintf(__("Related %s", true), Inflector::humanize($_details['controller']));?></h3> + <h3><?php printf(__("Related %s", true), Inflector::humanize($_details['controller'])); ?></h3> <?php if (!empty(${$singularVar}[$_alias])):?> <table cellpadding="0" cellspacing="0"> <tr> diff --git a/cake/tests/test_app/views/pages/home.ctp b/cake/tests/test_app/views/pages/home.ctp index 1d394b49f..830a21fae 100644 --- a/cake/tests/test_app/views/pages/home.ctp +++ b/cake/tests/test_app/views/pages/home.ctp @@ -23,7 +23,7 @@ endif; $settings = Cache::settings(); if (!empty($settings)): echo '<span class="notice success">'; - echo sprintf(__('The %s is being used for caching. To change the config edit APP/config/core.php ', true), '<em>'. $settings['engine'] . 'Engine</em>'); + printf(__('The %s is being used for caching. To change the config edit APP/config/core.php ', true), '<em>'. $settings['engine'] . 'Engine</em>'); echo '</span>'; else: echo '<span class="notice">'; @@ -74,7 +74,7 @@ if (!empty($filePresent)): <h3><?php __('Editing this Page') ?></h3> <p> <?php - echo sprintf(__('To change the content of this page, edit: %s + printf(__('To change the content of this page, edit: %s To change its layout, edit: %s You can also add some CSS styles for your pages at: %s', true), APP . 'views' . DS . 'pages' . DS . 'home.ctp.<br />', APP . 'views' . DS . 'layouts' . DS . 'default.ctp.<br />', APP . 'webroot' . DS . 'css'); diff --git a/cake/tests/test_app/views/posts/test_nocache_tags.ctp b/cake/tests/test_app/views/posts/test_nocache_tags.ctp index 121f1d7d0..ba21c7963 100644 --- a/cake/tests/test_app/views/posts/test_nocache_tags.ctp +++ b/cake/tests/test_app/views/posts/test_nocache_tags.ctp @@ -96,7 +96,7 @@ if (!empty($filePresent)): </span> </p> <?php endif; ?> -<h2><?php echo sprintf(__('Release Notes for CakePHP %s.', true), Configure::version()); ?></h2> +<h2><?php printf(__('Release Notes for CakePHP %s.', true), Configure::version()); ?></h2> <a href="https://trac.cakephp.org/wiki/notes/1.2.x.x"><?php __('Read the release notes and get the latest version'); ?> </a> <h2><?php __('Editing this Page'); ?></h2> <p> From 473e07a67409c2547fb2a504172f5befbb767077 Mon Sep 17 00:00:00 2001 From: Juan Basso <jrbasso@gmail.com> Date: Sat, 16 Jan 2010 18:23:31 -0200 Subject: [PATCH 1532/2083] Putting __() in strings that missing internationalization. Signed-off-by: Mark Story <mark@mark-story.com> --- cake/libs/cake_session.php | 8 ++++---- cake/libs/configure.php | 5 ++--- cake/libs/controller/components/acl.php | 4 ++-- cake/libs/controller/components/auth.php | 8 ++------ cake/libs/controller/components/cookie.php | 2 +- cake/libs/controller/components/email.php | 2 +- .../controller/components/request_handler.php | 2 +- cake/libs/controller/components/session.php | 2 +- cake/libs/folder.php | 10 +++++----- cake/libs/model/behaviors/acl.php | 2 +- cake/libs/model/cake_schema.php | 2 +- cake/libs/model/connection_manager.php | 3 +-- cake/libs/model/datasources/dbo/dbo_mssql.php | 2 +- cake/libs/model/datasources/dbo/dbo_oracle.php | 4 ++-- cake/libs/model/datasources/dbo/dbo_sqlite.php | 4 ++-- cake/libs/model/datasources/dbo_source.php | 12 ++++++------ cake/libs/model/db_acl.php | 4 ++-- cake/libs/model/model.php | 15 +++++---------- cake/libs/model/model_behavior.php | 2 +- cake/libs/set.php | 2 +- cake/libs/view/helpers/paginator.php | 6 +----- cake/libs/view/helpers/text.php | 2 +- cake/libs/view/view.php | 6 ++---- cake/libs/xml.php | 4 ++-- cake/tests/lib/cake_test_case.php | 2 +- cake/tests/lib/code_coverage_manager.php | 10 +++++----- cake/tests/lib/test_manager.php | 14 +++++++------- 27 files changed, 61 insertions(+), 78 deletions(-) diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index b3442998d..7780749da 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -245,7 +245,7 @@ function id($id = null) { * @deprecated Use CakeSession::delete instead */ function del($name) { - trigger_error('CakeSession::del() is deprecated, use CakeSession::delete() instead.', E_USER_WARNING); + trigger_error(__('CakeSession::del() is deprecated, use CakeSession::delete() instead.', true), E_USER_WARNING); return $this->delete($name); } @@ -259,12 +259,12 @@ function del($name) { function delete($name) { if ($this->check($name)) { if (in_array($name, $this->watchKeys)) { - trigger_error('Deleting session key {' . $name . '}', E_USER_NOTICE); + trigger_error(sprintf(__('Deleting session key {%s}', true), $name), E_USER_NOTICE); } $this->__overwrite($_SESSION, Set::remove($_SESSION, $name)); return ($this->check($name) == false); } - $this->__setError(2, "$name doesn't exist"); + $this->__setError(2, sprintf(__("%s doesn't exist", true), $name)); return false; } @@ -423,7 +423,7 @@ function write($name, $value) { return false; } if (in_array($name, $this->watchKeys)) { - trigger_error('Writing session key {' . $name . '}: ' . Debugger::exportVar($value), E_USER_NOTICE); + trigger_error(sprintf(__('Writing session key {%s}: %s', true), $name, Debugger::exportVar($value)), E_USER_NOTICE); } $this->__overwrite($_SESSION, Set::insert($_SESSION, $name, $value)); return (Set::classicExtract($_SESSION, $name) === $value); diff --git a/cake/libs/configure.php b/cake/libs/configure.php index fb463fa6a..a810b99ad 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -261,8 +261,7 @@ function load($fileName) { } if (!isset($config)) { - $error = __("Configure::load() - no variable \$config found in %s.php", true); - trigger_error(sprintf($error, $fileName), E_USER_WARNING); + trigger_error(sprintf(__('Configure::load() - no variable $config found in %s.php', true), $fileName), E_USER_WARNING); return false; } return Configure::write($config); @@ -398,7 +397,7 @@ function __loadBootstrap($boot) { $cache = Cache::config('default'); if (empty($cache['settings'])) { - trigger_error('Cache not configured properly. Please check Cache::config(); in APP/config/core.php', E_USER_WARNING); + trigger_error(__('Cache not configured properly. Please check Cache::config(); in APP/config/core.php', true), E_USER_WARNING); $cache = Cache::config('default', array('engine' => 'File')); } $path = $prefix = $duration = null; diff --git a/cake/libs/controller/components/acl.php b/cake/libs/controller/components/acl.php index 1e15fcb78..1a6a049d9 100644 --- a/cake/libs/controller/components/acl.php +++ b/cake/libs/controller/components/acl.php @@ -248,12 +248,12 @@ function check($aro, $aco, $action = "*") { $acoPath = $this->Aco->node($aco); if (empty($aroPath) || empty($acoPath)) { - trigger_error("DbAcl::check() - Failed ARO/ACO node lookup in permissions check. Node references:\nAro: " . print_r($aro, true) . "\nAco: " . print_r($aco, true), E_USER_WARNING); + trigger_error(__("DbAcl::check() - Failed ARO/ACO node lookup in permissions check. Node references:\nAro: ", true) . print_r($aro, true) . "\nAco: " . print_r($aco, true), E_USER_WARNING); return false; } if ($acoPath == null || $acoPath == array()) { - trigger_error("DbAcl::check() - Failed ACO node lookup in permissions check. Node references:\nAro: " . print_r($aro, true) . "\nAco: " . print_r($aco, true), E_USER_WARNING); + trigger_error(__("DbAcl::check() - Failed ACO node lookup in permissions check. Node references:\nAro: ", true) . print_r($aro, true) . "\nAco: " . print_r($aco, true), E_USER_WARNING); return false; } diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index bdbeb7146..258c7bb82 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -403,9 +403,7 @@ function startup(&$controller) { if (isset($controller->Acl)) { $this->Acl =& $controller->Acl; } else { - $err = 'Could not find AclComponent. Please include Acl in '; - $err .= 'Controller::$components.'; - trigger_error(__($err, true), E_USER_WARNING); + trigger_error(__('Could not find AclComponent. Please include Acl in Controller::$components.', true), E_USER_WARNING); } break; case 'model': @@ -514,10 +512,8 @@ function isAuthorized($type = null, $object = null, $user = null) { case 'crud': $this->mapActions(); if (!isset($this->actionMap[$this->params['action']])) { - $err = 'Auth::startup() - Attempted access of un-mapped action "%1$s" in'; - $err .= ' controller "%2$s"'; trigger_error( - sprintf(__($err, true), $this->params['action'], $this->params['controller']), + sprintf(__('Auth::startup() - Attempted access of un-mapped action "%1$s" in controller "%2$s"', true), $this->params['action'], $this->params['controller']), E_USER_WARNING ); } else { diff --git a/cake/libs/controller/components/cookie.php b/cake/libs/controller/components/cookie.php index d6783c3bd..a7403b2c6 100644 --- a/cake/libs/controller/components/cookie.php +++ b/cake/libs/controller/components/cookie.php @@ -263,7 +263,7 @@ function read($key = null) { * @deprecated use delete() */ function del($key) { - trigger_error('Deprecated method, use CookieComponent::delete instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use CookieComponent::delete instead', true), E_USER_WARNING); return $this->delete($key); } diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index 8eb16fec4..f29f92c51 100644 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -611,7 +611,7 @@ function __wrap($message) { $formatted = array(); if ($this->_lineLength !== null) { - trigger_error('_lineLength cannot be accessed please use lineLength', E_USER_WARNING); + trigger_error(__('_lineLength cannot be accessed please use lineLength', true), E_USER_WARNING); $this->lineLength = $this->_lineLength; } diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php index fbbf01afa..8cefb3917 100644 --- a/cake/libs/controller/components/request_handler.php +++ b/cake/libs/controller/components/request_handler.php @@ -425,7 +425,7 @@ function getReferer() { * @deprecated use getReferer() */ function getReferrer() { - trigger_error('Deprecated method, use RequestHandlerComponent::getReferer instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use RequestHandlerComponent::getReferer instead', true), E_USER_WARNING); return $this->getReferer(); } diff --git a/cake/libs/controller/components/session.php b/cake/libs/controller/components/session.php index cc4820c4b..11e735859 100644 --- a/cake/libs/controller/components/session.php +++ b/cake/libs/controller/components/session.php @@ -141,7 +141,7 @@ function read($name = null) { * @deprecated use delete */ function del($name) { - trigger_error('Deprecated method, use SessionComponent::delete instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use SessionComponent::delete instead', true), E_USER_WARNING); if ($this->__active === true) { $this->__start(); return parent::del($name); diff --git a/cake/libs/folder.php b/cake/libs/folder.php index cb5f4f9e0..6e4c23d3a 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -723,7 +723,7 @@ function errors() { * @access public */ function ls($sort = true, $exceptions = false) { - trigger_error('Deprecated method, use Folder::read instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use Folder::read instead', true), E_USER_WARNING); return $this->read($sort, $exceptions); } @@ -735,7 +735,7 @@ function ls($sort = true, $exceptions = false) { * @access public */ function mkdir($pathname, $mode = 0755) { - trigger_error('Deprecated method, use Folder::create instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use Folder::create instead', true), E_USER_WARNING); return $this->create($pathname, $mode); } @@ -747,7 +747,7 @@ function mkdir($pathname, $mode = 0755) { * @access public */ function cp($options) { - trigger_error('Deprecated method, use Folder::copy instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use Folder::copy instead', true), E_USER_WARNING); return $this->copy($options); } @@ -759,7 +759,7 @@ function cp($options) { * @access public */ function mv($options) { - trigger_error('Deprecated method, use Folder::move instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use Folder::move instead', true), E_USER_WARNING); return $this->move($options); } @@ -771,7 +771,7 @@ function mv($options) { * @access public */ function rm($path) { - trigger_error('Deprecated method, use Folder::delete instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use Folder::delete instead', true), E_USER_WARNING); return $this->delete($path); } diff --git a/cake/libs/model/behaviors/acl.php b/cake/libs/model/behaviors/acl.php index a103c5008..947f3b3e0 100644 --- a/cake/libs/model/behaviors/acl.php +++ b/cake/libs/model/behaviors/acl.php @@ -59,7 +59,7 @@ function setup(&$model, $config = array()) { $model->{$type} =& ClassRegistry::init($type); } if (!method_exists($model, 'parentNode')) { - trigger_error("Callback parentNode() not defined in {$model->alias}", E_USER_WARNING); + trigger_error(sprintf(__('Callback parentNode() not defined in %s', true), $model->alias), E_USER_WARNING); } } diff --git a/cake/libs/model/cake_schema.php b/cake/libs/model/cake_schema.php index 82b2e8913..7ae1ae7c3 100644 --- a/cake/libs/model/cake_schema.php +++ b/cake/libs/model/cake_schema.php @@ -545,7 +545,7 @@ function __columns(&$Obj) { $value['key'] = 'primary'; } if (!isset($db->columns[$value['type']])) { - trigger_error('Schema generation error: invalid column type ' . $value['type'] . ' does not exist in DBO', E_USER_NOTICE); + trigger_error(sprintf(__('Schema generation error: invalid column type %s does not exist in DBO', true), $value['type']), E_USER_NOTICE); continue; } else { $defaultCol = $db->columns[$value['type']]; diff --git a/cake/libs/model/connection_manager.php b/cake/libs/model/connection_manager.php index 0adf16b64..b09eda5c4 100644 --- a/cake/libs/model/connection_manager.php +++ b/cake/libs/model/connection_manager.php @@ -181,8 +181,7 @@ function loadDataSource($connName) { $class = "{$conn['plugin']}.{$conn['classname']}"; if (!App::import('Datasource', $class, false)) { - $error = __('ConnectionManager::loadDataSource - Unable to import DataSource class %s', true); - trigger_error(sprintf($error, $class), E_USER_ERROR); + trigger_error(sprintf(__('ConnectionManager::loadDataSource - Unable to import DataSource class %s', true), $class), E_USER_ERROR); return null; } return true; diff --git a/cake/libs/model/datasources/dbo/dbo_mssql.php b/cake/libs/model/datasources/dbo/dbo_mssql.php index 2e26fdb92..86e78fc31 100644 --- a/cake/libs/model/datasources/dbo/dbo_mssql.php +++ b/cake/libs/model/datasources/dbo/dbo_mssql.php @@ -111,7 +111,7 @@ class DboMssql extends DboSource { function __construct($config, $autoConnect = true) { if ($autoConnect) { if (!function_exists('mssql_min_message_severity')) { - trigger_error("PHP SQL Server interface is not installed, cannot continue. For troubleshooting information, see http://php.net/mssql/", E_USER_WARNING); + trigger_error(__("PHP SQL Server interface is not installed, cannot continue. For troubleshooting information, see http://php.net/mssql/", true), E_USER_WARNING); } mssql_min_message_severity(15); mssql_min_error_severity(2); diff --git a/cake/libs/model/datasources/dbo/dbo_oracle.php b/cake/libs/model/datasources/dbo/dbo_oracle.php index 04d322a43..5c991b026 100644 --- a/cake/libs/model/datasources/dbo/dbo_oracle.php +++ b/cake/libs/model/datasources/dbo/dbo_oracle.php @@ -583,7 +583,7 @@ function truncate($table, $reset = 0) { */ function constraint($action, $table) { if (empty($table)) { - trigger_error(__('Must specify table to operate on constraints')); + trigger_error(__('Must specify table to operate on constraints', true)); } $table = strtoupper($table); @@ -641,7 +641,7 @@ function constraint($action, $table) { return $constraints; break; default: - trigger_error(__('DboOracle::constraint() accepts only enable, disable, or list')); + trigger_error(__('DboOracle::constraint() accepts only enable, disable, or list', true)); } } return true; diff --git a/cake/libs/model/datasources/dbo/dbo_sqlite.php b/cake/libs/model/datasources/dbo/dbo_sqlite.php index 3bfa760b8..6a79bf1be 100644 --- a/cake/libs/model/datasources/dbo/dbo_sqlite.php +++ b/cake/libs/model/datasources/dbo/dbo_sqlite.php @@ -490,12 +490,12 @@ function buildColumn($column) { extract($column); if (empty($name) || empty($type)) { - trigger_error('Column name or type not defined in schema', E_USER_WARNING); + trigger_error(__('Column name or type not defined in schema', true), E_USER_WARNING); return null; } if (!isset($this->columns[$type])) { - trigger_error("Column type {$type} does not exist", E_USER_WARNING); + trigger_error(sprintf(__('Column type %s does not exist', true), $type), E_USER_WARNING); return null; } diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 88b673dfe..047ac879b 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -632,11 +632,11 @@ function showQuery($sql) { if (Configure::read() > 0) { $out = null; if ($error) { - trigger_error("<span style = \"color:Red;text-align:left\"><b>SQL Error:</b> {$this->error}</span>", E_USER_WARNING); + trigger_error('<span style="color:Red;text-align:left"><b>' . __('SQL Error:', true) . "</b> {$this->error}</span>", E_USER_WARNING); } else { - $out = ("<small>[Aff:{$this->affected} Num:{$this->numRows} Took:{$this->took}ms]</small>"); + $out = ('<small>[' . sprintf(__('Aff:%s Num:%s Took:%sms', true), $this->affected, $this->numRows, $this->took) . ']</small>'); } - pr(sprintf("<p style = \"text-align:left\"><b>Query:</b> %s %s</p>", $sql, $out)); + pr(sprintf('<p style="text-align:left"><b>' . __('Query:', true) . '</b> %s %s</p>', $sql, $out)); } } @@ -2386,7 +2386,7 @@ function hasAny(&$Model, $sql) { */ function length($real) { if (!preg_match_all('/([\w\s]+)(?:\((\d+)(?:,(\d+))?\))?(\sunsigned)?(\szerofill)?/', $real, $result)) { - trigger_error(__('FIXME: Can\'t parse field: ' . $real, true), E_USER_WARNING); + trigger_error(__("FIXME: Can't parse field: " . $real, true), E_USER_WARNING); $col = str_replace(array(')', 'unsigned'), '', $real); $limit = null; @@ -2585,12 +2585,12 @@ function buildColumn($column) { extract(array_merge(array('null' => true), $column)); if (empty($name) || empty($type)) { - trigger_error('Column name or type not defined in schema', E_USER_WARNING); + trigger_error(__('Column name or type not defined in schema', true), E_USER_WARNING); return null; } if (!isset($this->columns[$type])) { - trigger_error("Column type {$type} does not exist", E_USER_WARNING); + trigger_error(sprintf(__('Column type %s does not exist', true), $type), E_USER_WARNING); return null; } diff --git a/cake/libs/model/db_acl.php b/cake/libs/model/db_acl.php index 6599f2ac9..af65e8e92 100644 --- a/cake/libs/model/db_acl.php +++ b/cake/libs/model/db_acl.php @@ -142,7 +142,7 @@ function node($ref = null) { } if (empty($model)) { - trigger_error("Model class '$name' not found in AclNode::node() when trying to bind {$this->alias} object", E_USER_WARNING); + trigger_error(sprintf(__("Model class '%s' not found in AclNode::node() when trying to bind %s object", true), $type, $this->alias), E_USER_WARNING); return null; } @@ -187,7 +187,7 @@ function node($ref = null) { $result = $db->read($this, $queryData, -1); if (!$result) { - trigger_error("AclNode::node() - Couldn't find {$type} node identified by \"" . print_r($ref, true) . "\"", E_USER_WARNING); + trigger_error(sprintf(__("AclNode::node() - Couldn't find %s node identified by \"%s\"", true), $type, print_r($ref, true)), E_USER_WARNING); } } return $result; diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index b936fc7d7..32b3d5003 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -530,7 +530,7 @@ function call__($method, $params) { * @deprecated Use Model::bindModel() instead. */ function bind($model, $options = array(), $permanent = true) { - trigger_error('Deprecated method, use Model::bindModel instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use Model::bindModel instead', true), E_USER_WARNING); if (!is_array($model)) { $model = array($model => $options); } @@ -1809,7 +1809,7 @@ function updateAll($fields, $conditions = true) { * @link http://book.cakephp.org/view/691/remove */ function remove($id = null, $cascade = true) { - trigger_error('Deprecated method, use Model::delete instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use Model::delete instead', true), E_USER_WARNING); return $this->delete($id, $cascade); } @@ -1862,7 +1862,7 @@ function delete($id = null, $cascade = true) { * @deprecated */ function del($id = null, $cascade = true) { - trigger_error('Deprecated method, use Model::delete instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use Model::delete instead', true), E_USER_WARNING); return $this->delete($id, $cascade); } @@ -2615,12 +2615,7 @@ function invalidFields($options = array()) { } elseif (!is_array($validator['rule'])) { $valid = preg_match($rule, $data[$fieldName]); } elseif (Configure::read('debug') > 0) { - $error = sprintf( - __('Could not find validation handler %s for %s', true), - $rule, - $fieldName - ); - trigger_error($error, E_USER_WARNING); + trigger_error(sprintf(__('Could not find validation handler %s for %s', true), $rule, $fieldName), E_USER_WARNING); } if (!$valid || (is_string($valid) && strlen($valid) > 0)) { @@ -2727,7 +2722,7 @@ function isForeignKey($field) { * @deprecated */ function getDisplayField() { - trigger_error('Deprecated method, use Model::$displayField instead', E_USER_WARNING); + trigger_error(__('Deprecated method, use Model::$displayField instead', true), E_USER_WARNING); return $this->displayField; } diff --git a/cake/libs/model/model_behavior.php b/cake/libs/model/model_behavior.php index e5fd759de..4e5eeeea3 100644 --- a/cake/libs/model/model_behavior.php +++ b/cake/libs/model/model_behavior.php @@ -441,7 +441,7 @@ function dispatchMethod(&$model, $method, $params = array(), $strict = false) { $call = null; if ($strict && !$found) { - trigger_error("BehaviorCollection::dispatchMethod() - Method {$method} not found in any attached behavior", E_USER_WARNING); + trigger_error(sprintf(__("BehaviorCollection::dispatchMethod() - Method %s not found in any attached behavior", true), $method), E_USER_WARNING); return null; } elseif ($found) { $methods = array_combine($methods, array_values($this->__methods)); diff --git a/cake/libs/set.php b/cake/libs/set.php index 40929479a..2f9551a99 100644 --- a/cake/libs/set.php +++ b/cake/libs/set.php @@ -828,7 +828,7 @@ function diff($val1, $val2 = null) { * @deprecated */ function isEqual($val1, $val2 = null) { - trigger_error('Set::isEqual() is deprecated. Please use standard comparison operators instead.', E_USER_WARNING); + trigger_error(__('Set::isEqual() is deprecated. Please use standard comparison operators instead.', true), E_USER_WARNING); return ($val1 == $val2); } diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index 8b326efc5..8a29da535 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -92,11 +92,7 @@ function __construct($config = array()) { App::import('Helper', $ajaxProvider); $classname = $ajaxProvider . 'Helper'; if (!is_callable(array($classname, 'link'))) { - $message = sprintf( - __('%s does not implement a link() method, it is incompatible with PaginatorHelper', true), - $classname - ); - trigger_error($message, E_USER_WARNING); + trigger_error(sprintf(__('%s does not implement a link() method, it is incompatible with PaginatorHelper', true), $classname), E_USER_WARNING); } } diff --git a/cake/libs/view/helpers/text.php b/cake/libs/view/helpers/text.php index 63b02925e..21883781c 100644 --- a/cake/libs/view/helpers/text.php +++ b/cake/libs/view/helpers/text.php @@ -273,7 +273,7 @@ function truncate($text, $length = 100, $options = array()) { * @access public */ function trim() { - trigger_error('TextHelper::trim() is deprecated. Use TextHelper::truncate() instead', E_USER_WARNING); + trigger_error(__('TextHelper::trim() is deprecated. Use TextHelper::truncate() instead', true), E_USER_WARNING); $args = func_get_args(); return call_user_func_array(array(&$this, 'truncate'), $args); } diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index 05917c107..fd7db3654 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -420,8 +420,7 @@ function render($action = null, $layout = null, $file = null) { $this->hasRendered = true; } else { $out = $this->_render($viewFileName, $this->viewVars); - $msg = __("Error in view %s, got: <blockquote>%s</blockquote>", true); - trigger_error(sprintf($msg, $viewFileName, $out), E_USER_ERROR); + trigger_error(sprintf(__("Error in view %s, got: <blockquote>%s</blockquote>", true), $viewFileName, $out), E_USER_ERROR); } return $out; } @@ -464,8 +463,7 @@ function renderLayout($content_for_layout, $layout = null) { if ($this->output === false) { $this->output = $this->_render($layoutFileName, $data_for_layout); - $msg = __("Error in layout %s, got: <blockquote>%s</blockquote>", true); - trigger_error(sprintf($msg, $layoutFileName, $this->output), E_USER_ERROR); + trigger_error(sprintf(__("Error in layout %s, got: <blockquote>%s</blockquote>", true), $layoutFileName, $this->output), E_USER_ERROR); return false; } diff --git a/cake/libs/xml.php b/cake/libs/xml.php index a1fe11368..02b561b44 100644 --- a/cake/libs/xml.php +++ b/cake/libs/xml.php @@ -402,7 +402,7 @@ function &append(&$child, $options = array()) { if (is_object($child)) { if ($this->compare($child)) { - trigger_error('Cannot append a node to itself.'); + trigger_error(__('Cannot append a node to itself.', true)); $return = false; return $return; } @@ -909,7 +909,7 @@ function load($input) { } elseif (file_exists($input)) { $this->__rawData = file_get_contents($input); } else { - trigger_error('XML cannot be read'); + trigger_error(__('XML cannot be read', true)); return false; } return $this->parse(); diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index 9e4c6beed..7696e8a2d 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -533,7 +533,7 @@ function loadFixtures() { $fixture->truncate($this->db); $fixture->insert($this->db); } else { - trigger_error("Referenced fixture class {$class} not found", E_USER_WARNING); + trigger_error(sprintf(__('Referenced fixture class %s not found', true), $class), E_USER_WARNING); } } } diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index 5ddeaab84..1e88c734c 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -101,7 +101,7 @@ function init($testCaseFile, &$reporter) { $thisFile = str_replace('.php', '.test.php', basename(__FILE__)); if (strpos($testCaseFile, $thisFile) !== false) { - trigger_error('Xdebug supports no parallel coverage analysis - so this is not possible.', E_USER_ERROR); + trigger_error(__('Xdebug supports no parallel coverage analysis - so this is not possible.', true), E_USER_ERROR); } $manager->setParams($reporter); $manager->testCaseFile = $testCaseFile; @@ -223,7 +223,7 @@ function _getCoverageData() { $testObjectFile = $this->__testObjectFilesFromGroupFile($this->testCaseFile, $this->appTest); foreach ($testObjectFile as $file) { if (!file_exists($file)) { - trigger_error('This test object file is invalid: ' . $file); + trigger_error(sprintf(__('This test object file is invalid: %s', true), $file)); return ; } } @@ -236,7 +236,7 @@ function _getCoverageData() { $testObjectFile = $this->__testObjectFileFromCaseFile($this->testCaseFile, $this->appTest); if (!file_exists($testObjectFile)) { - trigger_error('This test object file is invalid: ' . $testObjectFile); + trigger_error(sprintf(__('This test object file is invalid: %s', true), $testObjectFile)); return ; } @@ -551,7 +551,7 @@ function __testObjectFilesFromGroupFile($groupFile, $isApp = true) { $path .= DS . $groupFile . $testManager->_groupExtension; if (!file_exists($path)) { - trigger_error('This group file does not exist!'); + trigger_error(__('This group file does not exist!', true)); return array(); } @@ -736,7 +736,7 @@ function __paintCodeline($class, $num, $line) { */ function __calcCoverage($lineCount, $coveredCount) { if ($coveredCount > $lineCount) { - trigger_error('Sorry, you cannot have more covered lines than total lines!'); + trigger_error(__('Sorry, you cannot have more covered lines than total lines!', true)); } return ($lineCount != 0) ? round(100 * $coveredCount / $lineCount, 2) diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index 21ee551ca..a71665301 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -101,11 +101,11 @@ function _installSimpleTest() { function runAllTests(&$reporter, $testing = false) { $testCases =& $this->_getTestFileList($this->_getTestsPath()); if ($this->appTest) { - $test =& new TestSuite('All App Tests'); + $test =& new TestSuite(__('All App Tests', true)); } else if ($this->pluginTest) { - $test =& new TestSuite('All ' . Inflector::humanize($this->pluginTest) . ' Plugin Tests'); + $test =& new TestSuite(sprintf(__('All %s Plugin Tests', true), Inflector::humanize($manager->pluginTest))); } else { - $test =& new TestSuite('All Core Tests'); + $test =& new TestSuite(__('All Core Tests', true)); } if ($testing) { @@ -132,7 +132,7 @@ function runTestCase($testCaseFile, &$reporter, $testing = false) { $testCaseFileWithPath = $this->_getTestsPath() . DS . $testCaseFile; if (!file_exists($testCaseFileWithPath)) { - trigger_error("Test case {$testCaseFile} cannot be found", E_USER_ERROR); + trigger_error(sprintf(__('Test case %s cannot be found', true), $testCaseFile), E_USER_ERROR); return false; } @@ -140,7 +140,7 @@ function runTestCase($testCaseFile, &$reporter, $testing = false) { return true; } - $test =& new TestSuite("Individual test case: " . $testCaseFile); + $test =& new TestSuite(sprintf(__('Individual test case: %s', true), $testCaseFile)); $test->addTestFile($testCaseFileWithPath); return $test->run($reporter); } @@ -157,11 +157,11 @@ function runGroupTest($groupTestName, &$reporter) { $filePath = $this->_getTestsPath('groups') . DS . strtolower($groupTestName) . $this->_groupExtension; if (!file_exists($filePath)) { - trigger_error("Group test {$groupTestName} cannot be found at {$filePath}", E_USER_ERROR); + trigger_error(sprintf(__('Group test %s cannot be found at %s', true), $groupTestName, $filePath), E_USER_ERROR); } require_once $filePath; - $test =& new TestSuite($groupTestName . ' group test'); + $test =& new TestSuite(sprintf(__('%s group test', true), $groupTestName)); foreach ($this->_getGroupTestClassNames($filePath) as $groupTest) { $testCase = new $groupTest(); $test->addTestCase($testCase); From d60a66f16b48a0f9cd0623f924c5c486d89fb802 Mon Sep 17 00:00:00 2001 From: Juan Basso <jrbasso@gmail.com> Date: Mon, 11 Jan 2010 17:47:43 -0200 Subject: [PATCH 1533/2083] Separate the variables of internationalized strings in controllers of cake bake. Signed-off-by: Mark Story <mark@mark-story.com> --- .../default/actions/controller_actions.ctp | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/cake/console/templates/default/actions/controller_actions.ctp b/cake/console/templates/default/actions/controller_actions.ctp index 6590a6e4d..1f9baa287 100644 --- a/cake/console/templates/default/actions/controller_actions.ctp +++ b/cake/console/templates/default/actions/controller_actions.ctp @@ -27,10 +27,10 @@ function <?php echo $admin ?>view($id = null) { if (!$id) { <?php if ($wannaUseSession): ?> - $this->Session->setFlash(__('Invalid <?php echo strtolower($singularHumanName) ?>', true)); + $this->Session->setFlash(sprintf(__('Invalid %s', true), '<?php echo strtolower($singularHumanName) ?>')); $this->redirect(array('action' => 'index')); <?php else: ?> - $this->flash(__('Invalid <?php echo strtolower($singularHumanName); ?>', true), array('action' => 'index')); + $this->flash(sprintf(__('Invalid %s', true), '<?php echo strtolower($singularHumanName); ?>'), array('action' => 'index')); <?php endif; ?> } $this->set('<?php echo $singularName; ?>', $this-><?php echo $currentModelName; ?>->read(null, $id)); @@ -42,14 +42,14 @@ $this-><?php echo $currentModelName; ?>->create(); if ($this-><?php echo $currentModelName; ?>->save($this->data)) { <?php if ($wannaUseSession): ?> - $this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> has been saved', true)); + $this->Session->setFlash(sprintf(__('The %s has been saved', true), '<?php echo strtolower($singularHumanName); ?>')); $this->redirect(array('action' => 'index')); <?php else: ?> - $this->flash(__('<?php echo ucfirst(strtolower($currentModelName)); ?> saved.', true), array('action' => 'index')); + $this->flash(sprintf(__('%s saved.', true), '<?php echo ucfirst(strtolower($currentModelName)); ?>'), array('action' => 'index')); <?php endif; ?> } else { <?php if ($wannaUseSession): ?> - $this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> could not be saved. Please, try again.', true)); + $this->Session->setFlash(sprintf(__('The %s could not be saved. Please, try again.', true), '<?php echo strtolower($singularHumanName); ?>')); <?php endif; ?> } } @@ -74,23 +74,23 @@ function <?php echo $admin; ?>edit($id = null) { if (!$id && empty($this->data)) { <?php if ($wannaUseSession): ?> - $this->Session->setFlash(__('Invalid <?php echo strtolower($singularHumanName); ?>', true)); + $this->Session->setFlash(sprintf(__('Invalid %s', true), '<?php echo strtolower($singularHumanName); ?>')); $this->redirect(array('action' => 'index')); <?php else: ?> - $this->flash(__('Invalid <?php echo strtolower($singularHumanName); ?>', true), array('action' => 'index')); + $this->flash(sprintf(__('Invalid %s', true), '<?php echo strtolower($singularHumanName); ?>'), array('action' => 'index')); <?php endif; ?> } if (!empty($this->data)) { if ($this-><?php echo $currentModelName; ?>->save($this->data)) { <?php if ($wannaUseSession): ?> - $this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> has been saved', true)); + $this->Session->setFlash(sprintf(__('The %s has been saved', true), '<?php echo strtolower($singularHumanName); ?>')); $this->redirect(array('action' => 'index')); <?php else: ?> - $this->flash(__('The <?php echo strtolower($singularHumanName); ?> has been saved.', true), array('action' => 'index')); + $this->flash(sprintf(__('The %s has been saved.', true), '<?php echo strtolower($singularHumanName); ?>'), array('action' => 'index')); <?php endif; ?> } else { <?php if ($wannaUseSession): ?> - $this->Session->setFlash(__('The <?php echo strtolower($singularHumanName); ?> could not be saved. Please, try again.', true)); + $this->Session->setFlash(sprintf(__('The %s could not be saved. Please, try again.', true), '<?php echo strtolower($singularHumanName); ?>')); <?php endif; ?> } } @@ -117,24 +117,24 @@ function <?php echo $admin; ?>delete($id = null) { if (!$id) { <?php if ($wannaUseSession): ?> - $this->Session->setFlash(__('Invalid id for <?php echo strtolower($singularHumanName); ?>', true)); + $this->Session->setFlash(sprintf(__('Invalid id for %s', true), '<?php echo strtolower($singularHumanName); ?>')); $this->redirect(array('action'=>'index')); <?php else: ?> - $this->flash(__('Invalid <?php echo strtolower($singularHumanName); ?>', true), array('action' => 'index')); + $this->flash(sprintf(__('Invalid %s', true), '<?php echo strtolower($singularHumanName); ?>'), array('action' => 'index')); <?php endif; ?> } if ($this-><?php echo $currentModelName; ?>->delete($id)) { <?php if ($wannaUseSession): ?> - $this->Session->setFlash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> deleted', true)); + $this->Session->setFlash(sprintf(__('%s deleted', true), '<?php echo ucfirst(strtolower($singularHumanName)); ?>')); $this->redirect(array('action'=>'index')); <?php else: ?> - $this->flash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> deleted', true), array('action' => 'index')); + $this->flash(sprintf(__('%s deleted', true), '<?php echo ucfirst(strtolower($singularHumanName)); ?>'), array('action' => 'index')); <?php endif; ?> } <?php if ($wannaUseSession): ?> - $this->Session->setFlash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> was not deleted', true)); + $this->Session->setFlash(sprintf(__('%s was not deleted', true), '<?php echo ucfirst(strtolower($singularHumanName)); ?>')); <?php else: ?> - $this->flash(__('<?php echo ucfirst(strtolower($singularHumanName)); ?> was not deleted', true), array('action' => 'index')); + $this->flash(sprintf(__('%s was not deleted', true), '<?php echo ucfirst(strtolower($singularHumanName)); ?>'), array('action' => 'index')); <?php endif; ?> $this->redirect(array('action' => 'index')); } \ No newline at end of file From 06ba7ac828afec12efc2972737768b6ce136861d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 18 Jan 2010 10:05:23 -0500 Subject: [PATCH 1534/2083] Adding omitted default route, and test cases to test its functionality. Fixes #212 --- cake/libs/router.php | 2 ++ cake/tests/cases/libs/router.test.php | 28 ++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index 9003bda8c..3478cd684 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -278,6 +278,7 @@ function connect($route, $defaults = array(), $options = array()) { $routeClass = $options['routeClass']; unset($options['routeClass']); } + //TODO 2.0 refactor this to use a string class name, throw exception, and then construct. $Route =& new $routeClass($route, $defaults, $options); if ($routeClass !== 'CakeRoute' && !is_subclass_of($Route, 'CakeRoute')) { trigger_error(__('Route classes must extend CakeRoute', true), E_USER_WARNING); @@ -539,6 +540,7 @@ function __connectDefaultRoutes() { $this->connect("/{$prefix}/:plugin/:controller", $indexParams, $match); $this->connect("/{$prefix}/:plugin/:controller/:action/*", $params, $match); } + $this->connect('/:plugin/:controller', array('action' => 'index'), $match); $this->connect('/:plugin/:controller/:action/*', array(), $match); } diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 552d5d05b..ce68c6f4f 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -1849,7 +1849,7 @@ function testStripPlugin() { * @return void * @access public */ - function testCurentRoute() { + function testCurrentRoute() { $url = array('controller' => 'pages', 'action' => 'display', 'government'); Router::connect('/government', $url); Router::parse('/government'); @@ -1924,6 +1924,32 @@ function testDefaultsMethod() { $this->assertFalse(isset($result['action'])); } +/** + * test that the required default routes are connected. + * + * @return void + */ + function testConnectDefaultRoutes() { + App::build(array( + 'plugins' => array( + TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS + ) + ), true); + App::objects('plugin', null, false); + + $plugins = App::objects('plugin'); + $plugin = Inflector::underscore($plugins[0]); + $result = Router::url(array('plugin' => $plugin, 'controller' => 'js_file', 'action' => 'index')); + $this->assertEqual($result, '/plugin_js/js_file'); + + $result = Router::parse('/plugin_js/js_file'); + $expected = array( + 'plugin' => 'plugin_js', 'controller' => 'js_file', 'action' => 'index', + 'named' => array(), 'pass' => array() + ); + $this->assertEqual($result, $expected); + } + /** * test using a custom route class for route connection * From cb4a1f07e5e0c2e7feb90e18b6faa2130f84d3ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Mon, 18 Jan 2010 13:05:30 -0430 Subject: [PATCH 1535/2083] Fixing issue with persistModels and plugin models, closes #192 and #198 --- cake/libs/model/model.php | 3 ++ cake/libs/object.php | 2 +- cake/tests/cases/libs/object.test.php | 15 +++++++-- cake/tests/test_app/models/persister_one.php | 4 +-- cake/tests/test_app/models/persister_two.php | 4 +-- .../models/test_plugin_authors.php | 31 +++++++++++++++++++ .../models/test_plugin_comment.php | 31 +++++++++++++++++++ 7 files changed, 83 insertions(+), 7 deletions(-) create mode 100644 cake/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php create mode 100644 cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 01b05c186..78be07d47 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -667,6 +667,9 @@ function __constructLinkedModel($assoc, $className = null) { } else { $this->{$assoc} =& ClassRegistry::init($model); } + if (strpos($className, '.') !== false) { + ClassRegistry::addObject($className, $this->{$assoc}); + } if ($assoc) { $this->tableToModel[$this->{$assoc}->table] = $assoc; } diff --git a/cake/libs/object.php b/cake/libs/object.php index 7a8ddfd33..eda5d7f63 100644 --- a/cake/libs/object.php +++ b/cake/libs/object.php @@ -275,7 +275,7 @@ function __openPersistent($name, $type = null) { if (strpos($key, '_behavior') !== false) { App::import('Behavior', Inflector::classify(substr($key, 0, -9))); } else { - App::import('Model', Inflector::classify($key)); + App::import('Model', Inflector::camelize($key)); } unset ($value); } diff --git a/cake/tests/cases/libs/object.test.php b/cake/tests/cases/libs/object.test.php index de63a517d..c5894c7cb 100644 --- a/cake/tests/cases/libs/object.test.php +++ b/cake/tests/cases/libs/object.test.php @@ -431,6 +431,7 @@ function testPersistWithBehavior() { $this->assertFalse(class_exists('PersisterOneBehaviorBehavior')); $this->assertFalse(class_exists('PersisterTwoBehaviorBehavior')); $this->assertFalse(class_exists('TestPluginPersisterBehavior')); + $this->assertFalse(class_exists('TestPluginAuthors')); $Controller = new RequestActionPersistentController(); $Controller->persistModel = true; @@ -439,13 +440,18 @@ function testPersistWithBehavior() { $this->assertTrue(file_exists(CACHE . 'persistent' . DS . 'persisterone.php')); $this->assertTrue(file_exists(CACHE . 'persistent' . DS . 'persisteroneregistry.php')); - $contents = str_replace('"PersisterOne"', '"PersisterTwo"', file_get_contents(CACHE . 'persistent' . DS . 'persisteroneregistry.php')); - $contents = str_replace('persister_one_', 'persister_two_', file_get_contents(CACHE . 'persistent' . DS . 'persisteroneregistry.php')); + $contents = file_get_contents(CACHE . 'persistent' . DS . 'persisteroneregistry.php'); + $contents = str_replace('"PersisterOne"', '"PersisterTwo"', $contents); + $contents = str_replace('persister_one', 'persister_two', $contents); + $contents = str_replace('test_plugin_comment', 'test_plugin_authors', $contents); $result = file_put_contents(CACHE . 'persistent' . DS . 'persisteroneregistry.php', $contents); $this->assertTrue(class_exists('PersisterOneBehaviorBehavior')); + $this->assertTrue(class_exists('TestPluginPersisterOneBehavior')); + $this->assertTrue(class_exists('TestPluginComment')); $this->assertFalse(class_exists('PersisterTwoBehaviorBehavior')); $this->assertFalse(class_exists('TestPluginPersisterTwoBehavior')); + $this->assertFalse(class_exists('TestPluginAuthors')); $Controller = new RequestActionPersistentController(); $Controller->persistModel = true; @@ -454,6 +460,7 @@ function testPersistWithBehavior() { $this->assertTrue(class_exists('PersisterOneBehaviorBehavior')); $this->assertTrue(class_exists('PersisterTwoBehaviorBehavior')); $this->assertTrue(class_exists('TestPluginPersisterTwoBehavior')); + $this->assertTrue(class_exists('TestPluginAuthors')); @unlink(CACHE . 'persistent' . DS . 'persisterone.php'); @unlink(CACHE . 'persistent' . DS . 'persisteroneregistry.php'); @@ -490,6 +497,8 @@ function testPersistWithBehaviorAndRequestAction() { $this->assertEqual($keys, array( 'persister_one', 'comment', + 'test_plugin_comment', + 'test_plugin.test_plugin_comment', 'persister_one_behavior_behavior', 'test_plugin_persister_one_behavior', 'test_plugin.test_plugin_persister_one_behavior' @@ -504,6 +513,8 @@ function testPersistWithBehaviorAndRequestAction() { $this->assertEqual($keys, array( 'persister_one', 'comment', + 'test_plugin_comment', + 'test_plugin.test_plugin_comment', 'persister_one_behavior_behavior', 'test_plugin_persister_one_behavior', 'test_plugin.test_plugin_persister_one_behavior', diff --git a/cake/tests/test_app/models/persister_one.php b/cake/tests/test_app/models/persister_one.php index 6f0fbf48d..8df8a4eac 100644 --- a/cake/tests/test_app/models/persister_one.php +++ b/cake/tests/test_app/models/persister_one.php @@ -28,8 +28,8 @@ class PersisterOne extends AppModel { var $useTable = 'posts'; var $name = 'PersisterOne'; - var $actsAs = array('PersisterOneBehavior','TestPlugin.TestPluginPersisterOne'); + var $actsAs = array('PersisterOneBehavior', 'TestPlugin.TestPluginPersisterOne'); - var $hasMany = array('Comment'); + var $hasMany = array('Comment', 'TestPlugin.TestPluginComment'); } ?> \ No newline at end of file diff --git a/cake/tests/test_app/models/persister_two.php b/cake/tests/test_app/models/persister_two.php index 0fb3ceb65..417cc146b 100644 --- a/cake/tests/test_app/models/persister_two.php +++ b/cake/tests/test_app/models/persister_two.php @@ -28,8 +28,8 @@ class PersisterTwo extends AppModel { var $useTable = 'posts'; var $name = 'PersisterTwo'; - var $actsAs = array('PersisterOneBehavior','TestPlugin.TestPluginPersisterOne'); + var $actsAs = array('PersisterOneBehavior', 'TestPlugin.TestPluginPersisterOne'); - var $hasMany = array('Comment'); + var $hasMany = array('Comment', 'TestPlugin.TestPluginComment'); } ?> \ No newline at end of file diff --git a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php new file mode 100644 index 000000000..56b963539 --- /dev/null +++ b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php @@ -0,0 +1,31 @@ +<?php +/* SVN FILE: $Id$ */ +/** + * Test App Comment Model + * + * + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2006-2008, Cake Software Foundation, Inc. + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @package cake + * @subpackage cake.cake.libs. + * @since CakePHP v 1.2.0.7726 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +class TestPluginAuthors extends TestPluginAppModel { + var $useTable = 'authors'; + var $name = 'TestPluginAuthors'; +} +?> \ No newline at end of file diff --git a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php new file mode 100644 index 000000000..90e6e9293 --- /dev/null +++ b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php @@ -0,0 +1,31 @@ +<?php +/* SVN FILE: $Id$ */ +/** + * Test App Comment Model + * + * + * + * PHP versions 4 and 5 + * + * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2006-2008, Cake Software Foundation, Inc. + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @package cake + * @subpackage cake.cake.libs. + * @since CakePHP v 1.2.0.7726 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +class TestPluginComment extends TestPluginAppModel { + var $useTable = 'comments'; + var $name = 'TestPluginComment'; +} +?> \ No newline at end of file From 7943f3d1685c787a60a2c478125aa700e3e9ad24 Mon Sep 17 00:00:00 2001 From: AD7six <andydawson76@yahoo.co.uk> Date: Sat, 16 Jan 2010 13:32:04 +0100 Subject: [PATCH 1536/2083] allowing vritual fields to work whether specified with a model alias or not. by concequence allows find('list', array('fields' => array('id', 'virtual'))) to work --- cake/libs/model/datasources/dbo_source.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 047ac879b..bebcb2aee 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -106,7 +106,7 @@ class DboSource extends DataSource { /** * Constructor - * + * * @param array $config Array of configuration information for the Datasource. * @param boolean $autoConnect Whether or not the datasource should automatically connect. * @access public @@ -668,7 +668,7 @@ function fullTableName($model, $quote = true) { * Creates new records in the database. * * @param Model $model Model object that the record is for. - * @param array $fields An array of field names to insert. If null, $model->data will be + * @param array $fields An array of field names to insert. If null, $model->data will be * used to generate field names. * @param array $values An array of values with keys matching the fields. If null, $model->data will * be used to generate values. @@ -853,7 +853,7 @@ function __filterResults(&$results, &$model, $filtered = array()) { * Queries associations. Used to fetch results on recursive models. * * @param Model $model Primary Model object - * @param Model $linkModel Linked model that + * @param Model $linkModel Linked model that * @param string $type Association type, one of the model association types ie. hasMany * @param unknown_type $association * @param unknown_type $assocData @@ -1840,7 +1840,7 @@ function __scrubQueryData($data) { * @param mixed $fields virtual fields to be used on query * @return array */ - function _constructVirtualFields(&$model,$alias,$fields) { + function _constructVirtualFields(&$model, $alias, $fields) { $virtual = array(); foreach ($fields as $field) { $virtualField = $this->name("{$alias}__{$field}"); @@ -1876,10 +1876,20 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) { return $fields; } $virtual = array(); - if ($model->getVirtualField()) { - $keys = array_keys($model->getVirtualField()); + $virtualFields = $model->getVirtualField(); + if ($virtualFields) { + $keys = array_keys($virtualFields); + foreach($keys as $field) { + $keys[] = $model->alias . '.' . $field; + } $virtual = ($allFields) ? $keys : array_intersect($keys, $fields); } + foreach($virtual as &$field) { + if (strpos($field, '.')) { + $field = str_replace($model->alias . '.', '', $field); + $fields = array_diff($fields, array($model->alias . '.' . $field)); + } + } $count = count($fields); if ($count >= 1 && !in_array($fields[0], array('*', 'COUNT(*)'))) { From 080e34718d82ce64d16440e24ba0e922af76333d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 18 Jan 2010 21:57:03 -0500 Subject: [PATCH 1537/2083] Minor refactor, and adding tests from previous commit. Fixes #208 --- cake/libs/model/datasources/dbo_source.php | 2 +- .../libs/model/datasources/dbo_source.test.php | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index bebcb2aee..4a900ab11 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -1882,7 +1882,7 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) { foreach($keys as $field) { $keys[] = $model->alias . '.' . $field; } - $virtual = ($allFields) ? $keys : array_intersect($keys, $fields); + $virtual = ($allFields) ? $keys : array_intersect($keys, $fields); } foreach($virtual as &$field) { if (strpos($field, '.')) { diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index f0d4f4b49..868e36812 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -4098,6 +4098,9 @@ function testShowQuery() { $this->assertNoPattern('/Num:/s', $contents); $this->assertNoPattern('/Took:/s', $contents); } + function getTests() { + return array('start', 'startCase', 'testVirtualFields', 'endCase', 'end'); + } /** * test fields generating usable virtual fields to use in query @@ -4127,14 +4130,21 @@ function testVirtualFields() { '(1 + 1) AS `Article__two`', '(SELECT COUNT(*) FROM comments WHERE `Article`.`id` = `comments`.`article_id`) AS `Article__comment_count`' ); - $this->assertEqual($expected,$result); + $this->assertEqual($expected, $result); - $result = $this->db->fields($Article, null, array('this_moment','title')); + $result = $this->db->fields($Article, null, array('this_moment', 'title')); $expected = array( '`Article`.`title`', '(NOW()) AS `Article__this_moment`', ); - $this->assertEqual($expected,$result); + $this->assertEqual($expected, $result); + + $result = $this->db->fields($Article, null, array('Article.title', 'Article.this_moment')); + $expected = array( + '`Article`.`title`', + '(NOW()) AS `Article__this_moment`', + ); + $this->assertEqual($expected, $result); } /** From 9f8e0e163ed648924ffc11adcd88bb57c8a23d6d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 18 Jan 2010 21:59:18 -0500 Subject: [PATCH 1538/2083] Removing getTests included by accident. --- cake/tests/cases/libs/model/datasources/dbo_source.test.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index 868e36812..9a7c79baa 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -4098,9 +4098,6 @@ function testShowQuery() { $this->assertNoPattern('/Num:/s', $contents); $this->assertNoPattern('/Took:/s', $contents); } - function getTests() { - return array('start', 'startCase', 'testVirtualFields', 'endCase', 'end'); - } /** * test fields generating usable virtual fields to use in query From 49ad582759a764d6b9bb424280a5476022cc1bff Mon Sep 17 00:00:00 2001 From: tPl0ch <t.ploch@reizwerk.com> Date: Tue, 19 Jan 2010 09:06:00 +0100 Subject: [PATCH 1539/2083] Fixes #222 . Fixed ShellDispatcher constructors to not issue warnings on PHP5.3 with E_STRICT Signed-off-by: Mark Story <mark@mark-story.com> --- cake/console/cake.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/cake/console/cake.php b/cake/console/cake.php index 7ec5c19be..01f32bafe 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -119,15 +119,6 @@ class ShellDispatcher { */ var $shellName = null; -/** - * Constructs this ShellDispatcher instance. - * - * @param array $args the argv. - */ - function ShellDispatcher($args = array()) { - $this->__construct($args); - } - /** * Constructor * @@ -138,7 +129,7 @@ function ShellDispatcher($args = array()) { * @return void * @access public */ - function __construct($args = array()) { + function ShellDispatcher($args = array()) { set_time_limit(0); $this->__initConstants(); From e1b0c41254addfae5471e57a0579a2064965e7a1 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 19 Jan 2010 09:22:13 -0500 Subject: [PATCH 1540/2083] Making Model::isVirtualField() and Model::getVirtualField() work with both `Model.field` as `field`. This fixes a number of issues in conditions, and fields arrays when model aliases are used. Fixes #208 and #220 --- cake/libs/model/datasources/dbo_source.php | 2 +- cake/libs/model/model.php | 18 +++++++++- .../cases/libs/model/model_read.test.php | 35 +++++++++++++++++-- 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 4a900ab11..c0d86f10f 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -2120,7 +2120,7 @@ function conditionKeysToString($conditions, $quoteValues = true, $model = null) * @return string * @access private */ - function __parseKey($model, $key, $value) { + function __parseKey(&$model, $key, $value) { $operatorMatch = '/^((' . implode(')|(', $this->__sqlOps); $operatorMatch .= '\\x20)|<[>=]?(?![^>]+>)\\x20?|[>=!]{1,3}(?!<)\\x20?)/is'; $bound = (strpos($key, '?') !== false || (is_array($value) && strpos($key, ':') !== false)); diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 32b3d5003..6a04a8396 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1077,7 +1077,19 @@ function hasField($name, $checkVirtual = false) { * @access public */ function isVirtualField($field) { - return !empty($this->virtualFields) && is_string($field) && array_key_exists($field, $this->virtualFields); + if (empty($this->virtualFields) || !is_string($field)) { + return false; + } + if (isset($this->virtualFields[$field])) { + return true; + } + if (strpos($field, '.') !== false) { + list($model, $field) = explode('.', $field); + if (isset($this->virtualFields[$field])) { + return true; + } + } + return false; } /** @@ -1094,6 +1106,9 @@ function getVirtualField($field = null) { return empty($this->virtualFields) ? false : $this->virtualFields; } if ($this->isVirtualField($field)) { + if (strpos($field, '.') !== false) { + list($model, $field) = explode('.', $field); + } return $this->virtualFields[$field]; } return false; @@ -2126,6 +2141,7 @@ function find($conditions = null, $fields = array(), $order = null, $recursive = if (!$db =& ConnectionManager::getDataSource($this->useDbConfig)) { return false; } + $results = $db->read($this, $query); $this->resetAssociations(); diff --git a/cake/tests/cases/libs/model/model_read.test.php b/cake/tests/cases/libs/model/model_read.test.php index 1ed9fd9e1..a0cd6d9b6 100755 --- a/cake/tests/cases/libs/model/model_read.test.php +++ b/cake/tests/cases/libs/model/model_read.test.php @@ -7172,7 +7172,7 @@ function testFindQueryTypeInCallbacks() { * @return void */ function testVirtualFields() { - $this->loadFixtures('Post','Author'); + $this->loadFixtures('Post', 'Author'); $Post =& ClassRegistry::init('Post'); $Post->virtualFields = array('two' => "1 + 1"); $result = $Post->find('first'); @@ -7235,7 +7235,7 @@ function testVirtualFields() { $Writing->virtualFields = array('two' => "1 + 1"); $result = $Writing->find('first'); $this->assertEqual($result['Writing']['two'], 2); - + $Post->create(); $Post->virtualFields = array('other_field' => 'COUNT(Post.id) + 1'); $result = $Post->field('other_field'); @@ -7264,5 +7264,36 @@ function testVirtualFields() { $this->assertEqual($result, $expectation); } + +/** + * test that isVirtualField will accept both aliased and non aliased fieldnames + * + * @return void + */ + function testIsVirtualField() { + $this->loadFixtures('Post'); + $Post =& ClassRegistry::init('Post'); + $Post->virtualFields = array('other_field' => 'COUNT(Post.id) + 1'); + + $this->assertTrue($Post->isVirtualField('other_field')); + $this->assertTrue($Post->isVirtualField('Post.other_field')); + $this->assertFalse($Post->isVirtualField('id')); + $this->assertFalse($Post->isVirtualField('Post.id')); + $this->assertFalse($Post->isVirtualField(array())); + } + +/** + * test that getting virtual fields works with and without model alias attached + * + * @return void + */ + function testGetVirtualField() { + $this->loadFixtures('Post'); + $Post =& ClassRegistry::init('Post'); + $Post->virtualFields = array('other_field' => 'COUNT(Post.id) + 1'); + + $this->assertEqual($Post->getVirtualField('other_field'), $Post->virtualFields['other_field']); + $this->assertEqual($Post->getVirtualField('Post.other_field'), $Post->virtualFields['other_field']); + } } ?> \ No newline at end of file From 39dd15d3f6dd9ee66b21da7a76ec1a12f72e2ebb Mon Sep 17 00:00:00 2001 From: "renan.saddam" <renan.saddam@gmail.com> Date: Tue, 19 Jan 2010 14:05:29 -0200 Subject: [PATCH 1541/2083] =?UTF-8?q?Removing=20the=20=B4with=B4=20key=20f?= =?UTF-8?q?rom=20otherFields=20array,=20also=20fixing=20the=20page=20title?= =?UTF-8?q?.=20Tests=20added.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cake/libs/controller/scaffold.php | 17 ++++++++++------- cake/libs/view/scaffolds/view.ctp | 6 +++++- .../cases/libs/controller/scaffold.test.php | 12 +++++++----- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/cake/libs/controller/scaffold.php b/cake/libs/controller/scaffold.php index 234ea3053..1ba3c3f0f 100644 --- a/cake/libs/controller/scaffold.php +++ b/cake/libs/controller/scaffold.php @@ -163,7 +163,7 @@ function __construct(&$controller, $params) { $this->{$var} = $controller->{$var}; } - $this->redirect = array('action'=> 'index'); + $this->redirect = array('action' => 'index'); $this->modelClass = $controller->modelClass; $this->modelKey = $controller->modelKey; @@ -177,8 +177,7 @@ function __construct(&$controller, $params) { $this->ScaffoldModel =& $this->controller->{$this->modelClass}; $this->scaffoldTitle = Inflector::humanize($this->viewPath); $this->scaffoldActions = $controller->scaffold; - $this->controller->pageTitle = __('Scaffold :: ', true) - . Inflector::humanize($this->action) . ' :: ' . $this->scaffoldTitle; + $title_for_layout = __('Scaffold :: ', true) . Inflector::humanize($this->action) . ' :: ' . $this->scaffoldTitle; $modelClass = $this->controller->modelClass; $primaryKey = $this->ScaffoldModel->primaryKey; $displayField = $this->ScaffoldModel->displayField; @@ -190,7 +189,7 @@ function __construct(&$controller, $params) { $associations = $this->__associations(); $this->controller->set(compact( - 'modelClass', 'primaryKey', 'displayField', 'singularVar', 'pluralVar', + 'title_for_layout', 'modelClass', 'primaryKey', 'displayField', 'singularVar', 'pluralVar', 'singularHumanName', 'pluralHumanName', 'scaffoldFields', 'associations' )); @@ -223,7 +222,7 @@ function _output() { */ function __scaffoldView($params) { if ($this->controller->_beforeScaffold('view')) { - + $message = sprintf(__("No id set for %s::view()", true), Inflector::humanize($this->modelKey)); if (isset($params['pass'][0])) { $this->ScaffoldModel->id = $params['pass'][0]; @@ -444,7 +443,7 @@ function __scaffold($params) { $db = &ConnectionManager::getDataSource($this->ScaffoldModel->useDbConfig); $prefixes = Configure::read('Routing.prefixes'); $scaffoldPrefix = $this->scaffoldActions; - + if (isset($db)) { if (empty($this->scaffoldActions)) { $this->scaffoldActions = array( @@ -452,7 +451,7 @@ function __scaffold($params) { ); } elseif (!empty($prefixes) && in_array($scaffoldPrefix, $prefixes)) { $this->scaffoldActions = array( - $scaffoldPrefix . '_index', + $scaffoldPrefix . '_index', $scaffoldPrefix . '_list', $scaffoldPrefix . '_view', $scaffoldPrefix . '_add', @@ -525,6 +524,10 @@ function __associations() { $associations[$type][$assocKey]['controller'] = Inflector::pluralize(Inflector::underscore($assocData['className'])); + + if ($type == 'hasAndBelongsToMany') { + $associations[$type][$assocKey]['with'] = $assocData['with']; + } } } return $associations; diff --git a/cake/libs/view/scaffolds/view.ctp b/cake/libs/view/scaffolds/view.ctp index 4bc9d293c..8ae15473a 100644 --- a/cake/libs/view/scaffolds/view.ctp +++ b/cake/libs/view/scaffolds/view.ctp @@ -117,6 +117,10 @@ $otherSingularVar = Inflector::variable($_alias); <tr> <?php $otherFields = array_keys(${$singularVar}[$_alias][0]); + if (isset($_details['with'])) { + $index = array_search($_details['with'], $otherFields); + unset($otherFields[$index]); + } foreach ($otherFields as $_field) { echo "\t\t<th>" . Inflector::humanize($_field) . "</th>\n"; } @@ -130,7 +134,7 @@ $otherSingularVar = Inflector::variable($_alias); if ($i++ % 2 == 0) { $class = ' class="altrow"'; } - echo "\t\t<tr{$class}>\n"; + echo "\t\t<tr{$class}>\n"; foreach ($otherFields as $_field) { echo "\t\t\t<td>" . ${$otherSingularVar}[$_field] . "</td>\n"; diff --git a/cake/tests/cases/libs/controller/scaffold.test.php b/cake/tests/cases/libs/controller/scaffold.test.php index af4d3d0ff..13b344d36 100644 --- a/cake/tests/cases/libs/controller/scaffold.test.php +++ b/cake/tests/cases/libs/controller/scaffold.test.php @@ -155,9 +155,9 @@ class ScaffoldMock extends CakeTestModel { var $hasAndBelongsToMany = array( 'ScaffoldTag' => array( 'className' => 'ScaffoldTag', - 'foreignKey' => 'post_id', - 'associationForeignKey' => 'tag_id', - 'joinTable' => 'posts_tags' + 'foreignKey' => 'something_id', + 'associationForeignKey' => 'something_else_id', + 'joinTable' => 'join_things' ) ); } @@ -271,7 +271,7 @@ class ScaffoldViewTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.article', 'core.user', 'core.comment', 'core.posts_tag', 'core.tag'); + var $fixtures = array('core.article', 'core.user', 'core.comment', 'core.join_thing', 'core.tag'); /** * startTest method @@ -459,6 +459,7 @@ function testViewScaffold() { //check related table $this->assertPattern('/<div class="related">\s*<h3>Related Scaffold Comments<\/h3>\s*<table cellpadding="0" cellspacing="0">/', $result); $this->assertPattern('/<li><a href="\/scaffold_comments\/add">New Comment<\/a><\/li>/', $result); + $this->assertNoPattern('/<th>JoinThing<\/th>/', $result); } /** @@ -659,7 +660,7 @@ class ScaffoldTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.article', 'core.user', 'core.comment', 'core.posts_tag', 'core.tag'); + var $fixtures = array('core.article', 'core.user', 'core.comment', 'core.join_thing', 'core.tag'); /** * startTest method * @@ -741,6 +742,7 @@ function testScaffoldVariableSetting() { $Scaffold =& new TestScaffoldMock($this->Controller, $params); $result = $Scaffold->controller->viewVars; + $this->assertEqual($result['title_for_layout'], 'Scaffold :: Admin Edit :: Scaffold Mock'); $this->assertEqual($result['singularHumanName'], 'Scaffold Mock'); $this->assertEqual($result['pluralHumanName'], 'Scaffold Mock'); $this->assertEqual($result['modelClass'], 'ScaffoldMock'); From 22073e33760fdf628d5a742ce7e71cd3b670053d Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Wed, 20 Jan 2010 01:23:20 +0530 Subject: [PATCH 1542/2083] Renaming Configure var 'Security.cipher_seed' to 'Security.cipherSeed'. Also added a srand() call at end of Security::cipher function to reset seed. Closes #73 , #183 , #218 --- app/config/core.php | 2 +- cake/console/templates/skel/config/core.php | 2 +- cake/libs/debugger.php | 4 ++-- cake/libs/security.php | 4 +++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/config/core.php b/app/config/core.php index c127be2d1..a4dea4cdd 100644 --- a/app/config/core.php +++ b/app/config/core.php @@ -200,7 +200,7 @@ /** * A random numeric string (digits only) used to encrypt/decrypt strings. */ - Configure::write('Security.cipher_seed', '76859309657453542496749683645'); + Configure::write('Security.cipherSeed', '76859309657453542496749683645'); /** * Apply timestamps with the last modified time to static assets (js, css, images). diff --git a/cake/console/templates/skel/config/core.php b/cake/console/templates/skel/config/core.php index 15ec7aec3..38c82319c 100644 --- a/cake/console/templates/skel/config/core.php +++ b/cake/console/templates/skel/config/core.php @@ -209,7 +209,7 @@ /** * A random numeric string (digits only) used to encrypt/decrypt strings. */ - Configure::write('Security.cipher_seed', '76859309657453542496749683645'); + Configure::write('Security.cipherSeed', '76859309657453542496749683645'); /** * Compress CSS output by removing comments, whitespace, repeating tags, etc. diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index ff01586cc..e0cefc703 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -674,8 +674,8 @@ function checkSecurityKeys() { trigger_error(__('Please change the value of \'Security.salt\' in app/config/core.php to a salt value specific to your application', true), E_USER_NOTICE); } - if (Configure::read('Security.cipher_seed') == '76859309657453542496749683645') { - trigger_error(__('Please change the value of \'Security.cipher_seed\' in app/config/core.php to a numeric (digits only) seed value specific to your application', true), E_USER_NOTICE); + if (Configure::read('Security.cipherSeed') == '76859309657453542496749683645') { + trigger_error(__('Please change the value of \'Security.cipherSeed\' in app/config/core.php to a numeric (digits only) seed value specific to your application', true), E_USER_NOTICE); } } diff --git a/cake/libs/security.php b/cake/libs/security.php index 5bfc387bf..e9d5c7f94 100644 --- a/cake/libs/security.php +++ b/cake/libs/security.php @@ -174,7 +174,7 @@ function cipher($text, $key) { return ''; } - srand(Configure::read('Security.cipher_seed')); + srand(Configure::read('Security.cipherSeed')); $out = ''; for ($i = 0; $i < strlen($text); $i++) { @@ -184,6 +184,8 @@ function cipher($text, $key) { $mask = rand(0, 255); $out .= chr(ord(substr($text, $i, 1)) ^ $mask); } + + srand(); return $out; } } From 96fd0bf10020945b93e4e6e4d60051c5af6c3135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Tue, 19 Jan 2010 16:44:43 -0430 Subject: [PATCH 1543/2083] Fixing error introduced in previous commit due to bad merge --- cake/libs/model/behavior.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/model/behavior.php b/cake/libs/model/behavior.php index 368f2a18e..61d319485 100644 --- a/cake/libs/model/behavior.php +++ b/cake/libs/model/behavior.php @@ -287,7 +287,7 @@ function attach($behavior, $config = array()) { } ClassRegistry::addObject($class, $this->{$name}); if (!empty($plugin)) { - ClassRegistry::addObject($plugin.'.'.$class, $clas); + ClassRegistry::addObject($plugin.'.'.$class, $this->{$name}); } } } elseif (isset($this->{$name}->settings) && isset($this->{$name}->settings[$this->modelName])) { From 6882d96bf8f8b6f602c5c02842eba286f376ad62 Mon Sep 17 00:00:00 2001 From: Juan Basso <jrbasso@gmail.com> Date: Tue, 19 Jan 2010 09:31:27 -0200 Subject: [PATCH 1544/2083] Caching charset in h(). It's save round 50% over each call by helpers. --- cake/basics.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cake/basics.php b/cake/basics.php index 7a48b628b..b20854da6 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -204,13 +204,19 @@ function h($text, $charset = null) { if (is_array($text)) { return array_map('h', $text); } - if (empty($charset)) { - $charset = Configure::read('App.encoding'); + + static $defaultCharset = false; + if ($defaultCharset === false) { + $defaultCharset = Configure::read('App.encoding'); + if ($defaultCharset === null) { + $defaultCharset = 'UTF-8'; + } } - if (empty($charset)) { - $charset = 'UTF-8'; + if ($charset) { + return htmlspecialchars($text, ENT_QUOTES, $charset); + } else { + return htmlspecialchars($text, ENT_QUOTES, $defaultCharset); } - return htmlspecialchars($text, ENT_QUOTES, $charset); } /** From d2d19eeda4ca8eabdf220b7b0f90d58c18797fee Mon Sep 17 00:00:00 2001 From: Juan Basso <jrbasso@gmail.com> Date: Tue, 19 Jan 2010 09:32:00 -0200 Subject: [PATCH 1545/2083] Fixing import in CakeSession. --- cake/libs/cake_session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index 7780749da..aac877fa4 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -122,7 +122,7 @@ class CakeSession extends Object { * @access public */ function __construct($base = null, $start = true) { - App::import('Core', 'Set', 'Security'); + App::import('Core', array('Set', 'Security')); $this->time = time(); if (Configure::read('Session.checkAgent') === true || Configure::read('Session.checkAgent') === null) { From 8d5acf07067a363adfc45134acfb5a9792c5aa33 Mon Sep 17 00:00:00 2001 From: Juan Basso <jrbasso@gmail.com> Date: Tue, 19 Jan 2010 09:39:08 -0200 Subject: [PATCH 1546/2083] Infector::_cache is a protected method and no need be singleton. --- cake/libs/inflector.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index 4d18c2eff..8c0d5900e 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -253,19 +253,17 @@ function &getInstance() { * @access protected */ function _cache($type, $key, $value = false) { - $_this =& Inflector::getInstance(); - $key = '_' . $key; $type = '_' . $type; if ($value !== false) { - $_this->{$type}[$key] = $value; + $this->{$type}[$key] = $value; return $value; } - if (!isset($_this->{$type}[$key])) { + if (!isset($this->{$type}[$key])) { return false; } - return $_this->{$type}[$key]; + return $this->{$type}[$key]; } /** @@ -328,8 +326,8 @@ function pluralize($word) { } if (!isset($_this->_plural['cacheUninflected']) || !isset($_this->_plural['cacheIrregular'])) { - $_this->_plural['cacheUninflected'] = '(?:' . join( '|', $_this->_plural['merged']['uninflected']) . ')'; - $_this->_plural['cacheIrregular'] = '(?:' . join( '|', array_keys($_this->_plural['merged']['irregular'])) . ')'; + $_this->_plural['cacheUninflected'] = '(?:' . implode('|', $_this->_plural['merged']['uninflected']) . ')'; + $_this->_plural['cacheIrregular'] = '(?:' . implode('|', array_keys($_this->_plural['merged']['irregular'])) . ')'; } if (preg_match('/(.*)\\b(' . $_this->_plural['cacheIrregular'] . ')$/i', $word, $regs)) { From e32804358631a2e803b2754207617a54ce0b51cf Mon Sep 17 00:00:00 2001 From: Juan Basso <jrbasso@gmail.com> Date: Tue, 19 Jan 2010 09:40:06 -0200 Subject: [PATCH 1547/2083] Minor optimization in helper. No need cast, always is array. --- cake/libs/view/helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index 5ff3bb4d1..2e9cf4964 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -317,7 +317,7 @@ function _parseAttributes($options, $exclude = null, $insertBefore = ' ', $inser if (!is_array($exclude)) { $exclude = array(); } - $keys = array_diff(array_keys($options), array_merge((array)$exclude, array('escape'))); + $keys = array_diff(array_keys($options), array_merge($exclude, array('escape'))); $values = array_intersect_key(array_values($options), $keys); $escape = $options['escape']; $attributes = array(); From c4afeb3fe6965439047b5a9fb35699fabdb1a507 Mon Sep 17 00:00:00 2001 From: Juan Basso <jrbasso@gmail.com> Date: Tue, 19 Jan 2010 09:41:17 -0200 Subject: [PATCH 1548/2083] Minor optimization on datasource and Mysql[i]. --- cake/libs/model/datasources/datasource.php | 10 +++++----- cake/libs/model/datasources/dbo/dbo_mysql.php | 3 +-- cake/libs/model/datasources/dbo/dbo_mysqli.php | 8 +++----- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/cake/libs/model/datasources/datasource.php b/cake/libs/model/datasources/datasource.php index 99d3e8568..510b615e9 100644 --- a/cake/libs/model/datasources/datasource.php +++ b/cake/libs/model/datasources/datasource.php @@ -436,11 +436,11 @@ function enabled() { * @access public */ function isInterfaceSupported($interface) { - $methods = get_class_methods(get_class($this)); - $methods = strtolower(implode('|', $methods)); - $methods = explode('|', $methods); - $return = in_array(strtolower($interface), $methods); - return $return; + static $methods = false; + if ($methods === false) { + $methods = array_map('strtolower', get_class_methods($this)); + } + return in_array(strtolower($interface), $methods); } /** diff --git a/cake/libs/model/datasources/dbo/dbo_mysql.php b/cake/libs/model/datasources/dbo/dbo_mysql.php index 2d512da80..2fd07d961 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysql.php +++ b/cake/libs/model/datasources/dbo/dbo_mysql.php @@ -605,7 +605,7 @@ function listSources() { } else { $tables = array(); - while ($line = mysql_fetch_array($result)) { + while ($line = mysql_fetch_row($result)) { $tables[] = $line[0]; } parent::listSources($tables); @@ -727,7 +727,6 @@ function resultSet(&$results) { $j = 0; while ($j < $numFields) { - $column = mysql_fetch_field($results,$j); if (!empty($column->table)) { $this->map[$index++] = array($column->table, $column->name); diff --git a/cake/libs/model/datasources/dbo/dbo_mysqli.php b/cake/libs/model/datasources/dbo/dbo_mysqli.php index 1f4719176..d4d5ada38 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysqli.php +++ b/cake/libs/model/datasources/dbo/dbo_mysqli.php @@ -140,7 +140,7 @@ function _executeProcedure($sql) { */ function listSources() { $cache = parent::listSources(); - if ($cache != null) { + if ($cache !== null) { return $cache; } $result = $this->_execute('SHOW TABLES FROM ' . $this->name($this->config['database']) . ';'); @@ -151,7 +151,7 @@ function listSources() { $tables = array(); - while ($line = mysqli_fetch_array($result)) { + while ($line = mysqli_fetch_row($result)) { $tables[] = $line[0]; } parent::listSources($tables); @@ -290,14 +290,12 @@ function resultSet(&$results) { function fetchResult() { if ($row = mysqli_fetch_row($this->results)) { $resultRow = array(); - $i = 0; foreach ($row as $index => $field) { $table = $column = null; - if (count($this->map[$index]) == 2) { + if (count($this->map[$index]) === 2) { list($table, $column) = $this->map[$index]; } $resultRow[$table][$column] = $row[$index]; - $i++; } return $resultRow; } From 85b193048d402799952239cb9a5bed927c48cb02 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 20 Jan 2010 10:47:04 -0500 Subject: [PATCH 1549/2083] Fixing ConsoleShell's use of Router. Fixes #236 --- cake/console/libs/console.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/console/libs/console.php b/cake/console/libs/console.php index 954d973d3..eb49d27b3 100644 --- a/cake/console/libs/console.php +++ b/cake/console/libs/console.php @@ -353,8 +353,8 @@ function _loadRoutes() { foreach (array_keys($router->getNamedExpressions()) as $var) { unset(${$var}); } - for ($i = 0; $i < count($router->routes); $i++) { - $router->compile($i); + for ($i = 0, $len = count($router->routes); $i < $len; $i++) { + $router->routes[$i]->compile(); } return true; } From 6e22261786a4355adcaec1def633de0753f48274 Mon Sep 17 00:00:00 2001 From: Robust Solution <hussein_elharake@yahoo.com> Date: Wed, 20 Jan 2010 12:39:26 +0000 Subject: [PATCH 1550/2083] small optimization in time units --- cake/basics.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cake/basics.php b/cake/basics.php index b20854da6..7dcd4cd07 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -24,12 +24,12 @@ * Basic defines for timing functions. */ define('SECOND', 1); - define('MINUTE', 60 * SECOND); - define('HOUR', 60 * MINUTE); - define('DAY', 24 * HOUR); - define('WEEK', 7 * DAY); - define('MONTH', 30 * DAY); - define('YEAR', 365 * DAY); + define('MINUTE', 60); + define('HOUR', 3600); + define('DAY', 86400); + define('WEEK', 604800); + define('MONTH', 2592000); + define('YEAR', 31536000); /** * Patch for PHP < 5.0 From ae4a31f0700deed0af993c8d2b05a305195f1eab Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 20 Jan 2010 14:33:37 -0500 Subject: [PATCH 1551/2083] Making DEFAULT_LANGUAGE also set $language var which sets Config.language to a correct value. Fixes #228 --- cake/libs/l10n.php | 2 +- cake/tests/cases/libs/l10n.test.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cake/libs/l10n.php b/cake/libs/l10n.php index a0acb162d..85f978a7d 100644 --- a/cake/libs/l10n.php +++ b/cake/libs/l10n.php @@ -352,7 +352,7 @@ function __setLanguage($language = null) { } else if ($language !== null && isset($this->__l10nCatalog[$language])) { $langKey = $language; } else if (defined('DEFAULT_LANGUAGE')) { - $langKey = DEFAULT_LANGUAGE; + $langKey = $language = DEFAULT_LANGUAGE; } if ($langKey !== null && isset($this->__l10nCatalog[$langKey])) { diff --git a/cake/tests/cases/libs/l10n.test.php b/cake/tests/cases/libs/l10n.test.php index 5687571fe..1e99235ef 100644 --- a/cake/tests/cases/libs/l10n.test.php +++ b/cake/tests/cases/libs/l10n.test.php @@ -99,6 +99,11 @@ function testGet() { $expected = 'en_us'; $this->assertEqual($result, $expected); + $l10n->get('es'); + $l10n->get(''); + $this->assertEqual($l10n->lang, 'en-us'); + + // Using $this->default $l10n = new L10n(); $l10n->get('use_default'); From 317463096a4f22b624595568925c1c27aaecc95f Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 20 Jan 2010 14:53:57 -0500 Subject: [PATCH 1552/2083] Refactoring tests in l10n that use object properties. --- cake/tests/cases/libs/l10n.test.php | 106 +++++++--------------------- 1 file changed, 25 insertions(+), 81 deletions(-) diff --git a/cake/tests/cases/libs/l10n.test.php b/cake/tests/cases/libs/l10n.test.php index 1e99235ef..a11d1e031 100644 --- a/cake/tests/cases/libs/l10n.test.php +++ b/cake/tests/cases/libs/l10n.test.php @@ -43,61 +43,33 @@ function testGet() { // Catalog Entry $l10n->get('en'); - $result = $l10n->language; - $expected = 'English'; - $this->assertEqual($result, $expected); - $result = $l10n->languagePath; - $expected = array('eng', 'eng'); - $this->assertEqual($result, $expected); - - $result = $l10n->locale; - $expected = 'eng'; - $this->assertEqual($result, $expected); + $this->assertEqual($l10n->language, 'English'); + $this->assertEqual($l10n->languagePath, array('eng', 'eng')); + $this->assertEqual($l10n->locale, 'eng'); // Map Entry $l10n->get('eng'); - $result = $l10n->language; - $expected = 'English'; - $this->assertEqual($result, $expected); - $result = $l10n->languagePath; - $expected = array('eng', 'eng'); - $this->assertEqual($result, $expected); - - $result = $l10n->locale; - $expected = 'eng'; - $this->assertEqual($result, $expected); + $this->assertEqual($l10n->language, 'English'); + $this->assertEqual($l10n->languagePath, array('eng', 'eng')); + $this->assertEqual($l10n->locale, 'eng'); // Catalog Entry $l10n->get('en-ca'); - $result = $l10n->language; - $expected = 'English (Canadian)'; - $this->assertEqual($result, $expected); - $result = $l10n->languagePath; - $expected = array('en_ca', 'eng'); - $this->assertEqual($result, $expected); - - $result = $l10n->locale; - $expected = 'en_ca'; - $this->assertEqual($result, $expected); + $this->assertEqual($l10n->language, 'English (Canadian)'); + $this->assertEqual($l10n->languagePath, array('en_ca', 'eng')); + $this->assertEqual($l10n->locale, 'en_ca'); // Default Entry define('DEFAULT_LANGUAGE', 'en-us'); $l10n->get('use_default'); - $result = $l10n->language; - $expected = 'English (United States)'; - $this->assertEqual($result, $expected); - $result = $l10n->languagePath; - $expected = array('en_us', 'eng'); - $this->assertEqual($result, $expected); - - $result = $l10n->locale; - $expected = 'en_us'; - $this->assertEqual($result, $expected); + $this->assertEqual($l10n->language, 'English (United States)'); + $this->assertEqual($l10n->languagePath, array('en_us', 'eng')); + $this->assertEqual($l10n->locale, 'en_us'); $l10n->get('es'); $l10n->get(''); @@ -106,18 +78,11 @@ function testGet() { // Using $this->default $l10n = new L10n(); - $l10n->get('use_default'); - $result = $l10n->language; - $expected = 'English (United States)'; - $this->assertEqual($result, $expected); - - $result = $l10n->languagePath; - $expected = array('en_us', 'eng', 'eng'); - $this->assertEqual($result, $expected); - $result = $l10n->locale; - $expected = 'en_us'; - $this->assertEqual($result, $expected); + $l10n->get('use_default'); + $this->assertEqual($l10n->language, 'English (United States)'); + $this->assertEqual($l10n->languagePath, array('en_us', 'eng', 'eng')); + $this->assertEqual($l10n->locale, 'en_us'); } /** * testGetAutoLanguage method @@ -131,45 +96,24 @@ function testGetAutoLanguage() { $l10n =& new L10n(); $l10n->get(); - $result = $l10n->language; - $expected = 'English (Canadian)'; - $this->assertEqual($result, $expected); - - $result = $l10n->languagePath; - $expected = array('en_ca', 'eng', 'eng'); - $this->assertEqual($result, $expected); - $result = $l10n->locale; - $expected = 'en_ca'; - $this->assertEqual($result, $expected); + $this->assertEqual($l10n->language, 'English (Canadian)'); + $this->assertEqual($l10n->languagePath, array('en_ca', 'eng', 'eng')); + $this->assertEqual($l10n->locale, 'en_ca'); $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'es_mx'; $l10n->get(); - $result = $l10n->language; - $expected = 'Spanish (Mexican)'; - $this->assertEqual($result, $expected); - - $result = $l10n->languagePath; - $expected = array('es_mx', 'spa', 'eng'); - $this->assertEqual($result, $expected); - $result = $l10n->locale; - $expected = 'es_mx'; - $this->assertEqual($result, $expected); + $this->assertEqual($l10n->language, 'Spanish (Mexican)'); + $this->assertEqual($l10n->languagePath, array('es_mx', 'spa', 'eng')); + $this->assertEqual($l10n->locale, 'es_mx'); $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'en_xy,en_ca'; $l10n->get(); - $result = $l10n->language; - $expected = 'English'; - $this->assertEqual($result, $expected); - - $result = $l10n->languagePath; - $expected = array('eng', 'eng', 'eng'); - $this->assertEqual($result, $expected); - $result = $l10n->locale; - $expected = 'eng'; - $this->assertEqual($result, $expected); + $this->assertEqual($l10n->language, 'English'); + $this->assertEqual($l10n->languagePath, array('eng', 'eng', 'eng')); + $this->assertEqual($l10n->locale, 'eng'); $_SERVER = $__SERVER; } From 570c9e5304eb1e2695e2f8863f7e8ed594142d11 Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Thu, 21 Jan 2010 01:42:54 +0530 Subject: [PATCH 1553/2083] Cleaning up commented and unneeded test cases and moving tests to more appropriate file --- .../cases/libs/model/model_read.test.php | 18 +- .../libs/model/model_validation.test.php | 353 +++++++++++++++ .../cases/libs/model/model_write.test.php | 418 ------------------ 3 files changed, 355 insertions(+), 434 deletions(-) diff --git a/cake/tests/cases/libs/model/model_read.test.php b/cake/tests/cases/libs/model/model_read.test.php index a0cd6d9b6..e75ef796c 100755 --- a/cake/tests/cases/libs/model/model_read.test.php +++ b/cake/tests/cases/libs/model/model_read.test.php @@ -3945,20 +3945,6 @@ function testSaveEmpty() { $expected = $TestModel->save($data); $this->assertFalse($expected); } - // function testBasicValidation() { - // $TestModel =& new ValidationTest1(); - // $TestModel->testing = true; - // $TestModel->set(array('title' => '', 'published' => 1)); - // $this->assertEqual($TestModel->invalidFields(), array('title' => 'This field cannot be left blank')); - // - // $TestModel->create(); - // $TestModel->set(array('title' => 'Hello', 'published' => 0)); - // $this->assertEqual($TestModel->invalidFields(), array('published' => 'This field cannot be left blank')); - // - // $TestModel->create(); - // $TestModel->set(array('title' => 'Hello', 'published' => 1, 'body' => '')); - // $this->assertEqual($TestModel->invalidFields(), array('body' => 'This field cannot be left blank')); - // } /** * testFindAllWithConditionInChildQuery @@ -7150,8 +7136,8 @@ function testRecursiveFindAllWithLimit() { } /** * Testing availability of $this->findQueryType in Model callbacks - * - * @return void + * + * @return void */ function testFindQueryTypeInCallbacks() { $this->loadFixtures('Comment'); diff --git a/cake/tests/cases/libs/model/model_validation.test.php b/cake/tests/cases/libs/model/model_validation.test.php index 80dc78589..200fc704e 100644 --- a/cake/tests/cases/libs/model/model_validation.test.php +++ b/cake/tests/cases/libs/model/model_validation.test.php @@ -169,6 +169,359 @@ function testInvalidFieldsWithFieldListParams() { $this->assertEqual($TestModel->validate, $validate); } +/** + * testValidates method + * + * @access public + * @return void + */ + function testValidates() { + $TestModel =& new TestValidate(); + + $TestModel->validate = array( + 'user_id' => 'numeric', + 'title' => array('allowEmpty' => false, 'rule' => 'notEmpty'), + 'body' => 'notEmpty' + ); + + $data = array('TestValidate' => array( + 'user_id' => '1', + 'title' => '', + 'body' => 'body' + )); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertFalse($result); + + $data = array('TestValidate' => array( + 'user_id' => '1', + 'title' => 'title', + 'body' => 'body' + )); + $result = $TestModel->create($data) && $TestModel->validates(); + $this->assertTrue($result); + + $data = array('TestValidate' => array( + 'user_id' => '1', + 'title' => '0', + 'body' => 'body' + )); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertTrue($result); + + $data = array('TestValidate' => array( + 'user_id' => '1', + 'title' => 0, + 'body' => 'body' + )); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertTrue($result); + + $TestModel->validate['modified'] = array('allowEmpty' => true, 'rule' => 'date'); + + $data = array('TestValidate' => array( + 'user_id' => '1', + 'title' => 0, + 'body' => 'body', + 'modified' => '' + )); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertTrue($result); + + $data = array('TestValidate' => array( + 'user_id' => '1', + 'title' => 0, + 'body' => 'body', + 'modified' => '2007-05-01' + )); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertTrue($result); + + $data = array('TestValidate' => array( + 'user_id' => '1', + 'title' => 0, + 'body' => 'body', + 'modified' => 'invalid-date-here' + )); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertFalse($result); + + $data = array('TestValidate' => array( + 'user_id' => '1', + 'title' => 0, + 'body' => 'body', + 'modified' => 0 + )); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertFalse($result); + + $data = array('TestValidate' => array( + 'user_id' => '1', + 'title' => 0, + 'body' => 'body', + 'modified' => '0' + )); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertFalse($result); + + $TestModel->validate['modified'] = array('allowEmpty' => false, 'rule' => 'date'); + + $data = array('TestValidate' => array('modified' => null)); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertFalse($result); + + $data = array('TestValidate' => array('modified' => false)); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertFalse($result); + + $data = array('TestValidate' => array('modified' => '')); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertFalse($result); + + $data = array('TestValidate' => array( + 'modified' => '2007-05-01' + )); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertTrue($result); + + $TestModel->validate['slug'] = array('allowEmpty' => false, 'rule' => array('maxLength', 45)); + + $data = array('TestValidate' => array( + 'user_id' => '1', + 'title' => 0, + 'body' => 'body', + 'slug' => '' + )); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertFalse($result); + + $data = array('TestValidate' => array( + 'user_id' => '1', + 'title' => 0, + 'body' => 'body', + 'slug' => 'slug-right-here' + )); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertTrue($result); + + $data = array('TestValidate' => array( + 'user_id' => '1', + 'title' => 0, + 'body' => 'body', + 'slug' => 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz' + )); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertFalse($result); + + $TestModel->validate = array( + 'number' => array( + 'rule' => 'validateNumber', + 'min' => 3, + 'max' => 5 + ), + 'title' => array( + 'allowEmpty' => false, + 'rule' => 'notEmpty' + )); + + $data = array('TestValidate' => array( + 'title' => 'title', + 'number' => '0' + )); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertFalse($result); + + $data = array('TestValidate' => array( + 'title' => 'title', + 'number' => 0 + )); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertFalse($result); + + $data = array('TestValidate' => array( + 'title' => 'title', + 'number' => '3' + )); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertTrue($result); + + $data = array('TestValidate' => array( + 'title' => 'title', + 'number' => 3 + )); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertTrue($result); + + $TestModel->validate = array( + 'number' => array( + 'rule' => 'validateNumber', + 'min' => 5, + 'max' => 10 + ), + 'title' => array( + 'allowEmpty' => false, + 'rule' => 'notEmpty' + )); + + $data = array('TestValidate' => array( + 'title' => 'title', + 'number' => '3' + )); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertFalse($result); + + $data = array('TestValidate' => array( + 'title' => 'title', + 'number' => 3 + )); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertFalse($result); + + $TestModel->validate = array( + 'title' => array( + 'allowEmpty' => false, + 'rule' => 'validateTitle' + )); + + $data = array('TestValidate' => array('title' => '')); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertFalse($result); + + $data = array('TestValidate' => array('title' => 'new title')); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertFalse($result); + + $data = array('TestValidate' => array('title' => 'title-new')); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertTrue($result); + + $TestModel->validate = array('title' => array( + 'allowEmpty' => true, + 'rule' => 'validateTitle' + )); + $data = array('TestValidate' => array('title' => '')); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertTrue($result); + + $TestModel->validate = array( + 'title' => array( + 'length' => array( + 'allowEmpty' => true, + 'rule' => array('maxLength', 10) + ))); + $data = array('TestValidate' => array('title' => '')); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertTrue($result); + + $TestModel->validate = array( + 'title' => array( + 'rule' => array('userDefined', 'Article', 'titleDuplicate') + )); + $data = array('TestValidate' => array('title' => 'My Article Title')); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertFalse($result); + + $data = array('TestValidate' => array( + 'title' => 'My Article With a Different Title' + )); + $result = $TestModel->create($data); + $this->assertTrue($result); + $result = $TestModel->validates(); + $this->assertTrue($result); + + $TestModel->validate = array( + 'title' => array( + 'tooShort' => array('rule' => array('minLength', 50)), + 'onlyLetters' => array('rule' => '/^[a-z]+$/i') + ), + ); + $data = array('TestValidate' => array( + 'title' => 'I am a short string' + )); + $TestModel->create($data); + $result = $TestModel->validates(); + $this->assertFalse($result); + $result = $TestModel->validationErrors; + $expected = array( + 'title' => 'onlyLetters' + ); + $this->assertEqual($result, $expected); + + $TestModel->validate = array( + 'title' => array( + 'tooShort' => array( + 'rule' => array('minLength', 50), + 'last' => true + ), + 'onlyLetters' => array('rule' => '/^[a-z]+$/i') + ), + ); + $data = array('TestValidate' => array( + 'title' => 'I am a short string' + )); + $TestModel->create($data); + $result = $TestModel->validates(); + $this->assertFalse($result); + $result = $TestModel->validationErrors; + $expected = array( + 'title' => 'tooShort' + ); + $this->assertEqual($result, $expected); + } + /** * test that validates() checks all the 'with' associations as well for validation * as this can cause partial/wrong data insertion. diff --git a/cake/tests/cases/libs/model/model_write.test.php b/cake/tests/cases/libs/model/model_write.test.php index d55731887..46313563a 100644 --- a/cake/tests/cases/libs/model/model_write.test.php +++ b/cake/tests/cases/libs/model/model_write.test.php @@ -548,72 +548,6 @@ function testSaveWithCounterCacheScope() { $this->assertIdentical($result['Syfile']['item_count'], '1'); } -/** - * testValidatesBackwards method - * - * @access public - * @return void - */ - function testValidatesBackwards() { - $TestModel =& new TestValidate(); - - $TestModel->validate = array( - 'user_id' => 'numeric', - 'title' => 'notEmpty', - 'body' => 'notEmpty' - ); - - $data = array('TestValidate' => array( - 'user_id' => '1', - 'title' => '', - 'body' => '' - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertFalse($result); - - $data = array('TestValidate' => array( - 'user_id' => '1', - 'title' => 'title', - 'body' => '' - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertFalse($result); - - $data = array('TestValidate' => array( - 'user_id' => '', - 'title' => 'title', - 'body' => 'body' - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertFalse($result); - - $data = array('TestValidate' => array( - 'user_id' => 'not a number', - 'title' => 'title', - 'body' => 'body' - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertFalse($result); - - $data = array('TestValidate' => array( - 'user_id' => '1', - 'title' => 'title', - 'body' => 'body' - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertTrue($result); - } - /** * test that beforeValidate returning false can abort saves. * @@ -648,358 +582,6 @@ function testBeforeSaveSaveAbortion() { $result = $Model->save($data); $this->assertFalse($result); } -/** - * testValidates method - * - * @access public - * @return void - */ - function testValidates() { - $TestModel =& new TestValidate(); - - $TestModel->validate = array( - 'user_id' => 'numeric', - 'title' => array('allowEmpty' => false, 'rule' => 'notEmpty'), - 'body' => 'notEmpty' - ); - - $data = array('TestValidate' => array( - 'user_id' => '1', - 'title' => '', - 'body' => 'body' - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertFalse($result); - - $data = array('TestValidate' => array( - 'user_id' => '1', - 'title' => 'title', - 'body' => 'body' - )); - $result = $TestModel->create($data) && $TestModel->validates(); - $this->assertTrue($result); - - $data = array('TestValidate' => array( - 'user_id' => '1', - 'title' => '0', - 'body' => 'body' - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertTrue($result); - - $data = array('TestValidate' => array( - 'user_id' => '1', - 'title' => 0, - 'body' => 'body' - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertTrue($result); - - $TestModel->validate['modified'] = array('allowEmpty' => true, 'rule' => 'date'); - - $data = array('TestValidate' => array( - 'user_id' => '1', - 'title' => 0, - 'body' => 'body', - 'modified' => '' - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertTrue($result); - - $data = array('TestValidate' => array( - 'user_id' => '1', - 'title' => 0, - 'body' => 'body', - 'modified' => '2007-05-01' - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertTrue($result); - - $data = array('TestValidate' => array( - 'user_id' => '1', - 'title' => 0, - 'body' => 'body', - 'modified' => 'invalid-date-here' - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertFalse($result); - - $data = array('TestValidate' => array( - 'user_id' => '1', - 'title' => 0, - 'body' => 'body', - 'modified' => 0 - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertFalse($result); - - $data = array('TestValidate' => array( - 'user_id' => '1', - 'title' => 0, - 'body' => 'body', - 'modified' => '0' - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertFalse($result); - - $TestModel->validate['modified'] = array('allowEmpty' => false, 'rule' => 'date'); - - $data = array('TestValidate' => array('modified' => null)); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertFalse($result); - - $data = array('TestValidate' => array('modified' => false)); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertFalse($result); - - $data = array('TestValidate' => array('modified' => '')); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertFalse($result); - - $data = array('TestValidate' => array( - 'modified' => '2007-05-01' - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertTrue($result); - - $TestModel->validate['slug'] = array('allowEmpty' => false, 'rule' => array('maxLength', 45)); - - $data = array('TestValidate' => array( - 'user_id' => '1', - 'title' => 0, - 'body' => 'body', - 'slug' => '' - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertFalse($result); - - $data = array('TestValidate' => array( - 'user_id' => '1', - 'title' => 0, - 'body' => 'body', - 'slug' => 'slug-right-here' - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertTrue($result); - - $data = array('TestValidate' => array( - 'user_id' => '1', - 'title' => 0, - 'body' => 'body', - 'slug' => 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz' - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertFalse($result); - - $TestModel->validate = array( - 'number' => array( - 'rule' => 'validateNumber', - 'min' => 3, - 'max' => 5 - ), - 'title' => array( - 'allowEmpty' => false, - 'rule' => 'notEmpty' - )); - - $data = array('TestValidate' => array( - 'title' => 'title', - 'number' => '0' - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertFalse($result); - - $data = array('TestValidate' => array( - 'title' => 'title', - 'number' => 0 - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertFalse($result); - - $data = array('TestValidate' => array( - 'title' => 'title', - 'number' => '3' - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertTrue($result); - - $data = array('TestValidate' => array( - 'title' => 'title', - 'number' => 3 - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertTrue($result); - - $TestModel->validate = array( - 'number' => array( - 'rule' => 'validateNumber', - 'min' => 5, - 'max' => 10 - ), - 'title' => array( - 'allowEmpty' => false, - 'rule' => 'notEmpty' - )); - - $data = array('TestValidate' => array( - 'title' => 'title', - 'number' => '3' - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertFalse($result); - - $data = array('TestValidate' => array( - 'title' => 'title', - 'number' => 3 - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertFalse($result); - - $TestModel->validate = array( - 'title' => array( - 'allowEmpty' => false, - 'rule' => 'validateTitle' - )); - - $data = array('TestValidate' => array('title' => '')); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertFalse($result); - - $data = array('TestValidate' => array('title' => 'new title')); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertFalse($result); - - $data = array('TestValidate' => array('title' => 'title-new')); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertTrue($result); - - $TestModel->validate = array('title' => array( - 'allowEmpty' => true, - 'rule' => 'validateTitle' - )); - $data = array('TestValidate' => array('title' => '')); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertTrue($result); - - $TestModel->validate = array( - 'title' => array( - 'length' => array( - 'allowEmpty' => true, - 'rule' => array('maxLength', 10) - ))); - $data = array('TestValidate' => array('title' => '')); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertTrue($result); - - $TestModel->validate = array( - 'title' => array( - 'rule' => array('userDefined', 'Article', 'titleDuplicate') - )); - $data = array('TestValidate' => array('title' => 'My Article Title')); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertFalse($result); - - $data = array('TestValidate' => array( - 'title' => 'My Article With a Different Title' - )); - $result = $TestModel->create($data); - $this->assertTrue($result); - $result = $TestModel->validates(); - $this->assertTrue($result); - - $TestModel->validate = array( - 'title' => array( - 'tooShort' => array('rule' => array('minLength', 50)), - 'onlyLetters' => array('rule' => '/^[a-z]+$/i') - ), - ); - $data = array('TestValidate' => array( - 'title' => 'I am a short string' - )); - $TestModel->create($data); - $result = $TestModel->validates(); - $this->assertFalse($result); - $result = $TestModel->validationErrors; - $expected = array( - 'title' => 'onlyLetters' - ); - $this->assertEqual($result, $expected); - - $TestModel->validate = array( - 'title' => array( - 'tooShort' => array( - 'rule' => array('minLength', 50), - 'last' => true - ), - 'onlyLetters' => array('rule' => '/^[a-z]+$/i') - ), - ); - $data = array('TestValidate' => array( - 'title' => 'I am a short string' - )); - $TestModel->create($data); - $result = $TestModel->validates(); - $this->assertFalse($result); - $result = $TestModel->validationErrors; - $expected = array( - 'title' => 'tooShort' - ); - $this->assertEqual($result, $expected); - } /** * testSaveField method From 913450daefb39114a4264b4cb56285c4ec669d16 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 21 Jan 2010 10:35:20 -0500 Subject: [PATCH 1554/2083] Additional tests for virtualFields and fixing issues with index 0 being removed. Fixes #208 --- cake/libs/model/datasources/dbo_source.php | 23 ++++++++++--------- .../model/datasources/dbo_source.test.php | 7 ++++++ .../cases/libs/model/model_read.test.php | 20 ++++++++++++++++ 3 files changed, 39 insertions(+), 11 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index c0d86f10f..f4129e608 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -1877,18 +1877,19 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) { } $virtual = array(); $virtualFields = $model->getVirtualField(); - if ($virtualFields) { - $keys = array_keys($virtualFields); - foreach($keys as $field) { - $keys[] = $model->alias . '.' . $field; + if (!empty($virtualFields)) { + $virtualKeys = array_keys($virtualFields); + foreach ($virtualKeys as $field) { + $virtualKeys[] = $model->alias . '.' . $field; } - $virtual = ($allFields) ? $keys : array_intersect($keys, $fields); - } - foreach($virtual as &$field) { - if (strpos($field, '.')) { - $field = str_replace($model->alias . '.', '', $field); - $fields = array_diff($fields, array($model->alias . '.' . $field)); + $virtual = ($allFields) ? $virtualKeys : array_intersect($virtualKeys, $fields); + foreach ($virtual as $i => $field) { + if (strpos($field, '.') !== false) { + $virtual[$i] = str_replace($model->alias . '.', '', $field); + } + $fields = array_diff($fields, array($field)); } + $fields = array_values($fields); } $count = count($fields); @@ -1954,7 +1955,7 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) { } } if (!empty($virtual)) { - $fields = array_merge($fields,$this->_constructVirtualFields($model, $alias, $virtual)); + $fields = array_merge($fields, $this->_constructVirtualFields($model, $alias, $virtual)); } return array_unique($fields); } diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index 9a7c79baa..0bd4a52b4 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -4142,6 +4142,13 @@ function testVirtualFields() { '(NOW()) AS `Article__this_moment`', ); $this->assertEqual($expected, $result); + + $result = $this->db->fields($Article, null, array('Article.this_moment', 'Article.title')); + $expected = array( + '`Article`.`title`', + '(NOW()) AS `Article__this_moment`', + ); + $this->assertEqual($expected, $result); } /** diff --git a/cake/tests/cases/libs/model/model_read.test.php b/cake/tests/cases/libs/model/model_read.test.php index e75ef796c..83c9cd060 100755 --- a/cake/tests/cases/libs/model/model_read.test.php +++ b/cake/tests/cases/libs/model/model_read.test.php @@ -7249,6 +7249,26 @@ function testVirtualFields() { )); $this->assertEqual($result, $expectation); + + + $Author =& ClassRegistry::init('Author'); + $Author->virtualFields = array( + 'full_name' => 'CONCAT(Author.user, " ", Author.id)' + ); + + $result = $Author->find('first', array( + 'conditions' => array('Author.user' => 'mariano'), + 'fields' => array('Author.password', 'Author.full_name'), + 'recursive' => -1 + )); + $this->assertTrue(isset($result['Author']['full_name'])); + + $result = $Author->find('first', array( + 'conditions' => array('Author.user' => 'mariano'), + 'fields' => array('Author.full_name', 'Author.password'), + 'recursive' => -1 + )); + $this->assertTrue(isset($result['Author']['full_name'])); } /** From a8040506b0288683feb38602b1054ce3c7a2795b Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Thu, 21 Jan 2010 22:03:03 +0530 Subject: [PATCH 1555/2083] Fixing spacing between button tag attributes. Fixes #241 --- cake/libs/view/helpers/form.php | 2 +- cake/tests/cases/libs/view/helpers/form.test.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index e8023ba96..4f83ef261 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -1170,7 +1170,7 @@ function button($title, $options = array()) { return sprintf( $this->Html->tags['button'], $options['type'], - $this->_parseAttributes($options, array('type'), '', ' '), + $this->_parseAttributes($options, array('type'), ' ', ''), $title ); } diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index b9ee7dc99..8dc5286ee 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -4753,6 +4753,9 @@ function testButton() { $result = $this->Form->button('Clear Form >', array('type' => 'reset')); $this->assertTags($result, array('button' => array('type' => 'reset'), 'Clear Form >', '/button')); + $result = $this->Form->button('Clear Form >', array('type' => 'reset', 'id' => 'clearForm')); + $this->assertTags($result, array('button' => array('type' => 'reset', 'id' => 'clearForm'), 'Clear Form >', '/button')); + $result = $this->Form->button('<Clear Form>', array('type' => 'reset', 'escape' => true)); $this->assertTags($result, array('button' => array('type' => 'reset'), '<Clear Form>', '/button')); From dff7e17fa2c4459450277412c45f044b3690244b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Thu, 21 Jan 2010 12:11:44 -0430 Subject: [PATCH 1556/2083] Adding atomic increment and decrement methods to cache engines, closes #234 --- cake/libs/cache.php | 86 +++++++++++++++++++ cake/libs/cache/apc.php | 32 +++++++ cake/libs/cache/memcache.php | 38 ++++++++ cake/libs/cache/xcache.php | 33 +++++++ cake/tests/cases/libs/cache/apc.test.php | 47 ++++++++++ cake/tests/cases/libs/cache/memcache.test.php | 47 ++++++++++ cake/tests/cases/libs/cache/xcache.test.php | 47 ++++++++++ 7 files changed, 330 insertions(+) diff --git a/cake/libs/cache.php b/cake/libs/cache.php index bf73cae60..512db1b16 100644 --- a/cake/libs/cache.php +++ b/cake/libs/cache.php @@ -328,6 +328,70 @@ function read($key, $config = null) { return $success; } +/** + * Increment a number under the key and return incremented value + * + * @param string $key Identifier for the data + * @param integer $offset How much to add + * @param string $config Optional - string configuration name + * @return mixed new value, or false if the data doesn't exist, is not integer, or if there was an error fetching it + * @access public + */ + function increment($key, $offset = 1, $config = null) { + $self =& Cache::getInstance(); + + if (!$config) { + $config = $self->__name; + } + $settings = $self->settings($config); + + if (empty($settings)) { + return null; + } + if (!$self->isInitialized($config)) { + return false; + } + $key = $self->_engines[$config]->key($key); + + if (!$key || is_resource($value)) { + return false; + } + $success = $_this->_Engine[$engine]->increment($settings['prefix'] . $key, $offset); + $self->set(); + return $success; + } +/** + * Decrement a number under the key and return decremented value + * + * @param string $key Identifier for the data + * @param integer $offset How much to substract + * @param string $config Optional - string configuration name + * @return mixed new value, or false if the data doesn't exist, is not integer, or if there was an error fetching it + * @access public + */ + function decrement($key, $offset = 1, $config = null) { + $self =& Cache::getInstance(); + + if (!$config) { + $config = $self->__name; + } + $settings = $self->settings($config); + + if (empty($settings)) { + return null; + } + if (!$self->isInitialized($config)) { + return false; + } + $key = $self->_engines[$config]->key($key); + + if (!$key || is_resource($value)) { + return false; + } + $success = $_this->_Engine[$engine]->increment($settings['prefix'] . $key, $offset); + $self->set(); + return $success; + } /** * Delete a key from the cache * @@ -498,6 +562,28 @@ function read($key) { trigger_error(sprintf(__('Method read() not implemented in %s', true), get_class($this)), E_USER_ERROR); } +/** + * Increment a number under the key and return incremented value + * + * @param string $key Identifier for the data + * @param integer $offset How much to add + * @return New incremented value, false otherwise + * @access public + */ + function increment($key, $offset = 1) { + trigger_error(sprintf(__('Method increment() not implemented in %s', true), get_class($this)), E_USER_ERROR); + } +/** + * Decrement a number under the key and return decremented value + * + * @param string $key Identifier for the data + * @param integer $value How much to substract + * @return New incremented value, false otherwise + * @access public + */ + function decrement($key, $offset = 1) { + trigger_error(sprintf(__('Method decrement() not implemented in %s', true), get_class($this)), E_USER_ERROR); + } /** * Delete a key from the cache * diff --git a/cake/libs/cache/apc.php b/cake/libs/cache/apc.php index acf438f32..e5b629544 100644 --- a/cake/libs/cache/apc.php +++ b/cake/libs/cache/apc.php @@ -74,6 +74,38 @@ function read($key) { return apc_fetch($key); } +/** + * Increments the value of an integer cached key + * + * @param string $key Identifier for the data + * @param integer $offset How much to increment + * @param integer $duration How long to cache the data, in seconds + * @return New incremented value, false otherwise + * @access public + */ + function increment($key, $offset = 1) { + if (!is_integer($offset) || $offset < 0) { + return false; + } + return apc_inc($key, $offset); + } + +/** + * Decrements the value of an integer cached key + * + * @param string $key Identifier for the data + * @param integer $offset How much to substract + * @param integer $duration How long to cache the data, in seconds + * @return New decremented value, false otherwise + * @access public + */ + function decrement($key, $offset = 1) { + if (!is_integer($offset) || $offset < 0) { + return false; + } + return apc_dec($key, $offset); + } + /** * Delete a key from the cache * diff --git a/cake/libs/cache/memcache.php b/cake/libs/cache/memcache.php index 485270339..d85590355 100644 --- a/cake/libs/cache/memcache.php +++ b/cake/libs/cache/memcache.php @@ -125,6 +125,44 @@ function read($key) { return $this->__Memcache->get($key); } +/** + * Increments the value of an integer cached key + * + * @param string $key Identifier for the data + * @param integer $offset How much to increment + * @param integer $duration How long to cache the data, in seconds + * @return New incremented value, false otherwise + * @access public + */ + function increment($key, $offset = 1) { + if ($this->settings['compress']) { + trigger_error(sprintf(__('Method increment() not implemented for compressed cache in %s', true), get_class($this)), E_USER_ERROR); + } + if (!is_integer($offset) || $offset < 0) { + return false; + } + return $this->__Memcache->increment($key, $offset); + } + +/** + * Decrements the value of an integer cached key + * + * @param string $key Identifier for the data + * @param integer $offset How much to substract + * @param integer $duration How long to cache the data, in seconds + * @return New decremented value, false otherwise + * @access public + */ + function decrement($key, $offset = 1) { + if ($this->settings['compress']) { + trigger_error(sprintf(__('Method decrement() not implemented for compressed cache in %s', true), get_class($this)), E_USER_ERROR); + } + if (!is_integer($offset) || $offset < 0) { + return false; + } + return $this->__Memcache->decrement($key, $offset); + } + /** * Delete a key from the cache * diff --git a/cake/libs/cache/xcache.php b/cake/libs/cache/xcache.php index ecdc08260..9d6fdb255 100644 --- a/cake/libs/cache/xcache.php +++ b/cake/libs/cache/xcache.php @@ -90,6 +90,39 @@ function read($key) { return false; } +/** + * Increments the value of an integer cached key + * If the cache key is not an integer it will be treated as 0 + * + * @param string $key Identifier for the data + * @param integer $offset How much to increment + * @param integer $duration How long to cache the data, in seconds + * @return New incremented value, false otherwise + * @access public + */ + function increment($key, $offset = 1) { + if (!is_integer($offset) || $offset < 0) { + return false; + } + return xcache_inc($key, $offset); + } + +/** + * Decrements the value of an integer cached key. + * If the cache key is not an integer it will be treated as 0 + * + * @param string $key Identifier for the data + * @param integer $offset How much to substract + * @param integer $duration How long to cache the data, in seconds + * @return New decremented value, false otherwise + * @access public + */ + function decrement($key, $offset = 1) { + if (!is_integer($offset) || $offset < 0) { + return false; + } + return xcache_dec($key, $offset); + } /** * Delete a key from the cache * diff --git a/cake/tests/cases/libs/cache/apc.test.php b/cake/tests/cases/libs/cache/apc.test.php index 10f9593dd..7323e8385 100644 --- a/cake/tests/cases/libs/cache/apc.test.php +++ b/cake/tests/cases/libs/cache/apc.test.php @@ -140,5 +140,52 @@ function testDeleteCache() { $result = Cache::delete('delete_test'); $this->assertTrue($result); } + +/** + * testDecrement method + * + * @access public + * @return void + */ + public function testDecrement() { + $result = Cache::write('test_decrement', 5); + $this->assertTrue($result); + + $result = Cache::decrement('test_decrement'); + $this->assertEqual(4, $result); + + $result = Cache::read('test_decrement'); + $this->assertEqual(4, $result); + + $result = Cache::decrement('test_decrement', 2); + $this->assertEqual(2, $result); + + $result = Cache::read('test_decrement'); + $this->assertEqual(2, $result); + + } + +/** + * testIncrement method + * + * @access public + * @return void + */ + public function testIncrement() { + $result = Cache::write('test_increment', 5); + $this->assertTrue($result); + + $result = Cache::increment('test_increment'); + $this->assertEqual(5, $result); + + $result = Cache::read('test_increment'); + $this->assertEqual(5, $result); + + $result = Cache::increment('test_increment', 2); + $this->assertEqual(7, $result); + + $result = Cache::read('test_increment'); + $this->assertEqual(7, $result); + } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/cache/memcache.test.php b/cake/tests/cases/libs/cache/memcache.test.php index 99cc68ca1..470f43ebb 100644 --- a/cake/tests/cases/libs/cache/memcache.test.php +++ b/cake/tests/cases/libs/cache/memcache.test.php @@ -220,5 +220,52 @@ function testDeleteCache() { $result = Cache::delete('delete_test'); $this->assertTrue($result); } + +/** + * testDecrement method + * + * @access public + * @return void + */ + public function testDecrement() { + $result = Cache::write('test_decrement', 5); + $this->assertTrue($result); + + $result = Cache::decrement('test_decrement'); + $this->assertEqual(4, $result); + + $result = Cache::read('test_decrement'); + $this->assertEqual(4, $result); + + $result = Cache::decrement('test_decrement', 2); + $this->assertEqual(2, $result); + + $result = Cache::read('test_decrement'); + $this->assertEqual(2, $result); + + } + +/** + * testIncrement method + * + * @access public + * @return void + */ + public function testIncrement() { + $result = Cache::write('test_increment', 5); + $this->assertTrue($result); + + $result = Cache::increment('test_increment'); + $this->assertEqual(5, $result); + + $result = Cache::read('test_increment'); + $this->assertEqual(5, $result); + + $result = Cache::increment('test_increment', 2); + $this->assertEqual(7, $result); + + $result = Cache::read('test_increment'); + $this->assertEqual(7, $result); + } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/cache/xcache.test.php b/cake/tests/cases/libs/cache/xcache.test.php index f78955cb0..0d1e7c4fd 100644 --- a/cake/tests/cases/libs/cache/xcache.test.php +++ b/cake/tests/cases/libs/cache/xcache.test.php @@ -173,5 +173,52 @@ function testClearCache() { $result = Cache::clear(); $this->assertTrue($result); } + +/** + * testDecrement method + * + * @access public + * @return void + */ + public function testDecrement() { + $result = Cache::write('test_decrement', 5); + $this->assertTrue($result); + + $result = Cache::decrement('test_decrement'); + $this->assertEqual(4, $result); + + $result = Cache::read('test_decrement'); + $this->assertEqual(4, $result); + + $result = Cache::decrement('test_decrement', 2); + $this->assertEqual(2, $result); + + $result = Cache::read('test_decrement'); + $this->assertEqual(2, $result); + + } + +/** + * testIncrement method + * + * @access public + * @return void + */ + public function testIncrement() { + $result = Cache::write('test_increment', 5); + $this->assertTrue($result); + + $result = Cache::increment('test_increment'); + $this->assertEqual(5, $result); + + $result = Cache::read('test_increment'); + $this->assertEqual(5, $result); + + $result = Cache::increment('test_increment', 2); + $this->assertEqual(7, $result); + + $result = Cache::read('test_increment'); + $this->assertEqual(7, $result); + } } ?> \ No newline at end of file From c5a5d1dfe6b902e2ecc219a6b480dcf36aeb970e Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 21 Jan 2010 11:59:49 -0500 Subject: [PATCH 1557/2083] Making Session.model the required setting and not Session.table. Session.table can still be used to set the table name used when configuring sessions, but the default value is cake_session as before. Fixes #223 --- cake/libs/cake_session.php | 29 ++++++++++----------- cake/tests/cases/libs/cake_session.test.php | 4 ++- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index aac877fa4..5d41f5756 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -138,17 +138,19 @@ function __construct($base = null, $start = true) { if (empty($database)) { $database = 'default'; } - if (empty($modelName)) { - ClassRegistry::init(array( - 'class' => Inflector::classify($table), - 'alias' => 'Session' - )); - } else { - ClassRegistry::init(array( - 'class' => $modelName, - 'alias' => 'Session' - )); + $settings = array( + 'class' => 'Session', + 'alias' => 'Session', + 'table' => 'cake_sessions', + 'ds' => $database + ); + if (!empty($modelName)) { + $settings['class'] = $modelName; + } + if (!empty($table)) { + $settings['table'] = $table; } + ClassRegistry::init($settings); } if ($start === true) { if (!empty($base)) { @@ -492,11 +494,9 @@ function __initSession() { break; case 'database': if (empty($_SESSION)) { - if (Configure::read('Session.table') === null) { + if (Configure::read('Session.model') === null) { trigger_error(__("You must set the all Configure::write('Session.*') in core.php to use database storage"), E_USER_WARNING); - exit(); - } elseif (Configure::read('Session.database') === null) { - Configure::write('Session.database', 'default'); + $this->_stop(); } if ($iniSet) { ini_set('session.use_trans_sid', 0); @@ -763,7 +763,6 @@ function __write($id, $data) { $model =& ClassRegistry::getObject('Session'); $return = $model->save(compact('id', 'data', 'expires')); - return $return; } diff --git a/cake/tests/cases/libs/cake_session.test.php b/cake/tests/cases/libs/cake_session.test.php index 99811c2e2..e5b9568cc 100644 --- a/cake/tests/cases/libs/cake_session.test.php +++ b/cake/tests/cases/libs/cake_session.test.php @@ -431,7 +431,8 @@ function testReadAndWriteWithDatabaseStorage() { unset($_SESSION); session_destroy(); Configure::write('Session.table', 'sessions'); - Configure::write('Session.database', 'test'); + Configure::write('Session.model', 'Session'); + Configure::write('Session.database', 'test_suite'); Configure::write('Session.save', 'database'); $this->setUp(); @@ -463,5 +464,6 @@ function testReadAndWriteWithDatabaseStorage() { Configure::write('Session.save', 'php'); $this->setUp(); } + } ?> \ No newline at end of file From b21538c4265f4bacf868486ae940f4cae0923f0e Mon Sep 17 00:00:00 2001 From: Juan Basso <jrbasso@gmail.com> Date: Sat, 16 Jan 2010 15:03:13 -0200 Subject: [PATCH 1558/2083] Getting a list of connections in the constructor of ConnectionManager class. Fixes issues where using ConnectionManager::create() before the standard connections are enumerated will result in the standard connections never being enumerated. Fixes #206 Signed-off-by: Mark Story <mark@mark-story.com> --- cake/libs/model/connection_manager.php | 44 +++++++++++++++----------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/cake/libs/model/connection_manager.php b/cake/libs/model/connection_manager.php index b09eda5c4..d1e3c20ec 100644 --- a/cake/libs/model/connection_manager.php +++ b/cake/libs/model/connection_manager.php @@ -62,6 +62,7 @@ function __construct() { if (class_exists('DATABASE_CONFIG')) { $this->config =& new DATABASE_CONFIG(); } + $this->_getConnectionObjects(); } /** @@ -96,14 +97,13 @@ function &getDataSource($name) { $return =& $_this->_dataSources[$name]; return $return; } - $connections = $_this->enumConnectionObjects(); - if (empty($connections[$name])) { + if (empty($_this->_connectionsEnum[$name])) { trigger_error(sprintf(__("ConnectionManager::getDataSource - Non-existent data source %s", true), $name), E_USER_ERROR); $null = null; return $null; } - $conn = $connections[$name]; + $conn = $_this->_connectionsEnum[$name]; $class = $conn['classname']; if ($_this->loadDataSource($name) === null) { @@ -165,8 +165,7 @@ function loadDataSource($connName) { if (is_array($connName)) { $conn = $connName; } else { - $connections = $_this->enumConnectionObjects(); - $conn = $connections[$connName]; + $conn = $_this->_connectionsEnum[$connName]; } if (class_exists($conn['classname'])) { @@ -188,7 +187,7 @@ function loadDataSource($connName) { } /** - * Gets a list of class and file names associated with the user-defined DataSource connections + * Return a list of connections * * @return array An associative array of elements where the key is the connection name * (as defined in Connections), and the value is an array with keys 'filename' and 'classname'. @@ -198,19 +197,7 @@ function loadDataSource($connName) { function enumConnectionObjects() { $_this =& ConnectionManager::getInstance(); - if (!empty($_this->_connectionsEnum)) { - return $_this->_connectionsEnum; - } - $connections = get_object_vars($_this->config); - - if ($connections != null) { - foreach ($connections as $name => $config) { - $_this->_connectionsEnum[$name] = $_this->__connectionData($config); - } - return $_this->_connectionsEnum; - } else { - $_this->cakeError('missingConnection', array(array('className' => 'ConnectionManager'))); - } + return $_this->_connectionsEnum; } /** @@ -235,6 +222,25 @@ function &create($name = '', $config = array()) { return $return; } +/** + * Gets a list of class and file names associated with the user-defined DataSource connections + * + * @return void + * @access protected + * @static + */ + function _getConnectionObjects() { + $connections = get_object_vars($this->config); + + if ($connections != null) { + foreach ($connections as $name => $config) { + $this->_connectionsEnum[$name] = $this->__connectionData($config); + } + } else { + $this->cakeError('missingConnection', array(array('className' => 'ConnectionManager'))); + } + } + /** * Returns the file, class name, and parent for the given driver. * From 2d3cde1abb0d9c770b490406e264262e87241aec Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 21 Jan 2010 13:18:00 -0500 Subject: [PATCH 1559/2083] Updating doc block for ConnectionManager and including note about possible PHP4 issues. --- cake/libs/model/connection_manager.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cake/libs/model/connection_manager.php b/cake/libs/model/connection_manager.php index d1e3c20ec..a6be6e12e 100644 --- a/cake/libs/model/connection_manager.php +++ b/cake/libs/model/connection_manager.php @@ -131,11 +131,13 @@ function sourceList() { } /** - * Gets a DataSource name from an object reference + * Gets a DataSource name from an object reference. + * + * **Warning** this method may cause fatal errors in PHP4. * * @param object $source DataSource object * @return string Datasource name, or null if source is not present - * in the ConnectionManager. + * in the ConnectionManager. * @access public * @static */ From e150db2a459c6068776355a569accc692ea7514e Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 21 Jan 2010 13:24:22 -0500 Subject: [PATCH 1560/2083] Removing test ignore --- cake/tests/cases/libs/cache.test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/cache.test.php b/cake/tests/cases/libs/cache.test.php index 03a1b2c14..c5e1be870 100644 --- a/cake/tests/cases/libs/cache.test.php +++ b/cake/tests/cases/libs/cache.test.php @@ -73,7 +73,7 @@ function testConfig() { * * @return void */ - function XXtestConfigWithLibAndPluginEngines() { + function testConfigWithLibAndPluginEngines() { App::build(array( 'libs' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'libs' . DS), 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) From 47c7387548d7a3595ca893c6761e222810899f52 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 21 Jan 2010 13:57:42 -0500 Subject: [PATCH 1561/2083] Fixing various errors related to Cache::increment() and Cache::decrement(). Removing php5 only keywords from test cases. Updating memcache tests, to correctly skip multiple server test when multiple memcached servers cannot be found. --- cake/libs/cache.php | 8 ++++---- cake/libs/cache/memcache.php | 6 ------ cake/tests/cases/libs/cache/memcache.test.php | 15 +++++++-------- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/cake/libs/cache.php b/cake/libs/cache.php index 512db1b16..2e27c4ab8 100644 --- a/cake/libs/cache.php +++ b/cake/libs/cache.php @@ -353,10 +353,10 @@ function increment($key, $offset = 1, $config = null) { } $key = $self->_engines[$config]->key($key); - if (!$key || is_resource($value)) { + if (!$key || !is_integer($offset) || $offset < 0) { return false; } - $success = $_this->_Engine[$engine]->increment($settings['prefix'] . $key, $offset); + $success = $self->_engines[$config]->increment($settings['prefix'] . $key, $offset); $self->set(); return $success; } @@ -385,10 +385,10 @@ function decrement($key, $offset = 1, $config = null) { } $key = $self->_engines[$config]->key($key); - if (!$key || is_resource($value)) { + if (!$key || !is_integer($offset) || $offset < 0) { return false; } - $success = $_this->_Engine[$engine]->increment($settings['prefix'] . $key, $offset); + $success = $self->_engines[$config]->decrement($settings['prefix'] . $key, $offset); $self->set(); return $success; } diff --git a/cake/libs/cache/memcache.php b/cake/libs/cache/memcache.php index d85590355..ed15d438e 100644 --- a/cake/libs/cache/memcache.php +++ b/cake/libs/cache/memcache.php @@ -138,9 +138,6 @@ function increment($key, $offset = 1) { if ($this->settings['compress']) { trigger_error(sprintf(__('Method increment() not implemented for compressed cache in %s', true), get_class($this)), E_USER_ERROR); } - if (!is_integer($offset) || $offset < 0) { - return false; - } return $this->__Memcache->increment($key, $offset); } @@ -157,9 +154,6 @@ function decrement($key, $offset = 1) { if ($this->settings['compress']) { trigger_error(sprintf(__('Method decrement() not implemented for compressed cache in %s', true), get_class($this)), E_USER_ERROR); } - if (!is_integer($offset) || $offset < 0) { - return false; - } return $this->__Memcache->decrement($key, $offset); } diff --git a/cake/tests/cases/libs/cache/memcache.test.php b/cake/tests/cases/libs/cache/memcache.test.php index 470f43ebb..c529b570a 100644 --- a/cake/tests/cases/libs/cache/memcache.test.php +++ b/cake/tests/cases/libs/cache/memcache.test.php @@ -100,7 +100,7 @@ function testMultipleServers() { foreach($servers as $server) { list($host, $port) = explode(':', $server); - if (!$Memcache->addServer($host, $port)) { + if (!@$Memcache->connect($host, $port)) { $available = false; } } @@ -227,7 +227,7 @@ function testDeleteCache() { * @access public * @return void */ - public function testDecrement() { + function testDecrement() { $result = Cache::write('test_decrement', 5); $this->assertTrue($result); @@ -242,7 +242,6 @@ public function testDecrement() { $result = Cache::read('test_decrement'); $this->assertEqual(2, $result); - } /** @@ -251,21 +250,21 @@ public function testDecrement() { * @access public * @return void */ - public function testIncrement() { + function testIncrement() { $result = Cache::write('test_increment', 5); $this->assertTrue($result); $result = Cache::increment('test_increment'); - $this->assertEqual(5, $result); + $this->assertEqual(6, $result); $result = Cache::read('test_increment'); - $this->assertEqual(5, $result); + $this->assertEqual(6, $result); $result = Cache::increment('test_increment', 2); - $this->assertEqual(7, $result); + $this->assertEqual(8, $result); $result = Cache::read('test_increment'); - $this->assertEqual(7, $result); + $this->assertEqual(8, $result); } } ?> \ No newline at end of file From ff7e906ba2f3046892fcb56c5ee7c957a468ba41 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 21 Jan 2010 14:06:18 -0500 Subject: [PATCH 1562/2083] Removing php5 visibility keywords. Fixing increment count tests in xcache test. --- cake/tests/cases/libs/cache/xcache.test.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cake/tests/cases/libs/cache/xcache.test.php b/cake/tests/cases/libs/cache/xcache.test.php index 0d1e7c4fd..cb12ff98f 100644 --- a/cake/tests/cases/libs/cache/xcache.test.php +++ b/cake/tests/cases/libs/cache/xcache.test.php @@ -180,7 +180,7 @@ function testClearCache() { * @access public * @return void */ - public function testDecrement() { + function testDecrement() { $result = Cache::write('test_decrement', 5); $this->assertTrue($result); @@ -195,7 +195,6 @@ public function testDecrement() { $result = Cache::read('test_decrement'); $this->assertEqual(2, $result); - } /** @@ -204,21 +203,21 @@ public function testDecrement() { * @access public * @return void */ - public function testIncrement() { + function testIncrement() { $result = Cache::write('test_increment', 5); $this->assertTrue($result); $result = Cache::increment('test_increment'); - $this->assertEqual(5, $result); + $this->assertEqual(6, $result); $result = Cache::read('test_increment'); - $this->assertEqual(5, $result); + $this->assertEqual(6, $result); $result = Cache::increment('test_increment', 2); - $this->assertEqual(7, $result); + $this->assertEqual(8, $result); $result = Cache::read('test_increment'); - $this->assertEqual(7, $result); + $this->assertEqual(8, $result); } } ?> \ No newline at end of file From 513db9a72a97da6bc0239e505c955663415fb372 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 21 Jan 2010 14:14:26 -0500 Subject: [PATCH 1563/2083] Removing repeated checks, as they've been refactored into Cache::increment() and Cache::decrement(). Adding skipIf()'s to ApcEngineTest in case apc_inc, and apc_dec are not available. --- cake/libs/cache/apc.php | 6 ------ cake/libs/cache/xcache.php | 6 ------ cake/tests/cases/libs/cache/apc.test.php | 12 +++++++++--- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/cake/libs/cache/apc.php b/cake/libs/cache/apc.php index e5b629544..cd5c89b45 100644 --- a/cake/libs/cache/apc.php +++ b/cake/libs/cache/apc.php @@ -84,9 +84,6 @@ function read($key) { * @access public */ function increment($key, $offset = 1) { - if (!is_integer($offset) || $offset < 0) { - return false; - } return apc_inc($key, $offset); } @@ -100,9 +97,6 @@ function increment($key, $offset = 1) { * @access public */ function decrement($key, $offset = 1) { - if (!is_integer($offset) || $offset < 0) { - return false; - } return apc_dec($key, $offset); } diff --git a/cake/libs/cache/xcache.php b/cake/libs/cache/xcache.php index 9d6fdb255..902fc0867 100644 --- a/cake/libs/cache/xcache.php +++ b/cake/libs/cache/xcache.php @@ -101,9 +101,6 @@ function read($key) { * @access public */ function increment($key, $offset = 1) { - if (!is_integer($offset) || $offset < 0) { - return false; - } return xcache_inc($key, $offset); } @@ -118,9 +115,6 @@ function increment($key, $offset = 1) { * @access public */ function decrement($key, $offset = 1) { - if (!is_integer($offset) || $offset < 0) { - return false; - } return xcache_dec($key, $offset); } /** diff --git a/cake/tests/cases/libs/cache/apc.test.php b/cake/tests/cases/libs/cache/apc.test.php index 7323e8385..24930fe68 100644 --- a/cake/tests/cases/libs/cache/apc.test.php +++ b/cake/tests/cases/libs/cache/apc.test.php @@ -27,7 +27,7 @@ * @package cake * @subpackage cake.tests.cases.libs.cache */ -class ApcEngineTest extends UnitTestCase { +class ApcEngineTest extends CakeTestCase { /** * skip method @@ -147,7 +147,10 @@ function testDeleteCache() { * @access public * @return void */ - public function testDecrement() { + function testDecrement() { + if ($this->skipIf(!function_exists('apc_dec'), 'No apc_dec() function, cannot test decrement() %s')) { + return; + } $result = Cache::write('test_decrement', 5); $this->assertTrue($result); @@ -171,7 +174,10 @@ public function testDecrement() { * @access public * @return void */ - public function testIncrement() { + function testIncrement() { + if ($this->skipIf(!function_exists('apc_inc'), 'No apc_inc() function, cannot test increment() %s')) { + return; + } $result = Cache::write('test_increment', 5); $this->assertTrue($result); From f4e837d985c36e7aaa453b35b0611843e1362b16 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 21 Jan 2010 15:12:46 -0500 Subject: [PATCH 1564/2083] Removing all methods currently issuing warnings about being deprecated. --- cake/libs/cake_session.php | 11 --- cake/libs/controller/components/cookie.php | 8 -- .../controller/components/request_handler.php | 8 -- cake/libs/controller/components/session.php | 12 --- cake/libs/folder.php | 60 -------------- cake/libs/model/model.php | 80 ------------------- 6 files changed, 179 deletions(-) diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index 5d41f5756..a0a1dd8c2 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -240,17 +240,6 @@ function id($id = null) { } } -/** - * Remove a variable from the session - * - * @return boolean - * @deprecated Use CakeSession::delete instead - */ - function del($name) { - trigger_error(__('CakeSession::del() is deprecated, use CakeSession::delete() instead.', true), E_USER_WARNING); - return $this->delete($name); - } - /** * Removes a variable from session. * diff --git a/cake/libs/controller/components/cookie.php b/cake/libs/controller/components/cookie.php index a7403b2c6..694c5379f 100644 --- a/cake/libs/controller/components/cookie.php +++ b/cake/libs/controller/components/cookie.php @@ -259,14 +259,6 @@ function read($key = null) { return $this->__values[$key]; } -/** - * @deprecated use delete() - */ - function del($key) { - trigger_error(__('Deprecated method, use CookieComponent::delete instead', true), E_USER_WARNING); - return $this->delete($key); - } - /** * Delete a cookie value * diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php index 8cefb3917..fcbf90177 100644 --- a/cake/libs/controller/components/request_handler.php +++ b/cake/libs/controller/components/request_handler.php @@ -421,14 +421,6 @@ function getReferer() { return trim(preg_replace('/(?:\:.*)/', '', $sessHost)); } -/** - * @deprecated use getReferer() - */ - function getReferrer() { - trigger_error(__('Deprecated method, use RequestHandlerComponent::getReferer instead', true), E_USER_WARNING); - return $this->getReferer(); - } - /** * Gets remote client IP * diff --git a/cake/libs/controller/components/session.php b/cake/libs/controller/components/session.php index 11e735859..73a93de66 100644 --- a/cake/libs/controller/components/session.php +++ b/cake/libs/controller/components/session.php @@ -137,18 +137,6 @@ function read($name = null) { return false; } -/** - * @deprecated use delete - */ - function del($name) { - trigger_error(__('Deprecated method, use SessionComponent::delete instead', true), E_USER_WARNING); - if ($this->__active === true) { - $this->__start(); - return parent::del($name); - } - return false; - } - /** * Wrapper for SessionComponent::del(); * diff --git a/cake/libs/folder.php b/cake/libs/folder.php index 6e4c23d3a..e1280001d 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -715,66 +715,6 @@ function errors() { return $this->__errors; } -/** - * nix flavored alias - * - * @see read - * @deprecated use read - * @access public - */ - function ls($sort = true, $exceptions = false) { - trigger_error(__('Deprecated method, use Folder::read instead', true), E_USER_WARNING); - return $this->read($sort, $exceptions); - } - -/** - * nix flavored alias - * - * @see create - * @deprecated use create - * @access public - */ - function mkdir($pathname, $mode = 0755) { - trigger_error(__('Deprecated method, use Folder::create instead', true), E_USER_WARNING); - return $this->create($pathname, $mode); - } - -/** - * nix flavored alias - * - * @see copy - * @deprecated use copy - * @access public - */ - function cp($options) { - trigger_error(__('Deprecated method, use Folder::copy instead', true), E_USER_WARNING); - return $this->copy($options); - } - -/** - * nix flavored alias - * - * @see move - * @deprecated use move - * @access public - */ - function mv($options) { - trigger_error(__('Deprecated method, use Folder::move instead', true), E_USER_WARNING); - return $this->move($options); - } - -/** - * nix flavored alias - * - * @see delete - * @deprecated use delete - * @access public - */ - function rm($path) { - trigger_error(__('Deprecated method, use Folder::delete instead', true), E_USER_WARNING); - return $this->delete($path); - } - /** * Get the real path (taking ".." and such into account) * diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 6a04a8396..f805b720f 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -515,57 +515,6 @@ function call__($method, $params) { return $return; } -/** - * Bind model associations on the fly. - * - * If $permanent is true, association will not be reset - * to the originals defined in the model. - * - * @param mixed $model A model or association name (string) or set of binding options (indexed by model name type) - * @param array $options If $model is a string, this is the list of association properties with which $model will - * be bound - * @param boolean $permanent Set to true to make the binding permanent - * @return void - * @access public - * @deprecated Use Model::bindModel() instead. - */ - function bind($model, $options = array(), $permanent = true) { - trigger_error(__('Deprecated method, use Model::bindModel instead', true), E_USER_WARNING); - if (!is_array($model)) { - $model = array($model => $options); - } - - foreach ($model as $name => $options) { - if (isset($options['type'])) { - $assoc = $options['type']; - } elseif (isset($options[0])) { - $assoc = $options[0]; - } else { - $assoc = 'belongsTo'; - } - - if (!$permanent) { - $this->__backAssociation[$assoc] = $this->{$assoc}; - } - foreach ($model as $key => $value) { - $assocName = $modelName = $key; - - if (isset($this->{$assoc}[$assocName])) { - $this->{$assoc}[$assocName] = array_merge($this->{$assoc}[$assocName], $options); - } else { - if (isset($value['className'])) { - $modelName = $value['className']; - } - - $this->__constructLinkedModel($assocName, $modelName); - $this->{$assoc}[$assocName] = $model[$assocName]; - $this->__generateAssociation($assoc); - } - unset($this->{$assoc}[$assocName]['type'], $this->{$assoc}[$assocName][0]); - } - } - } - /** * Bind model associations on the fly. * @@ -1819,15 +1768,6 @@ function updateAll($fields, $conditions = true) { return $db->update($this, $fields, null, $conditions); } -/** - * @deprecated - * @link http://book.cakephp.org/view/691/remove - */ - function remove($id = null, $cascade = true) { - trigger_error(__('Deprecated method, use Model::delete instead', true), E_USER_WARNING); - return $this->delete($id, $cascade); - } - /** * Removes record for given ID. If no ID is given, the current ID is used. Returns true on success. * @@ -1873,14 +1813,6 @@ function delete($id = null, $cascade = true) { return false; } -/** - * @deprecated - */ - function del($id = null, $cascade = true) { - trigger_error(__('Deprecated method, use Model::delete instead', true), E_USER_WARNING); - return $this->delete($id, $cascade); - } - /** * Cascades model deletes through associated hasMany and hasOne child records. * @@ -2730,18 +2662,6 @@ function isForeignKey($field) { return in_array($field, $foreignKeys); } -/** - * Returns the display field for this model. - * - * @return string The name of the display field for this Model (i.e. 'name', 'title'). - * @access public - * @deprecated - */ - function getDisplayField() { - trigger_error(__('Deprecated method, use Model::$displayField instead', true), E_USER_WARNING); - return $this->displayField; - } - /** * Escapes the field name and prepends the model name. Escaping is done according to the current database driver's rules. * From 2e46504d056fe4e50b3e08015e09cf4ea47f9810 Mon Sep 17 00:00:00 2001 From: Phally <info@frankdegraaf.net> Date: Thu, 21 Jan 2010 23:07:42 +0100 Subject: [PATCH 1565/2083] Fixed failing test case due to changes in 1.3. --- cake/tests/cases/libs/controller/components/email.test.php | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 cake/tests/cases/libs/controller/components/email.test.php diff --git a/cake/tests/cases/libs/controller/components/email.test.php b/cake/tests/cases/libs/controller/components/email.test.php old mode 100644 new mode 100755 index 8124c642d..5219b2fe3 --- a/cake/tests/cases/libs/controller/components/email.test.php +++ b/cake/tests/cases/libs/controller/components/email.test.php @@ -584,6 +584,7 @@ function testMessageRetrievalWithTemplate() { )); $this->Controller->set('value', 22091985); + $this->Controller->set('title_for_layout', 'EmailTest'); $this->Controller->EmailTest->to = 'postmaster@localhost'; $this->Controller->EmailTest->from = 'noreply@example.com'; From 5d35fd8d38b0b3a89b1f72d9e069b82e11e0acb4 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 22 Jan 2010 10:30:22 -0500 Subject: [PATCH 1566/2083] Fixing issues in DboSource::defaultConditions() and DboSource::conditions() where doubly deleting a record from the beforeDelete and delete() could create incorrect conditions that would delete all records in a table. Fixes #250 --- cake/libs/model/datasources/dbo_source.php | 27 ++++++++++++++----- .../model/datasources/dbo_source.test.php | 25 +++++++++++++++++ 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 5de4db2ee..95929a56c 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -1378,6 +1378,7 @@ function update(&$model, $fields = array(), $values = null, $conditions = null) } else { $combined = array_combine($fields, $values); } + $fields = implode(', ', $this->_prepareUpdateFields($model, $combined, empty($conditions))); $alias = $joins = null; @@ -1605,18 +1606,27 @@ function rollback(&$model) { } /** * Creates a default set of conditions from the model if $conditions is null/empty. + * If conditions are supplied then they will be returned. If a model doesn't exist and no conditions + * were provided either null or false will be returned based on what was input. * * @param object $model - * @param mixed $conditions + * @param mixed $conditions Array of conditions, conditions string, null or false. If an array of conditions, + * or string conditions those conditions will be returned. With other values the model's existance will be checked. + * If the model doesn't exist a null or false will be returned depending on the input value. * @param boolean $useAlias Use model aliases rather than table names when generating conditions - * @return mixed + * @return mixed Either null, false, $conditions or an array of default conditions to use. + * @see DboSource::update() + * @see DboSource::conditions() */ function defaultConditions(&$model, $conditions, $useAlias = true) { if (!empty($conditions)) { return $conditions; } - if (!$model->exists()) { + $exists = $model->exists(); + if (!$exists && $conditions !== null) { return false; + } elseif (!$exists) { + return null; } $alias = $model->alias; @@ -1741,9 +1751,11 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) { return array_unique($fields); } /** - * Creates a WHERE clause by parsing given conditions data. + * Creates a WHERE clause by parsing given conditions data. If an array or string + * conditions are provided those conditions will be parsed and quoted. If a boolean + * is given it will be integer cast as condition. Null will return 1 = 1. * - * @param mixed $conditions Array or string of conditions + * @param mixed $conditions Array or string of conditions, or any value. * @param boolean $quoteValues If true, values should be quoted * @param boolean $where If true, "WHERE " will be prepended to the return value * @param Model $model A reference to the Model instance making the query @@ -1764,8 +1776,11 @@ function conditions($conditions, $quoteValues = true, $where = true, $model = nu } return $clause . implode(' AND ', $out); } + if ($conditions === false || $conditions === true) { + return $clause . (int)$conditions . ' = 1'; + } - if (empty($conditions) || trim($conditions) == '' || $conditions === true) { + if (empty($conditions) || trim($conditions) == '') { return $clause . '1 = 1'; } $clauses = '/^WHERE\\x20|^GROUP\\x20BY\\x20|^HAVING\\x20|^ORDER\\x20BY\\x20/i'; diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index 321574ee6..7fe1a5a21 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -2096,6 +2096,30 @@ function testSelectDistict() { $expected = array('DISTINCT `Vendor`.`id`', '`Vendor`.`name`'); $this->assertEqual($result, $expected); } +/** + * test that booleans and null make logical condition strings. + * + * @return void + */ + function testBooleanNullConditionsParsing() { + $result = $this->testDb->conditions(true); + $this->assertEqual($result, ' WHERE 1 = 1', 'true conditions failed %s'); + + $result = $this->testDb->conditions(false); + $this->assertEqual($result, ' WHERE 0 = 1', 'false conditions failed %s'); + + $result = $this->testDb->conditions(null); + $this->assertEqual($result, ' WHERE 1 = 1', 'null conditions failed %s'); + + $result = $this->testDb->conditions(array()); + $this->assertEqual($result, ' WHERE 1 = 1', 'array() conditions failed %s'); + + $result = $this->testDb->conditions(''); + $this->assertEqual($result, ' WHERE 1 = 1', '"" conditions failed %s'); + + $result = $this->testDb->conditions(' ', '" " conditions failed %s'); + $this->assertEqual($result, ' WHERE 1 = 1'); + } /** * testStringConditionsParsing method * @@ -3093,6 +3117,7 @@ function testRenderStatement() { $result = $this->testDb->renderStatement('delete', array('fields' => 'value=2', 'table' => 'table', 'conditions' => 'WHERE 1=1', 'alias' => 'alias', 'joins' => '')); $this->assertPattern('/^\s*DELETE\s+alias\s+FROM\s+table\s+AS\s+alias\s+WHERE\s+1=1\s*$/', $result); } + /** * testStatements method * From ad496cea181323b21526b495bfa513119678ec0f Mon Sep 17 00:00:00 2001 From: Juan Basso <jrbasso@gmail.com> Date: Mon, 11 Jan 2010 18:51:04 -0200 Subject: [PATCH 1567/2083] Optimized Security::cipher(). Fixes #176 Signed-off-by: Mark Story <mark@mark-story.com> --- cake/libs/security.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cake/libs/security.php b/cake/libs/security.php index e9d5c7f94..fe65c7e81 100644 --- a/cake/libs/security.php +++ b/cake/libs/security.php @@ -177,12 +177,14 @@ function cipher($text, $key) { srand(Configure::read('Security.cipherSeed')); $out = ''; - for ($i = 0; $i < strlen($text); $i++) { - for ($j = 0; $j < ord(substr($key, $i % strlen($key), 1)); $j++) { - $toss = rand(0, 255); + $keyLength = strlen($key); + for ($i = 0, $j = strlen($text); $i < $j; $i++) { + $k = ord($key[$i % $keyLength]); + while ($k-- > 0) { + rand(0, 255); } $mask = rand(0, 255); - $out .= chr(ord(substr($text, $i, 1)) ^ $mask); + $out .= chr(ord($text[$i]) ^ $mask); } srand(); From 7e2079be3374f51e15a74fa960172fcfc5cd680f Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 22 Jan 2010 17:27:35 -0500 Subject: [PATCH 1568/2083] Removing use of Object::dispatchMethod() in Dispatcher::_invoke(). This has a miniscule performance increase as well as makes protected methods not prefixed with '_' inaccessible by url. Fixes #21 --- cake/dispatcher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 4dda2be43..7fca22283 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -201,7 +201,7 @@ function _invoke(&$controller, $params) { 'base' => $this->base ))); } - $output = $controller->dispatchMethod($params['action'], $params['pass']); + $output = call_user_func_array(array(&$controller, $params['action']), $params['pass']); if ($controller->autoRender) { $controller->output = $controller->render(); From 1877281cd816b4a2157164f173b3bb3484b98741 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 22 Jan 2010 17:54:28 -0500 Subject: [PATCH 1569/2083] Expanding doc blocks for Cache. --- cake/libs/cache.php | 94 +++++++++++++++++++++++++++++++++------------ 1 file changed, 69 insertions(+), 25 deletions(-) diff --git a/cake/libs/cache.php b/cake/libs/cache.php index 2e27c4ab8..6caa1d523 100644 --- a/cake/libs/cache.php +++ b/cake/libs/cache.php @@ -160,7 +160,7 @@ function _buildEngine($name) { /** * Returns an array containing the currently configured Cache settings. * - * @return array + * @return array Array of configured Cache config names. */ function configured() { $self = Cache::getInstance(); @@ -188,7 +188,7 @@ function drop($name) { /** * Tries to find and include a file for a cache engine and returns object instance * - * @param $name Name of the engine (without 'Engine') + * @param $name Name of the engine (without 'Engine') * @return mixed $engine object or null * @access private */ @@ -212,7 +212,7 @@ function __loadEngine($name, $plugin = null) { * * @param mixed $settings Optional string for simple name-value pair or array * @param string $value Optional for a simple name-value pair - * @return array of settings + * @return array Array of settings. * @access public * @static */ @@ -259,11 +259,23 @@ function gc() { } /** - * Write data for key into cache + * Write data for key into cache. Will automatically use the currently + * active cache configuration. To set the currently active configuration use + * Cache::config() + * + * ### Usage: + * + * Writing to the active cache config: + * + * `Cache::write('cached_data', $data);` + * + * Writing to a specific cache config: + * + * `Cache::write('cached_data', $data, 'long_term');` * * @param string $key Identifier for the data * @param mixed $value Data to be cached - anything except a resource - * @param string $config Optional - string configuration name + * @param string $config Optional string configuration name to write to. * @return boolean True if the data was successfully cached, false on failure * @access public * @static @@ -294,10 +306,22 @@ function write($key, $value, $config = null) { } /** - * Read a key from the cache + * Read a key from the cache. Will automatically use the currently + * active cache configuration. To set the currently active configuration use + * Cache::config() + * + * ### Usage: + * + * Reading from the active cache configuration. + * + * `Cache::read('my_data');` + * + * Reading from a specific cache configuration. + * + * `Cache::read('my_data', 'long_term');` * * @param string $key Identifier for the data - * @param string $config name of the configuration to use + * @param string $config optional name of the configuration to use. * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it * @access public * @static @@ -329,17 +353,19 @@ function read($key, $config = null) { } /** - * Increment a number under the key and return incremented value - * + * Increment a number under the key and return incremented value. + * * @param string $key Identifier for the data * @param integer $offset How much to add - * @param string $config Optional - string configuration name - * @return mixed new value, or false if the data doesn't exist, is not integer, or if there was an error fetching it + * @param string $config Optional string configuration name. If not specified the current + * default config will be used. + * @return mixed new value, or false if the data doesn't exist, is not integer, + * or if there was an error fetching it. * @access public */ function increment($key, $offset = 1, $config = null) { $self =& Cache::getInstance(); - + if (!$config) { $config = $self->__name; } @@ -361,17 +387,19 @@ function increment($key, $offset = 1, $config = null) { return $success; } /** - * Decrement a number under the key and return decremented value - * + * Decrement a number under the key and return decremented value. + * * @param string $key Identifier for the data * @param integer $offset How much to substract - * @param string $config Optional - string configuration name - * @return mixed new value, or false if the data doesn't exist, is not integer, or if there was an error fetching it + * @param string $config Optional string configuration name, if not specified the current + * default config will be used. + * @return mixed new value, or false if the data doesn't exist, is not integer, + * or if there was an error fetching it * @access public */ function decrement($key, $offset = 1, $config = null) { $self =& Cache::getInstance(); - + if (!$config) { $config = $self->__name; } @@ -393,7 +421,19 @@ function decrement($key, $offset = 1, $config = null) { return $success; } /** - * Delete a key from the cache + * Delete a key from the cache. Will automatically use the currently + * active cache configuration. To set the currently active configuration use + * Cache::config() + * + * ### Usage: + * + * Deleting from the active cache configuration. + * + * `Cache::delete('my_data');` + * + * Deleting from a specific cache configuration. + * + * `Cache::delete('my_data', 'long_term');` * * @param string $key Identifier for the data * @param string $config name of the configuration to use @@ -425,7 +465,7 @@ function delete($key, $config = null) { } /** - * Delete all keys from the cache + * Delete all keys from the cache. * * @param boolean $check if true will check expiration, otherwise delete all * @param string $config name of the configuration to use @@ -457,7 +497,7 @@ function clear($check = false, $config = null) { * * @param string $engine Name of the engine * @param string $config Name of the configuration setting - * @return bool + * @return bool Whether or not the config name has been initialized. * @access public * @static */ @@ -504,7 +544,7 @@ function settings($name = null) { class CacheEngine { /** - * settings of current engine instance + * Settings of current engine instance * * @var int * @access public @@ -521,7 +561,11 @@ class CacheEngine { * @access public */ function init($settings = array()) { - $this->settings = array_merge(array('prefix' => 'cake_', 'duration'=> 3600, 'probability'=> 100), $this->settings, $settings); + $this->settings = array_merge( + array('prefix' => 'cake_', 'duration'=> 3600, 'probability'=> 100), + $this->settings, + $settings + ); if (!is_numeric($this->settings['duration'])) { $this->settings['duration'] = strtotime($this->settings['duration']) - time(); } @@ -564,7 +608,7 @@ function read($key) { /** * Increment a number under the key and return incremented value - * + * * @param string $key Identifier for the data * @param integer $offset How much to add * @return New incremented value, false otherwise @@ -575,7 +619,7 @@ function increment($key, $offset = 1) { } /** * Decrement a number under the key and return decremented value - * + * * @param string $key Identifier for the data * @param integer $value How much to substract * @return New incremented value, false otherwise @@ -615,7 +659,7 @@ function settings() { } /** - * generates a safe key + * Generates a safe key for use with cache engine storage engines. * * @param string $key the key passed over * @return mixed string $key or false From 23a62b488b5b9683d9247c77f2b4ba7a83deddbc Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 22 Jan 2010 18:11:49 -0500 Subject: [PATCH 1570/2083] Updating and expanding documentation blocks in Dispatcher and CakeLog. --- cake/dispatcher.php | 3 ++- cake/libs/cake_log.php | 58 ++++++++++++++++++++++++++++++++++++------ 2 files changed, 52 insertions(+), 9 deletions(-) diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 7fca22283..0ad27a5cd 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -368,7 +368,8 @@ function baseUrl() { * Restructure params in case we're serving a plugin. * * @param array $params Array on where to re-set 'controller', 'action', and 'pass' indexes - * @param boolean $reverse + * @param boolean $reverse If true all the params are shifted one forward, so plugin becomes + * controller, controller becomes action etc. If false, plugin is made equal to controller * @return array Restructured array * @access protected */ diff --git a/cake/libs/cake_log.php b/cake/libs/cake_log.php index 610624fd5..2f13f4a59 100644 --- a/cake/libs/cake_log.php +++ b/cake/libs/cake_log.php @@ -38,7 +38,9 @@ } /** - * Logs messages to text files + * Logs messages to configured Log adapters. One or more adapters can be configured + * using CakeLogs's methods. If you don't configure any adapters, and write to the logs + * a default FileLog will be autoconfigured for you. * * @package cake * @subpackage cake.cake.libs @@ -70,7 +72,24 @@ function &getInstance() { /** * Configure and add a new logging stream to CakeLog - * You can use add loggers from app/libs use app.loggername, or any plugin/libs using plugin.loggername + * You can use add loggers from app/libs use app.loggername, or any plugin/libs using plugin.loggername. + * + * ### Usage: + * + * {{{ + * CakeLog::config('second_file', array( + * 'engine' => 'FileLog', + * 'path' => '/var/logs/my_app/' + * )); + * }}} + * + * Will configure a FileLog instance to use the specified path. All options that are not `engine` + * are passed onto the logging adapter, and handled there. Any class can be configured as a logging + * adapter as long as it implements a `write` method with the following signature. + * + * `write($type, $message)` + * + * For an explaination of these parameters, see CakeLog::write() * * @param string $key The keyname for this logger, used to revmoe the logger later. * @param array $config Array of configuration information for the logger @@ -96,7 +115,8 @@ function config($key, $config) { * Attempts to import a logger class from the various paths it could be on. * Checks that the logger class implements a write method as well. * - * @return mixed boolean false on any failures, string of classname to use if search was successful.\ + * @param string $loggerName the plugin.className of the logger class you want to build. + * @return mixed boolean false on any failures, string of classname to use if search was successful. * @access protected */ function _getLogger($loggerName) { @@ -126,7 +146,8 @@ function _getLogger($loggerName) { /** * Returns the keynames of the currently active streams * - * @return array + * @return array Array of configured log streams. + * @access public * @static */ function configured() { @@ -138,8 +159,9 @@ function configured() { * Removes a stream from the active streams. Once a stream has been removed * it will no longer have messages sent to it. * - * @param string $keyname Key name of callable to remove. + * @param string $keyname Key name of a configured stream to remove. * @return void + * @access public * @static */ function drop($streamName) { @@ -161,10 +183,27 @@ function _autoConfig() { } /** - * Writes given message to a log file in the logs directory. + * Writes the given message and type to all of the configured log adapters. + * Configured adapters are passed both the $type and $message variables. $type + * is one of the following strings/values. + * + * ### Types: + * + * - `LOG_WARNING` => 'warning', + * - `LOG_NOTICE` => 'notice', + * - `LOG_INFO` => 'info', + * - `LOG_DEBUG` => 'debug', + * - `LOG_ERR` => 'error', + * - `LOG_ERROR` => 'error' * - * @param string $type Type of log, becomes part of the log's filename - * @param string $message Message to log + * ### Usage: + * + * Write a message to the 'warning' log: + * + * `CakeLog::write('warning', 'Stuff is broken here');` + * + * @param string $type Type of message being written + * @param string $message Message content to log * @return boolean Success * @access public * @static @@ -202,6 +241,9 @@ function write($type, $message) { /** * An error_handler that will log errors to file using CakeLog::write(); + * You can control how verbose and what type of errors this error_handler will + * catch using `Configure::write('log', $value)`. See core.php for more information. + * * * @param integer $code Code of error * @param string $description Error description From c2d19c2011d39867a34c3ffc45bd8090f36288fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Sat, 23 Jan 2010 22:33:53 -0430 Subject: [PATCH 1571/2083] Various Optimizations, thanks jrbasso. Closes #232 --- cake/libs/configure.php | 42 +++++++++++++++++--------- cake/libs/folder.php | 33 +++++++++----------- cake/libs/model/connection_manager.php | 2 +- 3 files changed, 44 insertions(+), 33 deletions(-) diff --git a/cake/libs/configure.php b/cake/libs/configure.php index a810b99ad..873a084b6 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -696,12 +696,12 @@ function build($paths = array(), $reset = false) { $_this->{$type} = $default; if (!empty($paths[$type])) { - $path = array_flip(array_flip((array_merge( + $path = array_flip(array_flip(array_merge( $_this->{$type}, (array)$paths[$type], $merge - )))); + ))); $_this->{$type} = array_values($path); } else { - $path = array_flip(array_flip((array_merge($_this->{$type}, $merge)))); + $path = array_flip(array_flip(array_merge($_this->{$type}, $merge))); $_this->{$type} = array_values($path); } } @@ -734,13 +734,16 @@ function pluginPath($plugin) { * @access public */ function core($type = null) { - $paths = Cache::read('core_paths', '_cake_core_'); + static $paths = false; + if ($paths === false) { + $paths = Cache::read('core_paths', '_cake_core_'); + } if (!$paths) { $paths = array(); $openBasedir = ini_get('open_basedir'); if ($openBasedir) { $all = explode(PATH_SEPARATOR, $openBasedir); - $all = array_flip(array_flip((array_merge(array(CAKE_CORE_INCLUDE_PATH), $all)))); + $all = array_flip(array_flip(array_merge(array(CAKE_CORE_INCLUDE_PATH), $all))); } else { $all = explode(PATH_SEPARATOR, ini_get('include_path')); $all = array_flip(array_flip((array_merge(array(CAKE_CORE_INCLUDE_PATH), $all)))); @@ -925,8 +928,7 @@ function import($type = null, $name = null, $parent = true, $search = array(), $ $_this->__overload($type, $name . $ext['class'], $parent); if ($_this->return) { - $value = include $load; - return $value; + return include($load); } return true; } else { @@ -967,8 +969,7 @@ function import($type = null, $name = null, $parent = true, $search = array(), $ $_this->__overload($type, $name . $ext['class'], $parent); if ($_this->return) { - $value = include $directory . $file; - return $value; + return include($directory . $file); } return true; } @@ -1001,6 +1002,9 @@ function &getInstance() { * @access private */ function __find($file, $recursive = true) { + static $appPath = false; + static $libsPath = false; + if (empty($this->search)) { return null; } elseif (is_string($this->search)) { @@ -1012,9 +1016,13 @@ function __find($file, $recursive = true) { } foreach ($this->search as $path) { + if ($appPath === false) { + $appPath = rtrim(APP, DS); + $libsPath = rtrim(LIBS, DS); + } $path = rtrim($path, DS); - if ($path === rtrim(APP, DS)) { + if ($path === $appPath || $path === $libsPath) { $recursive = false; } if ($recursive === false) { @@ -1029,7 +1037,7 @@ function __find($file, $recursive = true) { require LIBS . 'folder.php'; } $Folder =& new Folder(); - $directories = $Folder->tree($path, array('.svn', 'tests', 'templates'), 'dir'); + $directories = $Folder->tree($path, array('.svn', '.git', 'CVS', 'tests', 'templates'), 'dir'); sort($directories); $this->__paths[$path] = $directories; } @@ -1133,7 +1141,7 @@ function __overload($type, $name, $parent) { */ function __settings($type, $plugin, $parent) { if (!$parent) { - return null; + return array('class' => null, 'suffix' => null, 'path' => null); } if ($plugin) { @@ -1164,6 +1172,11 @@ function __settings($type, $plugin, $parent) { } return array('class' => $type, 'suffix' => null, 'path' => $path); break; + case 'datasource': + if ($plugin) { + $path = $pluginPath . DS . 'models' . DS . 'datasources' . DS; + } + return array('class' => $type, 'suffix' => null, 'path' => $path); case 'controller': App::import($type, 'AppController', false); if ($plugin) { @@ -1226,8 +1239,9 @@ function __paths($type) { if ($type === 'core') { return App::core('libs'); } - if ($paths = App::path($type .'s')) { - return $paths; + + if (isset($this->{$type.'s'})) { + return $this->{$type.'s'}; } return $paths; } diff --git a/cake/libs/folder.php b/cake/libs/folder.php index e1280001d..b36493d1f 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -254,10 +254,7 @@ function _findRecursive($pattern, $sort = false) { * @static */ function isWindowsPath($path) { - if (preg_match('/^[A-Z]:\\\\/i', $path)) { - return true; - } - return false; + return (bool)preg_match('/^[A-Z]:\\\\/i', $path); } /** @@ -269,8 +266,7 @@ function isWindowsPath($path) { * @static */ function isAbsolute($path) { - $match = preg_match('/^\\//', $path) || preg_match('/^[A-Z]:\\\\/i', $path); - return $match; + return !empty($path) && ($path[0] === '/' || preg_match('/^[A-Z]:\\\\/i', $path)); } /** @@ -356,11 +352,7 @@ function inPath($path = '', $reverse = false) { } else { $return = preg_match('/^(.*)' . preg_quote($current, '/') . '(.*)/', $dir); } - if ($return == 1) { - return true; - } else { - return false; - } + return (bool)$return; } /** @@ -427,14 +419,20 @@ function chmod($path, $mode = false, $recursive = true, $exceptions = array()) { function tree($path, $exceptions = true, $type = null) { $original = $this->path; $path = rtrim($path, DS); + if (!$this->cd($path)) { + if ($type === null) { + return array(array(), array()); + } + return array(); + } $this->__files = array(); - $this->__directories = array($path); + $this->__directories = array($this->realpath($path)); $directories = array(); if ($exceptions === false) { $exceptions = true; } - while (count($this->__directories)) { + while (!empty($this->__directories)) { $dir = array_pop($this->__directories); $this->__tree($dir, $exceptions); $directories[] = $dir; @@ -459,11 +457,10 @@ function tree($path, $exceptions = true, $type = null) { * @access private */ function __tree($path, $exceptions) { - if ($this->cd($path)) { - list($dirs, $files) = $this->read(false, $exceptions, true); - $this->__directories = array_merge($this->__directories, $dirs); - $this->__files = array_merge($this->__files, $files); - } + $this->path = $path; + list($dirs, $files) = $this->read(false, $exceptions, true); + $this->__directories = array_merge($this->__directories, $dirs); + $this->__files = array_merge($this->__files, $files); } /** diff --git a/cake/libs/model/connection_manager.php b/cake/libs/model/connection_manager.php index a6be6e12e..0a5475dc9 100644 --- a/cake/libs/model/connection_manager.php +++ b/cake/libs/model/connection_manager.php @@ -181,7 +181,7 @@ function loadDataSource($connName) { $conn = array_merge(array('plugin' => null, 'classname' => null, 'parent' => null), $conn); $class = "{$conn['plugin']}.{$conn['classname']}"; - if (!App::import('Datasource', $class, false)) { + if (!App::import('Datasource', $class, !is_null($conn['plugin']))) { trigger_error(sprintf(__('ConnectionManager::loadDataSource - Unable to import DataSource class %s', true), $class), E_USER_ERROR); return null; } From 0387907d6de12d4cd11877b336c7a2bcf4fc281f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Sat, 23 Jan 2010 23:09:49 -0430 Subject: [PATCH 1572/2083] Adding Security.cipherSeed generation to bake project task, closes #237 --- cake/console/libs/tasks/project.php | 30 +++++++++++++++++++ .../cases/console/libs/tasks/project.test.php | 18 +++++++++++ 2 files changed, 48 insertions(+) diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php index ec6aaf4ae..2a1be3e18 100644 --- a/cake/console/libs/tasks/project.php +++ b/cake/console/libs/tasks/project.php @@ -90,6 +90,12 @@ function execute($project = null) { $this->err(sprintf(__('Unable to generate random hash for \'Security.salt\', you should change it in %s', true), CONFIGS . 'core.php')); } + if ($this->securityCipherSeed($path) === true ) { + $this->out(__('Random seed created for \'Security.cipherSeed\'', true)); + } else { + $this->err(sprintf(__('Unable to generate random seed for \'Security.cipherSeed\', you should change it in %s', true), CONFIGS . 'core.php')); + } + $corePath = $this->corePath($path); if ($corePath === true ) { $this->out(sprintf(__('CAKE_CORE_INCLUDE_PATH set to %s in webroot/index.php', true), CAKE_CORE_INCLUDE_PATH)); @@ -215,6 +221,30 @@ function securitySalt($path) { return false; } + /** + * Generates and writes 'Security.cipherSeed' + * + * @param string $path Project path + * @return boolean Success + * @access public + */ + function securityCipherSeed($path) { + $File =& new File($path . 'config' . DS . 'core.php'); + $contents = $File->read(); + if (preg_match('/([\\t\\x20]*Configure::write\\(\\\'Security.cipherSeed\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) { + if (!class_exists('Security')) { + require LIBS . 'security.php'; + } + $string = substr(bin2hex(Security::generateAuthKey()), 0, 30); + $result = str_replace($match[0], "\t" . 'Configure::write(\'Security.cipherSeed\', \''.$string.'\');', $contents); + if ($File->write($result)) { + return true; + } + return false; + } + return false; + } + /** * Generates and writes CAKE_CORE_INCLUDE_PATH * diff --git a/cake/tests/cases/console/libs/tasks/project.test.php b/cake/tests/cases/console/libs/tasks/project.test.php index 37096a205..75f3947f3 100644 --- a/cake/tests/cases/console/libs/tasks/project.test.php +++ b/cake/tests/cases/console/libs/tasks/project.test.php @@ -173,6 +173,24 @@ function testSecuritySaltGeneration() { $this->assertNoPattern('/DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi/', $contents, 'Default Salt left behind. %s'); } + /** + * test generation of Security.salt + * + * @return void + * @access public + */ + function testSecurityCipherSeedGeneration() { + $this->_setupTestProject(); + + $path = $this->Task->path . 'bake_test_app' . DS; + $result = $this->Task->securityCipherSeed($path); + $this->assertTrue($result); + + $file =& new File($path . 'config' . DS . 'core.php'); + $contents = $file->read(); + $this->assertNoPattern('/76859309657453542496749683645/', $contents, 'Default Salt left behind. %s'); + } + /** * Test that index.php is generated correctly. * From 3c265283e7a6f9422d2aab1a4112646fe0eb7060 Mon Sep 17 00:00:00 2001 From: Phally <info@frankdegraaf.net> Date: Sun, 24 Jan 2010 23:29:53 +0100 Subject: [PATCH 1573/2083] Added support for Message-ID headers. --- cake/libs/controller/components/email.php | 21 ++++++++++ .../libs/controller/components/email.test.php | 38 +++++++++++++++++++ 2 files changed, 59 insertions(+) mode change 100644 => 100755 cake/libs/controller/components/email.php diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php old mode 100644 new mode 100755 index c3aafa8d0..fa00dc685 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -255,6 +255,17 @@ class EmailComponent extends Object{ */ var $htmlMessage = null; +/** + * Whether to generate a Message-ID header for the + * e-mail. True to generate a Message-ID, False to let + * it be handled by sendmail (or similar) or a string + * to completely override the Message-ID. + * + * @var mixed + * @access public + */ + var $messageId = true; + /** * Temporary store of message header lines * @@ -394,6 +405,7 @@ function reset() { $this->attachments = array(); $this->htmlMessage = null; $this->textMessage = null; + $this->messageId = true; $this->__header = array(); $this->__boundary = null; $this->__message = array(); @@ -540,6 +552,15 @@ function _createHeader() { if ($this->delivery == 'smtp') { $headers['Subject'] = $this->_encode($this->subject); } + + if ($this->messageId !== false) { + if ($this->messageId === true) { + $headers['Message-ID'] = '<' . String::UUID() . '@' . env('HTTP_HOST') . '>'; + } else { + $headers['Message-ID'] = $this->messageId; + } + } + $headers['X-Mailer'] = $this->xMailer; if (!empty($this->headers)) { diff --git a/cake/tests/cases/libs/controller/components/email.test.php b/cake/tests/cases/libs/controller/components/email.test.php index 5219b2fe3..50de4850c 100755 --- a/cake/tests/cases/libs/controller/components/email.test.php +++ b/cake/tests/cases/libs/controller/components/email.test.php @@ -334,6 +334,7 @@ function testSendFormats() { $this->Controller->EmailTest->replyTo = 'noreply@example.com'; $this->Controller->EmailTest->template = null; $this->Controller->EmailTest->delivery = 'debug'; + $this->Controller->EmailTest->messageId = false; $message = <<<MSGBLOC <pre>To: postmaster@localhost @@ -384,6 +385,7 @@ function testTemplates() { $this->Controller->EmailTest->replyTo = 'noreply@example.com'; $this->Controller->EmailTest->delivery = 'debug'; + $this->Controller->EmailTest->messageId = false; $header = <<<HEADBLOC To: postmaster@localhost @@ -803,6 +805,7 @@ function testReset() { $this->Controller->EmailTest->attachments = array('attachment1', 'attachment2'); $this->Controller->EmailTest->textMessage = 'This is the body of the message'; $this->Controller->EmailTest->htmlMessage = 'This is the body of the message'; + $this->Controller->EmailTest->messageId = false; $this->assertFalse($this->Controller->EmailTest->send('Should not work')); @@ -823,6 +826,7 @@ function testReset() { $this->assertNull($this->Controller->EmailTest->smtpError); $this->assertIdentical($this->Controller->EmailTest->attachments, array()); $this->assertNull($this->Controller->EmailTest->textMessage); + $this->assertTrue($this->Controller->EmailTest->messageId); } function testPluginCustomViewClass() { @@ -856,5 +860,39 @@ function testStartup() { $this->assertNull($this->Controller->EmailTest->startup($this->Controller)); } +/** + * testMessageId method + * + * @access public + * @return void + */ + function testMessageId() { + $this->Controller->EmailTest->to = 'postmaster@localhost'; + $this->Controller->EmailTest->from = 'noreply@example.com'; + $this->Controller->EmailTest->subject = 'Cake Debug Test'; + $this->Controller->EmailTest->replyTo = 'noreply@example.com'; + $this->Controller->EmailTest->template = null; + + $this->Controller->EmailTest->delivery = 'debug'; + $this->assertTrue($this->Controller->EmailTest->send('This is the body of the message')); + $result = $this->Controller->Session->read('Message.email.message'); + + $this->assertPattern('/Message-ID: \<[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}@' . env('HTTP_HOST') . '\>\n/', $result); + + $this->Controller->EmailTest->messageId = '<22091985.998877@localhost>'; + + $this->assertTrue($this->Controller->EmailTest->send('This is the body of the message')); + $result = $this->Controller->Session->read('Message.email.message'); + + $this->assertPattern('/Message-ID: <22091985.998877@localhost>\n/', $result); + + $this->Controller->EmailTest->messageId = false; + + $this->assertTrue($this->Controller->EmailTest->send('This is the body of the message')); + $result = $this->Controller->Session->read('Message.email.message'); + + $this->assertNoPattern('/Message-ID:/', $result); + } + } ?> \ No newline at end of file From 03200440ed91d5a0c1cac1b0ff4ada8335163ff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Sun, 24 Jan 2010 18:27:08 -0430 Subject: [PATCH 1574/2083] Fixing TranslateBehavior and $tablePrefix. Closes #168 --- cake/libs/model/behaviors/translate.php | 6 +- .../libs/model/behaviors/translate.test.php | 24 ++++- cake/tests/cases/libs/model/models.php | 65 ++++++++++++++ .../translate_with_prefix_fixture.php | 89 +++++++++++++++++++ 4 files changed, 182 insertions(+), 2 deletions(-) create mode 100644 cake/tests/fixtures/translate_with_prefix_fixture.php diff --git a/cake/libs/model/behaviors/translate.php b/cake/libs/model/behaviors/translate.php index 64011295b..24659ef38 100644 --- a/cake/libs/model/behaviors/translate.php +++ b/cake/libs/model/behaviors/translate.php @@ -93,8 +93,12 @@ function beforeFind(&$model, $query) { return $query; } $db =& ConnectionManager::getDataSource($model->useDbConfig); - $tablePrefix = $db->config['prefix']; $RuntimeModel =& $this->translateModel($model); + if (!empty($RuntimeModel->tablePrefix)) { + $tablePrefix = $RuntimeModel->tablePrefix; + } else { + $tablePrefix = $db->config['prefix']; + } if (is_string($query['fields']) && 'COUNT(*) AS '.$db->name('count') == $query['fields']) { $query['fields'] = 'COUNT(DISTINCT('.$db->name($model->alias . '.' . $model->primaryKey) . ')) ' . $db->alias . 'count'; diff --git a/cake/tests/cases/libs/model/behaviors/translate.test.php b/cake/tests/cases/libs/model/behaviors/translate.test.php index 3914dec46..55e13d8af 100644 --- a/cake/tests/cases/libs/model/behaviors/translate.test.php +++ b/cake/tests/cases/libs/model/behaviors/translate.test.php @@ -52,7 +52,8 @@ class TranslateBehaviorTest extends CakeTestCase { */ var $fixtures = array( 'core.translated_item', 'core.translate', 'core.translate_table', - 'core.translated_article', 'core.translate_article', 'core.user', 'core.comment', 'core.tag', 'core.articles_tag' + 'core.translated_article', 'core.translate_article', 'core.user', 'core.comment', 'core.tag', 'core.articles_tag', + 'core.translate_with_prefix' ); /** * endTest method @@ -835,5 +836,26 @@ function testTranslateWithAssociations() { ); $this->assertEqual($result, $expected); } +/** + * testTranslateTableWithPrefix method + * Tests that is possible to have a translation model with a custom tablePrefix + * + * @access public + * @return void + */ + function testTranslateTableWithPrefix() { + $this->loadFixtures('TranslateWithPrefix', 'TranslatedItem'); + $TestModel =& new TranslatedItem2; + $TestModel->locale = 'eng'; + $result = $TestModel->read(null, 1); + $expected = array('TranslatedItem' => array( + 'id' => 1, + 'slug' => 'first_translated', + 'locale' => 'eng', + 'content' => 'Content #1', + 'title' => 'Title #1' + )); + $this->assertEqual($result, $expected); + } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/model/models.php b/cake/tests/cases/libs/model/models.php index 27829184f..b86779ddb 100644 --- a/cake/tests/cases/libs/model/models.php +++ b/cake/tests/cases/libs/model/models.php @@ -2790,6 +2790,35 @@ class TranslateTestModel extends CakeTestModel { */ var $displayField = 'field'; } +/** + * TranslateTestModel class. + * + * @package cake + * @subpackage cake.tests.cases.libs.model + */ +class TranslateWithPrefix extends CakeTestModel { +/** + * name property + * + * @var string 'TranslateTestModel' + * @access public + */ + var $name = 'TranslateWithPrefix'; +/** + * tablePrefix property + * + * @var string 'i18n' + * @access public + */ + var $tablePrefix = 'i18n_'; +/** + * displayField property + * + * @var string 'field' + * @access public + */ + var $displayField = 'field'; +} /** * TranslatedItem class. * @@ -2826,6 +2855,42 @@ class TranslatedItem extends CakeTestModel { */ var $translateModel = 'TranslateTestModel'; } +/** + * TranslatedItem class. + * + * @package cake + * @subpackage cake.tests.cases.libs.model + */ +class TranslatedItem2 extends CakeTestModel { +/** + * name property + * + * @var string 'TranslatedItem' + * @access public + */ + var $name = 'TranslatedItem'; +/** + * cacheQueries property + * + * @var bool false + * @access public + */ + var $cacheQueries = false; +/** + * actsAs property + * + * @var array + * @access public + */ + var $actsAs = array('Translate' => array('content', 'title')); +/** + * translateModel property + * + * @var string 'TranslateTestModel' + * @access public + */ + var $translateModel = 'TranslateWithPrefix'; +} /** * TranslatedItemWithTable class. * diff --git a/cake/tests/fixtures/translate_with_prefix_fixture.php b/cake/tests/fixtures/translate_with_prefix_fixture.php new file mode 100644 index 000000000..f8e3fc44a --- /dev/null +++ b/cake/tests/fixtures/translate_with_prefix_fixture.php @@ -0,0 +1,89 @@ +<?php +/* SVN FILE: $Id$ */ +/** + * Short description for file. + * + * Long description for file + * + * PHP versions 4 and 5 + * + * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests + * @package cake + * @subpackage cake.tests.fixtures + * @since CakePHP(tm) v 1.2.0.5669 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ +/** + * Short description for class. + * + * @package cake + * @subpackage cake.tests.fixtures + */ +class TranslateWithPrefixFixture extends CakeTestFixture { +/** + * name property + * + * @var string 'Translate' + * @access public + */ + var $name = 'TranslateWithPrefix'; +/** + * table property + * + * @var string 'i18n' + * @access public + */ + var $table = 'i18n_translate_with_prefixes'; +/** + * fields property + * + * @var array + * @access public + */ + var $fields = array( + 'id' => array('type' => 'integer', 'key' => 'primary'), + 'locale' => array('type' => 'string', 'length' => 6, 'null' => false), + 'model' => array('type' => 'string', 'null' => false), + 'foreign_key' => array('type' => 'integer', 'null' => false), + 'field' => array('type' => 'string', 'null' => false), + 'content' => array('type' => 'text') + ); +/** + * records property + * + * @var array + * @access public + */ + var $records = array( + array('id' => 1, 'locale' => 'eng', 'model' => 'TranslatedItem', 'foreign_key' => 1, 'field' => 'title', 'content' => 'Title #1'), + array('id' => 2, 'locale' => 'eng', 'model' => 'TranslatedItem', 'foreign_key' => 1, 'field' => 'content', 'content' => 'Content #1'), + array('id' => 3, 'locale' => 'deu', 'model' => 'TranslatedItem', 'foreign_key' => 1, 'field' => 'title', 'content' => 'Titel #1'), + array('id' => 4, 'locale' => 'deu', 'model' => 'TranslatedItem', 'foreign_key' => 1, 'field' => 'content', 'content' => 'Inhalt #1'), + array('id' => 5, 'locale' => 'cze', 'model' => 'TranslatedItem', 'foreign_key' => 1, 'field' => 'title', 'content' => 'Titulek #1'), + array('id' => 6, 'locale' => 'cze', 'model' => 'TranslatedItem', 'foreign_key' => 1, 'field' => 'content', 'content' => 'Obsah #1'), + array('id' => 7, 'locale' => 'eng', 'model' => 'TranslatedItem', 'foreign_key' => 2, 'field' => 'title', 'content' => 'Title #2'), + array('id' => 8, 'locale' => 'eng', 'model' => 'TranslatedItem', 'foreign_key' => 2, 'field' => 'content', 'content' => 'Content #2'), + array('id' => 9, 'locale' => 'deu', 'model' => 'TranslatedItem', 'foreign_key' => 2, 'field' => 'title', 'content' => 'Titel #2'), + array('id' => 10, 'locale' => 'deu', 'model' => 'TranslatedItem', 'foreign_key' => 2, 'field' => 'content', 'content' => 'Inhalt #2'), + array('id' => 11, 'locale' => 'cze', 'model' => 'TranslatedItem', 'foreign_key' => 2, 'field' => 'title', 'content' => 'Titulek #2'), + array('id' => 12, 'locale' => 'cze', 'model' => 'TranslatedItem', 'foreign_key' => 2, 'field' => 'content', 'content' => 'Obsah #2'), + array('id' => 13, 'locale' => 'eng', 'model' => 'TranslatedItem', 'foreign_key' => 3, 'field' => 'title', 'content' => 'Title #3'), + array('id' => 14, 'locale' => 'eng', 'model' => 'TranslatedItem', 'foreign_key' => 3, 'field' => 'content', 'content' => 'Content #3'), + array('id' => 15, 'locale' => 'deu', 'model' => 'TranslatedItem', 'foreign_key' => 3, 'field' => 'title', 'content' => 'Titel #3'), + array('id' => 16, 'locale' => 'deu', 'model' => 'TranslatedItem', 'foreign_key' => 3, 'field' => 'content', 'content' => 'Inhalt #3'), + array('id' => 17, 'locale' => 'cze', 'model' => 'TranslatedItem', 'foreign_key' => 3, 'field' => 'title', 'content' => 'Titulek #3'), + array('id' => 18, 'locale' => 'cze', 'model' => 'TranslatedItem', 'foreign_key' => 3, 'field' => 'content', 'content' => 'Obsah #3') + ); +} +?> \ No newline at end of file From 9c24c72db3032f0bf9482f6f4e749461a42d5b39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Mon, 25 Jan 2010 09:05:22 -0430 Subject: [PATCH 1575/2083] Fixing regression introduced in commit c2d19c2011d39867a34c3ffc45bd8090f36288fd, closes #258 --- cake/libs/configure.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 873a084b6..ec9bd091a 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -1003,7 +1003,6 @@ function &getInstance() { */ function __find($file, $recursive = true) { static $appPath = false; - static $libsPath = false; if (empty($this->search)) { return null; @@ -1018,11 +1017,10 @@ function __find($file, $recursive = true) { foreach ($this->search as $path) { if ($appPath === false) { $appPath = rtrim(APP, DS); - $libsPath = rtrim(LIBS, DS); } $path = rtrim($path, DS); - if ($path === $appPath || $path === $libsPath) { + if ($path === $appPath) { $recursive = false; } if ($recursive === false) { From ddf938c7728b79e6ff88ad0c5f18cea9789f02cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Mon, 25 Jan 2010 10:37:58 -0430 Subject: [PATCH 1576/2083] Correcting error message in test --- cake/tests/cases/console/libs/tasks/project.test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/cases/console/libs/tasks/project.test.php b/cake/tests/cases/console/libs/tasks/project.test.php index 75f3947f3..0378567d9 100644 --- a/cake/tests/cases/console/libs/tasks/project.test.php +++ b/cake/tests/cases/console/libs/tasks/project.test.php @@ -188,7 +188,7 @@ function testSecurityCipherSeedGeneration() { $file =& new File($path . 'config' . DS . 'core.php'); $contents = $file->read(); - $this->assertNoPattern('/76859309657453542496749683645/', $contents, 'Default Salt left behind. %s'); + $this->assertNoPattern('/76859309657453542496749683645/', $contents, 'Default CipherSeed left behind. %s'); } /** From b33fdba6d9808703c008a40bf889298a633b7cdd Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 25 Jan 2010 09:42:17 -0500 Subject: [PATCH 1577/2083] Updating doc blocks on Folder class and implementing a few small refactors to make code simpler. --- cake/libs/folder.php | 89 +++++++++++++++++++++----------------- cake/libs/log/file_log.php | 3 +- 2 files changed, 52 insertions(+), 40 deletions(-) diff --git a/cake/libs/folder.php b/cake/libs/folder.php index e1280001d..f8ea1ba0d 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -28,8 +28,7 @@ /** * Folder structure browser, lists folders and files. - * - * Long description for class + * Provides an Object interface for Common directory related tasks. * * @package cake * @subpackage cake.cake.libs @@ -45,7 +44,8 @@ class Folder extends Object { var $path = null; /** - * Sortedness. + * Sortedness. Whether or not list results + * should be sorted by name. * * @var boolean * @access public @@ -53,15 +53,15 @@ class Folder extends Object { var $sort = false; /** - * mode to be used on create. + * Mode to be used on create. Does nothing on windows platforms. * - * @var boolean + * @var integer * @access public */ var $mode = 0755; /** - * holds messages from last method. + * Holds messages from last method. * * @var array * @access private @@ -69,7 +69,7 @@ class Folder extends Object { var $__messages = array(); /** - * holds errors from last method. + * Holds errors from last method. * * @var array * @access private @@ -77,7 +77,7 @@ class Folder extends Object { var $__errors = false; /** - * holds array of complete directory paths. + * Holds array of complete directory paths. * * @var array * @access private @@ -85,7 +85,7 @@ class Folder extends Object { var $__directories; /** - * holds array of complete file paths. + * Holds array of complete file paths. * * @var array * @access private @@ -148,7 +148,8 @@ function cd($path) { * Returns an array of the contents of the current directory. * The returned array holds two arrays: One of directories and one of files. * - * @param boolean $sort + * @param boolean $sort Whether you want the results sorted, set this and the sort property + * to false to get unsorted results. * @param mixed $exceptions Either an array or boolean true will not grab dot files * @param boolean $fullPath True returns the full path * @return mixed Contents of current directory as an array, an empty array on failure @@ -195,6 +196,7 @@ function read($sort = true, $exceptions = false, $fullPath = false) { * Returns an array of all matching files in current directory. * * @param string $pattern Preg_match pattern (Defaults to: .*) + * @param boolean $sort Whether results should be sorted. * @return array Files that match given pattern * @access public */ @@ -207,6 +209,7 @@ function find($regexpPattern = '.*', $sort = false) { * Returns an array of all matching files in and below current directory. * * @param string $pattern Preg_match pattern (Defaults to: .*) + * @param boolean $sort Whether results should be sorted. * @return array Files matching $pattern * @access public */ @@ -224,6 +227,7 @@ function findRecursive($pattern = '.*', $sort = false) { * Private helper function for findRecursive. * * @param string $pattern Pattern to match against + * @param boolean $sort Whether results should be sorted. * @return array Files matching pattern * @access private */ @@ -254,23 +258,19 @@ function _findRecursive($pattern, $sort = false) { * @static */ function isWindowsPath($path) { - if (preg_match('/^[A-Z]:\\\\/i', $path)) { - return true; - } - return false; + return (bool) preg_match('/^[A-Z]:\\\\/i', $path); } /** * Returns true if given $path is an absolute path. * * @param string $path Path to check - * @return bool + * @return bool true if path is absolute. * @access public * @static */ function isAbsolute($path) { - $match = preg_match('/^\\//', $path) || preg_match('/^[A-Z]:\\\\/i', $path); - return $match; + return (bool) (preg_match('/^\\//', $path) || preg_match('/^[A-Z]:\\\\/i', $path)); } /** @@ -294,10 +294,7 @@ function normalizePath($path) { * @static */ function correctSlashFor($path) { - if (Folder::isWindowsPath($path)) { - return '\\'; - } - return '/'; + return (Folder::isWindowsPath($path)) ? '\\' : '/'; } /** @@ -331,6 +328,7 @@ function addPathElement($path, $element) { /** * Returns true if the File is in a given CakePath. * + * @param string $path The path to check. * @return bool * @access public */ @@ -344,6 +342,8 @@ function inCakePath($path = '') { /** * Returns true if the File is in given path. * + * @param string $path The path to check that the current pwd() resides with in. + * @param boolean $reverse * @return bool * @access public */ @@ -356,11 +356,7 @@ function inPath($path = '', $reverse = false) { } else { $return = preg_match('/^(.*)' . preg_quote($current, '/') . '(.*)/', $dir); } - if ($return == 1) { - return true; - } else { - return false; - } + return (bool) $return; } /** @@ -368,7 +364,7 @@ function inPath($path = '', $reverse = false) { * * @param string $path The path to chmod * @param integer $mode octal value 0755 - * @param boolean $recursive chmod recursively + * @param boolean $recursive chmod recursively, set to false to only change the current directory. * @param array $exceptions array of files, directories to skip * @return boolean Returns TRUE on success, FALSE on failure * @access public @@ -419,7 +415,7 @@ function chmod($path, $mode = false, $recursive = true, $exceptions = array()) { * Returns an array of nested directories and files in each directory * * @param string $path the directory path to build the tree from - * @param boolean $hidden return hidden files and directories + * @param mixed $exceptions Array of files to exclude, defaults to excluding hidden files. * @param string $type either file or dir. null returns both files and directories * @return mixed array of nested directories and files in each directory * @access public @@ -431,8 +427,8 @@ function tree($path, $exceptions = true, $type = null) { $this->__directories = array($path); $directories = array(); - if ($exceptions === false) { - $exceptions = true; + if ($hidden === false) { + $hidden = true; } while (count($this->__directories)) { $dir = array_pop($this->__directories); @@ -454,20 +450,21 @@ function tree($path, $exceptions = true, $type = null) { /** * Private method to list directories and files in each directory * - * @param string $path - * @param = boolean $hidden + * @param string $path The Path to read. + * @param mixed $hidden Array of files to exclude from the read that will be performed. * @access private */ - function __tree($path, $exceptions) { + function __tree($path, $hidden) { if ($this->cd($path)) { - list($dirs, $files) = $this->read(false, $exceptions, true); + list($dirs, $files) = $this->read(false, $hidden, true); $this->__directories = array_merge($this->__directories, $dirs); $this->__files = array_merge($this->__files, $files); } } /** - * Create a directory structure recursively. + * Create a directory structure recursively. Can be used to create + * deep path structures like `/foo/bar/baz/shoe/horn` * * @param string $pathname The directory structure to create * @param integer $mode octal value 0755 @@ -507,7 +504,7 @@ function create($pathname, $mode = false) { } /** - * Returns the size in bytes of this Folder. + * Returns the size in bytes of this Folder and its contents. * * @param string $directory Path to directory * @return int size in bytes of current folder @@ -544,7 +541,7 @@ function dirsize() { } /** - * Recursively Remove directories if system allow. + * Recursively Remove directories if the system allows. * * @param string $path Path of directory to delete * @return boolean Success @@ -596,8 +593,15 @@ function delete($path = null) { /** * Recursive directory copy. * - * @param array $options (to, from, chmod, skip) - * @return bool + * ### Options + * + * - `to` The directory to copy to. + * - `from` The directory to copy from, this will cause a cd() to occur, changing the results of pwd(). + * - `chmod` The mode to copy the files/directories with. + * - `skip` Files/directories to skip. + * + * @param mixed $options Either an array of options (see above) or a string of the destination directory. + * @return bool Success * @access public */ function copy($options = array()) { @@ -675,6 +679,13 @@ function copy($options = array()) { /** * Recursive directory move. * + * ### Options + * + * - `to` The directory to copy to. + * - `from` The directory to copy from, this will cause a cd() to occur, changing the results of pwd(). + * - `chmod` The mode to copy the files/directories with. + * - `skip` Files/directories to skip. + * * @param array $options (to, from, chmod, skip) * @return boolean Success * @access public diff --git a/cake/libs/log/file_log.php b/cake/libs/log/file_log.php index 3702d882a..b5d2bec1c 100644 --- a/cake/libs/log/file_log.php +++ b/cake/libs/log/file_log.php @@ -21,7 +21,8 @@ require LIBS . 'file.php'; } /** - * File Storage stream for Logging + * File Storage stream for Logging. Writes logs to different files + * based on the type of log it is. * * @package cake * @subpackage cake.cake.libs.log From 7459da2affccf9d48052ef41ffc808d8e07f33b1 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 25 Jan 2010 11:01:05 -0500 Subject: [PATCH 1578/2083] Updating doc blocks for HttpSocket and File. --- cake/libs/file.php | 22 +++--- cake/libs/http_socket.php | 142 +++++++++++++++++++++++++++----------- 2 files changed, 115 insertions(+), 49 deletions(-) diff --git a/cake/libs/file.php b/cake/libs/file.php index fd74949fc..6dd735538 100644 --- a/cake/libs/file.php +++ b/cake/libs/file.php @@ -171,7 +171,7 @@ function open($mode = 'r', $force = false) { * Return the contents of this File as a string. * * @param string $bytes where to start - * @param string $mode + * @param string $mode A `fread` compatible mode. * @param boolean $force If true then the file will be re-opened even if its already opened, otherwise it won't * @return mixed string on success, false on failure * @access public @@ -225,11 +225,12 @@ function offset($offset = false, $seek = SEEK_SET) { } /** - * Prepares a ascii string for writing - * fixes line endings + * Prepares a ascii string for writing. Converts line endings to the + * correct terminator for the current platform. If windows "\r\n" will be used + * all other platforms will use "\n" * * @param string $data Data to prepare for writing. - * @return string + * @return string The with converted line endings. * @access public */ function prepare($data, $forceWindows = false) { @@ -243,9 +244,9 @@ function prepare($data, $forceWindows = false) { /** * Write given data to this File. * - * @param string $data Data to write to this File. - * @param string $mode Mode of writing. {@link http://php.net/fwrite See fwrite()}. - * @param string $force force the file to open + * @param string $data Data to write to this File. + * @param string $mode Mode of writing. {@link http://php.net/fwrite See fwrite()}. + * @param string $force force the file to open * @return boolean Success * @access public */ @@ -272,7 +273,7 @@ function write($data, $mode = 'w', $force = false) { * Append given data string to this File. * * @param string $data Data to write - * @param string $force force the file to open + * @param string $force force the file to open * @return boolean Success * @access public */ @@ -360,7 +361,8 @@ function name() { /** * makes filename safe for saving * - * @param string $name the name of the file to make safe if different from $this->name + * @param string $name The name of the file to make safe if different from $this->name + * @param strin $ext The name of the extension to make safe if different from $this->ext * @return string $ext the extension of the file * @access public */ @@ -487,7 +489,7 @@ function owner() { } /** - * Returns the File group. + * Returns the File's group. * * @return integer the Filegroup * @access public diff --git a/cake/libs/http_socket.php b/cake/libs/http_socket.php index e7702957c..60b675650 100644 --- a/cake/libs/http_socket.php +++ b/cake/libs/http_socket.php @@ -22,7 +22,8 @@ /** * Cake network socket connection class. * - * Core base class for HTTP network communication. + * Core base class for HTTP network communication. HttpSocket can be used as an + * Object Oriented replacement for cURL in many places. * * @package cake * @subpackage cake.cake.libs @@ -112,10 +113,10 @@ class HttpSocket extends CakeSocket { */ var $config = array( 'persistent' => false, - 'host' => 'localhost', - 'protocol' => 'tcp', - 'port' => 80, - 'timeout' => 30, + 'host' => 'localhost', + 'protocol' => 'tcp', + 'port' => 80, + 'timeout' => 30, 'request' => array( 'uri' => array( 'scheme' => 'http', @@ -142,7 +143,24 @@ class HttpSocket extends CakeSocket { /** * Build an HTTP Socket using the specified configuration. * - * @param array $config Configuration + * You can use a url string to set the url and use default configurations for + * all other options: + * + * `$http =& new HttpSockect('http://cakephp.org/');` + * + * Or use an array to configure multiple options: + * + * {{{ + * $http =& new HttpSocket(array( + * 'host' => 'cakephp.org', + * 'timeout' => 20 + * )); + * }}} + * + * See HttpSocket::$config for options that can be used. + * + * @param mixed $config Configuration information, either a string url or an array of options. + * @access public */ function __construct($config = array()) { if (is_string($config)) { @@ -158,7 +176,8 @@ function __construct($config = array()) { } /** - * Issue the specified request. + * Issue the specified request. HttpSocket::get() and HttpSocket::post() wrap this + * method and provide a more granular interface. * * @param mixed $request Either an URI string, or an array defining host/uri * @return mixed false on error, request body on success @@ -270,15 +289,30 @@ function request($request = array()) { /** * Issues a GET request to the specified URI, query, and request. * - * @param mixed $uri URI to request (see {@link _parseUri()}) - * @param array $query Query to append to URI + * Using a string uri and an array of query string parameters: + * + * `$response = $http->get('http://google.com/search', array('q' => 'cakephp', 'client' => 'safari'));` + * + * Would do a GET request to `http://google.com/search?q=cakephp&client=safari` + * + * You could express the same thing using a uri array and query string parameters: + * + * {{{ + * $response = $http->get( + * array('host' => 'google.com', 'path' => '/search'), + * array('q' => 'cakephp', 'client' => 'safari') + * ); + * }}} + * + * @param mixed $uri URI to request. Either a string uri, or a uri array, see HttpSocket::_parseUri() + * @param array $query Querystring parameters to append to URI * @param array $request An indexed array with indexes such as 'method' or uri - * @return mixed Result of request + * @return mixed Result of request, either false on failure or the response to the request. * @access public */ function get($uri = null, $query = array(), $request = array()) { if (!empty($query)) { - $uri =$this->_parseUri($uri); + $uri = $this->_parseUri($uri); if (isset($uri['query'])) { $uri['query'] = array_merge($uri['query'], $query); } else { @@ -294,10 +328,19 @@ function get($uri = null, $query = array(), $request = array()) { /** * Issues a POST request to the specified URI, query, and request. * - * @param mixed $uri URI to request (see {@link _parseUri()}) - * @param array $query Query to append to URI + * `post()` can be used to post simple data arrays to a url: + * + * {{{ + * $response = $http->post('http://example.com', array( + * 'username' => 'batman', + * 'password' => 'bruce_w4yne' + * )); + * }}} + * + * @param mixed $uri URI to request. See HttpSocket::_parseUri() + * @param array $data Array of POST data keys and values. * @param array $request An indexed array with indexes such as 'method' or uri - * @return mixed Result of request + * @return mixed Result of request, either false on failure or the response to the request. * @access public */ function post($uri = null, $data = array(), $request = array()) { @@ -308,8 +351,8 @@ function post($uri = null, $data = array(), $request = array()) { /** * Issues a PUT request to the specified URI, query, and request. * - * @param mixed $uri URI to request (see {@link _parseUri()}) - * @param array $query Query to append to URI + * @param mixed $uri URI to request, See HttpSocket::_parseUri() + * @param array $data Array of PUT data keys and values. * @param array $request An indexed array with indexes such as 'method' or uri * @return mixed Result of request * @access public @@ -323,7 +366,7 @@ function put($uri = null, $data = array(), $request = array()) { * Issues a DELETE request to the specified URI, query, and request. * * @param mixed $uri URI to request (see {@link _parseUri()}) - * @param array $query Query to append to URI + * @param array $data Query to append to URI * @param array $request An indexed array with indexes such as 'method' or uri * @return mixed Result of request * @access public @@ -334,11 +377,31 @@ function delete($uri = null, $data = array(), $request = array()) { } /** - * undocumented function + * Normalizes urls into a $uriTemplate. If no template is provided + * a default one will be used. Will generate the url using the + * current config information. + * + * ### Usage: + * + * After configuring part of the request parameters, you can use url() to generate + * urls. + * + * {{{ + * $http->configUri('http://www.cakephp.org'); + * $url = $http->url('/search?q=bar'); + * }}} + * + * Would return `http://www.cakephp.org/search?q=bar` + * + * url() can also be used with custom templates: + * + * `$url = $http->url('http://www.cakephp/search?q=socket', '/%path?%query');` + * + * Would return `/search?q=socket`. * - * @param unknown $url - * @param unknown $uriTemplate - * @return void + * @param mixed $url Either a string or array of url options to create a url with. + * @param string $uriTemplate A template string to use for url formatting. + * @return mixed Either false on failure or a string containing the composed url. * @access public */ function url($url = null, $uriTemplate = null) { @@ -435,9 +498,9 @@ function _parseResponse($message) { * Generic function to decode a $body with a given $encoding. Returns either an array with the keys * 'body' and 'header' or false on failure. * - * @param string $body A string continaing the body to decode - * @param mixed $encoding Can be false in case no encoding is being used, or a string representing the encoding - * @return mixed Array or false + * @param string $body A string continaing the body to decode. + * @param mixed $encoding Can be false in case no encoding is being used, or a string representing the encoding. + * @return mixed Array of response headers and body or false. * @access protected */ function _decodeBody($body, $encoding = 'chunked') { @@ -462,8 +525,8 @@ function _decodeBody($body, $encoding = 'chunked') { * Decodes a chunked message $body and returns either an array with the keys 'body' and 'header' or false as * a result. * - * @param string $body A string continaing the chunked body to decode - * @return mixed Array or false + * @param string $body A string continaing the chunked body to decode. + * @return mixed Array of response headers and body or false. * @access protected */ function _decodeChunkedBody($body) { @@ -524,7 +587,7 @@ function _decodeChunkedBody($body) { /** * Parses and sets the specified URI into current request configuration. * - * @param mixed $uri URI (see {@link _parseUri()}) + * @param mixed $uri URI, See HttpSocket::_parseUri() * @return array Current configuration settings * @access protected */ @@ -557,9 +620,9 @@ function _configUri($uri = null) { /** * Takes a $uri array and turns it into a fully qualified URL string * - * @param array $uri A $uri array, or uses $this->config if left empty - * @param string $uriTemplate The Uri template/format to use - * @return string A fully qualified URL formated according to $uriTemplate + * @param mixed $uri Either A $uri array, or a request string. Will use $this->config if left empty. + * @param string $uriTemplate The Uri template/format to use. + * @return mixed A fully qualified URL formated according to $uriTemplate, or false on failure * @access protected */ function _buildUri($uri = array(), $uriTemplate = '%scheme://%user:%pass@%host:%port/%path?%query#%fragment') { @@ -668,11 +731,12 @@ function _parseUri($uri = null, $base = array()) { * - ?key[subKey]=value * - ?key[]=value1&key[]=value2 * - * A leading '?' mark in $query is optional and does not effect the outcome of this function. For the complete capabilities of this implementation - * take a look at HttpSocketTest::testparseQuery() + * A leading '?' mark in $query is optional and does not effect the outcome of this function. + * For the complete capabilities of this implementation take a look at HttpSocketTest::testparseQuery() * * @param mixed $query A query string to parse into an array or an array to return directly "as is" - * @return array The $query parsed into a possibly multi-level array. If an empty $query is given, an empty array is returned. + * @return array The $query parsed into a possibly multi-level array. If an empty $query is + * given, an empty array is returned. * @access protected */ function _parseQuery($query) { @@ -857,10 +921,10 @@ function _parseHeader($header) { } /** - * undocumented function + * Parses cookies in response headers. * - * @param unknown $header - * @return void + * @param array $header Header array containing one ore more 'Set-Cookie' headers. + * @return mixed Either false on no cookies, or an array of cookies recieved. * @access public * @todo Make this 100% RFC 2965 confirm */ @@ -899,10 +963,10 @@ function parseCookies($header) { } /** - * undocumented function + * Builds cookie headers for a request. * - * @param unknown $cookies - * @return void + * @param array $cookies Array of cookies to send with the request. + * @return string Cookie header string to be sent with the request. * @access public * @todo Refactor token escape mechanism to be configurable */ From 98749a5a2bd533e5c97ff5d885b9bd6c60da4e8a Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 25 Jan 2010 11:14:18 -0500 Subject: [PATCH 1579/2083] Merge branch '1.3' of github.com:cakephp/cakephp1x into 1.3 Conflicts: cake/libs/folder.php --- cake/console/libs/tasks/project.php | 30 ++++++++++++++ cake/libs/configure.php | 40 ++++++++++++------- cake/libs/folder.php | 29 ++++++++------ cake/libs/model/connection_manager.php | 2 +- .../cases/console/libs/tasks/project.test.php | 18 +++++++++ 5 files changed, 92 insertions(+), 27 deletions(-) diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php index ec6aaf4ae..2a1be3e18 100644 --- a/cake/console/libs/tasks/project.php +++ b/cake/console/libs/tasks/project.php @@ -90,6 +90,12 @@ function execute($project = null) { $this->err(sprintf(__('Unable to generate random hash for \'Security.salt\', you should change it in %s', true), CONFIGS . 'core.php')); } + if ($this->securityCipherSeed($path) === true ) { + $this->out(__('Random seed created for \'Security.cipherSeed\'', true)); + } else { + $this->err(sprintf(__('Unable to generate random seed for \'Security.cipherSeed\', you should change it in %s', true), CONFIGS . 'core.php')); + } + $corePath = $this->corePath($path); if ($corePath === true ) { $this->out(sprintf(__('CAKE_CORE_INCLUDE_PATH set to %s in webroot/index.php', true), CAKE_CORE_INCLUDE_PATH)); @@ -215,6 +221,30 @@ function securitySalt($path) { return false; } + /** + * Generates and writes 'Security.cipherSeed' + * + * @param string $path Project path + * @return boolean Success + * @access public + */ + function securityCipherSeed($path) { + $File =& new File($path . 'config' . DS . 'core.php'); + $contents = $File->read(); + if (preg_match('/([\\t\\x20]*Configure::write\\(\\\'Security.cipherSeed\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) { + if (!class_exists('Security')) { + require LIBS . 'security.php'; + } + $string = substr(bin2hex(Security::generateAuthKey()), 0, 30); + $result = str_replace($match[0], "\t" . 'Configure::write(\'Security.cipherSeed\', \''.$string.'\');', $contents); + if ($File->write($result)) { + return true; + } + return false; + } + return false; + } + /** * Generates and writes CAKE_CORE_INCLUDE_PATH * diff --git a/cake/libs/configure.php b/cake/libs/configure.php index a810b99ad..ec9bd091a 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -696,12 +696,12 @@ function build($paths = array(), $reset = false) { $_this->{$type} = $default; if (!empty($paths[$type])) { - $path = array_flip(array_flip((array_merge( + $path = array_flip(array_flip(array_merge( $_this->{$type}, (array)$paths[$type], $merge - )))); + ))); $_this->{$type} = array_values($path); } else { - $path = array_flip(array_flip((array_merge($_this->{$type}, $merge)))); + $path = array_flip(array_flip(array_merge($_this->{$type}, $merge))); $_this->{$type} = array_values($path); } } @@ -734,13 +734,16 @@ function pluginPath($plugin) { * @access public */ function core($type = null) { - $paths = Cache::read('core_paths', '_cake_core_'); + static $paths = false; + if ($paths === false) { + $paths = Cache::read('core_paths', '_cake_core_'); + } if (!$paths) { $paths = array(); $openBasedir = ini_get('open_basedir'); if ($openBasedir) { $all = explode(PATH_SEPARATOR, $openBasedir); - $all = array_flip(array_flip((array_merge(array(CAKE_CORE_INCLUDE_PATH), $all)))); + $all = array_flip(array_flip(array_merge(array(CAKE_CORE_INCLUDE_PATH), $all))); } else { $all = explode(PATH_SEPARATOR, ini_get('include_path')); $all = array_flip(array_flip((array_merge(array(CAKE_CORE_INCLUDE_PATH), $all)))); @@ -925,8 +928,7 @@ function import($type = null, $name = null, $parent = true, $search = array(), $ $_this->__overload($type, $name . $ext['class'], $parent); if ($_this->return) { - $value = include $load; - return $value; + return include($load); } return true; } else { @@ -967,8 +969,7 @@ function import($type = null, $name = null, $parent = true, $search = array(), $ $_this->__overload($type, $name . $ext['class'], $parent); if ($_this->return) { - $value = include $directory . $file; - return $value; + return include($directory . $file); } return true; } @@ -1001,6 +1002,8 @@ function &getInstance() { * @access private */ function __find($file, $recursive = true) { + static $appPath = false; + if (empty($this->search)) { return null; } elseif (is_string($this->search)) { @@ -1012,9 +1015,12 @@ function __find($file, $recursive = true) { } foreach ($this->search as $path) { + if ($appPath === false) { + $appPath = rtrim(APP, DS); + } $path = rtrim($path, DS); - if ($path === rtrim(APP, DS)) { + if ($path === $appPath) { $recursive = false; } if ($recursive === false) { @@ -1029,7 +1035,7 @@ function __find($file, $recursive = true) { require LIBS . 'folder.php'; } $Folder =& new Folder(); - $directories = $Folder->tree($path, array('.svn', 'tests', 'templates'), 'dir'); + $directories = $Folder->tree($path, array('.svn', '.git', 'CVS', 'tests', 'templates'), 'dir'); sort($directories); $this->__paths[$path] = $directories; } @@ -1133,7 +1139,7 @@ function __overload($type, $name, $parent) { */ function __settings($type, $plugin, $parent) { if (!$parent) { - return null; + return array('class' => null, 'suffix' => null, 'path' => null); } if ($plugin) { @@ -1164,6 +1170,11 @@ function __settings($type, $plugin, $parent) { } return array('class' => $type, 'suffix' => null, 'path' => $path); break; + case 'datasource': + if ($plugin) { + $path = $pluginPath . DS . 'models' . DS . 'datasources' . DS; + } + return array('class' => $type, 'suffix' => null, 'path' => $path); case 'controller': App::import($type, 'AppController', false); if ($plugin) { @@ -1226,8 +1237,9 @@ function __paths($type) { if ($type === 'core') { return App::core('libs'); } - if ($paths = App::path($type .'s')) { - return $paths; + + if (isset($this->{$type.'s'})) { + return $this->{$type.'s'}; } return $paths; } diff --git a/cake/libs/folder.php b/cake/libs/folder.php index f8ea1ba0d..aa64bd46d 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -270,7 +270,7 @@ function isWindowsPath($path) { * @static */ function isAbsolute($path) { - return (bool) (preg_match('/^\\//', $path) || preg_match('/^[A-Z]:\\\\/i', $path)); + return !empty($path) && ($path[0] === '/' || preg_match('/^[A-Z]:\\\\/i', $path)); } /** @@ -423,14 +423,20 @@ function chmod($path, $mode = false, $recursive = true, $exceptions = array()) { function tree($path, $exceptions = true, $type = null) { $original = $this->path; $path = rtrim($path, DS); + if (!$this->cd($path)) { + if ($type === null) { + return array(array(), array()); + } + return array(); + } $this->__files = array(); - $this->__directories = array($path); + $this->__directories = array($this->realpath($path)); $directories = array(); - if ($hidden === false) { - $hidden = true; + if ($exceptions === false) { + $exceptions = true; } - while (count($this->__directories)) { + while (!empty($this->__directories)) { $dir = array_pop($this->__directories); $this->__tree($dir, $exceptions); $directories[] = $dir; @@ -451,15 +457,14 @@ function tree($path, $exceptions = true, $type = null) { * Private method to list directories and files in each directory * * @param string $path The Path to read. - * @param mixed $hidden Array of files to exclude from the read that will be performed. + * @param mixed $exceptions Array of files to exclude from the read that will be performed. * @access private */ - function __tree($path, $hidden) { - if ($this->cd($path)) { - list($dirs, $files) = $this->read(false, $hidden, true); - $this->__directories = array_merge($this->__directories, $dirs); - $this->__files = array_merge($this->__files, $files); - } + function __tree($path, $exceptions) { + $this->path = $path; + list($dirs, $files) = $this->read(false, $exceptions, true); + $this->__directories = array_merge($this->__directories, $dirs); + $this->__files = array_merge($this->__files, $files); } /** diff --git a/cake/libs/model/connection_manager.php b/cake/libs/model/connection_manager.php index a6be6e12e..0a5475dc9 100644 --- a/cake/libs/model/connection_manager.php +++ b/cake/libs/model/connection_manager.php @@ -181,7 +181,7 @@ function loadDataSource($connName) { $conn = array_merge(array('plugin' => null, 'classname' => null, 'parent' => null), $conn); $class = "{$conn['plugin']}.{$conn['classname']}"; - if (!App::import('Datasource', $class, false)) { + if (!App::import('Datasource', $class, !is_null($conn['plugin']))) { trigger_error(sprintf(__('ConnectionManager::loadDataSource - Unable to import DataSource class %s', true), $class), E_USER_ERROR); return null; } diff --git a/cake/tests/cases/console/libs/tasks/project.test.php b/cake/tests/cases/console/libs/tasks/project.test.php index 37096a205..0378567d9 100644 --- a/cake/tests/cases/console/libs/tasks/project.test.php +++ b/cake/tests/cases/console/libs/tasks/project.test.php @@ -173,6 +173,24 @@ function testSecuritySaltGeneration() { $this->assertNoPattern('/DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi/', $contents, 'Default Salt left behind. %s'); } + /** + * test generation of Security.salt + * + * @return void + * @access public + */ + function testSecurityCipherSeedGeneration() { + $this->_setupTestProject(); + + $path = $this->Task->path . 'bake_test_app' . DS; + $result = $this->Task->securityCipherSeed($path); + $this->assertTrue($result); + + $file =& new File($path . 'config' . DS . 'core.php'); + $contents = $file->read(); + $this->assertNoPattern('/76859309657453542496749683645/', $contents, 'Default CipherSeed left behind. %s'); + } + /** * Test that index.php is generated correctly. * From 5fcbc33a7566a5fe9eb12a384d36fb54e02aa9e5 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 19 Jan 2010 23:55:50 -0500 Subject: [PATCH 1580/2083] Adding tests for CURRENT_TIMESTAMP to DboSource. --- .../model/datasources/dbo_source.test.php | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index 0bd4a52b4..642ad8911 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -3615,6 +3615,8 @@ function testBuildColumn() { 'default' => '', 'null' => false, ); + $restore = $this->testDb->columns; + $this->testDb->columns = array('integer' => array('name' => 'int', 'limit' => '11', 'formatter' => 'intval'), ); $result = $this->testDb->buildColumn($data); $expected = '`int_field` int(11) NOT NULL'; @@ -3649,6 +3651,47 @@ function testBuildColumn() { $result = $this->testDb->buildColumn($data); $expected = '`int_field` int(11) COLLATE GOOD NOT NULL'; $this->assertEqual($result, $expected); + + $this->testDb->columns = $restore; + + $data = array( + 'name' => 'created', + 'type' => 'timestamp', + 'default' => 'current_timestamp', + 'null' => false, + ); + $result = $this->db->buildColumn($data); + $expected = '`created` timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL'; + $this->assertEqual($result, $expected); + + $data = array( + 'name' => 'created', + 'type' => 'timestamp', + 'default' => 'CURRENT_TIMESTAMP', + 'null' => true, + ); + $result = $this->db->buildColumn($data); + $expected = '`created` timestamp DEFAULT CURRENT_TIMESTAMP'; + $this->assertEqual($result, $expected); + + $data = array( + 'name' => 'modified', + 'type' => 'timestamp', + 'null' => true, + ); + $result = $this->db->buildColumn($data); + $expected = '`modified` timestamp NULL'; + $this->assertEqual($result, $expected); + + $data = array( + 'name' => 'modified', + 'type' => 'timestamp', + 'default' => null, + 'null' => true, + ); + $result = $this->db->buildColumn($data); + $expected = '`modified` timestamp NULL'; + $this->assertEqual($result, $expected); } /** From f6d12dbde6935b4826c94f4c03776d08e153dcb7 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 21 Jan 2010 16:01:34 -0500 Subject: [PATCH 1581/2083] Adding support for CURRENT_TIMESTAMP to all dbo's. --- cake/libs/model/datasources/dbo_source.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index f4129e608..d9cc675c4 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -2634,11 +2634,16 @@ function buildColumn($column) { $out .= ' DEFAULT ' . $this->value($column['default'], $type) . ' NOT NULL'; } elseif (isset($column['default'])) { $out .= ' DEFAULT ' . $this->value($column['default'], $type); - } elseif (isset($column['null']) && $column['null'] == true) { + } elseif ($type !== 'timestamp' && !empty($column['null'])) { $out .= ' DEFAULT NULL'; + } elseif ($type === 'timestamp' && !empty($column['null'])) { + $out .= ' NULL'; } elseif (isset($column['null']) && $column['null'] == false) { $out .= ' NOT NULL'; } + if ($type == 'timestamp' && isset($column['default']) && strtolower($column['default']) == 'current_timestamp') { + $out = str_replace(array("'CURRENT_TIMESTAMP'", "'current_timestamp'"), 'CURRENT_TIMESTAMP', $out); + } $out = $this->_buildFieldParameters($out, $column, 'afterDefault'); return $out; } From 38eac37bb1c3855765a2b642311d4c2ce3449c42 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 25 Jan 2010 12:49:12 -0500 Subject: [PATCH 1582/2083] Removing optional group flag for routed parameters. Fixes issues with trailing empty route parameters. Tests added for correct parsing of these routes. Fixes #252 --- cake/libs/router.php | 3 +-- cake/tests/cases/libs/router.test.php | 14 +++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index 3478cd684..ee135624f 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -1307,7 +1307,7 @@ function _writeRoute() { $replacements[] = '(?:(?P<' . $name . '>' . $this->options[$name] . ')' . $option . ')' . $option; } } else { - $replacements[] = '(?:(?P<' . $name . '>[^/]+))?'; + $replacements[] = '(?:(?P<' . $name . '>[^/]+))'; $search[] = '\\' . $namedElements[0][$i]; } $names[] = $name; @@ -1334,7 +1334,6 @@ function parse($url) { if (!$this->compiled()) { $this->compile(); } - if (!preg_match($this->_compiledRoute, $url, $route)) { return false; } else { diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index ce68c6f4f..e23232b8c 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -2388,12 +2388,24 @@ function testPersistParams() { */ function testParse() { extract(Router::getNamedExpressions()); - $route = new CakeRoute('/:controller/:action/:id', array('controller' => 'testing4', 'id' => null), array('id' => $ID)); + $route =& new CakeRoute('/:controller/:action/:id', array('controller' => 'testing4', 'id' => null), array('id' => $ID)); $route->compile(); $result = $route->parse('/posts/view/1'); $this->assertEqual($result['controller'], 'posts'); $this->assertEqual($result['action'], 'view'); $this->assertEqual($result['id'], '1'); + + $route =& new Cakeroute( + '/admin/:controller', + array('prefix' => 'admin', 'admin' => 1, 'action' => 'index') + ); + $route->compile(); + $result = $route->parse('/admin/'); + $this->assertFalse($result); + + $result = $route->parse('/admin/posts'); + $this->assertEqual($result['controller'], 'posts'); + $this->assertEqual($result['action'], 'index'); } } From b24b43b84813b661c8228d01c33d722436dad57f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Mon, 25 Jan 2010 14:12:41 -0430 Subject: [PATCH 1583/2083] Fixing docblock --- cake/tests/cases/console/libs/tasks/project.test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/cases/console/libs/tasks/project.test.php b/cake/tests/cases/console/libs/tasks/project.test.php index 0378567d9..781aaa493 100644 --- a/cake/tests/cases/console/libs/tasks/project.test.php +++ b/cake/tests/cases/console/libs/tasks/project.test.php @@ -174,7 +174,7 @@ function testSecuritySaltGeneration() { } /** - * test generation of Security.salt + * test generation of Security.cipherSeed * * @return void * @access public From 134ce68dced65b673998a9f042957acef16ec621 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 25 Jan 2010 15:37:55 -0500 Subject: [PATCH 1584/2083] Updating and correct doc blocks for lib classes. Removing unused private property in Router. --- cake/libs/i18n.php | 10 ++-- cake/libs/inflector.php | 19 ++++--- cake/libs/l10n.php | 11 ++-- cake/libs/object.php | 18 ++++--- cake/libs/router.php | 111 ++++++++++++++++++++++++++-------------- cake/libs/security.php | 4 +- cake/libs/set.php | 19 ++++--- cake/libs/string.php | 7 +-- 8 files changed, 122 insertions(+), 77 deletions(-) diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index 2ebdd8662..3db3a47fe 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -24,7 +24,7 @@ App::import('Core', 'l10n'); /** - * Short description for file. + * I18n handles translation of Text and time format strings. * * @package cake * @subpackage cake.cake.libs @@ -120,10 +120,10 @@ function &getInstance() { * * @param string $singular String to translate * @param string $plural Plural string (if any) - * @param string $domain Domain - * @param string $category Category - * @param integer $count Count - * @return string translated strings. + * @param string $domain Domain The domain of the translation. Domains are often used by plugin translations + * @param string $category Category The integer value of the category to use. + * @param integer $count Count Count is used with $plural to choose the correct plural form. + * @return string translated string. * @access public */ function translate($singular, $plural = null, $domain = null, $category = 6, $count = null) { diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index 8c0d5900e..5a117c076 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -269,14 +269,19 @@ function _cache($type, $key, $value = false) { /** * Adds custom inflection $rules, of either 'plural' or 'singular' $type. * + * ### Usage: + * + * {{{ + * Inflector::rules('plural', array('/^(inflect)or$/i' => '\1ables')); + * Inflector::rules('plural', array( + * 'rules' => array('/^(inflect)ors$/i' => '\1ables'), + * 'uninflected' => array('dontinflectme'), + * 'irregular' => array('red' => 'redlings') + * )); + * }}} + * * @param string $type The type of inflection, either 'singular' or 'plural' - * @param array $rules Array of rules to be added. Example usage: - * Inflector::rules('plural', array('/^(inflect)or$/i' => '\1ables')); - * Inflector::rules('plural', array( - * 'rules' => array('/^(inflect)ors$/i' => '\1ables'), - * 'uninflected' => array('dontinflectme'), - * 'irregular' => array('red' => 'redlings') - * )); + * @param array $rules Array of rules to be added. * @param boolean $reset If true, will unset default inflections for all * new rules that are being defined in $rules. * @access public diff --git a/cake/libs/l10n.php b/cake/libs/l10n.php index cff50caba..b9eca5b7c 100644 --- a/cake/libs/l10n.php +++ b/cake/libs/l10n.php @@ -336,8 +336,8 @@ function __construct() { /** * Gets the settings for $language. - * If $language is null it attempt to get settings from I10n::__autoLanguage(); if this fails - * the method will get the settings from I10n::__setLanguage(); + * If $language is null it attempt to get settings from L10n::__autoLanguage(); if this fails + * the method will get the settings from L10n::__setLanguage(); * * @param string $language Language (if null will use DEFAULT_LANGUAGE if defined) * @access public @@ -432,7 +432,8 @@ function __autoLanguage() { * Attempts to find locale for language, or language for locale * * @param mixed $mixed 2/3 char string (language/locale), array of those strings, or null - * @return mixed string language/locale, array of those values, whole map as an array, or false when language/locale doesn't exist + * @return mixed string language/locale, array of those values, whole map as an array, + * or false when language/locale doesn't exist * @access public */ function map($mixed = null) { @@ -459,7 +460,9 @@ function map($mixed = null) { * Attempts to find catalog record for requested language * * @param mixed $language string requested language, array of requested languages, or null for whole catalog - * @return mixed array catalog record for requested language, array of catalog records, whole catalog, or false when language doesn't exist + * @return mixed array catalog record for requested language, array of catalog records, whole catalog, + * or false when language doesn't exist + * @access public */ function catalog($language = null) { if (is_array($language)) { diff --git a/cake/libs/object.php b/cake/libs/object.php index a9669b009..3c0535f3c 100644 --- a/cake/libs/object.php +++ b/cake/libs/object.php @@ -67,12 +67,14 @@ function toString() { } /** - * Calls a controller's method from any location. + * Calls a controller's method from any location. Can be used to connect controllers together + * or tie plugins into a main application. requestAction can be used to return rendered views + * or fetch the return value from controller actions. * * @param mixed $url String or array-based url. * @param array $extra if array includes the key "return" it sets the AutoRender to true. * @return mixed Boolean true or false on success/failure, or contents - * of rendered action if 'return' is set in $extra. + * of rendered action if 'return' is set in $extra. * @access public */ function requestAction($url, $extra = array()) { @@ -95,8 +97,7 @@ function requestAction($url, $extra = array()) { /** * Calls a method on this object with the given parameters. Provides an OO wrapper - * for call_user_func_array, and improves performance by using straight method calls - * in most cases. + * for `call_user_func_array` * * @param string $method Name of the method to call * @param array $params Parameter list to use when calling $method @@ -124,7 +125,8 @@ function dispatchMethod($method, $params = array()) { } /** - * Stop execution of the current script + * Stop execution of the current script. Wraps exit() making + * testing easier. * * @param $status see http://php.net/exit for values * @return void @@ -135,7 +137,8 @@ function _stop($status = 0) { } /** - * API for logging events. + * Convience method to write a message to CakeLog. See CakeLog::write() + * for more information on writing to logs. * * @param string $msg Log message * @param integer $type Error type constant. Defined in app/config/core.php. @@ -153,7 +156,8 @@ function log($msg, $type = LOG_ERROR) { } /** - * Allows setting of multiple properties of the object in a single line of code. + * Allows setting of multiple properties of the object in a single line of code. Will only set + * properties that are part of a class declaration. * * @param array $properties An associative array containing properties and corresponding values. * @return void diff --git a/cake/libs/router.php b/cake/libs/router.php index ee135624f..29707676c 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -27,7 +27,7 @@ class Router { /** - * Array of routes + * Array of routes connected with Router::connect() * * @var array * @access public @@ -110,18 +110,6 @@ class Router { array('action' => 'edit', 'method' => 'POST', 'id' => true) ); -/** - * HTTP header shortcut map. Used for evaluating header-based route expressions. - * - * @var array - * @access private - */ - var $__headerMap = array( - 'type' => 'content_type', - 'method' => 'request_method', - 'server' => 'server_name' - ); - /** * List of resource-mapped controllers * @@ -193,7 +181,7 @@ function __setPrefixes() { /** * Gets a reference to the Router object instance * - * @return object Object instance + * @return Router Instance of the Router. * @access public * @static */ @@ -248,6 +236,15 @@ function getNamedExpressions() { * Shows connecting a route with custom route parameters as well as providing patterns for those parameters. * Patterns for routing parameters do not need capturing groups, as one will be added for each route params. * + * $options offers two 'special' keys. `pass` and `persist` have special meaning in the $options array. + * + * `pass` is used to define which of the routed parameters should be shifted into the pass array. Adding a + * parameter to pass will remove it from the regular route array. Ex. `'pass' => array('slug')` + * + * `persist` is used to define which route parameters should be automatically included when generating + * new urls. You can override peristent parameters by redifining them in a url or remove them by + * setting the parameter to `false`. Ex. `'persist' => array('lang')` + * * @param string $route A string describing the template of the route * @param array $defaults An array describing the default route parameters. These parameters will be used by default * and can supply routing parameters that are not dynamic. See above. @@ -292,24 +289,41 @@ function connect($route, $defaults = array(), $options = array()) { * Specifies what named parameters CakePHP should be parsing. The most common setups are: * * Do not parse any named parameters: + * * {{{ Router::connectNamed(false); }}} * * Parse only default parameters used for CakePHP's pagination: + * * {{{ Router::connectNamed(false, array('default' => true)); }}} * * Parse only the page parameter if its value is a number: + * * {{{ Router::connectNamed(array('page' => '[\d]+'), array('default' => false, 'greedy' => false)); }}} * * Parse only the page parameter no mater what. + * * {{{ Router::connectNamed(array('page'), array('default' => false, 'greedy' => false)); }}} * * Parse only the page parameter if the current action is 'index'. - * {{{ Router::connectNamed(array('page' => array('action' => 'index')), array('default' => false, 'greedy' => false)); }}} + * + * {{{ + * Router::connectNamed( + * array('page' => array('action' => 'index')), + * array('default' => false, 'greedy' => false) + * ); + * }}} * * Parse only the page parameter if the current action is 'index' and the controller is 'pages'. - * {{{ Router::connectNamed(array('page' => array('action' => 'index', 'controller' => 'pages')), array('default' => false, 'greedy' => false)); }}} * - * @param array $named A list of named parameters. Key value pairs are accepted where values are either regex strings to match, or arrays as seen above. + * {{{ + * Router::connectNamed( + * array('page' => array('action' => 'index', 'controller' => 'pages')), + * array('default' => false, 'greedy' => false) + * ); + * }}} + * + * @param array $named A list of named parameters. Key value pairs are accepted where values are + * either regex strings to match, or arrays as seen above. * @param array $options Allows to control all settings: separator, greedy, reset, default * @return array * @access public @@ -366,7 +380,7 @@ function defaults($connect = true) { /** * Creates REST resource routes for the given controller(s) * - * Options: + * ### Options: * * - 'id' - The regular expression fragment to use when matching IDs. By default, matches * integer values and UUIDs. @@ -412,7 +426,7 @@ function prefixes() { } /** - * Parses given URL and returns an array of controllers, action and parameters + * Parses given URL and returns an array of controller, action and parameters * taken from that URL. * * @param string $url URL to be parsed @@ -521,8 +535,20 @@ function __parseExtension($url) { } /** - * Connects the default, built-in routes, including admin routes, and (deprecated) web services - * routes. + * Connects the default, built-in routes, including prefix and plugin routes. The following routes are created + * in the order below: + * + * - `/:prefix/:plugin/:controller` + * - `/:prefix/:plugin/:controller/:action/*` + * - `/:prefix/:controller` + * - `/:prefix/:controller/:action/*` + * - `/:plugin/:controller` + * - `/:plugin/:controller/:action/*` + * - `/:controller' + * - `/:controller/:action/*' + * + * A prefix route is generated for each Routing.prefixes declared in core.php. You can disable the + * connection of default routes with Router::defaults(). * * @return void * @access private @@ -560,7 +586,9 @@ function __connectDefaultRoutes() { } /** - * Takes parameter and path information back from the Dispatcher + * Takes parameter and path information back from the Dispatcher, sets these + * parameters as the current request parameters that are merged with url arrays + * created later in the request. * * @param array $params Parameters and path information * @return void @@ -586,7 +614,7 @@ function setRequestInfo($params) { /** * Gets parameter information * - * @param boolean $current Get current parameter (true) + * @param boolean $current Get current request parameter, useful when using requestAction * @return array Parameter information * @access public * @static @@ -606,7 +634,7 @@ function getParams($current = false) { * Gets URL parameter by name * * @param string $name Parameter name - * @param boolean $current Current parameter + * @param boolean $current Current parameter, useful when using requestAction * @return string Parameter value * @access public * @static @@ -622,7 +650,7 @@ function getParam($name = 'controller', $current = false) { /** * Gets path information * - * @param boolean $current Current parameter + * @param boolean $current Current parameter, useful when using requestAction * @return array * @access public * @static @@ -639,7 +667,8 @@ function getPaths($current = false) { } /** - * Reloads default Router settings + * Reloads default Router settings. Resets all class variables and + * removes all connected routes. * * @access public * @return void @@ -657,7 +686,7 @@ function reload() { * Promote a route (by default, the last one added) to the beginning of the list * * @param $which A zero-based array index representing the route to move. For example, - * if 3 routes have been added, the last route would be 2. + * if 3 routes have been added, the last route would be 2. * @return boolean Retuns false if no route exists at the position specified by $which. * @access public * @static @@ -1039,7 +1068,7 @@ function normalize($url = '/') { /** * Returns the route matching the current request URL. * - * @return array Matching route + * @return CakeRoute Matching route object. * @access public * @static */ @@ -1051,7 +1080,7 @@ function &requestRoute() { /** * Returns the route matching the current request (useful for requestAction traces) * - * @return array Matching route + * @return CakeRoute Matching route object. * @access public * @static */ @@ -1175,7 +1204,7 @@ class CakeRoute { /** * An array of named segments in a Route. - * `/:controller/:action/:id` has 3 named elements + * `/:controller/:action/:id` has 3 key elements * * @var array * @access public @@ -1189,6 +1218,7 @@ class CakeRoute { * @access public */ var $options = array(); + /** * Default parameters for a Route * @@ -1260,7 +1290,7 @@ function compiled() { } /** - * Compiles the routes regular expression. Modifies defaults property so all necessary keys are set + * Compiles the route's regular expression. Modifies defaults property so all necessary keys are set * and populates $this->names with the named routing elements. * * @return array Returns a string regular expression of the compiled route. @@ -1276,7 +1306,7 @@ function compile() { /** * Builds a route regular expression. Uses the template, defaults and options - * properties to compile a regular expression that can be used to match/parse request strings. + * properties to compile a regular expression that can be used to parse request strings. * * @return void * @access protected @@ -1324,7 +1354,7 @@ function _writeRoute() { /** * Checks to see if the given URL can be parsed by this route. * If the route can be parsed an array of parameters will be returned if not - * false will be returned. + * false will be returned. String urls are parsed if they match a routes regular expression. * * @param string $url The url to attempt to parse. * @return mixed Boolean false on failure, otherwise an array or parameters @@ -1377,7 +1407,9 @@ function parse($url) { } /** - * Apply persistent parameters to a url array. + * Apply persistent parameters to a url array. Persistant parameters are a special + * key used during route creation to force route parameters to persist when omitted from + * a url array. * * @param array $url The array to apply persistent parameters to. * @param array $params An array of persistent values to replace persistent ones. @@ -1394,9 +1426,9 @@ function persistParams($url, $params) { } /** - * Attempt to match a url array. If the url matches the routes pattern, then - * return an array of parsed params. If the url doesn't match the routes compiled pattern - * returns false. + * Attempt to match a url array. If the url matches the route parameters + settings, then + * return a generated string url. If the url doesn't match the route parameters false will be returned. + * This method handles the reverse routing or conversion of url arrays into string urls. * * @param array $url An array of parameters to check matching with. * @return mixed Either a string url for the parameters if they match or false. @@ -1476,10 +1508,11 @@ function match($url) { } /** - * Converts a matching route array into a url string. + * Converts a matching route array into a url string. Composes the string url using the template + * used to create the route. * * @param array $params The params to convert to a string url. - * @return string Compiled route string. + * @return string Composed route string. * @access protected */ function _writeUrl($params) { diff --git a/cake/libs/security.php b/cake/libs/security.php index fe65c7e81..8b08c251f 100644 --- a/cake/libs/security.php +++ b/cake/libs/security.php @@ -19,7 +19,7 @@ */ /** - * Short description for file. + * Security Library contains utility methods related to security * * @package cake * @subpackage cake.cake.libs @@ -105,7 +105,7 @@ function validateAuthKey($authKey) { * @param string $string String to hash * @param string $type Method to use (sha1/sha256/md5) * @param boolean $salt If true, automatically appends the application's salt - * value to $string (Security.salt) + * value to $string (Security.salt) * @return string Hash * @access public * @static diff --git a/cake/libs/set.php b/cake/libs/set.php index 2f9551a99..09bc6f563 100644 --- a/cake/libs/set.php +++ b/cake/libs/set.php @@ -21,8 +21,6 @@ /** * Class used for manipulation of arrays. * - * Long description for class - * * @package cake * @subpackage cake.cake.libs */ @@ -37,7 +35,8 @@ class Set { /** * This function can be thought of as a hybrid between PHP's array_merge and array_merge_recursive. The difference * to the two is that if an array key contains another array then the function behaves recursive (unlike array_merge) - * but does not do if for keys containing strings (unlike array_merge_recursive). See the unit test for more information. + * but does not do if for keys containing strings (unlike array_merge_recursive). + * See the unit test for more information. * * Note: This function will work with an unlimited amount of arguments and typecasts non-array parameters into arrays. * @@ -289,10 +288,10 @@ function enum($select, $list = null) { /** * Returns a series of values extracted from an array, formatted in a format string. * - * @param array $data Source array from which to extract the data - * @param string $format Format string into which values will be inserted, see sprintf() - * @param array $keys An array containing one or more Set::extract()-style key paths - * @return array An array of strings extracted from $keys and formatted with $format + * @param array $data Source array from which to extract the data + * @param string $format Format string into which values will be inserted, see sprintf() + * @param array $keys An array containing one or more Set::extract()-style key paths + * @return array An array of strings extracted from $keys and formatted with $format * @access public * @static */ @@ -345,7 +344,7 @@ function format($data, $format, $keys) { } /** - * Implements partial support for XPath 2.0. If $path is an array or $data is empty it the call + * Implements partial support for XPath 2.0. If $path is an array or $data is empty it the call * is delegated to Set::classicExtract. * * #### Currently implemented selectors: @@ -366,8 +365,8 @@ function format($data, $format, $keys) { * * - Only absolute paths starting with a single '/' are supported right now * - * **Warning**: Even so it has plenty of unit tests the XPath support has not gone through a lot of - * real-world testing. Please report Bugs as you find them. Suggestions for additional features to + * **Warning**: Even so it has plenty of unit tests the XPath support has not gone through a lot of + * real-world testing. Please report Bugs as you find them. Suggestions for additional features to * implement are also very welcome! * * @param string $path An absolute XPath 2.0 path diff --git a/cake/libs/string.php b/cake/libs/string.php index 10ec4cb34..12e8c7718 100644 --- a/cake/libs/string.php +++ b/cake/libs/string.php @@ -2,7 +2,6 @@ /** * String handling methods. * - * * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) @@ -108,8 +107,10 @@ function uuid() { * $leftBound and $rightBound * * @param string $data The data to tokenize - * @param string $separator The token to split the data on - * @return array + * @param string $separator The token to split the data on. + * @param string $leftBound The left boundary to ignore separators in. + * @param string $rightBound The right boundary to ignore separators in. + * @return array Array of tokens in $data. * @access public * @static */ From a77a0641643e155a7ba4420a9c04af3670add1bf Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 25 Jan 2010 17:59:05 -0500 Subject: [PATCH 1585/2083] Updating doc blocks for the helpers. Unifying formatting and adding missing @access tags and fixing various formatting differences. --- cake/libs/view/helper.php | 162 ++++++++++++-------- cake/libs/view/helpers/cache.php | 14 +- cake/libs/view/helpers/form.php | 126 +++++++++------ cake/libs/view/helpers/html.php | 101 ++++++------ cake/libs/view/helpers/jquery_engine.php | 34 ++-- cake/libs/view/helpers/js.php | 51 +++--- cake/libs/view/helpers/number.php | 10 +- cake/libs/view/helpers/paginator.php | 51 ++++-- cake/libs/view/helpers/prototype_engine.php | 26 +++- cake/libs/view/helpers/rss.php | 38 +++-- cake/libs/view/helpers/session.php | 13 +- cake/libs/view/helpers/text.php | 18 ++- cake/libs/view/helpers/time.php | 48 ++++-- cake/libs/view/helpers/xml.php | 28 ++-- 14 files changed, 451 insertions(+), 269 deletions(-) diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index 2e9cf4964..f7e6ee355 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -26,9 +26,8 @@ App::import('Core', 'Overloadable'); /** - * Backend for helpers. - * - * Long description for class + * Abstract base class for all other Helpers in CakePHP. + * Provides common methods and features. * * @package cake * @subpackage cake.cake.libs.view @@ -57,11 +56,11 @@ class Helper extends Overloadable { var $webroot = null; /** - * Theme name + * The current theme name if any. * * @var string */ - var $themeWeb = null; + var $theme = null; /** * URL to current action. @@ -158,8 +157,9 @@ function call__($method, $params) { /** * Parses tag templates into $this->tags. * - * @param $name file name + * @param $name file name inside app/config to load. * @return array merged tags from config/$name.php + * @access public */ function loadConfig($name = 'tags') { if (file_exists(CONFIGS . $name .'.php')) { @@ -174,18 +174,14 @@ function loadConfig($name = 'tags') { /** * Finds URL for specified action. * - * Returns an URL pointing to a combination of controller and action. Param - * $url can be: - * + Empty - the method will find adress to actuall controller/action. - * + '/' - the method will find base URL of application. - * + A combination of controller/action - the method will find url for it. - * - * @param mixed $url Cake-relative URL, like "/products/edit/92" or "/presidents/elect/4" - * or an array specifying any of the following: 'controller', 'action', - * and/or 'plugin', in addition to named arguments (keyed array elements), - * and standard URL arguments (indexed array elements) - * @param boolean $full If true, the full base URL will be prepended to the result + * Returns a URL pointing at the provided parameters. + * + * @param mixed $url Either a relative string url like `/products/view/23` or + * an array of url parameters. Using an array for urls will allow you to leverage + * the reverse routing features of CakePHP. + * @param boolean $full If true, the full base URL will be prepended to the result * @return string Full translated URL with base path. + * @access public */ function url($url = null, $full = false) { return h(Router::url($url, $full)); @@ -194,19 +190,20 @@ function url($url = null, $full = false) { /** * Checks if a file exists when theme is used, if no file is found default location is returned * - * @param string $file - * @return string $webPath web path to file. + * @param string $file The file to create a webroot path to. + * @return string $webPath web path to file. + * @access public */ function webroot($file) { $asset = explode('?', $file); $asset[1] = isset($asset[1]) ? '?' . $asset[1] : null; $webPath = "{$this->webroot}" . $asset[0]; $file = $asset[0]; - + if (!empty($this->theme)) { $file = trim($file, '/'); $theme = $this->theme . '/'; - + if (DS === '\\') { $file = str_replace('/', '\\', $file); } @@ -215,7 +212,7 @@ function webroot($file) { $webPath = "{$this->webroot}theme/" . $theme . $asset[0]; } else { $viewPaths = App::path('views'); - + foreach ($viewPaths as $viewPath) { $path = $viewPath . 'themed'. DS . $this->theme . DS . 'webroot' . DS . $file; @@ -233,12 +230,13 @@ function webroot($file) { } /** - * Adds a timestamp to a file based resource based on the value of `Asset.timestamp` in + * Adds a timestamp to a file based resource based on the value of `Asset.timestamp` in * Configure. If Asset.timestamp is true and debug > 0, or Asset.timestamp == 'force' * a timestamp will be added. * * @param string $path The file path to timestamp, the path must be inside WWW_ROOT * @return string Path with a timestamp added, or not. + * @access public */ function assetTimestamp($path) { $timestampEnabled = ( @@ -309,6 +307,7 @@ function clean($output) { * @param string $insertBefore String to be inserted before options. * @param string $insertAfter String to be inserted ater options. * @return string Composed attributes. + * @access public */ function _parseAttributes($options, $exclude = null, $insertBefore = ' ', $insertAfter = null) { if (is_array($options)) { @@ -334,6 +333,7 @@ function _parseAttributes($options, $exclude = null, $insertBefore = ' ', $inser /** * Formats an individual attribute, and returns the string value of the composed attribute. + * Works with minimized attributes that have the same value as their name such as 'disabled' and 'checked' * * @param string $key The name of the attribute to create * @param string $value The value of the attribute to create. @@ -343,7 +343,8 @@ function _parseAttributes($options, $exclude = null, $insertBefore = ' ', $inser function __formatAttribute($key, $value, $escape = true) { $attribute = ''; $attributeFormat = '%s="%s"'; - $minimizedAttributes = array('compact', 'checked', 'declare', 'readonly', 'disabled', 'selected', 'defer', 'ismap', 'nohref', 'noshade', 'nowrap', 'multiple', 'noresize'); + $minimizedAttributes = array('compact', 'checked', 'declare', 'readonly', 'disabled', + 'selected', 'defer', 'ismap', 'nohref', 'noshade', 'nowrap', 'multiple', 'noresize'); if (is_array($value)) { $value = ''; } @@ -364,6 +365,7 @@ function __formatAttribute($key, $value, $escape = true) { * @param mixed $entity A field name, like "ModelName.fieldName" or "ModelName.ID.fieldName" * @param boolean $setScope Sets the view scope to the model specified in $tagValue * @return void + * @access public */ function setEntity($entity, $setScope = false) { $view =& ClassRegistry::getObject('view'); @@ -373,7 +375,7 @@ function setEntity($entity, $setScope = false) { } elseif (!empty($view->entityPath) && $view->entityPath == $entity) { return; } - + if ($entity === null) { $view->model = null; $view->association = null; @@ -382,7 +384,7 @@ function setEntity($entity, $setScope = false) { $view->entityPath = null; return; } - + $view->entityPath = $entity; $model = $view->model; $sameScope = $hasField = false; @@ -391,7 +393,7 @@ function setEntity($entity, $setScope = false) { if (empty($parts)) { return; } - + $count = count($parts); if ($count === 1) { $sameScope = true; @@ -412,7 +414,7 @@ function setEntity($entity, $setScope = false) { } } } - + if (ClassRegistry::isKeySet($model)) { $ModelObj =& ClassRegistry::getObject($model); for ($i = 0; $i < $count; $i++) { @@ -476,7 +478,7 @@ function setEntity($entity, $setScope = false) { break; default: $reverse = array_reverse($parts); - + if ($hasField) { $view->field = $field; if (!is_numeric($reverse[1]) && $reverse[1] != $model) { @@ -509,6 +511,7 @@ function setEntity($entity, $setScope = false) { * Gets the currently-used model of the rendering context. * * @return string + * @access public */ function model() { $view =& ClassRegistry::getObject('view'); @@ -523,6 +526,7 @@ function model() { * Gets the ID of the currently-used model of the rendering context. * * @return mixed + * @access public */ function modelID() { $view =& ClassRegistry::getObject('view'); @@ -533,6 +537,7 @@ function modelID() { * Gets the currently-used model field of the rendering context. * * @return string + * @access public */ function field() { $view =& ClassRegistry::getObject('view'); @@ -540,11 +545,12 @@ function field() { } /** - * Returns false if given FORM field has no errors. Otherwise it returns the constant set in the array Model->validationErrors. + * Returns false if given FORM field has no errors. Otherwise it returns the constant set in + * the array Model->validationErrors. * - * @param string $model Model name as string - * @param string $field Fieldname as string - * @param integer $modelID Unique index identifying this record within the form + * @param string $model Model name as a string + * @param string $field Fieldname as a string + * @param integer $modelID Unique index identifying this record within the form * @return boolean True on errors. */ function tagIsInvalid($model = null, $field = null, $modelID = null) { @@ -558,10 +564,14 @@ function tagIsInvalid($model = null, $field = null, $modelID = null) { /** * Generates a DOM ID for the selected element, if one is not set. + * Uses the current View::entity() settings to generate a CamelCased id attribute. * - * @param mixed $options - * @param string $id - * @return mixed + * @param mixed $options Either an array of html attributes to add $id into, or a string + * with a view entity path to get a domId for. + * @param string $id The name of the 'id' attribute. + * @return mixed If $options was an array, an array will be returned with $id set. If a string + * was supplied, a string will be returned. + * @todo Refactor this method to not have as many input/output options. */ function domId($options = null, $id = 'id') { $view =& ClassRegistry::getObject('view'); @@ -573,10 +583,10 @@ function domId($options = null, $id = 'id') { $this->setEntity($options); return $this->domId(); } - + $entity = $view->entity(); $model = array_shift($entity); - $dom = $model . join('',array_map(array('Inflector','camelize'),$entity)); + $dom = $model . join('', array_map(array('Inflector', 'camelize'), $entity)); if (is_array($options) && !array_key_exists($id, $options)) { $options[$id] = $dom; @@ -587,12 +597,17 @@ function domId($options = null, $id = 'id') { } /** - * Gets the input field name for the current tag + * Gets the input field name for the current tag. Creates input name attributes + * using CakePHP's data[Model][field] formatting. * - * @param array $options - * @param string $key - * @return array + * @param mixed $options If an array, should be an array of attributes that $key needs to be added to. + * If a string or null, will be used as the View entity. + * @param string $field + * @param string $key The name of the attribute to be set, defaults to 'name' + * @return mixed If an array was given for $options, an array with $key set will be returned. + * If a string was supplied a string will be returned. * @access protected + * @todo Refactor this method to not have as many input/output options. */ function _name($options = array(), $field = null, $key = 'name') { $view =& ClassRegistry::getObject('view'); @@ -631,10 +646,14 @@ function _name($options = array(), $field = null, $key = 'name') { /** * Gets the data for the current tag * - * @param array $options - * @param string $key - * @return array + * @param mixed $options If an array, should be an array of attributes that $key needs to be added to. + * If a string or null, will be used as the View entity. + * @param string $field + * @param string $key The name of the attribute to be set, defaults to 'value' + * @return mixed If an array was given for $options, an array with $key set will be returned. + * If a string was supplied a string will be returned. * @access public + * @todo Refactor this method to not have as many input/output options. */ function value($options = array(), $field = null, $key = 'value') { if ($options === null) { @@ -647,11 +666,11 @@ function value($options = array(), $field = null, $key = 'value') { if (is_array($options) && isset($options[$key])) { return $options; } - + if (!empty($field)) { $this->setEntity($field); } - + $view =& ClassRegistry::getObject('view'); $result = null; @@ -692,11 +711,13 @@ function value($options = array(), $field = null, $key = 'value') { } /** - * Sets the defaults for an input tag + * Sets the defaults for an input tag. Will set the + * name, value, and id attributes for an array of html attributes. Will also + * add a 'form-error' class if the field contains validation errors. * - * @param array $options - * @param string $key - * @return array + * @param string $field The field name to initialize. + * @param array $options Array of options to use while initializing an input field. + * @return array Array options for the form input. * @access protected */ function _initInputField($field, $options = array()) { @@ -716,10 +737,11 @@ function _initInputField($field, $options = array()) { /** * Adds the given class to the element options * - * @param array $options - * @param string $class - * @param string $key - * @return array + * @param array $options Array options/attributes to add a class to + * @param string $class The classname being added. + * @param string $key the key to use for class. + * @return array Array of options with $key set. + * @access public */ function addClass($options = array(), $class = null, $key = 'class') { if (isset($options[$key]) && trim($options[$key]) != '') { @@ -735,37 +757,55 @@ function addClass($options = array(), $class = null, $key = 'class') { * * This method can be overridden in subclasses to do generalized output post-processing * - * @param string $str String to be output. + * @param string $str String to be output. * @return string + * @deprecated This method will be removed in future versions. */ function output($str) { return $str; } /** - * Before render callback. Overridden in subclasses. + * Before render callback. beforeRender is called before the view file is rendered. * + * Overridden in subclasses. + * + * @return void + * @access public */ function beforeRender() { } /** - * After render callback. Overridden in subclasses. + * After render callback. afterRender is called after the view file is rendered + * but before the layout has been rendered. * + * Overridden in subclasses. + * + * @return void + * @access public */ function afterRender() { } /** - * Before layout callback. Overridden in subclasses. + * Before layout callback. beforeLayout is called before the layout is rendered. * + * Overridden in subclasses. + * + * @return void + * @access public */ function beforeLayout() { } /** - * After layout callback. Overridden in subclasses. + * After layout callback. afterLayout is called after the layout has rendered. * + * Overridden in subclasses. + * + * @return void + * @access public */ function afterLayout() { } @@ -801,6 +841,7 @@ function __selectedArray($data, $key = 'id') { /** * Resets the vars used by Helper::clean() to null * + * @return void * @access private */ function __reset() { @@ -811,6 +852,7 @@ function __reset() { /** * Removes harmful content from output * + * @return void * @access private */ function __clean() { diff --git a/cake/libs/view/helpers/cache.php b/cake/libs/view/helpers/cache.php index 0d8357ae9..3abb043a9 100644 --- a/cake/libs/view/helpers/cache.php +++ b/cake/libs/view/helpers/cache.php @@ -61,7 +61,7 @@ class CacheHelper extends AppHelper { * @param string $file File to cache * @param string $out output to cache * @param boolean $cache - * @return view ouput + * @return string view ouput */ function cache($file, $out, $cache = false) { $cacheTime = 0; @@ -114,8 +114,8 @@ function cache($file, $out, $cache = false) { /** * Parse file searching for no cache tags * - * @param string $file - * @param boolean $cache + * @param string $file The filename that needs to be parsed. + * @param string $cache The cached content * @access private */ function __parseFile($file, $cache) { @@ -154,7 +154,7 @@ function __parseFile($file, $cache) { /** * Parse the output and replace cache tags * - * @param sting $cache + * @param string $cache Output to replace content in. * @return string with all replacements made to <cake:nocache><cake:nocache> * @access private */ @@ -187,9 +187,9 @@ function __parseOutput($cache) { /** * Write a cached version of the file * - * @param string $file - * @param sting $timestamp - * @return cached view + * @param string $content view content to write to a cache file. + * @param sting $timestamp Duration to set for cache file. + * @return boolean success of caching view. * @access private */ function __writeFile($content, $timestamp, $useCallbacks = false) { diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 4f83ef261..1495244a8 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -76,6 +76,7 @@ class FormHelper extends AppHelper { * The default model being used for the current form. * * @var string + * @access public */ var $defaultModel = null; @@ -147,14 +148,14 @@ function &_introspectModel($model) { /** * Returns an HTML FORM element. * - * #### Options: + * ### Options: * * - `type` Form method defaults to POST * - `action` The Action the form submits to. Can be a string or array, * - `url` The url the form submits to. Can be a string or a url array, * - `default` Allows for the creation of Ajax forms. * - `onsubmit` Used in conjunction with 'default' to create ajax forms. - * - `inputDefaults' set the default $options for FormHelper::input(). Any options that would + * - `inputDefaults` set the default $options for FormHelper::input(). Any options that would * be set when using FormHelper::input() can be set here. Options set with `inputDefaults` * can be overridden when calling input() * - `encoding` Set the accept-charset encoding for the form. Defaults to `Configure::read('App.encoding')` @@ -305,6 +306,7 @@ function create($model = null, $options = array()) { * * {{{ * array usage: + * * array('label' => 'save'); value="save" * array('label' => 'save', 'name' => 'Whatever'); value="save" name="Whatever" * array('name' => 'Whatever'); value="Submit" name="Whatever" @@ -387,10 +389,12 @@ function secure($fields = array()) { } /** - * Determine which fields of a form should be used for hash + * Determine which fields of a form should be used for hash. + * Populates $this->fields * * @param mixed $field Reference to field to be secured - * @param mixed $value Field value, if value should not be tampered with + * @param mixed $value Field value, if value should not be tampered with. + * @return void * @access private */ function __secure($field = null, $value = null) { @@ -433,12 +437,12 @@ function isFieldError($field) { /** * Returns a formatted error message for given FORM field, NULL if no errors. * - * Options: + * ### Options: * - * - 'escape' bool Whether or not to html escape the contents of the error. - * - 'wrap' mixed Whether or not the error message should be wrapped in a div. If a + * - `escape` bool Whether or not to html escape the contents of the error. + * - `wrap` mixed Whether or not the error message should be wrapped in a div. If a * string, will be used as the HTML tag to use. - * - 'class' string The classname for the error message + * - `class` string The classname for the error message * * @param string $field A field name, like "Modelname.fieldname" * @param mixed $text Error message or array of $options @@ -492,7 +496,8 @@ function error($field, $text = null, $options = array()) { } /** - * Returns a formatted LABEL element for HTML FORMs. + * Returns a formatted LABEL element for HTML FORMs. Will automatically generate + * a for attribute if one is not provided. * * @param string $fieldName This should be "Modelname.fieldname" * @param string $text Text that will appear in the label field. @@ -551,7 +556,7 @@ function label($fieldName = null, $text = null, $options = array()) { * }}} * * @param mixed $fields An array of fields to generate inputs for, or null. - * @param array $blacklist a simple array of fields to skip. + * @param array $blacklist a simple array of fields to not create inputs for. * @return string Completed form inputs. * @access public */ @@ -632,19 +637,26 @@ function inputs($fields = null, $blacklist = null) { /** * Generates a form input element complete with label and wrapper div * - * Options - See each field type method for more information. Any options that are part of - * $attributes or $options for the different type methods can be included in $options for input(). + * ### Options + * + * See each field type method for more information. Any options that are part of + * $attributes or $options for the different **type** methods can be included in `$options` for input(). * * - `type` - Force the type of widget you want. e.g. `type => 'select'` - * - `label` - control the label - * - `div` - control the wrapping div element + * - `label` - Either a string label, or an array of options for the label. See FormHelper::label() + * - `div` - Either `false` to disable the div, or an array of options for the div. + * See HtmlHelper::div() for more options. * - `options` - for widgets that take options e.g. radio, select * - `error` - control the error message that is produced * - `empty` - String or boolean to enable empty select box options. + * - `before` - Content to place before the label + input. + * - `after` - Content to place after the label + input. + * - `between` - Content to place between the label + input. * * @param string $fieldName This should be "Modelname.fieldname" * @param array $options Each type of input takes different options. - * @return string Completed form widget + * @return string Completed form widget. + * @access public */ function input($fieldName, $options = array()) { $this->setEntity($fieldName); @@ -905,16 +917,18 @@ function input($fieldName, $options = array()) { /** * Creates a checkbox input widget. * - * Options: + * ### Options: * * - `value` - the value of the checkbox * - `checked` - boolean indicate that this checkbox is checked. * - `hiddenField` - boolean to indicate if you want the results of checkbox() to include * a hidden input with a value of ''. + * - `disabled` - create a disabled input. * * @param string $fieldName Name of a field, like this "Modelname.fieldname" * @param array $options Array of HTML attributes. - * @return string An HTML text input element + * @return string An HTML text input element. + * @access public */ function checkbox($fieldName, $options = array()) { $options = $this->_initInputField($fieldName, $options) + array('hiddenField' => true); @@ -946,9 +960,10 @@ function checkbox($fieldName, $options = array()) { } /** - * Creates a set of radio widgets. + * Creates a set of radio widgets. Will create a legend and fieldset + * by default. Use $options to control this * - * Attributes: + * ### Attributes: * * - `separator` - define the string in between the radio buttons * - `legend` - control whether or not the widget set has a fieldset & legend @@ -959,8 +974,9 @@ function checkbox($fieldName, $options = array()) { * * @param string $fieldName Name of a field, like this "Modelname.fieldname" * @param array $options Radio button options array. - * @param array $attributes Array of HTML attributes. - * @return string + * @param array $attributes Array of HTML attributes, and special attributes above. + * @return string Completed radio widget set. + * @access public */ function radio($fieldName, $options = array(), $attributes = array()) { $attributes = $this->_initInputField($fieldName, $attributes); @@ -1042,7 +1058,8 @@ function radio($fieldName, $options = array(), $attributes = array()) { * * @param string $fieldName Name of a field, in the form "Modelname.fieldname" * @param array $options Array of HTML attributes. - * @return string An HTML text input element + * @return string A generated HTML text input element + * @access public */ function text($fieldName, $options = array()) { $options = $this->_initInputField($fieldName, array_merge( @@ -1060,7 +1077,8 @@ function text($fieldName, $options = array()) { * * @param string $fieldName Name of a field, like in the form "Modelname.fieldname" * @param array $options Array of HTML attributes. - * @return string + * @return string A generated password input. + * @access public */ function password($fieldName, $options = array()) { $options = $this->_initInputField($fieldName, $options); @@ -1074,9 +1092,14 @@ function password($fieldName, $options = array()) { /** * Creates a textarea widget. * + * ### Options: + * + * - `escape` - Whether or not the contents of the textarea should be escaped. Defaults to true. + * * @param string $fieldName Name of a field, in the form "Modelname.fieldname" - * @param array $options Array of HTML attributes. - * @return string An HTML text input element + * @param array $options Array of HTML attributes, and special options above. + * @return string A generated HTML text input element + * @access public */ function textarea($fieldName, $options = array()) { $options = $this->_initInputField($fieldName, $options); @@ -1100,9 +1123,9 @@ function textarea($fieldName, $options = array()) { /** * Creates a hidden input field. * - * @param string $fieldName Name of a field, in the form"Modelname.fieldname" + * @param string $fieldName Name of a field, in the form of "Modelname.fieldname" * @param array $options Array of HTML attributes. - * @return string + * @return string A generated hidden input * @access public */ function hidden($fieldName, $options = array()) { @@ -1133,7 +1156,7 @@ function hidden($fieldName, $options = array()) { * * @param string $fieldName Name of a field, in the form "Modelname.fieldname" * @param array $options Array of HTML attributes. - * @return string + * @return string A generated file input. * @access public */ function file($fieldName, $options = array()) { @@ -1151,13 +1174,13 @@ function file($fieldName, $options = array()) { } /** - * Creates a <button> tag. + * Creates a `<button>` tag. * - * Options: + * ### Options: * * - `escape` - HTML entity encode the $title of the button. Defaults to false. * - * @param string $title The button's caption. Not automatically HTML encoded + * @param string $title The button's caption. Not automatically HTML encoded * @param array $options Array of options and HTML attributes. * @return string A HTML button tag. * @access public @@ -1184,6 +1207,7 @@ function button($title, $options = array()) { * OR if the first character is not /, image is relative to webroot/img. * @param array $options * @return string A HTML submit button + * @access public */ function submit($caption = null, $options = array()) { if (!$caption) { @@ -1252,7 +1276,7 @@ function submit($caption = null, $options = array()) { /** * Returns a formatted SELECT element. * - * Attributes: + * ### Attributes: * * - `showParents` - If included in the array and set to true, an additional option element * will be added for the parent of each option group. @@ -1260,6 +1284,7 @@ function submit($caption = null, $options = array()) { * created instead. * - `empty` - If true, the empty select option is shown. If a string, * that string is displayed as the empty element. + * - `escape` - If true contents of options will be HTML entity encoded. Defaults to true. * * @param string $fieldName Name attribute of the SELECT * @param array $options Array of the OPTION elements (as 'value'=>'Text' pairs) to be used in the @@ -1268,6 +1293,7 @@ function submit($caption = null, $options = array()) { * from POST data will be used when available. * @param array $attributes The HTML attributes of the select element. * @return string Formatted SELECT element + * @access public */ function select($fieldName, $options = array(), $selected = null, $attributes = array()) { $select = array(); @@ -1356,7 +1382,7 @@ function select($fieldName, $options = array(), $selected = null, $attributes = /** * Returns a SELECT element for days. * - * Attributes: + * ### Attributes: * * - `empty` - If true, the empty select option is shown. If a string, * that string is displayed as the empty element. @@ -1364,7 +1390,8 @@ function select($fieldName, $options = array(), $selected = null, $attributes = * @param string $fieldName Prefix name for the SELECT element * @param string $selected Option which is selected. * @param array $attributes HTML attributes for the select element - * @return string + * @return string A generated day select box. + * @access public */ function day($fieldName, $selected = null, $attributes = array()) { $attributes += array('empty' => true); @@ -1381,7 +1408,7 @@ function day($fieldName, $selected = null, $attributes = array()) { /** * Returns a SELECT element for years * - * Attributes: + * ### Attributes: * * - `empty` - If true, the empty select option is shown. If a string, * that string is displayed as the empty element. @@ -1392,6 +1419,7 @@ function day($fieldName, $selected = null, $attributes = array()) { * @param string $selected Option which is selected. * @param array $attributes Attribute array for the select elements. * @return string Completed year select input + * @access public */ function year($fieldName, $minYear = null, $maxYear = null, $selected = null, $attributes = array()) { $attributes += array('empty' => true); @@ -1428,7 +1456,7 @@ function year($fieldName, $minYear = null, $maxYear = null, $selected = null, $a /** * Returns a SELECT element for months. * - * Attributes: + * ### Attributes: * * - `monthNames` - If false, 2 digit numbers will be used instead of text. * If a array, the given array will be used. @@ -1438,7 +1466,8 @@ function year($fieldName, $minYear = null, $maxYear = null, $selected = null, $a * @param string $fieldName Prefix name for the SELECT element * @param string $selected Option which is selected. * @param array $attributes Attributes for the select element - * @return string + * @return string A generated month select dropdown. + * @access public */ function month($fieldName, $selected = null, $attributes = array()) { $attributes += array('empty' => true); @@ -1464,7 +1493,7 @@ function month($fieldName, $selected = null, $attributes = array()) { /** * Returns a SELECT element for hours. * - * Attributes: + * ### Attributes: * * - `empty` - If true, the empty select option is shown. If a string, * that string is displayed as the empty element. @@ -1474,6 +1503,7 @@ function month($fieldName, $selected = null, $attributes = array()) { * @param string $selected Option which is selected. * @param array $attributes List of HTML attributes * @return string Completed hour select input + * @access public */ function hour($fieldName, $format24Hours = false, $selected = null, $attributes = array()) { $attributes += array('empty' => true); @@ -1498,7 +1528,7 @@ function hour($fieldName, $format24Hours = false, $selected = null, $attributes /** * Returns a SELECT element for minutes. * - * Attributes: + * ### Attributes: * * - `empty` - If true, the empty select option is shown. If a string, * that string is displayed as the empty element. @@ -1506,7 +1536,8 @@ function hour($fieldName, $format24Hours = false, $selected = null, $attributes * @param string $fieldName Prefix name for the SELECT element * @param string $selected Option which is selected. * @param string $attributes Array of Attributes - * @return string Completed minute select input + * @return string Completed minute select input. + * @access public */ function minute($fieldName, $selected = null, $attributes = array()) { $attributes += array('empty' => true); @@ -1537,6 +1568,7 @@ function minute($fieldName, $selected = null, $attributes = array()) { * @param mixed $selected The current selected value. * @param array $attributes Array of attributes, must contain 'empty' key. * @return string Currently selected value. + * @access private */ function __dateTimeSelected($select, $fieldName, $selected, $attributes) { if ((empty($selected) || $selected === true) && $value = $this->value($fieldName)) { @@ -1558,7 +1590,7 @@ function __dateTimeSelected($select, $fieldName, $selected, $attributes) { /** * Returns a SELECT element for AM or PM. * - * Attributes: + * ### Attributes: * * - `empty` - If true, the empty select option is shown. If a string, * that string is displayed as the empty element. @@ -1568,6 +1600,7 @@ function __dateTimeSelected($select, $fieldName, $selected, $attributes) { * @param string $attributes Array of Attributes * @param bool $showEmpty Show/Hide an empty option * @return string Completed meridian select input + * @access public */ function meridian($fieldName, $selected = null, $attributes = array()) { $attributes += array('empty' => true); @@ -1598,7 +1631,7 @@ function meridian($fieldName, $selected = null, $attributes = array()) { /** * Returns a set of SELECT elements for a full datetime setup: day, month and year, and then time. * - * Attributes: + * ### Attributes: * * - `monthNames` If false, 2 digit numbers will be used instead of text. * If a array, the given array will be used. @@ -1614,7 +1647,8 @@ function meridian($fieldName, $selected = null, $attributes = array()) { * @param string $timeFormat 12, 24. * @param string $selected Option which is selected. * @param string $attributes array of Attributes - * @return string The HTML formatted OPTION element + * @return string Generated set of select boxes for the date and time formats chosen. + * @access public */ function dateTime($fieldName, $dateFormat = 'DMY', $timeFormat = '12', $selected = null, $attributes = array()) { $attributes += array('empty' => true); @@ -1982,9 +2016,9 @@ function __generateOptions($name, $options = array()) { * * - `secure` - boolean whether or not the the field should be added to the security fields. * - * @param string $field - * @param array $options - * @return array + * @param string $field Name of the field to initialize options for. + * @param array $options Array of options to append options into. + * @return array Array of options for the input. * @access protected */ function _initInputField($field, $options = array()) { diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php index 8aebddab6..272bd12e3 100644 --- a/cake/libs/view/helpers/html.php +++ b/cake/libs/view/helpers/html.php @@ -91,49 +91,10 @@ class HtmlHelper extends AppHelper { 'javascriptend' => '</script>' ); -/** - * Base URL - * - * @var string - * @access public - */ - var $base = null; - -/** - * URL to current action. - * - * @var string - * @access public - */ - var $here = null; - -/** - * Parameter array. - * - * @var array - * @access public - */ - var $params = array(); - -/** - * Current action. - * - * @var string - * @access public - */ - var $action = null; - -/** - * Enter description here... - * - * @var array - * @access public - */ - var $data = null; /** * Breadcrumbs. * - * @var array + * @var array * @access protected */ var $_crumbs = array(); @@ -155,7 +116,7 @@ class HtmlHelper extends AppHelper { /** * Document type definitions * - * @var array + * @var array * @access private */ var $__docTypes = array( @@ -209,7 +170,7 @@ function docType($type = 'xhtml-strict') { /** * Creates a link to an external resource and handles basic meta tags * - * #### Options + * ### Options * * - `inline` Whether or not the link element should be output inline, or in scripts_for_layout. * @@ -217,7 +178,7 @@ function docType($type = 'xhtml-strict') { * @param mixed $url The address of the external resource or string for content attribute * @param array $options Other attributes for the generated tag. If the type attribute is html, * rss, atom, or icon, the mime-type is returned. - * @return string A completed <link /> element. + * @return string A completed `<link />` element. * @access public */ function meta($type, $url = null, $options = array()) { @@ -280,7 +241,8 @@ function meta($type, $url = null, $options = array()) { /** * Returns a charset META-tag. * - * @param string $charset The character set to be used in the meta tag. Example: "utf-8". + * @param string $charset The character set to be used in the meta tag. If empty, + * The App.encoding value will be used. Example: "utf-8". * @return string A meta tag containing the specified character set. * @access public */ @@ -300,7 +262,7 @@ function charset($charset = null) { * * If the $url is empty, $title is used instead. * - * #### Options + * ### Options * * - `escape` Set to false to disable escaping of title and attributes. * @@ -308,7 +270,7 @@ function charset($charset = null) { * @param mixed $url Cake-relative URL or array of URL parameters, or external URL (starts with http://) * @param array $options Array of HTML attributes. * @param string $confirmMessage JavaScript confirmation message. - * @return string An <a /> element. + * @return string An `<a />` element. * @access public */ function link($title, $url = null, $options = array(), $confirmMessage = false) { @@ -353,7 +315,7 @@ function link($title, $url = null, $options = array(), $confirmMessage = false) /** * Creates a link element for CSS stylesheets. * - * #### Options + * ### Options * * - `inline` If set to false, the generated tag appears in the head tag of the layout. Defaults to true * @@ -418,14 +380,14 @@ function css($path, $rel = null, $options = array()) { } /** - * Returns one or many <script> tags depending on the number of scripts given. + * Returns one or many `<script>` tags depending on the number of scripts given. * * If the filename is prefixed with "/", the path will be relative to the base path of your * application. Otherwise, the path will be relative to your JavaScript path, usually webroot/js. * * Can include one or many Javascript files. * - * #### Options + * ### Options * * - `inline` - Whether script should be output inline or into scripts_for_layout. * - `once` - Whether or not the script should be checked for uniqueness. If true scripts will only be @@ -433,8 +395,9 @@ function css($path, $rel = null, $options = array()) { * * @param mixed $url String or array of javascript files to include * @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 + * @return mixed String of `<script />` tags or null if $inline is false or if $once is true and the file has been * included before. + * @access public */ function script($url, $options = array()) { if (is_bool($options)) { @@ -480,6 +443,7 @@ function script($url, $options = array()) { $view->addScript($out); } } + /** * Wrap $script in a script tag. * @@ -491,6 +455,7 @@ function script($url, $options = array()) { * @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']` + * @access public */ function scriptBlock($script, $options = array()) { $options += array('safe' => true, 'inline' => true); @@ -508,6 +473,7 @@ function scriptBlock($script, $options = array()) { return null; } } + /** * Begin a script block that captures output until HtmlHelper::scriptEnd() * is called. This capturing block will capture all output between the methods @@ -520,6 +486,7 @@ function scriptBlock($script, $options = array()) { * * @param array $options Options for the code block. * @return void + * @access public */ function scriptStart($options = array()) { $options += array('safe' => true, 'inline' => true); @@ -527,12 +494,14 @@ function scriptStart($options = array()) { ob_start(); return null; } + /** * End a Buffered section of Javascript capturing. * Generates a script tag inline or in `$scripts_for_layout` depending on the settings * used when the scriptBlock was started * * @return mixed depending on the settings of scriptStart() either a script tag or null + * @access public */ function scriptEnd() { $buffer = ob_get_clean(); @@ -540,10 +509,20 @@ function scriptEnd() { $this->_scriptBlockOptions = array(); return $this->scriptBlock($buffer, $options); } + /** * Builds CSS style data from an array of CSS properties * - * @param array $data Style data array + * ### Usage: + * + * {{{ + * echo $html->style(array('margin' => '10px', 'padding' => '10px'), true); + * + * // creates + * 'margin:10px;padding:10px;' + * }}} + * + * @param array $data Style data array, keys will be used as property names, values as property values. * @param boolean $oneline Whether or not the style block should be displayed on one line. * @return string CSS styling data * @access public @@ -567,7 +546,7 @@ function style($data, $oneline = true) { * * @param string $separator Text to separate crumbs. * @param string $startText This will be the first crumb, if false it defaults to first crumb in array - * @return string + * @return string Composed bread crumbs * @access public */ function getCrumbs($separator = '»', $startText = false) { @@ -591,10 +570,20 @@ function getCrumbs($separator = '»', $startText = false) { } /** - * Creates a formatted IMG element. If `$options['url']` is provided, an image link will be + * Creates a formatted IMG element. If `$options['url']` is provided, an image link will be * generated with the link pointed at `$options['url']`. This method will set an empty * alt attribute if one is not supplied. * + * ### Usage + * + * Create a regular image: + * + * `echo $html->image('cake_icon.png', array('alt' => 'CakePHP'));` + * + * Create an image link: + * + * `echo $html->image('cake_icon.png', array('alt' => 'CakePHP', 'url' => 'http://cakephp.org'));` + * * @param string $path Path to the image file, relative to the app/webroot/img/ directory. * @param array $options Array of HTML attributes. * @return string completed img tag @@ -702,7 +691,7 @@ function tableCells($data, $oddTrOptions = null, $evenTrOptions = null, $useCoun /** * Returns a formatted block tag, i.e DIV, SPAN, P. * - * #### Options + * ### Options * * - `escape` Whether or not the contents should be html_entity escaped. * @@ -732,7 +721,7 @@ function tag($name, $text = null, $options = array()) { /** * Returns a formatted DIV tag for HTML FORMs. * - * #### Options + * ### Options * * - `escape` Whether or not the contents should be html_entity escaped. * @@ -753,7 +742,7 @@ function div($class = null, $text = null, $options = array()) { /** * Returns a formatted P tag. * - * #### Options + * ### Options * * - `escape` Whether or not the contents should be html_entity escaped. * diff --git a/cake/libs/view/helpers/jquery_engine.php b/cake/libs/view/helpers/jquery_engine.php index ccc6e4a94..0d66561e3 100644 --- a/cake/libs/view/helpers/jquery_engine.php +++ b/cake/libs/view/helpers/jquery_engine.php @@ -4,12 +4,14 @@ * * Provides jQuery specific Javascript for JsHelper. * + * Implements the JsHelper interface for jQuery. All $options arrays + * support all options found in the JsHelper, as well as those in the jQuery + * documentation. + * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework <http://www.cakephp.org/> - * Copyright 2006-2009, Cake Software Foundation, Inc. - * 1785 E. Sahara Avenue, Suite 490-204 - * Las Vegas, Nevada 89104 + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. @@ -27,6 +29,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper { * Option mappings for jQuery * * @var array + * @access protected */ var $_optionMap = array( 'request' => array( @@ -52,9 +55,10 @@ class JqueryEngineHelper extends JsBaseEngineHelper { ); /** - * callback arguments lists + * Callback arguments lists * * @var string + * @access protected */ var $_callbackArguments = array( 'slider' => array( @@ -103,6 +107,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper { * when jQuery is put into noConflict() mode. * * @var string + * @access public */ var $jQueryObject = '$'; @@ -114,8 +119,8 @@ class JqueryEngineHelper extends JsBaseEngineHelper { * @param string $selection the selection to apply * @param string $options Array of options for method * @param string $callbacks Array of callback / special options. + * @return string Composed method string * @access public - * @return string */ function _methodTemplate($method, $template, $options, $extraSafeKeys = array()) { $options = $this->_mapOptions($method, $options); @@ -133,6 +138,7 @@ function _methodTemplate($method, $template, $options, $extraSafeKeys = array()) * * @param string $selector The selector that is targeted * @return object instance of $this. Allows chained methods. + * @access public */ function get($selector) { if ($selector == 'window' || $selector == 'document') { @@ -155,6 +161,7 @@ function get($selector) { * @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 + * @access public */ function event($type, $callback, $options = array()) { $defaults = array('wrap' => true, 'stop' => true); @@ -171,10 +178,11 @@ function event($type, $callback, $options = array()) { } /** - * Create a domReady event. This is a special event in many libraries + * Create a domReady event. For jQuery * * @param string $functionBody The code to run on domReady * @return string completed domReady method + * @access public */ function domReady($functionBody) { $this->get('document'); @@ -187,6 +195,7 @@ function domReady($functionBody) { * @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 + * @access public */ function each($callback) { return $this->selection . '.each(function () {' . $callback . '});'; @@ -198,6 +207,7 @@ function each($callback) { * @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. + * @access public * @see JsBaseEngineHelper::effect() */ function effect($name, $options = array()) { @@ -228,8 +238,9 @@ function effect($name, $options = array()) { * If the 'update' key is set, success callback will be overridden. * * @param mixed $url - * @param array $options + * @param array $options See JsHelper::request() for options. * @return string The completed ajax call. + * @access public */ function request($url, $options = array()) { $url = $this->url($url); @@ -266,6 +277,7 @@ function request($url, $options = array()) { * * @param array $options Array of options for the sortable. * @return string Completed sortable script. + * @access public * @see JsHelper::sortable() for options list. */ function sortable($options = array()) { @@ -280,6 +292,7 @@ function sortable($options = array()) { * * @param array $options Array of options for the draggable element. * @return string Completed Draggable script. + * @access public * @see JsHelper::drag() for options list. */ function drag($options = array()) { @@ -294,6 +307,7 @@ function drag($options = array()) { * * @param array $options Array of options for the droppable element. * @return string Completed Droppable script. + * @access public * @see JsHelper::drop() for options list. */ function drop($options = array()) { @@ -308,6 +322,7 @@ function drop($options = array()) { * * @param array $options Array of options for the droppable element. * @return string Completed Slider script. + * @access public * @see JsHelper::slider() for options list. */ function slider($options = array()) { @@ -321,7 +336,8 @@ function slider($options = array()) { * form, errors will be created in the Javascript. * * @param array $options Options for the serialization - * @return string completed form serialization script + * @return string completed form serialization script. + * @access public * @see JsHelper::serializeForm() for option list. */ function serializeForm($options = array()) { diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index f15050409..fae4e1f03 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -57,6 +57,7 @@ class JsHelper extends AppHelper { * Scripts that are queued for output * * @var array + * @see JsHelper::buffer() * @access private */ var $__bufferedScripts = array(); @@ -186,7 +187,7 @@ function value($val, $quoteString = true) { * caches them to a file and returns a linked script. If no scripts have been * buffered this method will return null * - * Options + * ### Options * * - `inline` - Set to true to have scripts output as a script block inline * if `cache` is also true, a script link tag will be generated. (default true) @@ -198,6 +199,7 @@ function value($val, $quoteString = true) { * @param array $options options for the code block * @return mixed Completed javascript tag if there are scripts, if there are no buffered * scripts null will be returned. + * @access public */ function writeBuffer($options = array()) { $defaults = array('onDomReady' => true, 'inline' => true, 'cache' => false, 'clear' => true, 'safe' => true); @@ -230,7 +232,7 @@ function writeBuffer($options = array()) { } /** - * Write a script to the cached scripts. + * Write a script to the buffered scripts. * * @param string $script Script string to add to the buffer. * @param boolean $top If true the script will be added to the top of the @@ -247,7 +249,7 @@ function buffer($script, $top = false) { } /** - * Get all the cached scripts + * Get all the buffered scripts * * @param boolean $clear Whether or not to clear the script caches (default true) * @return array Array of scripts added to the request. @@ -266,8 +268,8 @@ function getBuffer($clear = true) { /** * Generates the object string for variables passed to javascript. * - * @return string - * @access public + * @return string Generated JSON object of all set vars + * @access protected */ function _createVars() { if (!empty($this->__jsVars)) { @@ -354,7 +356,7 @@ function set($one, $two = null) { * both those for FormHelper::submit() and JsBaseEngine::request(), JsBaseEngine::event(); * * Forms submitting with this method, cannot send files. Files do not transfer over XmlHttpRequest - * and require an iframe. + * and require an iframe or flash. * * @param string $title The display text of the submit button. * @param array $options Array of options to use. @@ -402,7 +404,7 @@ function submit($caption = null, $options = array()) { * @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 js options and Htmloptions - * @access public + * @access protected */ function _getHtmlOptions($options, $additional = array()) { $htmlKeys = array_merge(array('class', 'id', 'escape', 'onblur', 'onfocus', 'rel', 'title'), $additional); @@ -482,7 +484,7 @@ function __construct() { } /** - * Create an alert message in Javascript + * Create an `alert()` message in Javascript * * @param string $message Message you want to alter. * @return string completed alert() @@ -493,10 +495,11 @@ function alert($message) { } /** - * Redirects to a URL + * Redirects to a URL. Creates a window.location modification snippet + * that can be used to trigger 'redirects' from Javascript. * - * @param mixed $url - * @param array $options + * @param mixed $url + * @param array $options * @return string completed redirect in javascript * @access public */ @@ -505,7 +508,7 @@ function redirect($url = null) { } /** - * Create a confirm() message + * Create a `confirm()` message * * @param string $message Message you want confirmed. * @return string completed confirm() @@ -530,7 +533,7 @@ function confirmReturn($message) { } /** - * Create a prompt() Javascript function + * Create a `prompt()` Javascript function * * @param string $message Message you want to prompt. * @param string $default Default message @@ -545,7 +548,7 @@ function prompt($message, $default = '') { * Generates a JavaScript object in JavaScript Object Notation (JSON) * from an array. Will use native JSON encode method if available, and $useNative == true * - * Options: + * ### Options: * * - `prefix` - String prepended to the returned data. * - `postfix` - String appended to the returned data. @@ -647,9 +650,9 @@ function value($val, $quoteString = true) { * * List of escaped elements: * - * + "\r" => '\n' - * + "\n" => '\n' - * + '"' => '\"' + * - "\r" => '\n' + * - "\n" => '\n' + * - '"' => '\"' * * @param string $script String that needs to get escaped. * @return string Escaped string. @@ -812,7 +815,7 @@ function each($callback) { * * ### Supported Effects * - * The following effects are supported by all JsEngines + * The following effects are supported by all core JsEngines * * - `show` - reveal an element. * - `hide` - hide an element. @@ -867,7 +870,7 @@ function request($url, $options = array()) { /** * Create a draggable element. Works on the currently selected element. - * Additional options may be supported by your library. + * Additional options may be supported by the library implementation. * * ### Options * @@ -891,7 +894,7 @@ function drag($options = array()) { /** * Create a droppable element. Allows for draggable elements to be dropped on it. - * Additional options may be supported by your library. + * Additional options may be supported by the library implementation. * * ### Options * @@ -913,6 +916,7 @@ function drop($options = array()) { /** * Create a sortable element. + * Additional options may be supported by the library implementation. * * ### Options * @@ -937,7 +941,8 @@ function sortable() { } /** - * Create a slider UI widget. Comprised of a track and knob + * Create a slider UI widget. Comprised of a track and knob. + * Additional options may be supported by the library implementation. * * ### Options * @@ -984,11 +989,11 @@ function serializeForm() { /** * Parse an options assoc array into an Javascript object literal. * Similar to object() but treats any non-integer value as a string, - * does not include { } + * does not include `{ }` * * @param array $options Options to be converted * @param array $safeKeys Keys that should not be escaped. - * @return string + * @return string Parsed JSON options without enclosing { }. * @access protected */ function _parseOptions($options, $safeKeys = array()) { diff --git a/cake/libs/view/helpers/number.php b/cake/libs/view/helpers/number.php index c9a565407..050e1e97b 100644 --- a/cake/libs/view/helpers/number.php +++ b/cake/libs/view/helpers/number.php @@ -66,9 +66,10 @@ class NumberHelper extends AppHelper { /** * Formats a number with a level of precision. * - * @param float $number A floating point number. - * @param integer $precision The precision of the returned number. + * @param float $number A floating point number. + * @param integer $precision The precision of the returned number. * @return float Enter description here... + * @access public */ function precision($number, $precision = 3) { return sprintf("%01.{$precision}f", $number); @@ -79,6 +80,7 @@ function precision($number, $precision = 3) { * * @param integer $length Size in bytes * @return string Human readable size + * @access public */ function toReadableSize($size) { switch (true) { @@ -101,6 +103,7 @@ function toReadableSize($size) { * @param float $number A floating point number * @param integer $precision The precision of the returned number * @return string Percentage string + * @access public */ function toPercentage($number, $precision = 2) { return $this->precision($number, $precision) . '%'; @@ -113,6 +116,7 @@ function toPercentage($number, $precision = 2) { * @param integer $options if int then places, if string then before, if (,.-) then use it * or array with places and before keys * @return string formatted number + * @access public */ function format($number, $options = false) { $places = 0; @@ -169,6 +173,7 @@ function format($number, $options = false) { * set at least 'before' and 'after' options. * @param array $options * @return string Number formatted as a currency. + * @access public */ function currency($number, $currency = 'USD', $options = array()) { $default = $this->_currencyDefaults; @@ -237,6 +242,7 @@ function currency($number, $currency = 'USD', $options = array()) { * @param array $options The array of options for this format. * @return void * @see NumberHelper::currency() + * @access public */ function addFormat($formatName, $options) { $this->_currencies[$formatName] = $options + $this->_currencyDefaults; diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index 8a29da535..2e5dcca7d 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -67,9 +67,11 @@ class PaginatorHelper extends AppHelper { * - `$options['escape']` Defines if the title field for the link should be escaped (default: true). * - `$options['update']` DOM id of the element updated with the results of the AJAX call. * If this key isn't specified Paginator will use plain HTML links. - * - `$options['indicator']` DOM id of the element that will be shown when doing AJAX requests. + * - `$options['indicator']` DOM id of the element that will be shown when doing AJAX requests. **Only supported by + * AjaxHelper** * * @var array + * @access public */ var $options = array(); @@ -98,6 +100,9 @@ function __construct($config = array()) { /** * Before render callback. Overridden to merge passed args with url options. + * + * @return void + * @access public */ function beforeRender() { $this->options['url'] = array_merge($this->params['pass'], $this->params['named']); @@ -110,6 +115,7 @@ function beforeRender() { * * @param string $model Optional model name. Uses the default if none is specified. * @return array The array of paging parameters for the paginated resultset. + * @access public */ function params($model = null) { if (empty($model)) { @@ -125,7 +131,9 @@ function params($model = null) { * Sets default options for all pagination links * * @param mixed $options Default options for pagination links. If a string is supplied - it - * is used as the DOM id element to update. See #options for list of keys. + * is used as the DOM id element to update. See PaginatorHelper::$options for list of keys. + * @return void + * @access public */ function options($options = array()) { if (is_string($options)) { @@ -158,6 +166,7 @@ function options($options = array()) { * * @param string $model Optional model name. Uses the default if none is specified. * @return string The current page number of the recordset. + * @access public */ function current($model = null) { $params = $this->params($model); @@ -175,6 +184,7 @@ function current($model = null) { * @param mixed $options Options for pagination links. See #options for list of keys. * @return string The name of the key by which the recordset is being sorted, or * null if the results are not currently sorted. + * @access public */ function sortKey($model = null, $options = array()) { if (empty($options)) { @@ -207,6 +217,7 @@ function sortKey($model = null, $options = array()) { * @param mixed $options Options for pagination links. See #options for list of keys. * @return string The direction by which the recordset is being sorted, or * null if the results are not currently sorted. + * @access public */ function sortDir($model = null, $options = array()) { $dir = null; @@ -231,7 +242,7 @@ function sortDir($model = null, $options = array()) { /** * Generates a "previous" link for a set of paged records * - * Options: + * ### Options: * * - `tag` The tag wrapping tag you want to use, defaults to 'span' * - `escape` Whether you want the contents html entity encoded, defaults to true @@ -242,6 +253,7 @@ function sortDir($model = null, $options = array()) { * @param string $disabledTitle Title when the link is disabled. * @param mixed $disabledOptions Options for the disabled pagination link. See #options for list of keys. * @return string A "previous" link or $disabledTitle text if the link is disabled. + * @access public */ function prev($title = '<< Previous', $options = array(), $disabledTitle = null, $disabledOptions = array()) { return $this->__pagingLink('Prev', $title, $options, $disabledTitle, $disabledOptions); @@ -250,7 +262,7 @@ function prev($title = '<< Previous', $options = array(), $disabledTitle = null, /** * Generates a "next" link for a set of paged records * - * Options: + * ### Options: * * - `tag` The tag wrapping tag you want to use, defaults to 'span' * - `escape` Whether you want the contents html entity encoded, defaults to true @@ -261,6 +273,7 @@ function prev($title = '<< Previous', $options = array(), $disabledTitle = null, * @param string $disabledTitle Title when the link is disabled. * @param mixed $disabledOptions Options for the disabled pagination link. See above for list of keys. * @return string A "next" link or or $disabledTitle text if the link is disabled. + * @access public */ function next($title = 'Next >>', $options = array(), $disabledTitle = null, $disabledOptions = array()) { return $this->__pagingLink('Next', $title, $options, $disabledTitle, $disabledOptions); @@ -270,7 +283,7 @@ function next($title = 'Next >>', $options = array(), $disabledTitle = null, $di * Generates a sorting link. Sets named parameters for the sort and direction. Handles * direction switching automatically. * - * Options: + * ### Options: * * - `escape` Whether you want the contents html entity encoded, defaults to true * - `model` The model to use, defaults to PaginatorHelper::defaultModel() @@ -281,6 +294,7 @@ function next($title = 'Next >>', $options = array(), $disabledTitle = null, $di * @param array $options Options for sorting link. See above for list of keys. * @return string A link sorting default by 'asc'. If the resultset is sorted 'asc' by the specified * key the returned link will sort by 'desc'. + * @access public */ function sort($title, $key = null, $options = array()) { $options = array_merge(array('url' => array(), 'model' => null), $options); @@ -317,7 +331,7 @@ function sort($title, $key = null, $options = array()) { /** * Generates a plain or Ajax link with pagination parameters * - * Options + * ### Options * * - `update` The Id of the DOM element you wish to update. Creates Ajax enabled links * with the AjaxHelper. @@ -328,6 +342,7 @@ function sort($title, $key = null, $options = array()) { * @param mixed $url Url for the action. See Router::url() * @param array $options Options for the link. See #options for list of keys. * @return string A link with pagination parameters. + * @access public */ function link($title, $url = array(), $options = array()) { $options = array_merge(array('model' => null, 'escape' => true), $options); @@ -356,6 +371,7 @@ function link($title, $url = array(), $options = array()) { * @param boolean $asArray Return the url as an array, or a URI string * @param string $model Which model to paginate on * @return mixed By default, returns a full pagination URL string for use in non-standard contexts (i.e. JavaScript) + * @access public */ function url($options = array(), $asArray = false, $model = null) { $paging = $this->params($model); @@ -381,6 +397,7 @@ function url($options = array(), $asArray = false, $model = null) { /** * Protected method for generating prev/next links * + * @access protected */ function __pagingLink($which, $title = null, $options = array(), $disabledTitle = null, $disabledOptions = array()) { $check = 'has' . $which; @@ -421,6 +438,7 @@ function __pagingLink($which, $title = null, $options = array(), $disabledTitle * * @param string $model Optional model name. Uses the default if none is specified. * @return boolean True if the result set is not at the first page. + * @access public */ function hasPrev($model = null) { return $this->__hasPage($model, 'prev'); @@ -431,6 +449,7 @@ function hasPrev($model = null) { * * @param string $model Optional model name. Uses the default if none is specified. * @return boolean True if the result set is not at the last page. + * @access public */ function hasNext($model = null) { return $this->__hasPage($model, 'next'); @@ -442,6 +461,7 @@ function hasNext($model = null) { * @param string $model Optional model name. Uses the default if none is specified. * @param int $page The page number - if not set defaults to 1. * @return boolean True if the given result set has the specified page number. + * @access public */ function hasPage($model = null, $page = 1) { if (is_numeric($model)) { @@ -453,8 +473,12 @@ function hasPage($model = null, $page = 1) { } /** - * Protected method + * Does $model have $page in its range? * + * @param string $model Model name to get parameters for. + * @param integer $page Page number you are checking. + * @return boolean Whether model has $page + * @access protected */ function __hasPage($model, $page) { $params = $this->params($model); @@ -470,6 +494,7 @@ function __hasPage($model, $page) { * Gets the default model of the paged sets * * @return string Model name or null if the pagination isn't initialized. + * @access public */ function defaultModel() { if ($this->__defaultModel != null) { @@ -485,7 +510,7 @@ function defaultModel() { /** * Returns a counter string for the paged result set * - * Options + * ### Options * * - `model` The model to use, defaults to PaginatorHelper::defaultModel(); * - `format` The format string you want to use, defaults to 'pages' Which generates output like '1 of 5' @@ -496,6 +521,7 @@ function defaultModel() { * * @param mixed $options Options for the counter string. See #options for list of keys. * @return string Counter string. + * @access public */ function counter($options = array()) { if (is_string($options)) { @@ -558,7 +584,7 @@ function counter($options = array()) { * Returns a set of numbers for the paged result set * uses a modulus to decide how many numbers to show on each side of the current page (default: 8) * - * Options + * ### Options * * - `before` Content to be inserted before the numbers * - `after` Content to be inserted after the numbers @@ -573,6 +599,7 @@ function counter($options = array()) { * * @param mixed $options Options for the numbers, (before, after, model, modulus, separator) * @return string numbers string. + * @access public */ function numbers($options = array()) { if ($options === true) { @@ -678,7 +705,7 @@ function numbers($options = array()) { /** * Returns a first or set of numbers for the first pages * - * Options: + * ### Options: * * - `tag` The tag wrapping tag you want to use, defaults to 'span' * - `before` Content to insert before the link/tag @@ -688,6 +715,7 @@ function numbers($options = array()) { * @param mixed $first if string use as label for the link, if numeric print page numbers * @param mixed $options * @return string numbers string. + * @access public */ function first($first = '<< first', $options = array()) { $options = array_merge( @@ -731,7 +759,7 @@ function first($first = '<< first', $options = array()) { /** * Returns a last or set of numbers for the last pages * - * Options: + * ### Options: * * - `tag` The tag wrapping tag you want to use, defaults to 'span' * - `before` Content to insert before the link/tag @@ -741,6 +769,7 @@ function first($first = '<< first', $options = array()) { * @param mixed $last if string use as label for the link, if numeric print page numbers * @param mixed $options Array of options * @return string numbers string. + * @access public */ function last($last = 'last >>', $options = array()) { $options = array_merge( diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php index 71fd93bda..3f6ffb409 100644 --- a/cake/libs/view/helpers/prototype_engine.php +++ b/cake/libs/view/helpers/prototype_engine.php @@ -29,6 +29,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper { * @var boolean */ var $_multiple = false; + /** * Option mappings for Prototype * @@ -123,13 +124,14 @@ function get($selector) { $this->selection = '$$("' . $selector . '")'; return $this; } + /** * Add an event to the script cache. Operates on the currently selected elements. * * ### Options * - * - 'wrap' - Whether you want the callback wrapped in an anonymous function. (defaults true) - * - 'stop' - Whether you want the event to stopped. (defaults true) + * - `wrap` - Whether you want the callback wrapped in an anonymous function. (defaults true) + * - `stop` - Whether you want the event to stopped. (defaults true) * * @param string $type Type of event to bind to the current 946 id * @param string $callback The Javascript function you wish to trigger or the function literal @@ -150,34 +152,40 @@ function event($type, $callback, $options = array()) { $out = $this->selection . ".observe(\"{$type}\", $callback);"; return $out; } + /** * Create a domReady event. This is a special event in many libraries * * @param string $functionBody The code to run on domReady * @return string completed domReady method + * @access public */ function domReady($functionBody) { $this->selection = 'document'; return $this->event('dom:loaded', $functionBody, array('stop' => false)); } + /** * Create an iteration over the current selection result. * * @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 + * @access public */ function each($callback) { return $this->selection . '.each(function (item, index) {' . $callback . '});'; } + /** * Trigger an Effect. * - * #### Note: Effects require Scriptaculous to be loaded. + * ### Note: Effects require Scriptaculous to be loaded. * * @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. + * @access public * @see JsBaseEngineHelper::effect() */ function effect($name, $options = array()) { @@ -214,12 +222,14 @@ function effect($name, $options = array()) { } return $effect; } + /** * Create an Ajax or Ajax.Updater call. * * @param mixed $url * @param array $options * @return string The completed ajax call. + * @access public */ function request($url, $options = array()) { $url = '"'. $this->url($url) . '"'; @@ -246,6 +256,7 @@ function request($url, $options = array()) { } return "var jsRequest = new Ajax$type($url$options);"; } + /** * Create a sortable element. * @@ -253,6 +264,7 @@ function request($url, $options = array()) { * * @param array $options Array of options for the sortable. * @return string Completed sortable script. + * @access public * @see JsHelper::sortable() for options list. */ function sortable($options = array()) { @@ -262,6 +274,7 @@ function sortable($options = array()) { } return 'var jsSortable = Sortable.create(' . $this->selection . $options . ');'; } + /** * Create a Draggable element. * @@ -269,6 +282,7 @@ function sortable($options = array()) { * * @param array $options Array of options for the draggable. * @return string Completed draggable script. + * @access public * @see JsHelper::draggable() for options list. */ function drag($options = array()) { @@ -281,6 +295,7 @@ function drag($options = array()) { } return 'var jsDrag = new Draggable(' . $this->selection . $options . ');'; } + /** * Create a Droppable element. * @@ -288,6 +303,7 @@ function drag($options = array()) { * * @param array $options Array of options for the droppable. * @return string Completed droppable script. + * @access public * @see JsHelper::droppable() for options list. */ function drop($options = array()) { @@ -297,6 +313,7 @@ function drop($options = array()) { } return 'Droppables.add(' . $this->selection . $options . ');'; } + /** * Creates a slider control widget. * @@ -304,6 +321,7 @@ function drop($options = array()) { * * @param array $options Array of options for the slider. * @return string Completed slider script. + * @access public * @see JsHelper::slider() for options list. */ function slider($options = array()) { @@ -323,11 +341,13 @@ function slider($options = array()) { $this->selection = $slider; return $out; } + /** * Serialize the form attached to $selector. * * @param array $options Array of options. * @return string Completed serializeForm() snippet + * @access public * @see JsHelper::serializeForm() */ function serializeForm($options = array()) { diff --git a/cake/libs/view/helpers/rss.php b/cake/libs/view/helpers/rss.php index f885f3da3..00b8919d7 100644 --- a/cake/libs/view/helpers/rss.php +++ b/cake/libs/view/helpers/rss.php @@ -102,10 +102,11 @@ class RssHelper extends XmlHelper { var $version = '2.0'; /** - * Returns an RSS document wrapped in <rss /> tags + * Returns an RSS document wrapped in `<rss />` tags * - * @param array $attrib <rss /> tag attributes + * @param array $attrib `<rss />` tag attributes * @return string An RSS document + * @access public */ function document($attrib = array(), $content = null) { if ($content === null) { @@ -120,12 +121,13 @@ function document($attrib = array(), $content = null) { } /** - * Returns an RSS <channel /> element + * Returns an RSS `<channel />` element * - * @param array $attrib <channel /> tag attributes - * @param mixed $elements Named array elements which are converted to tags - * @param mixed $content Content (<item />'s belonging to this channel - * @return string An RSS <channel /> + * @param array $attrib `<channel />` tag attributes + * @param mixed $elements Named array elements which are converted to tags + * @param mixed $content Content (`<item />`'s belonging to this channel + * @return string An RSS `<channel />` + * @access public */ function channel($attrib = array(), $elements = array(), $content = null) { $view =& ClassRegistry::getObject('view'); @@ -166,12 +168,13 @@ function channel($attrib = array(), $elements = array(), $content = null) { /** * Transforms an array of data using an optional callback, and maps it to a set - * of <item /> tags + * of `<item />` tags * - * @param array $items The list of items to be mapped - * @param mixed $callback A string function name, or array containing an object - * and a string method name - * @return string A set of RSS <item /> elements + * @param array $items The list of items to be mapped + * @param mixed $callback A string function name, or array containing an object + * and a string method name + * @return string A set of RSS `<item />` elements + * @access public */ function items($items, $callback = null) { if ($callback != null) { @@ -188,11 +191,12 @@ function items($items, $callback = null) { } /** - * Converts an array into an <item /> element and its contents + * Converts an array into an `<item />` element and its contents * - * @param array $attrib The attributes of the <item /> element - * @param array $elements The list of elements contained in this <item /> - * @return string An RSS <item /> element + * @param array $attrib The attributes of the `<item />` element + * @param array $elements The list of elements contained in this `<item />` + * @return string An RSS `<item />` element + * @access public */ function item($att = array(), $elements = array()) { $content = null; @@ -275,7 +279,7 @@ function item($att = array(), $elements = array()) { /** * Converts a time in any format to an RSS time * - * @param mixed $time + * @param mixed $time * @return string An RSS-formatted timestamp * @see TimeHelper::toRSS */ diff --git a/cake/libs/view/helpers/session.php b/cake/libs/view/helpers/session.php index 5383b4351..8f6f9b46e 100644 --- a/cake/libs/view/helpers/session.php +++ b/cake/libs/view/helpers/session.php @@ -27,7 +27,6 @@ * * @package cake * @subpackage cake.cake.libs.view.helpers - * */ class SessionHelper extends CakeSession { @@ -36,7 +35,7 @@ class SessionHelper extends CakeSession { * * @var array */ - var $helpers = null; + var $helpers = array(); /** * Used to determine if methods implementation is used, or bypassed @@ -62,6 +61,7 @@ function __construct($base = null) { * Turn sessions on if 'Session.start' is set to false in core.php * * @param string $base + * @access public */ function activate($base = null) { $this->__active = true; @@ -70,11 +70,10 @@ function activate($base = null) { /** * Used to read a session values set in a controller for a key or return values for all keys. * - * In your view: $session->read('Controller.sessKey'); + * In your view: `$session->read('Controller.sessKey');` * Calling the method without a param will return all session vars * * @param string $name the name of the session key you want to read - * * @return values from the session vars * @access public */ @@ -88,7 +87,7 @@ function read($name = null) { /** * Used to check is a session key has been set * - * In your view: $session->check('Controller.sessKey'); + * In your view: `$session->check('Controller.sessKey');` * * @param string $name * @return boolean @@ -104,7 +103,7 @@ function check($name) { /** * Returns last error encountered in a session * - * In your view: $session->error(); + * In your view: `$session->error();` * * @return string last error * @access public @@ -120,7 +119,7 @@ function error() { * Used to render the message set in Controller::Session::setFlash() * * In your view: $session->flash('somekey'); - * Will default to flash if no param is passed + * Will default to flash if no param is passed * * @param string $key The [Message.]key you are rendering in the view. * @return boolean|string Will return the value if $key is set, or false if not set. diff --git a/cake/libs/view/helpers/text.php b/cake/libs/view/helpers/text.php index 21883781c..8a069b70c 100644 --- a/cake/libs/view/helpers/text.php +++ b/cake/libs/view/helpers/text.php @@ -45,10 +45,10 @@ class TextHelper extends AppHelper { * Highlights a given phrase in a text. You can specify any expression in highlighter that * may include the \1 expression to include the $phrase found. * - * Options: + * ### Options: * - * - 'format' The piece of html with that the phrase will be highlighted - * - 'html' If true, will ignore any HTML tags, ensuring that only the correct text is highlighted + * - `format` The piece of html with that the phrase will be highlighted + * - `html` If true, will ignore any HTML tags, ensuring that only the correct text is highlighted * * @param string $text Text to search the phrase in * @param string $phrase The phrase that will be searched @@ -166,16 +166,17 @@ function autoLink($text, $options = array()) { * Cuts a string to the length of $length and replaces the last characters * with the ending if the text is longer than length. * - * Options: + * ### Options: * - * - 'ending' Will be used as Ending and appended to the trimmed string - * - 'exact' If false, $text will not be cut mid-word - * - 'html' If true, HTML tags would be handled correctly + * - `ending` Will be used as Ending and appended to the trimmed string + * - `exact` If false, $text will not be cut mid-word + * - `html` If true, HTML tags would be handled correctly * * @param string $text String to truncate. * @param integer $length Length of returned string, including ellipsis. * @param array $options An array of html attributes and options. * @return string Trimmed string. + * @access public */ function truncate($text, $length = 100, $options = array()) { $default = array( @@ -279,7 +280,8 @@ function trim() { } /** - * Extracts an excerpt from the text surrounding the phrase with a number of characters on each side determined by radius. + * Extracts an excerpt from the text surrounding the phrase with a number of characters on each side + * determined by radius. * * @param string $text String to search the phrase in * @param string $phrase Phrase that will be searched for diff --git a/cake/libs/view/helpers/time.php b/cake/libs/view/helpers/time.php index 1431fd52c..18a2a391b 100644 --- a/cake/libs/view/helpers/time.php +++ b/cake/libs/view/helpers/time.php @@ -32,9 +32,11 @@ class TimeHelper extends AppHelper { * Converts a string representing the format for the function strftime and returns a * windows safe and i18n aware format. * - * @param string $format Format with specifiers for strftime function. Accepts the special specifier %S which mimics th modifier S for date() + * @param string $format Format with specifiers for strftime function. + * Accepts the special specifier %S which mimics th modifier S for date() * @param string UNIX timestamp * @return string windows safe and date() function compatible format for strftime + * @access public */ function convertSpecifiers($format, $time = null) { if (!$time) { @@ -50,6 +52,7 @@ function convertSpecifiers($format, $time = null) { * * @param array $specifier match from regular expression * @return string converted element + * @access private */ function __translateSpecifier($specifier) { switch ($specifier[1]) { @@ -138,6 +141,7 @@ function __translateSpecifier($specifier) { * @param string $serverTime UNIX timestamp * @param int $userOffset User's offset from GMT (in hours) * @return string UNIX timestamp + * @access public */ function convert($serverTime, $userOffset) { $serverOffset = $this->serverOffset(); @@ -150,6 +154,7 @@ function convert($serverTime, $userOffset) { * Returns server's offset from GMT in seconds. * * @return int Offset + * @access public */ function serverOffset() { return date('Z', time()); @@ -161,6 +166,7 @@ function serverOffset() { * @param string $dateString Datetime string * @param int $userOffset User's offset from GMT (in hours) * @return string Parsed timestamp + * @access public */ function fromString($dateString, $userOffset = null) { if (empty($dateString)) { @@ -186,6 +192,7 @@ function fromString($dateString, $userOffset = null) { * @param string $dateString Datetime string or Unix timestamp * @param int $userOffset User's offset from GMT (in hours) * @return string Formatted date string + * @access public */ function nice($dateString = null, $userOffset = null) { if ($dateString != null) { @@ -208,6 +215,7 @@ function nice($dateString = null, $userOffset = null) { * @param string $dateString Datetime string or Unix timestamp * @param int $userOffset User's offset from GMT (in hours) * @return string Described, relative date string + * @access public */ function niceShort($dateString = null, $userOffset = null) { $date = $dateString ? $this->fromString($dateString, $userOffset) : time(); @@ -234,6 +242,7 @@ function niceShort($dateString = null, $userOffset = null) { * @param string $fieldName Name of database field to compare with * @param int $userOffset User's offset from GMT (in hours) * @return string Partial SQL string. + * @access public */ function daysAsSql($begin, $end, $fieldName, $userOffset = null) { $begin = $this->fromString($begin, $userOffset); @@ -252,6 +261,7 @@ function daysAsSql($begin, $end, $fieldName, $userOffset = null) { * @param string $fieldName Name of database field to compare with * @param int $userOffset User's offset from GMT (in hours) * @return string Partial SQL string. + * @access public */ function dayAsSql($dateString, $fieldName, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); @@ -264,6 +274,7 @@ function dayAsSql($dateString, $fieldName, $userOffset = null) { * @param string $dateString Datetime string or Unix timestamp * @param int $userOffset User's offset from GMT (in hours) * @return boolean True if datetime string is today + * @access public */ function isToday($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); @@ -275,6 +286,7 @@ function isToday($dateString, $userOffset = null) { * @param string $dateString * @param int $userOffset User's offset from GMT (in hours) * @return boolean True if datetime string is within current week + * @access public */ function isThisWeek($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); @@ -286,6 +298,7 @@ function isThisWeek($dateString, $userOffset = null) { * @param string $dateString * @param int $userOffset User's offset from GMT (in hours) * @return boolean True if datetime string is within current month + * @access public */ function isThisMonth($dateString, $userOffset = null) { $date = $this->fromString($dateString); @@ -297,6 +310,7 @@ function isThisMonth($dateString, $userOffset = null) { * * @param string $dateString Datetime string or Unix timestamp * @return boolean True if datetime string is within current year + * @access public */ function isThisYear($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); @@ -309,6 +323,7 @@ function isThisYear($dateString, $userOffset = null) { * @param string $dateString Datetime string or Unix timestamp * @param int $userOffset User's offset from GMT (in hours) * @return boolean True if datetime string was yesterday + * @access public */ function wasYesterday($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); @@ -321,6 +336,7 @@ function wasYesterday($dateString, $userOffset = null) { * @param string $dateString Datetime string or Unix timestamp * @param int $userOffset User's offset from GMT (in hours) * @return boolean True if datetime string was yesterday + * @access public */ function isTomorrow($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); @@ -328,10 +344,12 @@ function isTomorrow($dateString, $userOffset = null) { } /** - * Returns the quart + * Returns the quarter + * * @param string $dateString * @param boolean $range if true returns a range in Y-m-d format * @return boolean True if datetime string is within current week + * @access public */ function toQuarter($dateString, $range = false) { $time = $this->fromString($dateString); @@ -368,6 +386,7 @@ function toQuarter($dateString, $range = false) { * @param string $dateString Datetime string to be represented as a Unix timestamp * @param int $userOffset User's offset from GMT (in hours) * @return integer Unix timestamp + * @access public */ function toUnix($dateString, $userOffset = null) { return $this->fromString($dateString, $userOffset); @@ -379,6 +398,7 @@ function toUnix($dateString, $userOffset = null) { * @param string $dateString Datetime string or Unix timestamp * @param int $userOffset User's offset from GMT (in hours) * @return string Formatted date string + * @access public */ function toAtom($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); @@ -391,6 +411,7 @@ function toAtom($dateString, $userOffset = null) { * @param string $dateString Datetime string or Unix timestamp * @param int $userOffset User's offset from GMT (in hours) * @return string Formatted date string + * @access public */ function toRSS($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); @@ -402,11 +423,11 @@ function toRSS($dateString, $userOffset = null) { * on the difference between the current time and given datetime. * $datetime should be in a <i>strtotime</i> - parsable format, like MySQL's datetime datatype. * - * Options: + * ### Options: * - * - 'format' => a fall back format if the relative time is longer than the duration specified by end - * - 'end' => The end of relative time telling - * - 'userOffset' => Users offset from GMT (in hours) + * - `format` => a fall back format if the relative time is longer than the duration specified by end + * - `end` => The end of relative time telling + * - `userOffset` => Users offset from GMT (in hours) * * Relative dates look something like this: * 3 weeks, 4 days ago @@ -420,6 +441,7 @@ function toRSS($dateString, $userOffset = null) { * @param string $dateString Datetime string or Unix timestamp * @param array $options Default format if timestamp is used in $dateString * @return string Relative time string. + * @access public */ function timeAgoInWords($dateTime, $options = array()) { $userOffset = null; @@ -584,7 +606,9 @@ function timeAgoInWords($dateTime, $options = array()) { * @param mixed $options Default format string, if timestamp is used in $dateTime, or an array of options to be passed * on to timeAgoInWords(). * @return string Relative time string. - * @see TimeHelper::timeAgoInWords + * @see TimeHelper::timeAgoInWords + * @access public + * @deprecated This method alias will be removed in future versions. */ function relativeTime($dateTime, $options = array()) { return $this->timeAgoInWords($dateTime, $options); @@ -593,10 +617,12 @@ function relativeTime($dateTime, $options = array()) { /** * Returns true if specified datetime was within the interval specified, else false. * - * @param mixed $timeInterval the numeric value with space then time type. Example of valid types: 6 hours, 2 days, 1 minute. + * @param mixed $timeInterval the numeric value with space then time type. + * Example of valid types: 6 hours, 2 days, 1 minute. * @param mixed $dateString the datestring or unix timestamp to compare * @param int $userOffset User's offset from GMT (in hours) * @return bool + * @access public */ function wasWithinLast($timeInterval, $dateString, $userOffset = null) { $tmp = str_replace(' ', '', $timeInterval); @@ -619,6 +645,7 @@ function wasWithinLast($timeInterval, $dateString, $userOffset = null) { * * @param string $dateString Datetime string * @return string Formatted date string + * @access public */ function gmt($string = null) { if ($string != null) { @@ -647,6 +674,7 @@ function gmt($string = null) { * @param boolean $invalid flag to ignore results of fromString == false * @param int $userOffset User's offset from GMT (in hours) * @return string Formatted date string + * @access public */ function format($format, $date = null, $invalid = false, $userOffset = null) { $time = $this->fromString($date, $userOffset); @@ -665,11 +693,13 @@ function format($format, $date = null, $invalid = false, $userOffset = null) { /** * Returns a formatted date string, given either a UNIX timestamp or a valid strtotime() date string. * It take in account the default date format for the current language if a LC_TIME file is used. + * * @param string $dateString Datetime string * @param string $format strftime format string. * @param boolean $invalid flag to ignore results of fromString == false * @param int $userOffset User's offset from GMT (in hours) - * @return string Formatted and translated date string + * @return string Formatted and translated date string @access public + * @access public */ function i18nFormat($date, $format = null, $invalid = false, $userOffset = null) { $date = $this->fromString($date, $userOffset); diff --git a/cake/libs/view/helpers/xml.php b/cake/libs/view/helpers/xml.php index ac7b9775b..f45fa77bb 100644 --- a/cake/libs/view/helpers/xml.php +++ b/cake/libs/view/helpers/xml.php @@ -39,6 +39,7 @@ class XmlHelper extends AppHelper { /** * Constructor + * * @return void */ function __construct() { @@ -50,8 +51,9 @@ function __construct() { /** * Returns an XML document header * - * @param array $attrib Header tag attributes + * @param array $attrib Header tag attributes * @return string XML header + * @access public */ function header($attrib = array()) { if (Configure::read('App.encoding') !== null) { @@ -71,10 +73,10 @@ function header($attrib = array()) { /** * Adds a namespace to any documents generated * - * @param string $name The namespace name - * @param string $url The namespace URI; can be empty if in the default namespace map + * @param string $name The namespace name + * @param string $url The namespace URI; can be empty if in the default namespace map * @return boolean False if no URL is specified, and the namespace does not exist - * default namespace map, otherwise true + * default namespace map, otherwise true * @deprecated * @see Xml::addNs() */ @@ -88,6 +90,7 @@ function addNs($name, $url = null) { * @param string $name The namespace name or URI * @deprecated * @see Xml::removeNs() + * @access public */ function removeNs($name) { return $this->Xml->removeGlobalNamespace($name); @@ -96,11 +99,12 @@ function removeNs($name) { /** * Generates an XML element * - * @param string $name The name of the XML element - * @param array $attrib The attributes of the XML element - * @param mixed $content XML element content - * @param boolean $endTag Whether the end tag of the element should be printed + * @param string $name The name of the XML element + * @param array $attrib The attributes of the XML element + * @param mixed $content XML element content + * @param boolean $endTag Whether the end tag of the element should be printed * @return string XML + * @access public */ function elem($name, $attrib = array(), $content = null, $endTag = true) { $namespace = null; @@ -138,6 +142,7 @@ function elem($name, $attrib = array(), $content = null, $endTag = true) { * Create closing tag for current element * * @return string + * @access public */ function closeElem() { $name = $this->Xml->name(); @@ -150,11 +155,12 @@ function closeElem() { /** * Serializes a model resultset into XML * - * @param mixed $data The content to be converted to XML - * @param array $options The data formatting options. For a list of valid options, see - * XmlNode::__construct(). + * @param mixed $data The content to be converted to XML + * @param array $options The data formatting options. For a list of valid options, see + * XmlNode::__construct(). * @return string A copy of $data in XML format * @see XmlNode + * @access public */ function serialize($data, $options = array()) { $options += array('attributes' => false, 'format' => 'attributes'); From c2e7e5642ec9ca2b62fa812dbb120cc8e6e4edb1 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 25 Jan 2010 18:14:16 -0500 Subject: [PATCH 1586/2083] Updating doc blocks for View and Theme View. --- cake/libs/view/helpers/cache.php | 2 +- cake/libs/view/theme.php | 4 ++- cake/libs/view/view.php | 57 +++++++++++++++++++++++++------- 3 files changed, 49 insertions(+), 14 deletions(-) diff --git a/cake/libs/view/helpers/cache.php b/cake/libs/view/helpers/cache.php index 3abb043a9..d4874948a 100644 --- a/cake/libs/view/helpers/cache.php +++ b/cake/libs/view/helpers/cache.php @@ -60,7 +60,7 @@ class CacheHelper extends AppHelper { * * @param string $file File to cache * @param string $out output to cache - * @param boolean $cache + * @param boolean $cache Whether or not a cache file should be written. * @return string view ouput */ function cache($file, $out, $cache = false) { diff --git a/cake/libs/view/theme.php b/cake/libs/view/theme.php index fb0fae942..51c16250a 100644 --- a/cake/libs/view/theme.php +++ b/cake/libs/view/theme.php @@ -46,8 +46,10 @@ function __construct(&$controller, $register = true) { * Return all possible paths to find view files in order * * @param string $plugin + * @param boolean $cached Set to true to force dir scan. * @return array paths - * @access private + * @access protected + * @todo Make theme path building respect $cached parameter. */ function _paths($plugin = null, $cached = true) { $paths = parent::_paths($plugin, $cached); diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index fd7db3654..d762aec80 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -152,6 +152,7 @@ class View extends Object { * File extension. Defaults to Cake's template ".ctp". * * @var string + * @access public */ var $ext = '.ctp'; @@ -159,6 +160,7 @@ class View extends Object { * Sub-directory for this view file. * * @var string + * @access public */ var $subDir = null; @@ -166,6 +168,7 @@ class View extends Object { * Theme name. * * @var string + * @access public */ var $theme = null; @@ -182,6 +185,7 @@ class View extends Object { * holds current errors for the model validation * * @var array + * @access public */ var $validationErrors = array(); @@ -189,6 +193,7 @@ class View extends Object { * True when the view has been rendered. * * @var boolean + * @access public */ var $hasRendered = false; @@ -196,6 +201,7 @@ class View extends Object { * Array of loaded view helpers. * * @var array + * @access public */ var $loaded = array(); @@ -203,6 +209,7 @@ class View extends Object { * True if in scope of model-specific region * * @var boolean + * @access public */ var $modelScope = false; @@ -210,6 +217,7 @@ class View extends Object { * Name of current model this view context is attached to * * @var string + * @access public */ var $model = null; @@ -217,6 +225,7 @@ class View extends Object { * Name of association model this view context is attached to * * @var string + * @access public */ var $association = null; @@ -224,6 +233,7 @@ class View extends Object { * Name of current model field this view context is attached to * * @var string + * @access public */ var $field = null; @@ -231,6 +241,7 @@ class View extends Object { * Suffix of current field this view context is attached to * * @var string + * @access public */ var $fieldSuffix = null; @@ -238,6 +249,7 @@ class View extends Object { * The current model ID this view context is attached to * * @var mixed + * @access public */ var $modelId = null; @@ -245,6 +257,7 @@ class View extends Object { * List of generated DOM UUIDs * * @var array + * @access public */ var $uuids = array(); @@ -252,6 +265,7 @@ class View extends Object { * Holds View output. * * @var string + * @access public */ var $output = false; @@ -279,12 +293,15 @@ class View extends Object { * Holds an array of paths. * * @var array + * @access private */ var $__paths = array(); /** * Constructor * + * @param Controller $controller A controller object to pull View::__passedArgs from. + * @param boolean $register Should the View instance be registered in the ClassRegistry * @return View */ function __construct(&$controller, $register = true) { @@ -311,10 +328,11 @@ function __construct(&$controller, $register = true) { * * ### Special params * - * - cache - enable caching for this element accepts boolean or strtotime compatible string. + * - `cache` - enable caching for this element accepts boolean or strtotime compatible string. * Can also be an array. If `cache` is an array, * `time` is used to specify duration of cache. * `key` can be used to create unique cache files. + * - `plugin` - Load an element from a specific plugin. * * @param string $name Name of template file in the/app/views/elements/ folder * @param array $params Array of data to be made available to the for rendered @@ -385,6 +403,7 @@ function element($name, $params = array(), $loadHelpers = false) { * @param string $layout Layout to use * @param string $file Custom filename for view * @return string Rendered Element + * @access public */ function render($action = null, $layout = null, $file = null) { if ($this->hasRendered) { @@ -435,6 +454,7 @@ function render($action = null, $layout = null, $file = null) { * * @param string $content_for_layout Content to render in a view, wrapped by the surrounding layout. * @return mixed Rendered output, or false on error + * @access public */ function renderLayout($content_for_layout, $layout = null) { $layoutFileName = $this->_getLayoutFileName($layout); @@ -496,10 +516,13 @@ function _triggerHelpers($callback) { } /** - * Render cached view + * Render cached view. Works in concert with CacheHelper and Dispatcher to + * render cached view files. * * @param string $filename the cache file to include * @param string $timeStart the page render start time + * @return boolean Success of rendering the cached file. + * @access public */ function renderCache($filename, $timeStart) { ob_start(); @@ -529,7 +552,7 @@ function renderCache($filename, $timeStart) { /** * Returns a list of variables available in the current View context * - * @return array + * @return array Array of the set view variable names. * @access public */ function getVars() { @@ -539,7 +562,8 @@ function getVars() { /** * Returns the contents of the given View variable(s) * - * @return array + * @param string $var The view var you want the contents of. + * @return mixed The content of the named var if its set, otherwise null. * @access public */ function getVar($var) { @@ -552,10 +576,11 @@ function getVar($var) { /** * Adds a script block or other element to be inserted in $scripts_for_layout in - * the <head /> of a document layout + * the `<head />` of a document layout * - * @param string $name - * @param string $content + * @param string $name Either the key name for the script, or the script content. Name can be used to + * update/replace a script element. + * @param string $content The content of the script being added, optional. * @return void * @access public */ @@ -593,6 +618,7 @@ function uuid($object, $url) { * Returns the entity reference of the current context as an array of identity parts * * @return array An array containing the identity elements of an entity + * @access public */ function entity() { $assoc = ($this->association) ? $this->association : $this->model; @@ -622,6 +648,7 @@ function entity() { * @param mixed $two Value in case $one is a string (which then works as the key). * Unused if $one is an associative array, otherwise serves as the values to $one's keys. * @return void + * @access public */ function set($one, $two = null) { $data = null; @@ -646,6 +673,7 @@ function set($one, $two = null) { * @param integer $code HTTP Error code (for instance: 404) * @param string $name Name of the error (for instance: Not Found) * @param string $message Error message as a web page + * @access public */ function error($code, $name, $message) { header ("HTTP/1.1 {$code} {$name}"); @@ -661,6 +689,8 @@ function error($code, $name, $message) { * * @param string $___viewFn Filename of the view * @param array $___dataForView Data to include in rendered view + * @param boolean $loadHelpers Boolean to indicate that helpers should be loaded. + * @param boolean $cached Whether or not to trigger the creation of a cache file. * @return string Rendered output * @access protected */ @@ -727,7 +757,8 @@ function _render($___viewFn, $___dataForView, $loadHelpers = true, $cached = fal * @param array $loaded List of helpers that are already loaded. * @param array $helpers List of helpers to load. * @param string $parent holds name of helper, if loaded helper has helpers - * @return array + * @return array Array containing the loaded helpers. + * @access protected */ function &_loadHelpers(&$loaded, $helpers, $parent = null) { foreach ($helpers as $i => $helper) { @@ -792,7 +823,7 @@ function &_loadHelpers(&$loaded, $helpers, $parent = null) { * CamelCased action names will be under_scored! This means that you can have * LongActionNames that refer to long_action_names.ctp views. * - * @param string $action Controller action to find template filename for + * @param string $name Controller action to find template filename for * @return string Template filename * @access protected */ @@ -852,6 +883,7 @@ function _getViewFileName($name = null) { /** * Returns layout filename for this template as a string. * + * @param string $name The name of the layout to find. * @return string Filename for layout file (.ctp). * @access protected */ @@ -885,10 +917,10 @@ function _getLayoutFileName($name = null) { * Return a misssing view error message * * @param string $viewFileName the filename that should exist - * @return cakeError + * @return false + * @access protected */ function _missingView($file, $error = 'missingView') { - if ($error === 'missingView') { $this->cakeError('missingView', array( 'className' => $this->name, @@ -910,7 +942,8 @@ function _missingView($file, $error = 'missingView') { /** * Return all possible paths to find view files in order * - * @param string $plugin + * @param string $plugin Optional plugin name to scan for view files. + * @param boolean $cached Set to true to force a refresh of view paths. * @return array paths * @access protected */ From 3e4a9631da5205d90c7df58e86a677d83f4e83af Mon Sep 17 00:00:00 2001 From: "renan.saddam" <renan.saddam@gmail.com> Date: Tue, 26 Jan 2010 12:14:47 -0200 Subject: [PATCH 1587/2083] Fixing notice due by using a non-existent variable. --- cake/tests/lib/test_manager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index a71665301..d961ee219 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -23,7 +23,7 @@ define('APP_TEST_GROUPS', TESTS . 'groups'); /** - * TestManager is the base class that handles loading and initiating the running + * TestManager is the base class that handles loading and initiating the running * of TestCase and TestSuite classes that the user has selected. * * @package cake @@ -103,7 +103,7 @@ function runAllTests(&$reporter, $testing = false) { if ($this->appTest) { $test =& new TestSuite(__('All App Tests', true)); } else if ($this->pluginTest) { - $test =& new TestSuite(sprintf(__('All %s Plugin Tests', true), Inflector::humanize($manager->pluginTest))); + $test =& new TestSuite(sprintf(__('All %s Plugin Tests', true), Inflector::humanize($this->pluginTest))); } else { $test =& new TestSuite(__('All Core Tests', true)); } From b1a0eb10973e037a33b1299c3210b3642004ae5d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 26 Jan 2010 10:10:22 -0500 Subject: [PATCH 1588/2083] Fixing double DS when requiring cache engines. Fixes #254 --- cake/libs/cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/cache.php b/cake/libs/cache.php index ee39f42ca..1162e61e6 100644 --- a/cake/libs/cache.php +++ b/cake/libs/cache.php @@ -81,7 +81,7 @@ function &getInstance() { */ function __loadEngine($name) { if (!class_exists($name . 'Engine')) { - require LIBS . DS . 'cache' . DS . strtolower($name) . '.php'; + require LIBS . 'cache' . DS . strtolower($name) . '.php'; } return true; } From 16eaa990df971baca4664641dc8c6c92f9785d66 Mon Sep 17 00:00:00 2001 From: Robust Solution <hussein_elharake@yahoo.com> Date: Wed, 20 Jan 2010 22:18:55 +0000 Subject: [PATCH 1589/2083] optimization in AuthComponent class startup method Signed-off-by: Mark Story <mark@mark-story.com> --- cake/libs/controller/components/auth.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index abebeb0f5..574481a7a 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -262,10 +262,6 @@ function initialize(&$controller) { * @access public */ function startup(&$controller) { - $methods = array_flip($controller->methods); - $action = strtolower($controller->params['action']); - $allowedActions = array_map('strtolower', $this->allowedActions); - $isErrorOrTests = ( strtolower($controller->name) == 'cakeerror' || (strtolower($controller->name) == 'tests' && Configure::read() > 0) @@ -274,6 +270,8 @@ function startup(&$controller) { return true; } + $methods = array_flip($controller->methods); + $action = strtolower($controller->params['action']); $isMissingAction = ( $controller->scaffold === false && !isset($methods[$action]) @@ -296,6 +294,7 @@ function startup(&$controller) { $url = Router::normalize($url); $loginAction = Router::normalize($this->loginAction); + $allowedActions = array_map('strtolower', $this->allowedActions); $isAllowed = ( $this->allowedActions == array('*') || in_array($action, $allowedActions) From 9cbb9d193aca9cf96cfd927e750401ad9b4f8334 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 26 Jan 2010 10:55:11 -0500 Subject: [PATCH 1590/2083] Fixing php4 compatibility and errors from array to string conversion. --- cake/libs/view/helpers/form.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 62982ee75..a1aaa34fc 100644 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -1721,7 +1721,10 @@ function __selectOptions($elements = array(), $selected = null, $parents = array } if ($name !== null) { - if ((!$selectedIsEmpty && (string)$selected == (string)$name) || ($selectedIsArray && in_array($name, $selected))) { + if ( + (!$selectedIsArray && !$selectedIsEmpty && (string)$selected == (string)$name) || + ($selectedIsArray && in_array($name, $selected)) + ) { if ($attributes['style'] === 'checkbox') { $htmlOptions['checked'] = true; } else { From c195d654b329c48c586c9739e4f36c4bf995b58d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 26 Jan 2010 11:00:37 -0500 Subject: [PATCH 1591/2083] Fixing TranslateBehavior test to run in php4. --- cake/libs/model/behaviors/translate.php | 3 ++- .../libs/model/behaviors/translate.test.php | 20 +++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/cake/libs/model/behaviors/translate.php b/cake/libs/model/behaviors/translate.php index 24659ef38..1162180ab 100644 --- a/cake/libs/model/behaviors/translate.php +++ b/cake/libs/model/behaviors/translate.php @@ -377,7 +377,8 @@ function &translateModel(&$model) { } elseif (empty($model->translateTable) && empty($model->translateModel)) { $this->runtime[$model->alias]['model']->setSource('i18n'); } - return $this->runtime[$model->alias]['model']; + $model =& $this->runtime[$model->alias]['model']; + return $model; } /** * Bind translation for fields, optionally with hasMany association for diff --git a/cake/tests/cases/libs/model/behaviors/translate.test.php b/cake/tests/cases/libs/model/behaviors/translate.test.php index 55e13d8af..1231eecb9 100644 --- a/cake/tests/cases/libs/model/behaviors/translate.test.php +++ b/cake/tests/cases/libs/model/behaviors/translate.test.php @@ -74,21 +74,25 @@ function testTranslateModel() { $TestModel =& new Tag(); $TestModel->translateTable = 'another_i18n'; $TestModel->Behaviors->attach('Translate', array('title')); - $this->assertEqual($TestModel->translateModel()->name, 'I18nModel'); - $this->assertEqual($TestModel->translateModel()->useTable, 'another_i18n'); + $translateModel =& $TestModel->Behaviors->Translate->translateModel($TestModel); + $this->assertEqual($translateModel->name, 'I18nModel'); + $this->assertEqual($translateModel->useTable, 'another_i18n'); $TestModel =& new User(); $TestModel->Behaviors->attach('Translate', array('title')); - $this->assertEqual($TestModel->translateModel()->name, 'I18nModel'); - $this->assertEqual($TestModel->translateModel()->useTable, 'i18n'); + $translateModel =& $TestModel->Behaviors->Translate->translateModel($TestModel); + $this->assertEqual($translateModel->name, 'I18nModel'); + $this->assertEqual($translateModel->useTable, 'i18n'); $TestModel =& new TranslatedArticle(); - $this->assertEqual($TestModel->translateModel()->name, 'TranslateArticleModel'); - $this->assertEqual($TestModel->translateModel()->useTable, 'article_i18n'); + $translateModel =& $TestModel->Behaviors->Translate->translateModel($TestModel); + $this->assertEqual($translateModel->name, 'TranslateArticleModel'); + $this->assertEqual($translateModel->useTable, 'article_i18n'); $TestModel =& new TranslatedItem(); - $this->assertEqual($TestModel->translateModel()->name, 'TranslateTestModel'); - $this->assertEqual($TestModel->translateModel()->useTable, 'i18n'); + $translateModel =& $TestModel->Behaviors->Translate->translateModel($TestModel); + $this->assertEqual($translateModel->name, 'TranslateTestModel'); + $this->assertEqual($translateModel->useTable, 'i18n'); } /** * testLocaleFalsePlain method From 81414b717542173761a213f3c97f16c7bcc0ea5e Mon Sep 17 00:00:00 2001 From: "renan.saddam" <renan.saddam@gmail.com> Date: Tue, 26 Jan 2010 15:00:19 -0200 Subject: [PATCH 1592/2083] Enabling group code coverage on plugins outside APP/plugins path. --- cake/tests/lib/code_coverage_manager.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index 1e88c734c..ca49e4dc1 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -118,7 +118,7 @@ function start() { } /** - * Stops/pauses code coverage collection. Does not clean the + * Stops/pauses code coverage collection. Does not clean the * code coverage memory. Use clean() to clear code coverage memory * * @return void @@ -159,7 +159,7 @@ function setParams(&$reporter) { } /** - * Stops the current code coverage analyzation and dumps a nice report + * Stops the current code coverage analyzation and dumps a nice report * depending on the reporter that was passed to start() * * @return void @@ -559,6 +559,7 @@ function __testObjectFilesFromGroupFile($groupFile, $isApp = true) { $groupContent = file_get_contents($path); $ds = '\s*\.\s*DS\s*\.\s*'; $pluginTest = 'APP\.\'plugins\'' . $ds . '\'' . $manager->pluginTest . '\'' . $ds . '\'tests\'' . $ds . '\'cases\''; + $pluginTest .= '|App::pluginPath\(\'' . $manager->pluginTest . '\'\)' . $ds . '\'tests\'' . $ds . '\'cases\''; $pattern = '/\s*TestManager::addTestFile\(\s*\$this,\s*(' . $pluginTest . '|APP_TEST_CASES|CORE_TEST_CASES)' . $ds . '(.*?)\)/i'; preg_match_all($pattern, $groupContent, $matches); From fc304056a31088069157f2d28ac480c02e4b1d9f Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 26 Jan 2010 13:59:26 -0500 Subject: [PATCH 1593/2083] Removing Session deletion of nonce token on blackhole. Fixes possible CSRF risk from multiple submissions of the same invalid data. Refs #214 --- cake/libs/controller/components/security.php | 2 -- .../controller/components/security.test.php | 20 ++++++++++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/cake/libs/controller/components/security.php b/cake/libs/controller/components/security.php index 52f0d3d9d..5aca459b6 100644 --- a/cake/libs/controller/components/security.php +++ b/cake/libs/controller/components/security.php @@ -381,8 +381,6 @@ function generateDigestResponseHash($data) { * @see SecurityComponent::$blackHoleCallback */ function blackHole(&$controller, $error = '') { - $this->Session->del('_Token'); - if ($this->blackHoleCallback == null) { $code = 404; if ($error == 'login') { diff --git a/cake/tests/cases/libs/controller/components/security.test.php b/cake/tests/cases/libs/controller/components/security.test.php index 111aa0cb9..b1cf605f6 100644 --- a/cake/tests/cases/libs/controller/components/security.test.php +++ b/cake/tests/cases/libs/controller/components/security.test.php @@ -237,16 +237,16 @@ function testRequireAuthFail() { $this->Controller->Security->startup($this->Controller); $this->assertTrue($this->Controller->failed); - $this->Controller->Session->write('_Token', array('allowedControllers' => array())); + $this->Controller->Session->write('_Token', serialize(array('allowedControllers' => array()))); $this->Controller->data = array('username' => 'willy', 'password' => 'somePass'); $this->Controller->action = 'posted'; $this->Controller->Security->requireAuth('posted'); $this->Controller->Security->startup($this->Controller); $this->assertTrue($this->Controller->failed); - $this->Controller->Session->write('_Token', array( + $this->Controller->Session->write('_Token', serialize(array( 'allowedControllers' => array('SecurityTest'), 'allowedActions' => array('posted2') - )); + ))); $this->Controller->data = array('username' => 'willy', 'password' => 'somePass'); $this->Controller->action = 'posted'; $this->Controller->Security->requireAuth('posted'); @@ -1145,5 +1145,19 @@ function testSettingTokenForRequestAction() { $this->Controller->Security->startup($this->Controller); $this->assertEqual($this->Controller->params['_Token']['key'], $key); } + +/** + * test that blackhole doesn't delete the _Token session key so repeat data submissions + * stay blackholed. + * + * @link http://cakephp.lighthouseapp.com/projects/42648/tickets/214 + * @return void + */ + function testBlackHoleNotDeletingSessionInformation() { + $this->Controller->Security->startup($this->Controller); + + $this->Controller->Security->blackHole($this->Controller, 'auth'); + $this->assertTrue($this->Controller->Security->Session->check('_Token'), '_Token was deleted by blackHole %s'); + } } ?> \ No newline at end of file From 3a1b0924c4523511c389b5d2ce54ea05b34fd79f Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 26 Jan 2010 14:10:58 -0500 Subject: [PATCH 1594/2083] Additional doc tag fixes for Router. --- cake/libs/router.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index 29707676c..8f1caca8f 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -371,6 +371,8 @@ function connectNamed($named, $options = array()) { * * @param boolean $connect Set to true or false depending on whether you want or don't want default routes. * @return void + * @access public + * @static */ function defaults($connect = true) { $self =& Router::getInstance(); @@ -861,6 +863,7 @@ function url($url = null, $full = false) { * * @param array $url A url that didn't match any routes * @return string A generated url for the array + * @access protected * @see Router::url() */ function _handleNoRoute($url) { @@ -956,6 +959,7 @@ function getNamedElements($params, $controller = null, $action = null) { * @param string $context An array with additional context information (controller / action) * @return boolean * @access public + * @static */ function matchNamed($param, $val, $rule, $context = array()) { if ($rule === true || $rule === false) { @@ -1020,6 +1024,7 @@ function queryString($q, $extra = array(), $escape = false) { * @param array $param The params array that needs to be reversed. * @return string The string that is the reversed result of the array * @access public + * @static */ function reverse($params) { $pass = $params['pass']; @@ -1198,7 +1203,7 @@ function getArgs($args, $options = array()) { * * @package cake.libs * @since 1.3.0 - * @see Router::connect + * @see Router::connect() */ class CakeRoute { From a318ba43fd8dbe6b3c0927b9cb0a9f9cf3058fbf Mon Sep 17 00:00:00 2001 From: "renan.saddam" <renan.saddam@gmail.com> Date: Tue, 26 Jan 2010 17:22:07 -0200 Subject: [PATCH 1595/2083] Enabling code coverage to run on 'All tests' group. --- cake/tests/lib/cake_test_suite_dispatcher.php | 6 +- cake/tests/lib/code_coverage_manager.php | 76 +++++++++---------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/cake/tests/lib/cake_test_suite_dispatcher.php b/cake/tests/lib/cake_test_suite_dispatcher.php index 8b30cb6fa..fb5f6c35b 100644 --- a/cake/tests/lib/cake_test_suite_dispatcher.php +++ b/cake/tests/lib/cake_test_suite_dispatcher.php @@ -224,12 +224,12 @@ function _parseParams() { */ function _runGroupTest() { $Reporter =& CakeTestSuiteDispatcher::getReporter(); + if ($this->params['codeCoverage']) { + CodeCoverageManager::init($this->params['group'], $Reporter); + } if ('all' == $this->params['group']) { $this->Manager->runAllTests($Reporter); } else { - if ($this->params['codeCoverage']) { - CodeCoverageManager::init($this->params['group'], $Reporter); - } $this->Manager->runGroupTest(ucfirst($this->params['group']), $Reporter); } } diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index ca49e4dc1..05a7acdcb 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -530,50 +530,50 @@ function __testObjectFilesFromGroupFile($groupFile, $isApp = true) { $manager = CodeCoverageManager::getInstance(); $testManager =& new TestManager(); - $path = TESTS . 'groups'; - + $path = TESTS; if (!$isApp) { - $path = ROOT . DS . 'cake' . DS . 'tests' . DS . 'groups'; + $path = ROOT . DS . 'cake' . DS . 'tests'; } - if (!!$manager->pluginTest) { - $path = APP . 'plugins' . DS . $manager->pluginTest . DS . 'tests' . DS . 'groups'; - - $pluginPaths = App::path('plugins'); - foreach ($pluginPaths as $pluginPath) { - $tmpPath = $pluginPath . $manager->pluginTest . DS . 'tests' . DS. 'groups'; - if (file_exists($tmpPath)) { - $path = $tmpPath; - break; - } - } - } - $path .= DS . $groupFile . $testManager->_groupExtension; - - if (!file_exists($path)) { - trigger_error(__('This group file does not exist!', true)); - return array(); + $path = App::pluginPath($manager->pluginTest) . DS . 'tests'; } $result = array(); - $groupContent = file_get_contents($path); - $ds = '\s*\.\s*DS\s*\.\s*'; - $pluginTest = 'APP\.\'plugins\'' . $ds . '\'' . $manager->pluginTest . '\'' . $ds . '\'tests\'' . $ds . '\'cases\''; - $pluginTest .= '|App::pluginPath\(\'' . $manager->pluginTest . '\'\)' . $ds . '\'tests\'' . $ds . '\'cases\''; - $pattern = '/\s*TestManager::addTestFile\(\s*\$this,\s*(' . $pluginTest . '|APP_TEST_CASES|CORE_TEST_CASES)' . $ds . '(.*?)\)/i'; - preg_match_all($pattern, $groupContent, $matches); - - foreach ($matches[2] as $file) { - $patterns = array( - '/\s*\.\s*DS\s*\.\s*/', - '/\s*APP_TEST_CASES\s*/', - '/\s*CORE_TEST_CASES\s*/', - ); - - $replacements = array(DS, '', ''); - $file = preg_replace($patterns, $replacements, $file); - $file = str_replace("'", '', $file); - $result[] = $manager->__testObjectFileFromCaseFile($file, $isApp) . '.php'; + if ($groupFile == 'all') { + $files = array_keys($testManager->getTestCaseList()); + foreach ($files as $file) { + $file = str_replace(DS . 'tests' . DS . 'cases' . DS, DS, $file); + $file = str_replace('.test.php', '.php', $file); + $file = str_replace(DS . DS, DS, $file); + $result[] = $file; + } + } else { + $path .= DS . 'groups' . DS . $groupFile . $testManager->_groupExtension; + if (!file_exists($path)) { + trigger_error(__('This group file does not exist!', true)); + return array(); + } + + $result = array(); + $groupContent = file_get_contents($path); + $ds = '\s*\.\s*DS\s*\.\s*'; + $pluginTest = 'APP\.\'plugins\'' . $ds . '\'' . $manager->pluginTest . '\'' . $ds . '\'tests\'' . $ds . '\'cases\''; + $pluginTest .= '|App::pluginPath\(\'' . $manager->pluginTest . '\'\)' . $ds . '\'tests\'' . $ds . '\'cases\''; + $pattern = '/\s*TestManager::addTestFile\(\s*\$this,\s*(' . $pluginTest . '|APP_TEST_CASES|CORE_TEST_CASES)' . $ds . '(.*?)\)/i'; + preg_match_all($pattern, $groupContent, $matches); + + foreach ($matches[2] as $file) { + $patterns = array( + '/\s*\.\s*DS\s*\.\s*/', + '/\s*APP_TEST_CASES\s*/', + '/\s*CORE_TEST_CASES\s*/', + ); + + $replacements = array(DS, '', ''); + $file = preg_replace($patterns, $replacements, $file); + $file = str_replace("'", '', $file); + $result[] = $manager->__testObjectFileFromCaseFile($file, $isApp) . '.php'; + } } return $result; } From 527eec1a54ae6952102c79aa5924b38367733a54 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 26 Jan 2010 14:18:20 -0500 Subject: [PATCH 1596/2083] Fixing doc tags to make merge easier. --- README | 2 +- app/config/acl.ini.php | 7 +++---- app/config/bootstrap.php | 9 ++++----- app/config/core.php | 9 ++++----- app/config/database.php.default | 9 ++++----- app/config/inflections.php | 9 ++++----- app/config/routes.php | 9 ++++----- app/config/sql/db_acl.php | 9 ++++----- app/config/sql/i18n.php | 9 ++++----- app/config/sql/sessions.php | 9 ++++----- app/index.php | 9 ++++----- app/webroot/css.php | 9 ++++----- app/webroot/css/cake.generic.css | 9 ++++----- app/webroot/index.php | 9 ++++----- app/webroot/js/vendors.php | 9 ++++----- app/webroot/test.php | 5 ++--- cake/basics.php | 9 ++++----- cake/bootstrap.php | 9 ++++----- cake/config/config.php | 9 ++++----- cake/config/paths.php | 9 ++++----- cake/config/unicode/casefolding/0080_00ff.php | 9 ++++----- cake/config/unicode/casefolding/0100_017f.php | 9 ++++----- cake/config/unicode/casefolding/0180_024F.php | 9 ++++----- cake/config/unicode/casefolding/0250_02af.php | 9 ++++----- cake/config/unicode/casefolding/0370_03ff.php | 9 ++++----- cake/config/unicode/casefolding/0400_04ff.php | 9 ++++----- cake/config/unicode/casefolding/0500_052f.php | 9 ++++----- cake/config/unicode/casefolding/0530_058f.php | 9 ++++----- cake/config/unicode/casefolding/1e00_1eff.php | 9 ++++----- cake/config/unicode/casefolding/1f00_1fff.php | 9 ++++----- cake/config/unicode/casefolding/2100_214f.php | 9 ++++----- cake/config/unicode/casefolding/2150_218f.php | 9 ++++----- cake/config/unicode/casefolding/2460_24ff.php | 9 ++++----- cake/config/unicode/casefolding/2c00_2c5f.php | 9 ++++----- cake/config/unicode/casefolding/2c60_2c7f.php | 9 ++++----- cake/config/unicode/casefolding/2c80_2cff.php | 9 ++++----- cake/config/unicode/casefolding/ff00_ffef.php | 9 ++++----- cake/console/cake | 2 +- cake/console/cake.bat | 2 +- cake/console/cake.php | 7 +++---- cake/console/error.php | 9 ++++----- cake/console/libs/acl.php | 9 ++++----- cake/console/libs/api.php | 9 ++++----- cake/console/libs/bake.php | 9 ++++----- cake/console/libs/console.php | 9 ++++----- cake/console/libs/i18n.php | 9 ++++----- cake/console/libs/schema.php | 9 ++++----- cake/console/libs/shell.php | 7 +++---- cake/console/libs/tasks/controller.php | 7 +++---- cake/console/libs/tasks/db_config.php | 9 ++++----- cake/console/libs/tasks/extract.php | 9 ++++----- cake/console/libs/tasks/model.php | 9 ++++----- cake/console/libs/tasks/plugin.php | 9 ++++----- cake/console/libs/tasks/project.php | 9 ++++----- cake/console/libs/tasks/test.php | 9 ++++----- cake/console/libs/tasks/view.php | 9 ++++----- cake/console/libs/templates/skel/app_controller.php | 9 ++++----- cake/console/libs/templates/skel/app_helper.php | 9 ++++----- cake/console/libs/templates/skel/app_model.php | 9 ++++----- cake/console/libs/templates/skel/config/acl.ini.php | 7 +++---- cake/console/libs/templates/skel/config/bootstrap.php | 9 ++++----- cake/console/libs/templates/skel/config/core.php | 9 ++++----- .../libs/templates/skel/config/database.php.default | 9 ++++----- .../libs/templates/skel/config/inflections.php | 9 ++++----- cake/console/libs/templates/skel/config/routes.php | 9 ++++----- .../console/libs/templates/skel/config/sql/db_acl.php | 9 ++++----- cake/console/libs/templates/skel/config/sql/i18n.php | 9 ++++----- .../libs/templates/skel/config/sql/sessions.php | 9 ++++----- .../templates/skel/controllers/pages_controller.php | 9 ++++----- cake/console/libs/templates/skel/index.php | 9 ++++----- .../skel/views/elements/email/html/default.ctp | 9 ++++----- .../skel/views/elements/email/text/default.ctp | 9 ++++----- .../libs/templates/skel/views/layouts/ajax.ctp | 9 ++++----- .../libs/templates/skel/views/layouts/default.ctp | 9 ++++----- .../skel/views/layouts/email/html/default.ctp | 9 ++++----- .../skel/views/layouts/email/text/default.ctp | 9 ++++----- .../libs/templates/skel/views/layouts/flash.ctp | 9 ++++----- cake/console/libs/templates/skel/webroot/css.php | 9 ++++----- .../libs/templates/skel/webroot/css/cake.generic.css | 9 ++++----- cake/console/libs/templates/skel/webroot/index.php | 9 ++++----- .../libs/templates/skel/webroot/js/vendors.php | 9 ++++----- cake/console/libs/templates/skel/webroot/test.php | 5 ++--- cake/console/libs/templates/views/form.ctp | 9 ++++----- cake/console/libs/templates/views/index.ctp | 9 ++++----- cake/console/libs/templates/views/view.ctp | 9 ++++----- cake/console/libs/testsuite.php | 5 ++--- cake/dispatcher.php | 7 +++---- cake/libs/cache.php | 9 ++++----- cake/libs/cache/apc.php | 9 ++++----- cake/libs/cache/file.php | 9 ++++----- cake/libs/cache/memcache.php | 9 ++++----- cake/libs/cache/xcache.php | 9 ++++----- cake/libs/cake_log.php | 9 ++++----- cake/libs/class_registry.php | 9 ++++----- cake/libs/configure.php | 9 ++++----- cake/libs/controller/app_controller.php | 9 ++++----- cake/libs/controller/component.php | 9 ++++----- cake/libs/controller/components/acl.php | 9 ++++----- cake/libs/controller/components/auth.php | 9 ++++----- cake/libs/controller/components/cookie.php | 9 ++++----- cake/libs/controller/components/email.php | 9 ++++----- cake/libs/controller/components/request_handler.php | 9 ++++----- cake/libs/controller/components/security.php | 7 +++---- cake/libs/controller/components/session.php | 9 ++++----- cake/libs/controller/controller.php | 9 ++++----- cake/libs/controller/pages_controller.php | 9 ++++----- cake/libs/controller/scaffold.php | 9 ++++----- cake/libs/debugger.php | 9 ++++----- cake/libs/error.php | 9 ++++----- cake/libs/file.php | 9 ++++----- cake/libs/flay.php | 9 ++++----- cake/libs/folder.php | 9 ++++----- cake/libs/http_socket.php | 9 ++++----- cake/libs/i18n.php | 9 ++++----- cake/libs/inflector.php | 9 ++++----- cake/libs/l10n.php | 9 ++++----- cake/libs/magic_db.php | 9 ++++----- cake/libs/model/app_model.php | 9 ++++----- cake/libs/model/behavior.php | 9 ++++----- cake/libs/model/behaviors/acl.php | 3 +-- cake/libs/model/behaviors/containable.php | 9 ++++----- cake/libs/model/behaviors/translate.php | 9 ++++----- cake/libs/model/behaviors/tree.php | 3 +-- cake/libs/model/connection_manager.php | 9 ++++----- cake/libs/model/datasources/datasource.php | 9 ++++----- cake/libs/model/datasources/dbo/dbo_adodb.php | 9 ++++----- cake/libs/model/datasources/dbo/dbo_db2.php | 7 +++---- cake/libs/model/datasources/dbo/dbo_firebird.php | 9 ++++----- cake/libs/model/datasources/dbo/dbo_mssql.php | 9 ++++----- cake/libs/model/datasources/dbo/dbo_mysql.php | 9 ++++----- cake/libs/model/datasources/dbo/dbo_mysqli.php | 9 ++++----- cake/libs/model/datasources/dbo/dbo_odbc.php | 9 ++++----- cake/libs/model/datasources/dbo/dbo_oracle.php | 9 ++++----- cake/libs/model/datasources/dbo/dbo_postgres.php | 9 ++++----- cake/libs/model/datasources/dbo/dbo_sqlite.php | 9 ++++----- cake/libs/model/datasources/dbo/dbo_sybase.php | 9 ++++----- cake/libs/model/datasources/dbo_source.php | 9 ++++----- cake/libs/model/db_acl.php | 9 ++++----- cake/libs/model/model.php | 9 ++++----- cake/libs/model/schema.php | 9 ++++----- cake/libs/multibyte.php | 9 ++++----- cake/libs/object.php | 9 ++++----- cake/libs/overloadable.php | 9 ++++----- cake/libs/overloadable_php4.php | 9 ++++----- cake/libs/overloadable_php5.php | 9 ++++----- cake/libs/router.php | 9 ++++----- cake/libs/sanitize.php | 9 ++++----- cake/libs/security.php | 9 ++++----- cake/libs/session.php | 9 ++++----- cake/libs/set.php | 9 ++++----- cake/libs/socket.php | 9 ++++----- cake/libs/string.php | 9 ++++----- cake/libs/validation.php | 9 ++++----- cake/libs/view/elements/dump.ctp | 9 ++++----- cake/libs/view/elements/email/html/default.ctp | 9 ++++----- cake/libs/view/elements/email/text/default.ctp | 9 ++++----- cake/libs/view/errors/error404.ctp | 9 ++++----- cake/libs/view/errors/missing_action.ctp | 9 ++++----- cake/libs/view/errors/missing_component_class.ctp | 9 ++++----- cake/libs/view/errors/missing_component_file.ctp | 9 ++++----- cake/libs/view/errors/missing_connection.ctp | 9 ++++----- cake/libs/view/errors/missing_controller.ctp | 9 ++++----- cake/libs/view/errors/missing_helper_class.ctp | 9 ++++----- cake/libs/view/errors/missing_helper_file.ctp | 9 ++++----- cake/libs/view/errors/missing_layout.ctp | 9 ++++----- cake/libs/view/errors/missing_model.ctp | 9 ++++----- cake/libs/view/errors/missing_scaffolddb.ctp | 9 ++++----- cake/libs/view/errors/missing_table.ctp | 9 ++++----- cake/libs/view/errors/missing_view.ctp | 9 ++++----- cake/libs/view/errors/private_action.ctp | 9 ++++----- cake/libs/view/errors/scaffold_error.ctp | 9 ++++----- cake/libs/view/helper.php | 9 ++++----- cake/libs/view/helpers/ajax.php | 9 ++++----- cake/libs/view/helpers/app_helper.php | 9 ++++----- cake/libs/view/helpers/cache.php | 9 ++++----- cake/libs/view/helpers/form.php | 9 ++++----- cake/libs/view/helpers/html.php | 9 ++++----- cake/libs/view/helpers/javascript.php | 9 ++++----- cake/libs/view/helpers/js.php | 3 +-- cake/libs/view/helpers/number.php | 9 ++++----- cake/libs/view/helpers/paginator.php | 9 ++++----- cake/libs/view/helpers/rss.php | 9 ++++----- cake/libs/view/helpers/session.php | 9 ++++----- cake/libs/view/helpers/text.php | 9 ++++----- cake/libs/view/helpers/time.php | 9 ++++----- cake/libs/view/helpers/xml.php | 9 ++++----- cake/libs/view/layouts/ajax.ctp | 9 ++++----- cake/libs/view/layouts/default.ctp | 9 ++++----- cake/libs/view/layouts/email/html/default.ctp | 9 ++++----- cake/libs/view/layouts/email/text/default.ctp | 9 ++++----- cake/libs/view/layouts/flash.ctp | 9 ++++----- cake/libs/view/media.php | 9 ++++----- cake/libs/view/pages/home.ctp | 11 +++++------ cake/libs/view/scaffolds/edit.ctp | 9 ++++----- cake/libs/view/scaffolds/index.ctp | 9 ++++----- cake/libs/view/scaffolds/view.ctp | 9 ++++----- cake/libs/view/theme.php | 9 ++++----- cake/libs/view/view.php | 9 ++++----- cake/libs/xml.php | 9 ++++----- cake/tests/cases/basics.test.php | 5 ++--- cake/tests/cases/console/cake.test.php | 1 - cake/tests/cases/console/libs/acl.test.php | 3 +-- cake/tests/cases/console/libs/api.test.php | 3 +-- cake/tests/cases/console/libs/schema.test.php | 3 +-- cake/tests/cases/console/libs/shell.test.php | 3 +-- cake/tests/cases/console/libs/tasks/extract.test.php | 3 +-- cake/tests/cases/console/libs/tasks/model.test.php | 3 +-- cake/tests/cases/console/libs/tasks/test.test.php | 3 +-- cake/tests/cases/dispatcher.test.php | 5 ++--- cake/tests/cases/libs/cache.test.php | 5 ++--- cake/tests/cases/libs/cache/apc.test.php | 5 ++--- cake/tests/cases/libs/cache/file.test.php | 5 ++--- cake/tests/cases/libs/cache/memcache.test.php | 5 ++--- cake/tests/cases/libs/cache/xcache.test.php | 5 ++--- cake/tests/cases/libs/cake_log.test.php | 5 ++--- cake/tests/cases/libs/cake_test_case.test.php | 3 +-- cake/tests/cases/libs/cake_test_fixture.test.php | 5 ++--- cake/tests/cases/libs/class_registry.test.php | 5 ++--- cake/tests/cases/libs/code_coverage_manager.test.php | 5 ++--- cake/tests/cases/libs/configure.test.php | 5 ++--- cake/tests/cases/libs/controller/component.test.php | 5 ++--- .../cases/libs/controller/components/acl.test.php | 5 ++--- .../cases/libs/controller/components/auth.test.php | 5 ++--- .../cases/libs/controller/components/cookie.test.php | 5 ++--- .../cases/libs/controller/components/email.test.php | 5 ++--- .../controller/components/request_handler.test.php | 5 ++--- .../libs/controller/components/security.test.php | 5 ++--- .../cases/libs/controller/components/session.test.php | 5 ++--- cake/tests/cases/libs/controller/controller.test.php | 5 ++--- .../libs/controller/controller_merge_vars.test.php | 5 ++--- .../cases/libs/controller/pages_controller.test.php | 5 ++--- cake/tests/cases/libs/controller/scaffold.test.php | 5 ++--- cake/tests/cases/libs/debugger.test.php | 5 ++--- cake/tests/cases/libs/error.test.php | 5 ++--- cake/tests/cases/libs/file.test.php | 5 ++--- cake/tests/cases/libs/flay.test.php | 5 ++--- cake/tests/cases/libs/folder.test.php | 5 ++--- cake/tests/cases/libs/http_socket.test.php | 5 ++--- cake/tests/cases/libs/i18n.test.php | 5 ++--- cake/tests/cases/libs/inflector.test.php | 5 ++--- cake/tests/cases/libs/l10n.test.php | 5 ++--- cake/tests/cases/libs/magic_db.test.php | 9 ++++----- cake/tests/cases/libs/model/behavior.test.php | 1 - cake/tests/cases/libs/model/behaviors/acl.test.php | 3 +-- .../cases/libs/model/behaviors/containable.test.php | 5 ++--- .../cases/libs/model/behaviors/translate.test.php | 5 ++--- cake/tests/cases/libs/model/behaviors/tree.test.php | 5 ++--- .../cases/libs/model/connection_manager.test.php | 5 ++--- .../libs/model/datasources/dbo/dbo_adodb.test.php | 9 ++++----- .../libs/model/datasources/dbo/dbo_mssql.test.php | 9 ++++----- .../libs/model/datasources/dbo/dbo_mysql.test.php | 9 ++++----- .../libs/model/datasources/dbo/dbo_mysqli.test.php | 9 ++++----- .../libs/model/datasources/dbo/dbo_oracle.test.php | 9 ++++----- .../libs/model/datasources/dbo/dbo_postgres.test.php | 9 ++++----- .../libs/model/datasources/dbo/dbo_sqlite.test.php | 9 ++++----- .../cases/libs/model/datasources/dbo_source.test.php | 5 ++--- cake/tests/cases/libs/model/db_acl.test.php | 5 ++--- cake/tests/cases/libs/model/model.test.php | 5 ++--- cake/tests/cases/libs/model/model_delete.test.php | 5 ++--- .../tests/cases/libs/model/model_integration.test.php | 5 ++--- cake/tests/cases/libs/model/model_read.test.php | 5 ++--- cake/tests/cases/libs/model/model_validation.test.php | 5 ++--- cake/tests/cases/libs/model/model_write.test.php | 5 ++--- cake/tests/cases/libs/model/models.php | 5 ++--- cake/tests/cases/libs/model/schema.test.php | 5 ++--- cake/tests/cases/libs/multibyte.test.php | 5 ++--- cake/tests/cases/libs/object.test.php | 5 ++--- cake/tests/cases/libs/overloadable.test.php | 5 ++--- cake/tests/cases/libs/router.test.php | 5 ++--- cake/tests/cases/libs/sanitize.test.php | 5 ++--- cake/tests/cases/libs/security.test.php | 5 ++--- cake/tests/cases/libs/session.test.php | 5 ++--- cake/tests/cases/libs/set.test.php | 5 ++--- cake/tests/cases/libs/socket.test.php | 5 ++--- cake/tests/cases/libs/string.test.php | 5 ++--- cake/tests/cases/libs/test_manager.test.php | 3 +-- cake/tests/cases/libs/validation.test.php | 5 ++--- cake/tests/cases/libs/view/helper.test.php | 5 ++--- cake/tests/cases/libs/view/helpers/ajax.test.php | 5 ++--- cake/tests/cases/libs/view/helpers/cache.test.php | 5 ++--- cake/tests/cases/libs/view/helpers/form.test.php | 1 - cake/tests/cases/libs/view/helpers/html.test.php | 1 - .../tests/cases/libs/view/helpers/javascript.test.php | 1 - cake/tests/cases/libs/view/helpers/js.test.php | 5 ++--- cake/tests/cases/libs/view/helpers/number.test.php | 5 ++--- cake/tests/cases/libs/view/helpers/paginator.test.php | 5 ++--- cake/tests/cases/libs/view/helpers/rss.test.php | 5 ++--- cake/tests/cases/libs/view/helpers/session.test.php | 5 ++--- cake/tests/cases/libs/view/helpers/text.test.php | 5 ++--- cake/tests/cases/libs/view/helpers/time.test.php | 5 ++--- cake/tests/cases/libs/view/helpers/xml.test.php | 5 ++--- cake/tests/cases/libs/view/theme.test.php | 5 ++--- cake/tests/cases/libs/view/view.test.php | 5 ++--- cake/tests/cases/libs/xml.test.php | 5 ++--- cake/tests/fixtures/account_fixture.php | 5 ++--- cake/tests/fixtures/aco_action_fixture.php | 5 ++--- cake/tests/fixtures/aco_fixture.php | 5 ++--- cake/tests/fixtures/aco_two_fixture.php | 5 ++--- cake/tests/fixtures/ad_fixture.php | 1 - cake/tests/fixtures/advertisement_fixture.php | 5 ++--- cake/tests/fixtures/after_tree_fixture.php | 1 - cake/tests/fixtures/another_article_fixture.php | 5 ++--- cake/tests/fixtures/apple_fixture.php | 5 ++--- cake/tests/fixtures/aro_fixture.php | 5 ++--- cake/tests/fixtures/aro_two_fixture.php | 5 ++--- cake/tests/fixtures/aros_aco_fixture.php | 5 ++--- cake/tests/fixtures/aros_aco_two_fixture.php | 5 ++--- cake/tests/fixtures/article_featured_fixture.php | 5 ++--- .../tests/fixtures/article_featureds_tags_fixture.php | 5 ++--- cake/tests/fixtures/article_fixture.php | 5 ++--- cake/tests/fixtures/articles_tag_fixture.php | 5 ++--- cake/tests/fixtures/attachment_fixture.php | 5 ++--- .../tests/fixtures/auth_user_custom_field_fixture.php | 5 ++--- cake/tests/fixtures/auth_user_fixture.php | 5 ++--- cake/tests/fixtures/author_fixture.php | 5 ++--- cake/tests/fixtures/basket_fixture.php | 5 ++--- cake/tests/fixtures/bid_fixture.php | 5 ++--- cake/tests/fixtures/binary_test_fixture.php | 5 ++--- cake/tests/fixtures/book_fixture.php | 5 ++--- cake/tests/fixtures/cache_test_model_fixture.php | 5 ++--- cake/tests/fixtures/callback_fixture.php | 5 ++--- cake/tests/fixtures/campaign_fixture.php | 1 - cake/tests/fixtures/category_fixture.php | 5 ++--- cake/tests/fixtures/category_thread_fixture.php | 5 ++--- cake/tests/fixtures/cd_fixture.php | 5 ++--- cake/tests/fixtures/comment_fixture.php | 5 ++--- cake/tests/fixtures/content_account_fixture.php | 5 ++--- cake/tests/fixtures/content_fixture.php | 5 ++--- cake/tests/fixtures/counter_cache_post_fixture.php | 5 ++--- ...ter_cache_post_nonstandard_primary_key_fixture.php | 5 ++--- cake/tests/fixtures/counter_cache_user_fixture.php | 5 ++--- ...ter_cache_user_nonstandard_primary_key_fixture.php | 5 ++--- cake/tests/fixtures/data_test_fixture.php | 5 ++--- cake/tests/fixtures/datatype_fixture.php | 9 ++++----- cake/tests/fixtures/dependency_fixture.php | 9 ++++----- cake/tests/fixtures/device_fixture.php | 5 ++--- cake/tests/fixtures/device_type_category_fixture.php | 5 ++--- cake/tests/fixtures/device_type_fixture.php | 5 ++--- cake/tests/fixtures/document_directory_fixture.php | 5 ++--- cake/tests/fixtures/document_fixture.php | 5 ++--- .../tests/fixtures/exterior_type_category_fixture.php | 5 ++--- cake/tests/fixtures/feature_set_fixture.php | 5 ++--- cake/tests/fixtures/featured_fixture.php | 5 ++--- cake/tests/fixtures/film_file_fixture.php | 5 ++--- cake/tests/fixtures/flag_tree_fixture.php | 5 ++--- cake/tests/fixtures/fruit_fixture.php | 5 ++--- cake/tests/fixtures/fruits_uuid_tag_fixture.php | 5 ++--- cake/tests/fixtures/home_fixture.php | 5 ++--- cake/tests/fixtures/image_fixture.php | 5 ++--- cake/tests/fixtures/item_fixture.php | 5 ++--- cake/tests/fixtures/items_portfolio_fixture.php | 5 ++--- cake/tests/fixtures/join_a_b_fixture.php | 5 ++--- cake/tests/fixtures/join_a_c_fixture.php | 5 ++--- cake/tests/fixtures/join_a_fixture.php | 5 ++--- cake/tests/fixtures/join_b_fixture.php | 5 ++--- cake/tests/fixtures/join_c_fixture.php | 5 ++--- cake/tests/fixtures/join_thing_fixture.php | 5 ++--- cake/tests/fixtures/message_fixture.php | 5 ++--- .../fixtures/my_categories_my_products_fixture.php | 5 ++--- .../tests/fixtures/my_categories_my_users_fixture.php | 5 ++--- cake/tests/fixtures/my_category_fixture.php | 5 ++--- cake/tests/fixtures/my_product_fixture.php | 5 ++--- cake/tests/fixtures/my_user_fixture.php | 5 ++--- cake/tests/fixtures/node_fixture.php | 9 ++++----- cake/tests/fixtures/number_tree_fixture.php | 5 ++--- cake/tests/fixtures/number_tree_two_fixture.php | 5 ++--- cake/tests/fixtures/numeric_article_fixture.php | 5 ++--- cake/tests/fixtures/overall_favorite_fixture.php | 5 ++--- cake/tests/fixtures/person_fixture.php | 5 ++--- cake/tests/fixtures/portfolio_fixture.php | 5 ++--- cake/tests/fixtures/post_fixture.php | 5 ++--- cake/tests/fixtures/posts_tag_fixture.php | 5 ++--- cake/tests/fixtures/primary_model_fixture.php | 5 ++--- cake/tests/fixtures/product_fixture.php | 5 ++--- cake/tests/fixtures/project_fixture.php | 5 ++--- cake/tests/fixtures/sample_fixture.php | 5 ++--- cake/tests/fixtures/secondary_model_fixture.php | 5 ++--- cake/tests/fixtures/session_fixture.php | 5 ++--- cake/tests/fixtures/something_else_fixture.php | 5 ++--- cake/tests/fixtures/something_fixture.php | 5 ++--- cake/tests/fixtures/stories_tag_fixture.php | 5 ++--- cake/tests/fixtures/story_fixture.php | 5 ++--- cake/tests/fixtures/syfile_fixture.php | 5 ++--- cake/tests/fixtures/tag_fixture.php | 5 ++--- cake/tests/fixtures/test_plugin_article_fixture.php | 5 ++--- cake/tests/fixtures/test_plugin_comment_fixture.php | 5 ++--- cake/tests/fixtures/the_paper_monkies_fixture.php | 5 ++--- cake/tests/fixtures/thread_fixture.php | 5 ++--- cake/tests/fixtures/translate_article_fixture.php | 5 ++--- cake/tests/fixtures/translate_fixture.php | 5 ++--- cake/tests/fixtures/translate_table_fixture.php | 5 ++--- cake/tests/fixtures/translate_with_prefix_fixture.php | 5 ++--- cake/tests/fixtures/translated_article_fixture.php | 5 ++--- cake/tests/fixtures/translated_item_fixture.php | 5 ++--- cake/tests/fixtures/unconventional_tree_fixture.php | 5 ++--- cake/tests/fixtures/underscore_field_fixture.php | 5 ++--- cake/tests/fixtures/user_fixture.php | 5 ++--- cake/tests/fixtures/uuid_fixture.php | 5 ++--- cake/tests/fixtures/uuid_tag_fixture.php | 5 ++--- cake/tests/fixtures/uuid_tree_fixture.php | 5 ++--- cake/tests/fixtures/uuiditem_fixture.php | 5 ++--- .../fixtures/uuiditems_uuidportfolio_fixture.php | 5 ++--- .../uuiditems_uuidportfolio_numericid_fixture.php | 5 ++--- cake/tests/fixtures/uuidportfolio_fixture.php | 5 ++--- cake/tests/groups/acl.group.php | 5 ++--- cake/tests/groups/cache.group.php | 5 ++--- cake/tests/groups/components.group.php | 5 ++--- cake/tests/groups/configure.group.php | 5 ++--- cake/tests/groups/console.group.php | 5 ++--- cake/tests/groups/controller.group.php | 5 ++--- cake/tests/groups/database.group.php | 5 ++--- cake/tests/groups/helpers.group.php | 5 ++--- cake/tests/groups/lib.group.php | 5 ++--- cake/tests/groups/model.group.php | 5 ++--- cake/tests/groups/no_cross_contamination.group.php | 5 ++--- cake/tests/groups/routing_system.group.php | 5 ++--- cake/tests/groups/socket.group.php | 1 - cake/tests/groups/test_suite.group.php | 1 - cake/tests/groups/view.group.php | 5 ++--- cake/tests/groups/xml.group.php | 5 ++--- cake/tests/lib/cake_reporter.php | 5 ++--- cake/tests/lib/cake_test_case.php | 5 ++--- cake/tests/lib/cake_test_fixture.php | 5 ++--- cake/tests/lib/cake_test_model.php | 5 ++--- cake/tests/lib/cake_web_test_case.php | 5 ++--- cake/tests/lib/cli_reporter.php | 5 ++--- cake/tests/lib/code_coverage_manager.php | 5 ++--- cake/tests/lib/content.php | 5 ++--- cake/tests/lib/footer.php | 5 ++--- cake/tests/lib/header.php | 5 ++--- cake/tests/lib/simpletest.php | 5 ++--- cake/tests/lib/test_manager.php | 5 ++--- cake/tests/lib/xdebug.php | 5 ++--- cake/tests/test_app/config/acl.ini.php | 9 ++++----- .../test_app/controllers/tests_apps_controller.php | 5 ++--- .../controllers/tests_apps_posts_controller.php | 5 ++--- .../models/behaviors/persister_one_behavior.php | 9 ++++----- .../models/behaviors/persister_two_behavior.php | 9 ++++----- cake/tests/test_app/models/comment.php | 3 +-- cake/tests/test_app/models/persister_one.php | 3 +-- cake/tests/test_app/models/persister_two.php | 3 +-- cake/tests/test_app/models/post.php | 3 +-- .../controllers/components/other_component.php | 5 ++--- .../controllers/components/plugins_component.php | 5 ++--- .../controllers/components/test_plugin_component.php | 5 ++--- .../components/test_plugin_other_component.php | 5 ++--- .../test_plugin/controllers/tests_controller.php | 5 ++--- .../models/behaviors/test_plugin_persister_one.php | 9 ++++----- .../models/behaviors/test_plugin_persister_two.php | 9 ++++----- .../test_plugin/models/test_plugin_authors.php | 3 +-- .../test_plugin/models/test_plugin_comment.php | 3 +-- .../plugins/test_plugin/models/test_plugin_post.php | 3 +-- .../test_plugin/test_plugin_app_controller.php | 5 ++--- .../plugins/test_plugin/test_plugin_app_model.php | 5 ++--- .../test_plugin/vendors/sample/sample_plugin.php | 5 ++--- .../plugins/test_plugin/vendors/shells/example.php | 5 ++--- .../test_app/plugins/test_plugin/vendors/welcome.php | 5 ++--- .../test_plugin/views/helpers/other_helper.php | 5 ++--- .../test_plugin/views/helpers/plugged_helper.php | 5 ++--- .../test_plugin_two/vendors/shells/example.php | 5 ++--- .../test_plugin_two/vendors/shells/welcome.php | 5 ++--- cake/tests/test_app/vendors/Test/MyTest.php | 5 ++--- cake/tests/test_app/vendors/Test/hello.php | 5 ++--- .../vendors/sample/configure_test_vendor_sample.php | 5 ++--- cake/tests/test_app/vendors/shells/sample.php | 5 ++--- cake/tests/test_app/vendors/somename/some.name.php | 5 ++--- cake/tests/test_app/vendors/welcome.php | 5 ++--- .../test_app/views/elements/email/html/default.ctp | 9 ++++----- .../test_app/views/elements/email/text/default.ctp | 9 ++++----- .../tests/test_app/views/elements/email/text/wide.ctp | 9 ++++----- cake/tests/test_app/views/layouts/ajax.ctp | 9 ++++----- cake/tests/test_app/views/layouts/ajax2.ctp | 9 ++++----- cake/tests/test_app/views/layouts/cache_layout.ctp | 9 ++++----- cake/tests/test_app/views/layouts/default.ctp | 9 ++++----- .../test_app/views/layouts/email/html/default.ctp | 9 ++++----- cake/tests/test_app/views/layouts/email/html/thin.ctp | 9 ++++----- .../test_app/views/layouts/email/text/default.ctp | 9 ++++----- cake/tests/test_app/views/layouts/flash.ctp | 9 ++++----- cake/tests/test_app/views/layouts/multi_cache.ctp | 9 ++++----- .../tests/test_app/views/posts/sequencial_nocache.ctp | 9 ++++----- cake/tests/test_app/views/posts/test_nocache_tags.ctp | 11 +++++------ index.php | 7 +++---- 482 files changed, 1356 insertions(+), 1835 deletions(-) diff --git a/README b/README index 5fe134356..b92cb46e9 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility. The Cake Software Foundation - promoting development related to CakePHP -http://www.cakefoundation.org/ +http://cakefoundation.org/ CakePHP - the rapid development PHP framework http://www.cakephp.org diff --git a/app/config/acl.ini.php b/app/config/acl.ini.php index c0e3a9b7a..a6e9c97fb 100644 --- a/app/config/acl.ini.php +++ b/app/config/acl.ini.php @@ -7,14 +7,13 @@ ; * PHP versions 4 and 5 ; * ; * CakePHP(tm) : Rapid Development Framework http://www.cakephp.org/ -; * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) +; * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) ; * ; * Licensed under The MIT License ; * Redistributions of files must retain the above copyright notice. ; * -; * @filesource -; * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) -; * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project +; * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) +; * @link http://cakephp.org CakePHP(tm) Project ; * @package cake ; * @subpackage cake.app.config ; * @since CakePHP(tm) v 0.10.0.1076 diff --git a/app/config/bootstrap.php b/app/config/bootstrap.php index bede17125..22bd4a938 100644 --- a/app/config/bootstrap.php +++ b/app/config/bootstrap.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.config * @since CakePHP(tm) v 0.10.8.2117 diff --git a/app/config/core.php b/app/config/core.php index 7e078fc96..283eba4d1 100644 --- a/app/config/core.php +++ b/app/config/core.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.config * @since CakePHP(tm) v 0.2.9 diff --git a/app/config/database.php.default b/app/config/database.php.default index ac3e99dfe..c30e368ae 100644 --- a/app/config/database.php.default +++ b/app/config/database.php.default @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.config * @since CakePHP(tm) v 0.2.9 diff --git a/app/config/inflections.php b/app/config/inflections.php index ccbb0e793..2c73fd884 100644 --- a/app/config/inflections.php +++ b/app/config/inflections.php @@ -8,15 +8,14 @@ * * PHP versions 4 and % * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.config * @since CakePHP(tm) v 1.0.0.2312 diff --git a/app/config/routes.php b/app/config/routes.php index 1bec77b10..32094aa62 100644 --- a/app/config/routes.php +++ b/app/config/routes.php @@ -9,15 +9,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.config * @since CakePHP(tm) v 0.2.9 diff --git a/app/config/sql/db_acl.php b/app/config/sql/db_acl.php index dd6a1ac1b..72530d65c 100644 --- a/app/config/sql/db_acl.php +++ b/app/config/sql/db_acl.php @@ -8,15 +8,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.config.sql * @since CakePHP(tm) v 0.2.9 diff --git a/app/config/sql/i18n.php b/app/config/sql/i18n.php index 40c2957fe..ac0e7f5a9 100644 --- a/app/config/sql/i18n.php +++ b/app/config/sql/i18n.php @@ -8,15 +8,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.config.sql * @since CakePHP(tm) v 0.2.9 diff --git a/app/config/sql/sessions.php b/app/config/sql/sessions.php index 334c0b9ce..8880e49b5 100644 --- a/app/config/sql/sessions.php +++ b/app/config/sql/sessions.php @@ -8,15 +8,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.config.sql * @since CakePHP(tm) v 0.2.9 diff --git a/app/index.php b/app/index.php index 057c1af3a..a8cca5d89 100644 --- a/app/index.php +++ b/app/index.php @@ -3,15 +3,14 @@ /** * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app * @since CakePHP(tm) v 0.10.0.1076 diff --git a/app/webroot/css.php b/app/webroot/css.php index 15dba4ae8..bb29d0362 100644 --- a/app/webroot/css.php +++ b/app/webroot/css.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.webroot * @since CakePHP(tm) v 0.2.9 diff --git a/app/webroot/css/cake.generic.css b/app/webroot/css/cake.generic.css index 13df20602..3c244c5ba 100644 --- a/app/webroot/css/cake.generic.css +++ b/app/webroot/css/cake.generic.css @@ -3,15 +3,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.webroot.css * @since CakePHP(tm) diff --git a/app/webroot/index.php b/app/webroot/index.php index 9d2113576..8608f07dd 100644 --- a/app/webroot/index.php +++ b/app/webroot/index.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.webroot * @since CakePHP(tm) v 0.2.9 diff --git a/app/webroot/js/vendors.php b/app/webroot/js/vendors.php index 5c6181290..d9d38f690 100644 --- a/app/webroot/js/vendors.php +++ b/app/webroot/js/vendors.php @@ -8,15 +8,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.webroot.js * @since CakePHP(tm) v 0.2.9 diff --git a/app/webroot/test.php b/app/webroot/test.php index 665def442..de8fb027f 100644 --- a/app/webroot/test.php +++ b/app/webroot/test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs diff --git a/cake/basics.php b/cake/basics.php index 530dd2252..19cfc5bbb 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake * @since CakePHP(tm) v 0.2.9 diff --git a/cake/bootstrap.php b/cake/bootstrap.php index 1652b085f..473530fd6 100644 --- a/cake/bootstrap.php +++ b/cake/bootstrap.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake * @since CakePHP(tm) v 0.2.9 diff --git a/cake/config/config.php b/cake/config/config.php index f4f248de0..ce1b9ba83 100644 --- a/cake/config/config.php +++ b/cake/config/config.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.config * @since CakePHP(tm) v 1.1.11.4062 diff --git a/cake/config/paths.php b/cake/config/paths.php index 727b36cca..781ce0ce9 100644 --- a/cake/config/paths.php +++ b/cake/config/paths.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.app.config * @since CakePHP(tm) v 0.2.9 diff --git a/cake/config/unicode/casefolding/0080_00ff.php b/cake/config/unicode/casefolding/0080_00ff.php index 730c97086..a3917c776 100644 --- a/cake/config/unicode/casefolding/0080_00ff.php +++ b/cake/config/unicode/casefolding/0080_00ff.php @@ -11,15 +11,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding * @since CakePHP(tm) v 1.2.0.5691 diff --git a/cake/config/unicode/casefolding/0100_017f.php b/cake/config/unicode/casefolding/0100_017f.php index aa092f719..e3df9f639 100644 --- a/cake/config/unicode/casefolding/0100_017f.php +++ b/cake/config/unicode/casefolding/0100_017f.php @@ -11,15 +11,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding * @since CakePHP(tm) v 1.2.0.5691 diff --git a/cake/config/unicode/casefolding/0180_024F.php b/cake/config/unicode/casefolding/0180_024F.php index 948eb8906..73fb18d7d 100644 --- a/cake/config/unicode/casefolding/0180_024F.php +++ b/cake/config/unicode/casefolding/0180_024F.php @@ -11,15 +11,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding * @since CakePHP(tm) v 1.2.0.5691 diff --git a/cake/config/unicode/casefolding/0250_02af.php b/cake/config/unicode/casefolding/0250_02af.php index 62cf773af..df1b95321 100644 --- a/cake/config/unicode/casefolding/0250_02af.php +++ b/cake/config/unicode/casefolding/0250_02af.php @@ -11,15 +11,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding * @since CakePHP(tm) v 1.2.0.6833 diff --git a/cake/config/unicode/casefolding/0370_03ff.php b/cake/config/unicode/casefolding/0370_03ff.php index c088320ef..aff493514 100644 --- a/cake/config/unicode/casefolding/0370_03ff.php +++ b/cake/config/unicode/casefolding/0370_03ff.php @@ -11,15 +11,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding * @since CakePHP(tm) v 1.2.0.5691 diff --git a/cake/config/unicode/casefolding/0400_04ff.php b/cake/config/unicode/casefolding/0400_04ff.php index 3e3cf8d98..4b789a8ae 100644 --- a/cake/config/unicode/casefolding/0400_04ff.php +++ b/cake/config/unicode/casefolding/0400_04ff.php @@ -11,15 +11,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding * @since CakePHP(tm) v 1.2.0.5691 diff --git a/cake/config/unicode/casefolding/0500_052f.php b/cake/config/unicode/casefolding/0500_052f.php index 1e5449ec5..6747ce752 100644 --- a/cake/config/unicode/casefolding/0500_052f.php +++ b/cake/config/unicode/casefolding/0500_052f.php @@ -11,15 +11,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding * @since CakePHP(tm) v 1.2.0.5691 diff --git a/cake/config/unicode/casefolding/0530_058f.php b/cake/config/unicode/casefolding/0530_058f.php index 599b8516c..68f3c6562 100644 --- a/cake/config/unicode/casefolding/0530_058f.php +++ b/cake/config/unicode/casefolding/0530_058f.php @@ -11,15 +11,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding * @since CakePHP(tm) v 1.2.0.5691 diff --git a/cake/config/unicode/casefolding/1e00_1eff.php b/cake/config/unicode/casefolding/1e00_1eff.php index cdd24c36f..12f58212a 100644 --- a/cake/config/unicode/casefolding/1e00_1eff.php +++ b/cake/config/unicode/casefolding/1e00_1eff.php @@ -11,15 +11,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding * @since CakePHP(tm) v 1.2.0.5691 diff --git a/cake/config/unicode/casefolding/1f00_1fff.php b/cake/config/unicode/casefolding/1f00_1fff.php index 39bebc63b..59a451ae0 100644 --- a/cake/config/unicode/casefolding/1f00_1fff.php +++ b/cake/config/unicode/casefolding/1f00_1fff.php @@ -11,15 +11,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding * @since CakePHP(tm) v 1.2.0.5691 diff --git a/cake/config/unicode/casefolding/2100_214f.php b/cake/config/unicode/casefolding/2100_214f.php index eb801c35c..c39d3ff2d 100644 --- a/cake/config/unicode/casefolding/2100_214f.php +++ b/cake/config/unicode/casefolding/2100_214f.php @@ -11,15 +11,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding * @since CakePHP(tm) v 1.2.0.5691 diff --git a/cake/config/unicode/casefolding/2150_218f.php b/cake/config/unicode/casefolding/2150_218f.php index dcff6df50..0cc85d0ee 100644 --- a/cake/config/unicode/casefolding/2150_218f.php +++ b/cake/config/unicode/casefolding/2150_218f.php @@ -11,15 +11,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding * @since CakePHP(tm) v 1.2.0.5691 diff --git a/cake/config/unicode/casefolding/2460_24ff.php b/cake/config/unicode/casefolding/2460_24ff.php index e7e675373..ff9508812 100644 --- a/cake/config/unicode/casefolding/2460_24ff.php +++ b/cake/config/unicode/casefolding/2460_24ff.php @@ -11,15 +11,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding * @since CakePHP(tm) v 1.2.0.5691 diff --git a/cake/config/unicode/casefolding/2c00_2c5f.php b/cake/config/unicode/casefolding/2c00_2c5f.php index e27abdf82..f7c97b85d 100644 --- a/cake/config/unicode/casefolding/2c00_2c5f.php +++ b/cake/config/unicode/casefolding/2c00_2c5f.php @@ -11,15 +11,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding * @since CakePHP(tm) v 1.2.0.5691 diff --git a/cake/config/unicode/casefolding/2c60_2c7f.php b/cake/config/unicode/casefolding/2c60_2c7f.php index 3d3553a52..ca1d527eb 100644 --- a/cake/config/unicode/casefolding/2c60_2c7f.php +++ b/cake/config/unicode/casefolding/2c60_2c7f.php @@ -11,15 +11,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding * @since CakePHP(tm) v 1.2.0.5691 diff --git a/cake/config/unicode/casefolding/2c80_2cff.php b/cake/config/unicode/casefolding/2c80_2cff.php index df9879c55..bad418bcb 100644 --- a/cake/config/unicode/casefolding/2c80_2cff.php +++ b/cake/config/unicode/casefolding/2c80_2cff.php @@ -11,15 +11,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding * @since CakePHP(tm) v 1.2.0.5691 diff --git a/cake/config/unicode/casefolding/ff00_ffef.php b/cake/config/unicode/casefolding/ff00_ffef.php index 530f0e75c..f4facbe76 100644 --- a/cake/config/unicode/casefolding/ff00_ffef.php +++ b/cake/config/unicode/casefolding/ff00_ffef.php @@ -11,15 +11,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.config.unicode.casefolding * @since CakePHP(tm) v 1.2.0.5691 diff --git a/cake/console/cake b/cake/console/cake index 0edff7e8f..890457ba6 100755 --- a/cake/console/cake +++ b/cake/console/cake @@ -12,7 +12,7 @@ # # @filesource # @copyright Copyright 2005-2010, Cake Software Foundation, Inc. -# @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project +# @link http://cakefoundation.org/projects/info/cakephp CakePHP(tm) Project # @package cake # @subpackage cake.cake.console # @since CakePHP(tm) v 1.2.0.5012 diff --git a/cake/console/cake.bat b/cake/console/cake.bat index 35c1a2b83..09701dea7 100644 --- a/cake/console/cake.bat +++ b/cake/console/cake.bat @@ -11,7 +11,7 @@ :: :: @filesource :: @copyright Copyright 2005-2010, Cake Software Foundation, Inc. -:: @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project +:: @link http://cakefoundation.org/projects/info/cakephp CakePHP(tm) Project :: @package cake :: @subpackage cake.cake.console :: @since CakePHP(tm) v 1.2.0.5012 diff --git a/cake/console/cake.php b/cake/console/cake.php index e90f7e555..517437069 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -8,15 +8,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console * @since CakePHP(tm) v 1.2.0.5012 diff --git a/cake/console/error.php b/cake/console/error.php index 788fe3611..1eebc436f 100644 --- a/cake/console/error.php +++ b/cake/console/error.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console * @since CakePHP(tm) v 1.2.0.5074 diff --git a/cake/console/libs/acl.php b/cake/console/libs/acl.php index f7d8c4ae1..74d4895ff 100644 --- a/cake/console/libs/acl.php +++ b/cake/console/libs/acl.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs * @since CakePHP(tm) v 1.2.0.5012 diff --git a/cake/console/libs/api.php b/cake/console/libs/api.php index b3a34755f..593e90d84 100644 --- a/cake/console/libs/api.php +++ b/cake/console/libs/api.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs * @since CakePHP(tm) v 1.2.0.5012 diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index a80cf775e..cf20acff0 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -9,15 +9,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs * @since CakePHP(tm) v 1.2.0.5012 diff --git a/cake/console/libs/console.php b/cake/console/libs/console.php index ea5508584..56f90c23f 100644 --- a/cake/console/libs/console.php +++ b/cake/console/libs/console.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs * @since CakePHP(tm) v 1.2.0.5012 diff --git a/cake/console/libs/i18n.php b/cake/console/libs/i18n.php index 70ffd61b3..875c63ff5 100644 --- a/cake/console/libs/i18n.php +++ b/cake/console/libs/i18n.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs * @since CakePHP(tm) v 1.2.0.5669 diff --git a/cake/console/libs/schema.php b/cake/console/libs/schema.php index c7cf5cfcf..1c643fa98 100644 --- a/cake/console/libs/schema.php +++ b/cake/console/libs/schema.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs * @since CakePHP(tm) v 1.2.0.5550 diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php index 8f5c7a6eb..4e477f1af 100644 --- a/cake/console/libs/shell.php +++ b/cake/console/libs/shell.php @@ -8,14 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs * @since CakePHP(tm) v 1.2.0.5012 diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index fcc367998..404f5cacd 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.tasks * @since CakePHP(tm) v 1.2 diff --git a/cake/console/libs/tasks/db_config.php b/cake/console/libs/tasks/db_config.php index e0844a5d9..a19eb6114 100644 --- a/cake/console/libs/tasks/db_config.php +++ b/cake/console/libs/tasks/db_config.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.tasks * @since CakePHP(tm) v 1.2 diff --git a/cake/console/libs/tasks/extract.php b/cake/console/libs/tasks/extract.php index 6bb5a27ff..b93f29320 100644 --- a/cake/console/libs/tasks/extract.php +++ b/cake/console/libs/tasks/extract.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs * @since CakePHP(tm) v 1.2.0.5012 diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index fac911605..13c321be8 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.tasks * @since CakePHP(tm) v 1.2 diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index 34bc1b4ed..4cf68d802 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.tasks * @since CakePHP(tm) v 1.2 diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php index e2836daef..d6a3a547b 100644 --- a/cake/console/libs/tasks/project.php +++ b/cake/console/libs/tasks/project.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.scripts.bake * @since CakePHP(tm) v 1.2 diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index aa71bdb15..26d056a70 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.tasks * @since CakePHP(tm) v 1.2 diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index d15b5f243..14b8029be 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.tasks * @since CakePHP(tm) v 1.2 diff --git a/cake/console/libs/templates/skel/app_controller.php b/cake/console/libs/templates/skel/app_controller.php index 6c38cbe90..d88316a2b 100644 --- a/cake/console/libs/templates/skel/app_controller.php +++ b/cake/console/libs/templates/skel/app_controller.php @@ -8,15 +8,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app * @since CakePHP(tm) v 0.2.9 diff --git a/cake/console/libs/templates/skel/app_helper.php b/cake/console/libs/templates/skel/app_helper.php index 3b751a8b4..b5c962f8f 100644 --- a/cake/console/libs/templates/skel/app_helper.php +++ b/cake/console/libs/templates/skel/app_helper.php @@ -8,15 +8,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake * @since CakePHP(tm) v 0.2.9 diff --git a/cake/console/libs/templates/skel/app_model.php b/cake/console/libs/templates/skel/app_model.php index b1fcdc75a..bb6b950b5 100644 --- a/cake/console/libs/templates/skel/app_model.php +++ b/cake/console/libs/templates/skel/app_model.php @@ -9,15 +9,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app * @since CakePHP(tm) v 0.2.9 diff --git a/cake/console/libs/templates/skel/config/acl.ini.php b/cake/console/libs/templates/skel/config/acl.ini.php index 23ba4d25f..ad013f31f 100644 --- a/cake/console/libs/templates/skel/config/acl.ini.php +++ b/cake/console/libs/templates/skel/config/acl.ini.php @@ -7,14 +7,13 @@ ; * PHP versions 4 and 5 ; * ; * CakePHP(tm) : Rapid Development Framework http://www.cakephp.org/ -; * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) +; * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) ; * ; * Licensed under The MIT License ; * Redistributions of files must retain the above copyright notice. ; * -; * @filesource -; * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) -; * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project +;; * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) +; * @link http://cakephp.org CakePHP(tm) Project ; * @package cake ; * @subpackage cake.app.config ; * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/console/libs/templates/skel/config/bootstrap.php b/cake/console/libs/templates/skel/config/bootstrap.php index bede17125..22bd4a938 100644 --- a/cake/console/libs/templates/skel/config/bootstrap.php +++ b/cake/console/libs/templates/skel/config/bootstrap.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.config * @since CakePHP(tm) v 0.10.8.2117 diff --git a/cake/console/libs/templates/skel/config/core.php b/cake/console/libs/templates/skel/config/core.php index bbc34d0f8..a8bc5b9ee 100644 --- a/cake/console/libs/templates/skel/config/core.php +++ b/cake/console/libs/templates/skel/config/core.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.config * @since CakePHP(tm) v 0.2.9 diff --git a/cake/console/libs/templates/skel/config/database.php.default b/cake/console/libs/templates/skel/config/database.php.default index ac3e99dfe..c30e368ae 100644 --- a/cake/console/libs/templates/skel/config/database.php.default +++ b/cake/console/libs/templates/skel/config/database.php.default @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.config * @since CakePHP(tm) v 0.2.9 diff --git a/cake/console/libs/templates/skel/config/inflections.php b/cake/console/libs/templates/skel/config/inflections.php index 467b09c66..fe45e4d2f 100644 --- a/cake/console/libs/templates/skel/config/inflections.php +++ b/cake/console/libs/templates/skel/config/inflections.php @@ -8,15 +8,14 @@ * * PHP versions 4 and % * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.config * @since CakePHP(tm) v 1.0.0.2312 diff --git a/cake/console/libs/templates/skel/config/routes.php b/cake/console/libs/templates/skel/config/routes.php index 1bec77b10..32094aa62 100644 --- a/cake/console/libs/templates/skel/config/routes.php +++ b/cake/console/libs/templates/skel/config/routes.php @@ -9,15 +9,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.config * @since CakePHP(tm) v 0.2.9 diff --git a/cake/console/libs/templates/skel/config/sql/db_acl.php b/cake/console/libs/templates/skel/config/sql/db_acl.php index dd6a1ac1b..72530d65c 100644 --- a/cake/console/libs/templates/skel/config/sql/db_acl.php +++ b/cake/console/libs/templates/skel/config/sql/db_acl.php @@ -8,15 +8,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.config.sql * @since CakePHP(tm) v 0.2.9 diff --git a/cake/console/libs/templates/skel/config/sql/i18n.php b/cake/console/libs/templates/skel/config/sql/i18n.php index 40c2957fe..ac0e7f5a9 100644 --- a/cake/console/libs/templates/skel/config/sql/i18n.php +++ b/cake/console/libs/templates/skel/config/sql/i18n.php @@ -8,15 +8,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.config.sql * @since CakePHP(tm) v 0.2.9 diff --git a/cake/console/libs/templates/skel/config/sql/sessions.php b/cake/console/libs/templates/skel/config/sql/sessions.php index 334c0b9ce..8880e49b5 100644 --- a/cake/console/libs/templates/skel/config/sql/sessions.php +++ b/cake/console/libs/templates/skel/config/sql/sessions.php @@ -8,15 +8,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.config.sql * @since CakePHP(tm) v 0.2.9 diff --git a/cake/console/libs/templates/skel/controllers/pages_controller.php b/cake/console/libs/templates/skel/controllers/pages_controller.php index ecbb51388..4001408c0 100644 --- a/cake/console/libs/templates/skel/controllers/pages_controller.php +++ b/cake/console/libs/templates/skel/controllers/pages_controller.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller * @since CakePHP(tm) v 0.2.9 diff --git a/cake/console/libs/templates/skel/index.php b/cake/console/libs/templates/skel/index.php index 057c1af3a..a8cca5d89 100644 --- a/cake/console/libs/templates/skel/index.php +++ b/cake/console/libs/templates/skel/index.php @@ -3,15 +3,14 @@ /** * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/console/libs/templates/skel/views/elements/email/html/default.ctp b/cake/console/libs/templates/skel/views/elements/email/html/default.ctp index 49a085a29..b7c906233 100644 --- a/cake/console/libs/templates/skel/views/elements/email/html/default.ctp +++ b/cake/console/libs/templates/skel/views/elements/email/html/default.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.elements.email.html * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/console/libs/templates/skel/views/elements/email/text/default.ctp b/cake/console/libs/templates/skel/views/elements/email/text/default.ctp index 284acea16..d3f885b5c 100644 --- a/cake/console/libs/templates/skel/views/elements/email/text/default.ctp +++ b/cake/console/libs/templates/skel/views/elements/email/text/default.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.elements.email.text * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/console/libs/templates/skel/views/layouts/ajax.ctp b/cake/console/libs/templates/skel/views/layouts/ajax.ctp index e6bd065e0..a3440dd2c 100644 --- a/cake/console/libs/templates/skel/views/layouts/ajax.ctp +++ b/cake/console/libs/templates/skel/views/layouts/ajax.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/console/libs/templates/skel/views/layouts/default.ctp b/cake/console/libs/templates/skel/views/layouts/default.ctp index 589f4f447..f9b1423ab 100644 --- a/cake/console/libs/templates/skel/views/layouts/default.ctp +++ b/cake/console/libs/templates/skel/views/layouts/default.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.templates.skel.views.layouts * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/console/libs/templates/skel/views/layouts/email/html/default.ctp b/cake/console/libs/templates/skel/views/layouts/email/html/default.ctp index 63573ac05..dbf7916be 100644 --- a/cake/console/libs/templates/skel/views/layouts/email/html/default.ctp +++ b/cake/console/libs/templates/skel/views/layouts/email/html/default.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts.email.html * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/console/libs/templates/skel/views/layouts/email/text/default.ctp b/cake/console/libs/templates/skel/views/layouts/email/text/default.ctp index 9a0cf7835..aeef64f2b 100644 --- a/cake/console/libs/templates/skel/views/layouts/email/text/default.ctp +++ b/cake/console/libs/templates/skel/views/layouts/email/text/default.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts.email.text * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/console/libs/templates/skel/views/layouts/flash.ctp b/cake/console/libs/templates/skel/views/layouts/flash.ctp index d02fa8571..9ec3209f4 100644 --- a/cake/console/libs/templates/skel/views/layouts/flash.ctp +++ b/cake/console/libs/templates/skel/views/layouts/flash.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/console/libs/templates/skel/webroot/css.php b/cake/console/libs/templates/skel/webroot/css.php index e475508ee..b95cb8a36 100644 --- a/cake/console/libs/templates/skel/webroot/css.php +++ b/cake/console/libs/templates/skel/webroot/css.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.webroot * @since CakePHP(tm) v 0.2.9 diff --git a/cake/console/libs/templates/skel/webroot/css/cake.generic.css b/cake/console/libs/templates/skel/webroot/css/cake.generic.css index 29773b983..6769c99ca 100644 --- a/cake/console/libs/templates/skel/webroot/css/cake.generic.css +++ b/cake/console/libs/templates/skel/webroot/css/cake.generic.css @@ -3,15 +3,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.webroot.css * @since CakePHP(tm) diff --git a/cake/console/libs/templates/skel/webroot/index.php b/cake/console/libs/templates/skel/webroot/index.php index 1a4d7ddef..798b026f5 100644 --- a/cake/console/libs/templates/skel/webroot/index.php +++ b/cake/console/libs/templates/skel/webroot/index.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.webroot * @since CakePHP(tm) v 0.2.9 diff --git a/cake/console/libs/templates/skel/webroot/js/vendors.php b/cake/console/libs/templates/skel/webroot/js/vendors.php index 5c6181290..d9d38f690 100644 --- a/cake/console/libs/templates/skel/webroot/js/vendors.php +++ b/cake/console/libs/templates/skel/webroot/js/vendors.php @@ -8,15 +8,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.webroot.js * @since CakePHP(tm) v 0.2.9 diff --git a/cake/console/libs/templates/skel/webroot/test.php b/cake/console/libs/templates/skel/webroot/test.php index d0c4065a2..cb42147e7 100644 --- a/cake/console/libs/templates/skel/webroot/test.php +++ b/cake/console/libs/templates/skel/webroot/test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs diff --git a/cake/console/libs/templates/views/form.ctp b/cake/console/libs/templates/views/form.ctp index 07fddcf0c..91c9f77db 100644 --- a/cake/console/libs/templates/views/form.ctp +++ b/cake/console/libs/templates/views/form.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.templates.views * @since CakePHP(tm) v 1.2.0.5234 diff --git a/cake/console/libs/templates/views/index.ctp b/cake/console/libs/templates/views/index.ctp index fb089f9a3..13de4923b 100644 --- a/cake/console/libs/templates/views/index.ctp +++ b/cake/console/libs/templates/views/index.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.templates.views * @since CakePHP(tm) v 1.2.0.5234 diff --git a/cake/console/libs/templates/views/view.ctp b/cake/console/libs/templates/views/view.ctp index 1a9c73d2c..362d57c89 100644 --- a/cake/console/libs/templates/views/view.ctp +++ b/cake/console/libs/templates/views/view.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.templates.views * @since CakePHP(tm) v 1.2.0.5234 diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php index 03408ba8b..6e8df608b 100644 --- a/cake/console/libs/testsuite.php +++ b/cake/console/libs/testsuite.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.console.libs diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 7c241473c..69eb962f5 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -9,14 +9,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake * @since CakePHP(tm) v 0.2.9 diff --git a/cake/libs/cache.php b/cake/libs/cache.php index 1162e61e6..bc93aa9a2 100644 --- a/cake/libs/cache.php +++ b/cake/libs/cache.php @@ -6,15 +6,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.0.4933 diff --git a/cake/libs/cache/apc.php b/cake/libs/cache/apc.php index dcba88221..ecf8f746c 100644 --- a/cake/libs/cache/apc.php +++ b/cake/libs/cache/apc.php @@ -6,15 +6,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.cache * @since CakePHP(tm) v 1.2.0.4933 diff --git a/cake/libs/cache/file.php b/cake/libs/cache/file.php index ab17230dc..c98ccc6d3 100644 --- a/cake/libs/cache/file.php +++ b/cake/libs/cache/file.php @@ -6,15 +6,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.cache * @since CakePHP(tm) v 1.2.0.4933 diff --git a/cake/libs/cache/memcache.php b/cake/libs/cache/memcache.php index 0ee73f4a5..fb293176d 100644 --- a/cake/libs/cache/memcache.php +++ b/cake/libs/cache/memcache.php @@ -6,15 +6,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.cache * @since CakePHP(tm) v 1.2.0.4933 diff --git a/cake/libs/cache/xcache.php b/cake/libs/cache/xcache.php index 211e46ddb..f25dbdd2c 100644 --- a/cake/libs/cache/xcache.php +++ b/cake/libs/cache/xcache.php @@ -6,15 +6,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.cache * @since CakePHP(tm) v 1.2.0.4947 diff --git a/cake/libs/cake_log.php b/cake/libs/cake_log.php index 852f8fcb5..b0b6404b3 100644 --- a/cake/libs/cake_log.php +++ b/cake/libs/cake_log.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 0.2.9 diff --git a/cake/libs/class_registry.php b/cake/libs/class_registry.php index 07b3a0599..a825e800e 100644 --- a/cake/libs/class_registry.php +++ b/cake/libs/class_registry.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 0.9.2 diff --git a/cake/libs/configure.php b/cake/libs/configure.php index b9c2914de..4d0ed0a2f 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.0.0.2363 diff --git a/cake/libs/controller/app_controller.php b/cake/libs/controller/app_controller.php index d15e034d1..57d35bada 100644 --- a/cake/libs/controller/app_controller.php +++ b/cake/libs/controller/app_controller.php @@ -8,15 +8,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller * @since CakePHP(tm) v 0.2.9 diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php index 27dab4efe..3e740003c 100644 --- a/cake/libs/controller/component.php +++ b/cake/libs/controller/component.php @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller * @since CakePHP(tm) v TBD diff --git a/cake/libs/controller/components/acl.php b/cake/libs/controller/components/acl.php index 5caceceaa..2d53b3283 100644 --- a/cake/libs/controller/components/acl.php +++ b/cake/libs/controller/components/acl.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller.components * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index 574481a7a..ec1a03051 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -8,15 +8,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller.components * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/controller/components/cookie.php b/cake/libs/controller/components/cookie.php index deaa2647a..04ac59918 100644 --- a/cake/libs/controller/components/cookie.php +++ b/cake/libs/controller/components/cookie.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller.components * @since CakePHP(tm) v 1.2.0.4213 diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index 6fa466cd7..61f6e2ed1 100644 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller.components * @since CakePHP(tm) v 1.2.0.3467 diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php index e95b6bd79..25342941b 100644 --- a/cake/libs/controller/components/request_handler.php +++ b/cake/libs/controller/components/request_handler.php @@ -7,15 +7,14 @@ * and the like. These units have no use for Ajax requests, and this Component can tell how Cake * should respond to the different needs of a handheld computer and a desktop machine. * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller.components * @since CakePHP(tm) v 0.10.4.1076 diff --git a/cake/libs/controller/components/security.php b/cake/libs/controller/components/security.php index 5aca459b6..306080d41 100644 --- a/cake/libs/controller/components/security.php +++ b/cake/libs/controller/components/security.php @@ -8,14 +8,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller.components * @since CakePHP(tm) v 0.10.8.2156 diff --git a/cake/libs/controller/components/session.php b/cake/libs/controller/components/session.php index 08b61cbca..483ddba31 100644 --- a/cake/libs/controller/components/session.php +++ b/cake/libs/controller/components/session.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller.components * @since CakePHP(tm) v 0.10.0.1232 diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 721a45c4e..2f12be5d2 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller * @since CakePHP(tm) v 0.2.9 diff --git a/cake/libs/controller/pages_controller.php b/cake/libs/controller/pages_controller.php index ecbb51388..4001408c0 100644 --- a/cake/libs/controller/pages_controller.php +++ b/cake/libs/controller/pages_controller.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller * @since CakePHP(tm) v 0.2.9 diff --git a/cake/libs/controller/scaffold.php b/cake/libs/controller/scaffold.php index b2e1d93af..d885e8a2e 100644 --- a/cake/libs/controller/scaffold.php +++ b/cake/libs/controller/scaffold.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.controller * @since Cake v 0.10.0.1076 diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index 4afa34b01..a4cd47a7b 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.4560 diff --git a/cake/libs/error.php b/cake/libs/error.php index 195dbf7d1..e3c0a3d14 100644 --- a/cake/libs/error.php +++ b/cake/libs/error.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 0.10.5.1732 diff --git a/cake/libs/file.php b/cake/libs/file.php index 641f2e1e5..fba1f3aa3 100644 --- a/cake/libs/file.php +++ b/cake/libs/file.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 0.2.9 diff --git a/cake/libs/flay.php b/cake/libs/flay.php index ec3c213b3..1a81930af 100644 --- a/cake/libs/flay.php +++ b/cake/libs/flay.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 0.2.9 diff --git a/cake/libs/folder.php b/cake/libs/folder.php index 5f6154c96..bd0ef42cf 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 0.2.9 diff --git a/cake/libs/http_socket.php b/cake/libs/http_socket.php index 44e4dfc2b..ccd5aa037 100644 --- a/cake/libs/http_socket.php +++ b/cake/libs/http_socket.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.0 diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index 6eba0bae9..8fdb30b15 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.0.4116 diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index 2a94a84e1..9ce5714d4 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 0.2.9 diff --git a/cake/libs/l10n.php b/cake/libs/l10n.php index 85f978a7d..13a2e9a6b 100644 --- a/cake/libs/l10n.php +++ b/cake/libs/l10n.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.0.4116 diff --git a/cake/libs/magic_db.php b/cake/libs/magic_db.php index 37396618c..a5784441a 100644 --- a/cake/libs/magic_db.php +++ b/cake/libs/magic_db.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.0 diff --git a/cake/libs/model/app_model.php b/cake/libs/model/app_model.php index a311329c8..e09b1f970 100644 --- a/cake/libs/model/app_model.php +++ b/cake/libs/model/app_model.php @@ -8,15 +8,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model * @since CakePHP(tm) v 0.2.9 diff --git a/cake/libs/model/behavior.php b/cake/libs/model/behavior.php index 61d319485..d91bf0eb3 100644 --- a/cake/libs/model/behavior.php +++ b/cake/libs/model/behavior.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model * @since CakePHP(tm) v 1.2.0.0 diff --git a/cake/libs/model/behaviors/acl.php b/cake/libs/model/behaviors/acl.php index 01de82dca..e2c7038c0 100644 --- a/cake/libs/model/behaviors/acl.php +++ b/cake/libs/model/behaviors/acl.php @@ -13,9 +13,8 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @link http://cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.libs.model.behaviors * @since CakePHP v 1.2.0.4487 diff --git a/cake/libs/model/behaviors/containable.php b/cake/libs/model/behaviors/containable.php index 52f519ac4..221cb8f1e 100644 --- a/cake/libs/model/behaviors/containable.php +++ b/cake/libs/model/behaviors/containable.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs * @since CakePHP(tm) v 1.2.0.5669 diff --git a/cake/libs/model/behaviors/translate.php b/cake/libs/model/behaviors/translate.php index 1162180ab..bba76be4d 100644 --- a/cake/libs/model/behaviors/translate.php +++ b/cake/libs/model/behaviors/translate.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.behaviors * @since CakePHP(tm) v 1.2.0.4525 diff --git a/cake/libs/model/behaviors/tree.php b/cake/libs/model/behaviors/tree.php index addd8c6c2..ab1d2ff9c 100644 --- a/cake/libs/model/behaviors/tree.php +++ b/cake/libs/model/behaviors/tree.php @@ -13,9 +13,8 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @link http://cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.libs.model.behaviors * @since CakePHP v 1.2.0.4487 diff --git a/cake/libs/model/connection_manager.php b/cake/libs/model/connection_manager.php index 867605f50..581cd3b2d 100644 --- a/cake/libs/model/connection_manager.php +++ b/cake/libs/model/connection_manager.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model * @since CakePHP(tm) v 0.10.x.1402 diff --git a/cake/libs/model/datasources/datasource.php b/cake/libs/model/datasources/datasource.php index 835ba3a1d..e57fbfcd6 100644 --- a/cake/libs/model/datasources/datasource.php +++ b/cake/libs/model/datasources/datasource.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources * @since CakePHP(tm) v 0.10.5.1790 diff --git a/cake/libs/model/datasources/dbo/dbo_adodb.php b/cake/libs/model/datasources/dbo/dbo_adodb.php index 94badf16b..e089e1f10 100644 --- a/cake/libs/model/datasources/dbo/dbo_adodb.php +++ b/cake/libs/model/datasources/dbo/dbo_adodb.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources.dbo * @since CakePHP(tm) v 0.2.9 diff --git a/cake/libs/model/datasources/dbo/dbo_db2.php b/cake/libs/model/datasources/dbo/dbo_db2.php index 100b28535..0a5600bca 100644 --- a/cake/libs/model/datasources/dbo/dbo_db2.php +++ b/cake/libs/model/datasources/dbo/dbo_db2.php @@ -9,15 +9,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) * Copyright 2007, Cake Software Foundation, Inc. * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources.dbo * @since CakePHP(tm) v 0.10.5.1790 diff --git a/cake/libs/model/datasources/dbo/dbo_firebird.php b/cake/libs/model/datasources/dbo/dbo_firebird.php index f1c29e5b9..06454fef6 100644 --- a/cake/libs/model/datasources/dbo/dbo_firebird.php +++ b/cake/libs/model/datasources/dbo/dbo_firebird.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.dbo * @since CakePHP(tm) v 1.2.0.5152 diff --git a/cake/libs/model/datasources/dbo/dbo_mssql.php b/cake/libs/model/datasources/dbo/dbo_mssql.php index 18c138364..dadf67660 100644 --- a/cake/libs/model/datasources/dbo/dbo_mssql.php +++ b/cake/libs/model/datasources/dbo/dbo_mssql.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources.dbo * @since CakePHP(tm) v 0.10.5.1790 diff --git a/cake/libs/model/datasources/dbo/dbo_mysql.php b/cake/libs/model/datasources/dbo/dbo_mysql.php index 94962a8b7..190d96aa1 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysql.php +++ b/cake/libs/model/datasources/dbo/dbo_mysql.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources.dbo * @since CakePHP(tm) v 0.10.5.1790 diff --git a/cake/libs/model/datasources/dbo/dbo_mysqli.php b/cake/libs/model/datasources/dbo/dbo_mysqli.php index cc506e5a2..d7e991476 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysqli.php +++ b/cake/libs/model/datasources/dbo/dbo_mysqli.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources.dbo * @since CakePHP(tm) v 1.1.4.2974 diff --git a/cake/libs/model/datasources/dbo/dbo_odbc.php b/cake/libs/model/datasources/dbo/dbo_odbc.php index 64ab17d51..d35f5e7a8 100644 --- a/cake/libs/model/datasources/dbo/dbo_odbc.php +++ b/cake/libs/model/datasources/dbo/dbo_odbc.php @@ -8,15 +8,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.dbo * @since CakePHP(tm) v 0.10.5.1790 diff --git a/cake/libs/model/datasources/dbo/dbo_oracle.php b/cake/libs/model/datasources/dbo/dbo_oracle.php index f74c18766..db6a1586c 100644 --- a/cake/libs/model/datasources/dbo/dbo_oracle.php +++ b/cake/libs/model/datasources/dbo/dbo_oracle.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources.dbo * @since CakePHP v 1.2.0.4041 diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index e2c0d8ce3..959a23826 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -8,15 +8,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources.dbo * @since CakePHP(tm) v 0.9.1.114 diff --git a/cake/libs/model/datasources/dbo/dbo_sqlite.php b/cake/libs/model/datasources/dbo/dbo_sqlite.php index dea7385bc..3b13e7980 100644 --- a/cake/libs/model/datasources/dbo/dbo_sqlite.php +++ b/cake/libs/model/datasources/dbo/dbo_sqlite.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources.dbo * @since CakePHP(tm) v 0.9.0 diff --git a/cake/libs/model/datasources/dbo/dbo_sybase.php b/cake/libs/model/datasources/dbo/dbo_sybase.php index 5e30bfe3b..21c87b62b 100644 --- a/cake/libs/model/datasources/dbo/dbo_sybase.php +++ b/cake/libs/model/datasources/dbo/dbo_sybase.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources.dbo * @since CakePHP(tm) v 1.2.0.3097 diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 95929a56c..94c060cc7 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/model/db_acl.php b/cake/libs/model/db_acl.php index aae5f718d..49b3d04fb 100644 --- a/cake/libs/model/db_acl.php +++ b/cake/libs/model/db_acl.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model * @since CakePHP(tm) v 0.2.9 diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 78be07d47..158ee86ea 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -7,15 +7,14 @@ * * PHP versions 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model * @since CakePHP(tm) v 0.10.0.0 diff --git a/cake/libs/model/schema.php b/cake/libs/model/schema.php index 5de4a5e84..7457968af 100644 --- a/cake/libs/model/schema.php +++ b/cake/libs/model/schema.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model * @since CakePHP(tm) v 1.2.0.5550 diff --git a/cake/libs/multibyte.php b/cake/libs/multibyte.php index d9ac214a0..069136ccc 100644 --- a/cake/libs/multibyte.php +++ b/cake/libs/multibyte.php @@ -6,15 +6,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.0.6833 diff --git a/cake/libs/object.php b/cake/libs/object.php index eda5d7f63..0b83127e6 100644 --- a/cake/libs/object.php +++ b/cake/libs/object.php @@ -8,15 +8,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 0.2.9 diff --git a/cake/libs/overloadable.php b/cake/libs/overloadable.php index c58a4986b..2714ae81c 100644 --- a/cake/libs/overloadable.php +++ b/cake/libs/overloadable.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2 diff --git a/cake/libs/overloadable_php4.php b/cake/libs/overloadable_php4.php index 1e0750a17..e4977bc16 100644 --- a/cake/libs/overloadable_php4.php +++ b/cake/libs/overloadable_php4.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2 diff --git a/cake/libs/overloadable_php5.php b/cake/libs/overloadable_php5.php index d78a8ab91..27aadff1a 100644 --- a/cake/libs/overloadable_php5.php +++ b/cake/libs/overloadable_php5.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2 diff --git a/cake/libs/router.php b/cake/libs/router.php index dc22a29ef..c3fca15ce 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 0.2.9 diff --git a/cake/libs/sanitize.php b/cake/libs/sanitize.php index 90ab45325..45a8b5689 100644 --- a/cake/libs/sanitize.php +++ b/cake/libs/sanitize.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/security.php b/cake/libs/security.php index 72b453a03..4dba07c55 100644 --- a/cake/libs/security.php +++ b/cake/libs/security.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v .0.10.0.1233 diff --git a/cake/libs/session.php b/cake/libs/session.php index cc4d41524..b3ba09e7a 100644 --- a/cake/libs/session.php +++ b/cake/libs/session.php @@ -10,15 +10,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v .0.10.0.1222 diff --git a/cake/libs/set.php b/cake/libs/set.php index 8a83d3c7f..f6b13a9b4 100644 --- a/cake/libs/set.php +++ b/cake/libs/set.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.0 diff --git a/cake/libs/socket.php b/cake/libs/socket.php index 9308b0a2c..1ec8bf4b3 100644 --- a/cake/libs/socket.php +++ b/cake/libs/socket.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.0 diff --git a/cake/libs/string.php b/cake/libs/string.php index 279e84732..9717896ae 100644 --- a/cake/libs/string.php +++ b/cake/libs/string.php @@ -6,15 +6,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.0.5551 diff --git a/cake/libs/validation.php b/cake/libs/validation.php index 93adc1439..fbe6bdf46 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.0.3830 diff --git a/cake/libs/view/elements/dump.ctp b/cake/libs/view/elements/dump.ctp index 9b1f807a3..622a531d0 100644 --- a/cake/libs/view/elements/dump.ctp +++ b/cake/libs/view/elements/dump.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.elements * @since CakePHP(tm) v 0.10.5.1782 diff --git a/cake/libs/view/elements/email/html/default.ctp b/cake/libs/view/elements/email/html/default.ctp index 49a085a29..b7c906233 100644 --- a/cake/libs/view/elements/email/html/default.ctp +++ b/cake/libs/view/elements/email/html/default.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.elements.email.html * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/elements/email/text/default.ctp b/cake/libs/view/elements/email/text/default.ctp index 284acea16..d3f885b5c 100644 --- a/cake/libs/view/elements/email/text/default.ctp +++ b/cake/libs/view/elements/email/text/default.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.elements.email.text * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/errors/error404.ctp b/cake/libs/view/errors/error404.ctp index aa6dcd9ab..b1bc0686d 100644 --- a/cake/libs/view/errors/error404.ctp +++ b/cake/libs/view/errors/error404.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/errors/missing_action.ctp b/cake/libs/view/errors/missing_action.ctp index 00b65e886..1e9cc196d 100644 --- a/cake/libs/view/errors/missing_action.ctp +++ b/cake/libs/view/errors/missing_action.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/errors/missing_component_class.ctp b/cake/libs/view/errors/missing_component_class.ctp index 7171c32c9..ce8ff52bb 100644 --- a/cake/libs/view/errors/missing_component_class.ctp +++ b/cake/libs/view/errors/missing_component_class.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/errors/missing_component_file.ctp b/cake/libs/view/errors/missing_component_file.ctp index fa44f497e..83520da99 100644 --- a/cake/libs/view/errors/missing_component_file.ctp +++ b/cake/libs/view/errors/missing_component_file.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/errors/missing_connection.ctp b/cake/libs/view/errors/missing_connection.ctp index 66fd3500e..754c2a3d5 100644 --- a/cake/libs/view/errors/missing_connection.ctp +++ b/cake/libs/view/errors/missing_connection.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/errors/missing_controller.ctp b/cake/libs/view/errors/missing_controller.ctp index acad3e50a..f50b8d6e8 100644 --- a/cake/libs/view/errors/missing_controller.ctp +++ b/cake/libs/view/errors/missing_controller.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/errors/missing_helper_class.ctp b/cake/libs/view/errors/missing_helper_class.ctp index 9718ae33c..ac7877682 100644 --- a/cake/libs/view/errors/missing_helper_class.ctp +++ b/cake/libs/view/errors/missing_helper_class.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/errors/missing_helper_file.ctp b/cake/libs/view/errors/missing_helper_file.ctp index 5c33ca213..d5a72f9b8 100644 --- a/cake/libs/view/errors/missing_helper_file.ctp +++ b/cake/libs/view/errors/missing_helper_file.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/errors/missing_layout.ctp b/cake/libs/view/errors/missing_layout.ctp index c86a48d8b..febe11d33 100644 --- a/cake/libs/view/errors/missing_layout.ctp +++ b/cake/libs/view/errors/missing_layout.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/errors/missing_model.ctp b/cake/libs/view/errors/missing_model.ctp index bcd421fb8..e7e45c484 100644 --- a/cake/libs/view/errors/missing_model.ctp +++ b/cake/libs/view/errors/missing_model.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/errors/missing_scaffolddb.ctp b/cake/libs/view/errors/missing_scaffolddb.ctp index f694fbc7b..f6355a850 100644 --- a/cake/libs/view/errors/missing_scaffolddb.ctp +++ b/cake/libs/view/errors/missing_scaffolddb.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/errors/missing_table.ctp b/cake/libs/view/errors/missing_table.ctp index e8be76f3d..a1775a4e5 100644 --- a/cake/libs/view/errors/missing_table.ctp +++ b/cake/libs/view/errors/missing_table.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/errors/missing_view.ctp b/cake/libs/view/errors/missing_view.ctp index aefdae41b..503179f96 100644 --- a/cake/libs/view/errors/missing_view.ctp +++ b/cake/libs/view/errors/missing_view.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/errors/private_action.ctp b/cake/libs/view/errors/private_action.ctp index 35d630529..23beb5052 100644 --- a/cake/libs/view/errors/private_action.ctp +++ b/cake/libs/view/errors/private_action.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/errors/scaffold_error.ctp b/cake/libs/view/errors/scaffold_error.ctp index 09dc0eb52..48b8db4db 100644 --- a/cake/libs/view/errors/scaffold_error.ctp +++ b/cake/libs/view/errors/scaffold_error.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.errors * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index d4a873f76..2cd51639c 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view * @since CakePHP(tm) v 0.2.9 diff --git a/cake/libs/view/helpers/ajax.php b/cake/libs/view/helpers/ajax.php index c2bbb5ba0..600c93327 100644 --- a/cake/libs/view/helpers/ajax.php +++ b/cake/libs/view/helpers/ajax.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/helpers/app_helper.php b/cake/libs/view/helpers/app_helper.php index 3b751a8b4..b5c962f8f 100644 --- a/cake/libs/view/helpers/app_helper.php +++ b/cake/libs/view/helpers/app_helper.php @@ -8,15 +8,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake * @since CakePHP(tm) v 0.2.9 diff --git a/cake/libs/view/helpers/cache.php b/cake/libs/view/helpers/cache.php index 58757c77e..f3043ba2a 100644 --- a/cake/libs/view/helpers/cache.php +++ b/cake/libs/view/helpers/cache.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers * @since CakePHP(tm) v 1.0.0.2277 diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index a1aaa34fc..fc90a5a6c 100644 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php index 044a511a7..446188650 100644 --- a/cake/libs/view/helpers/html.php +++ b/cake/libs/view/helpers/html.php @@ -5,15 +5,14 @@ * * Simplifies the construction of HTML elements. * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers * @since CakePHP(tm) v 0.9.1 diff --git a/cake/libs/view/helpers/javascript.php b/cake/libs/view/helpers/javascript.php index f07a6cedc..aacfd4e0e 100644 --- a/cake/libs/view/helpers/javascript.php +++ b/cake/libs/view/helpers/javascript.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index c8f46a439..8cc82c9fa 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -11,9 +11,8 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @link http://cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.libs.view.helpers * @since CakePHP v 1.2 diff --git a/cake/libs/view/helpers/number.php b/cake/libs/view/helpers/number.php index 5e240d679..69b7e1130 100644 --- a/cake/libs/view/helpers/number.php +++ b/cake/libs/view/helpers/number.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index 054ae44ec..d00477853 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -5,15 +5,14 @@ * * Generates pagination links * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers * @since CakePHP(tm) v 1.2.0 diff --git a/cake/libs/view/helpers/rss.php b/cake/libs/view/helpers/rss.php index 6de685ebb..5ab558308 100644 --- a/cake/libs/view/helpers/rss.php +++ b/cake/libs/view/helpers/rss.php @@ -5,15 +5,14 @@ * * Simplifies the output of RSS feeds. * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers * @since CakePHP(tm) v 1.2 diff --git a/cake/libs/view/helpers/session.php b/cake/libs/view/helpers/session.php index e69658e84..d8303fb7b 100644 --- a/cake/libs/view/helpers/session.php +++ b/cake/libs/view/helpers/session.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers * @since CakePHP(tm) v 1.1.7.3328 diff --git a/cake/libs/view/helpers/text.php b/cake/libs/view/helpers/text.php index 737681ef9..546b0e632 100644 --- a/cake/libs/view/helpers/text.php +++ b/cake/libs/view/helpers/text.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/helpers/time.php b/cake/libs/view/helpers/time.php index e9d0feca9..637514cb2 100644 --- a/cake/libs/view/helpers/time.php +++ b/cake/libs/view/helpers/time.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/helpers/xml.php b/cake/libs/view/helpers/xml.php index ab6810eb7..aeec5ab36 100644 --- a/cake/libs/view/helpers/xml.php +++ b/cake/libs/view/helpers/xml.php @@ -5,15 +5,14 @@ * * Simplifies the output of XML documents. * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.helpers * @since CakePHP(tm) v 1.2 diff --git a/cake/libs/view/layouts/ajax.ctp b/cake/libs/view/layouts/ajax.ctp index e6bd065e0..a3440dd2c 100644 --- a/cake/libs/view/layouts/ajax.ctp +++ b/cake/libs/view/layouts/ajax.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/layouts/default.ctp b/cake/libs/view/layouts/default.ctp index 9be4e143d..79efc313a 100644 --- a/cake/libs/view/layouts/default.ctp +++ b/cake/libs/view/layouts/default.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/layouts/email/html/default.ctp b/cake/libs/view/layouts/email/html/default.ctp index 1467a8847..fdac9bd00 100644 --- a/cake/libs/view/layouts/email/html/default.ctp +++ b/cake/libs/view/layouts/email/html/default.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts.email.html * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/layouts/email/text/default.ctp b/cake/libs/view/layouts/email/text/default.ctp index 502a393fc..8131e4710 100644 --- a/cake/libs/view/layouts/email/text/default.ctp +++ b/cake/libs/view/layouts/email/text/default.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts.email.text * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/layouts/flash.ctp b/cake/libs/view/layouts/flash.ctp index 44b388f28..c48aaf62e 100644 --- a/cake/libs/view/layouts/flash.ctp +++ b/cake/libs/view/layouts/flash.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/media.php b/cake/libs/view/media.php index 1738036fd..2ec12d66b 100644 --- a/cake/libs/view/media.php +++ b/cake/libs/view/media.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view * @since CakePHP(tm) v 1.2.0.5714 diff --git a/cake/libs/view/pages/home.ctp b/cake/libs/view/pages/home.ctp index 61c427c60..d63519b95 100644 --- a/cake/libs/view/pages/home.ctp +++ b/cake/libs/view/pages/home.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.pages * @since CakePHP(tm) v 0.10.0.1076 @@ -120,7 +119,7 @@ You can also add some CSS styles for your pages at: APP/webroot/css.'); </p> <br /> <ul> - <li><a href="http://www.cakefoundation.org/"><?php __('Cake Software Foundation'); ?> </a> + <li><a href="http://cakefoundation.org/"><?php __('Cake Software Foundation'); ?> </a> <ul><li><?php __('Promoting development related to CakePHP'); ?></li></ul></li> <li><a href="http://www.cakephp.org"><?php __('CakePHP'); ?> </a> <ul><li><?php __('The Rapid Development Framework'); ?></li></ul></li> diff --git a/cake/libs/view/scaffolds/edit.ctp b/cake/libs/view/scaffolds/edit.ctp index 36b4e845e..215a77aed 100644 --- a/cake/libs/view/scaffolds/edit.ctp +++ b/cake/libs/view/scaffolds/edit.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.scaffolds * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/scaffolds/index.ctp b/cake/libs/view/scaffolds/index.ctp index c67553b46..79039c02d 100644 --- a/cake/libs/view/scaffolds/index.ctp +++ b/cake/libs/view/scaffolds/index.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.console.libs.templates.views * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/scaffolds/view.ctp b/cake/libs/view/scaffolds/view.ctp index 5b3572c0e..11ff93796 100644 --- a/cake/libs/view/scaffolds/view.ctp +++ b/cake/libs/view/scaffolds/view.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.scaffolds * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/theme.php b/cake/libs/view/theme.php index 594cdb117..0c318e643 100644 --- a/cake/libs/view/theme.php +++ b/cake/libs/view/theme.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index 44f9437fe..ca2319a0b 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/libs/xml.php b/cake/libs/xml.php index ad8cf15e0..81acb6921 100644 --- a/cake/libs/xml.php +++ b/cake/libs/xml.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP v .0.10.3.1400 diff --git a/cake/tests/cases/basics.test.php b/cake/tests/cases/basics.test.php index 8920c0bc3..03164730b 100644 --- a/cake/tests/cases/basics.test.php +++ b/cake/tests/cases/basics.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases diff --git a/cake/tests/cases/console/cake.test.php b/cake/tests/cases/console/cake.test.php index 949fede8a..de04d74ef 100644 --- a/cake/tests/cases/console/cake.test.php +++ b/cake/tests/cases/console/cake.test.php @@ -13,7 +13,6 @@ * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake diff --git a/cake/tests/cases/console/libs/acl.test.php b/cake/tests/cases/console/libs/acl.test.php index 55dff3402..145d7b70e 100644 --- a/cake/tests/cases/console/libs/acl.test.php +++ b/cake/tests/cases/console/libs/acl.test.php @@ -11,9 +11,8 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @link http://cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.cases.console.libs.tasks * @since CakePHP v 1.2.0.7726 diff --git a/cake/tests/cases/console/libs/api.test.php b/cake/tests/cases/console/libs/api.test.php index 1d089b179..29f84eafe 100644 --- a/cake/tests/cases/console/libs/api.test.php +++ b/cake/tests/cases/console/libs/api.test.php @@ -11,9 +11,8 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @link http://cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.cases.console.libs.tasks * @since CakePHP v 1.2.0.7726 diff --git a/cake/tests/cases/console/libs/schema.test.php b/cake/tests/cases/console/libs/schema.test.php index e4cf0a856..57c850590 100644 --- a/cake/tests/cases/console/libs/schema.test.php +++ b/cake/tests/cases/console/libs/schema.test.php @@ -10,9 +10,8 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @link http://cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.cases.console.libs.Shells * @since CakePHP v 1.3 diff --git a/cake/tests/cases/console/libs/shell.test.php b/cake/tests/cases/console/libs/shell.test.php index ec50f577b..5117da879 100644 --- a/cake/tests/cases/console/libs/shell.test.php +++ b/cake/tests/cases/console/libs/shell.test.php @@ -13,9 +13,8 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @link http://cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.cases.console.libs * @since CakePHP v 1.2.0.7726 diff --git a/cake/tests/cases/console/libs/tasks/extract.test.php b/cake/tests/cases/console/libs/tasks/extract.test.php index 37e79dc27..51c50d89b 100644 --- a/cake/tests/cases/console/libs/tasks/extract.test.php +++ b/cake/tests/cases/console/libs/tasks/extract.test.php @@ -13,9 +13,8 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @link http://cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.cases.console.libs.tasks * @since CakePHP v 1.2.0.7726 diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index f61262f21..e47d35bf0 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -13,9 +13,8 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @link http://cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.cases.console.libs.tasks * @since CakePHP v 1.2.6 diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index b646dc554..a07f26989 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -13,9 +13,8 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @link http://cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.cases.console.libs.tasks * @since CakePHP v 1.2.0.7726 diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index 98f6312fb..0ff46bb3b 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases diff --git a/cake/tests/cases/libs/cache.test.php b/cake/tests/cases/libs/cache.test.php index 82ed7762f..6909e5047 100644 --- a/cake/tests/cases/libs/cache.test.php +++ b/cake/tests/cases/libs/cache.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/cache/apc.test.php b/cake/tests/cases/libs/cache/apc.test.php index 2f75cf9e2..8a9229bf2 100644 --- a/cake/tests/cases/libs/cache/apc.test.php +++ b/cake/tests/cases/libs/cache/apc.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.cache diff --git a/cake/tests/cases/libs/cache/file.test.php b/cake/tests/cases/libs/cache/file.test.php index 4bc0ab3d0..76c0d11bc 100644 --- a/cake/tests/cases/libs/cache/file.test.php +++ b/cake/tests/cases/libs/cache/file.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.cache diff --git a/cake/tests/cases/libs/cache/memcache.test.php b/cake/tests/cases/libs/cache/memcache.test.php index aa56459ec..0a62804fb 100644 --- a/cake/tests/cases/libs/cache/memcache.test.php +++ b/cake/tests/cases/libs/cache/memcache.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.cache diff --git a/cake/tests/cases/libs/cache/xcache.test.php b/cake/tests/cases/libs/cache/xcache.test.php index 818d10ada..3a5392d20 100644 --- a/cake/tests/cases/libs/cache/xcache.test.php +++ b/cake/tests/cases/libs/cache/xcache.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.cache diff --git a/cake/tests/cases/libs/cake_log.test.php b/cake/tests/cases/libs/cake_log.test.php index 8ab46ca9a..095682ad1 100644 --- a/cake/tests/cases/libs/cake_log.test.php +++ b/cake/tests/cases/libs/cake_log.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/cake_test_case.test.php b/cake/tests/cases/libs/cake_test_case.test.php index 5340f8f5d..7b0a486b8 100644 --- a/cake/tests/cases/libs/cake_test_case.test.php +++ b/cake/tests/cases/libs/cake_test_case.test.php @@ -13,9 +13,8 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @link http://cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.libs. * @since CakePHP v 1.2.0.4487 diff --git a/cake/tests/cases/libs/cake_test_fixture.test.php b/cake/tests/cases/libs/cake_test_fixture.test.php index b2e438abb..9e46b4083 100644 --- a/cake/tests/cases/libs/cake_test_fixture.test.php +++ b/cake/tests/cases/libs/cake_test_fixture.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs diff --git a/cake/tests/cases/libs/class_registry.test.php b/cake/tests/cases/libs/class_registry.test.php index e8dd6886d..06b3698a2 100644 --- a/cake/tests/cases/libs/class_registry.test.php +++ b/cake/tests/cases/libs/class_registry.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/code_coverage_manager.test.php b/cake/tests/cases/libs/code_coverage_manager.test.php index af1ae0b73..d6bbd2e66 100644 --- a/cake/tests/cases/libs/code_coverage_manager.test.php +++ b/cake/tests/cases/libs/code_coverage_manager.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/configure.test.php b/cake/tests/cases/libs/configure.test.php index af0f26402..6339ce735 100644 --- a/cake/tests/cases/libs/configure.test.php +++ b/cake/tests/cases/libs/configure.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/controller/component.test.php b/cake/tests/cases/libs/controller/component.test.php index cf1386cd7..b3cd367f9 100644 --- a/cake/tests/cases/libs/controller/component.test.php +++ b/cake/tests/cases/libs/controller/component.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller diff --git a/cake/tests/cases/libs/controller/components/acl.test.php b/cake/tests/cases/libs/controller/components/acl.test.php index 2daff3f67..1c23bfa67 100644 --- a/cake/tests/cases/libs/controller/components/acl.test.php +++ b/cake/tests/cases/libs/controller/components/acl.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller.components diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php index 4890f70d3..0de2c1e20 100644 --- a/cake/tests/cases/libs/controller/components/auth.test.php +++ b/cake/tests/cases/libs/controller/components/auth.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.cases.libs.controller.components diff --git a/cake/tests/cases/libs/controller/components/cookie.test.php b/cake/tests/cases/libs/controller/components/cookie.test.php index c5ebef42b..de122d107 100644 --- a/cake/tests/cases/libs/controller/components/cookie.test.php +++ b/cake/tests/cases/libs/controller/components/cookie.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller.components diff --git a/cake/tests/cases/libs/controller/components/email.test.php b/cake/tests/cases/libs/controller/components/email.test.php index 32c97be30..036faaf11 100644 --- a/cake/tests/cases/libs/controller/components/email.test.php +++ b/cake/tests/cases/libs/controller/components/email.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.cases.libs.controller.components diff --git a/cake/tests/cases/libs/controller/components/request_handler.test.php b/cake/tests/cases/libs/controller/components/request_handler.test.php index 24ce58218..b9cc6e762 100644 --- a/cake/tests/cases/libs/controller/components/request_handler.test.php +++ b/cake/tests/cases/libs/controller/components/request_handler.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller.components diff --git a/cake/tests/cases/libs/controller/components/security.test.php b/cake/tests/cases/libs/controller/components/security.test.php index b1cf605f6..e32109ea6 100644 --- a/cake/tests/cases/libs/controller/components/security.test.php +++ b/cake/tests/cases/libs/controller/components/security.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller.components diff --git a/cake/tests/cases/libs/controller/components/session.test.php b/cake/tests/cases/libs/controller/components/session.test.php index 4b6dd69ba..c87c9f6f0 100644 --- a/cake/tests/cases/libs/controller/components/session.test.php +++ b/cake/tests/cases/libs/controller/components/session.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller.components diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index a522bc252..1b06f487a 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller diff --git a/cake/tests/cases/libs/controller/controller_merge_vars.test.php b/cake/tests/cases/libs/controller/controller_merge_vars.test.php index b0a5a3733..306ec187d 100644 --- a/cake/tests/cases/libs/controller/controller_merge_vars.test.php +++ b/cake/tests/cases/libs/controller/controller_merge_vars.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller diff --git a/cake/tests/cases/libs/controller/pages_controller.test.php b/cake/tests/cases/libs/controller/pages_controller.test.php index 50fdd5177..df16eeb08 100644 --- a/cake/tests/cases/libs/controller/pages_controller.test.php +++ b/cake/tests/cases/libs/controller/pages_controller.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller diff --git a/cake/tests/cases/libs/controller/scaffold.test.php b/cake/tests/cases/libs/controller/scaffold.test.php index 729523253..aff5f5aa5 100644 --- a/cake/tests/cases/libs/controller/scaffold.test.php +++ b/cake/tests/cases/libs/controller/scaffold.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller diff --git a/cake/tests/cases/libs/debugger.test.php b/cake/tests/cases/libs/debugger.test.php index 0dd77a6b6..09ed07535 100644 --- a/cake/tests/cases/libs/debugger.test.php +++ b/cake/tests/cases/libs/debugger.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/error.test.php b/cake/tests/cases/libs/error.test.php index 2a13f5e56..161e65639 100644 --- a/cake/tests/cases/libs/error.test.php +++ b/cake/tests/cases/libs/error.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/file.test.php b/cake/tests/cases/libs/file.test.php index 2a395d0ac..8133c58fc 100644 --- a/cake/tests/cases/libs/file.test.php +++ b/cake/tests/cases/libs/file.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/flay.test.php b/cake/tests/cases/libs/flay.test.php index c064ff5e3..ff413320e 100644 --- a/cake/tests/cases/libs/flay.test.php +++ b/cake/tests/cases/libs/flay.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/folder.test.php b/cake/tests/cases/libs/folder.test.php index eaf1de3d1..ecdf13e99 100644 --- a/cake/tests/cases/libs/folder.test.php +++ b/cake/tests/cases/libs/folder.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/http_socket.test.php b/cake/tests/cases/libs/http_socket.test.php index 49e3ed58e..0fa79d453 100644 --- a/cake/tests/cases/libs/http_socket.test.php +++ b/cake/tests/cases/libs/http_socket.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/i18n.test.php b/cake/tests/cases/libs/i18n.test.php index 3d395d26e..7a6366615 100644 --- a/cake/tests/cases/libs/i18n.test.php +++ b/cake/tests/cases/libs/i18n.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/inflector.test.php b/cake/tests/cases/libs/inflector.test.php index d99bdcb2b..b896805a3 100644 --- a/cake/tests/cases/libs/inflector.test.php +++ b/cake/tests/cases/libs/inflector.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/l10n.test.php b/cake/tests/cases/libs/l10n.test.php index a11d1e031..a8f8d5030 100644 --- a/cake/tests/cases/libs/l10n.test.php +++ b/cake/tests/cases/libs/l10n.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/magic_db.test.php b/cake/tests/cases/libs/magic_db.test.php index 1be3c30cb..1ef07f6b9 100644 --- a/cake/tests/cases/libs/magic_db.test.php +++ b/cake/tests/cases/libs/magic_db.test.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.0 diff --git a/cake/tests/cases/libs/model/behavior.test.php b/cake/tests/cases/libs/model/behavior.test.php index 49b53cd2a..93516ab86 100644 --- a/cake/tests/cases/libs/model/behavior.test.php +++ b/cake/tests/cases/libs/model/behavior.test.php @@ -12,7 +12,6 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) * @link http://www.cakephp.org * @package cake diff --git a/cake/tests/cases/libs/model/behaviors/acl.test.php b/cake/tests/cases/libs/model/behaviors/acl.test.php index 102d75884..c43d52c25 100644 --- a/cake/tests/cases/libs/model/behaviors/acl.test.php +++ b/cake/tests/cases/libs/model/behaviors/acl.test.php @@ -13,9 +13,8 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @link http://cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.libs.tests.model.behaviors.acl * @since CakePHP v 1.2.0.4487 diff --git a/cake/tests/cases/libs/model/behaviors/containable.test.php b/cake/tests/cases/libs/model/behaviors/containable.test.php index e491611c6..ebfa57a54 100644 --- a/cake/tests/cases/libs/model/behaviors/containable.test.php +++ b/cake/tests/cases/libs/model/behaviors/containable.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model.behaviors diff --git a/cake/tests/cases/libs/model/behaviors/translate.test.php b/cake/tests/cases/libs/model/behaviors/translate.test.php index 1231eecb9..426da7817 100644 --- a/cake/tests/cases/libs/model/behaviors/translate.test.php +++ b/cake/tests/cases/libs/model/behaviors/translate.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model.behaviors diff --git a/cake/tests/cases/libs/model/behaviors/tree.test.php b/cake/tests/cases/libs/model/behaviors/tree.test.php index 8f58ac003..768b5b48a 100644 --- a/cake/tests/cases/libs/model/behaviors/tree.test.php +++ b/cake/tests/cases/libs/model/behaviors/tree.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model.behaviors diff --git a/cake/tests/cases/libs/model/connection_manager.test.php b/cake/tests/cases/libs/model/connection_manager.test.php index 00b850b02..f44c18edd 100644 --- a/cake/tests/cases/libs/model/connection_manager.test.php +++ b/cake/tests/cases/libs/model/connection_manager.test.php @@ -6,13 +6,12 @@ * * PHP versions 4 and 5 * - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_adodb.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_adodb.test.php index 55acd701e..5188f24fd 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_adodb.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_adodb.test.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.model.datasources.dbo * @since CakePHP(tm) v 0.2.9 diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php index fa969cb86..286569656 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.0 diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php index 1f4a4f919..f3dccc199 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.0 diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php index 0431f7d7f..f3de27127 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.0 diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php index af956e4dc..40063ddf8 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.0 diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php index 2c2b628d9..03ebfd919 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.0 diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php index e4e0fbcf7..3cf4cbf1a 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php @@ -5,15 +5,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.0 diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index 7fe1a5a21..0b3364b5d 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model.datasources diff --git a/cake/tests/cases/libs/model/db_acl.test.php b/cake/tests/cases/libs/model/db_acl.test.php index 2de13d0a0..08cecedf8 100644 --- a/cake/tests/cases/libs/model/db_acl.test.php +++ b/cake/tests/cases/libs/model/db_acl.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.controller.components.dbacl.models diff --git a/cake/tests/cases/libs/model/model.test.php b/cake/tests/cases/libs/model/model.test.php index bf420f6a4..044bba9cf 100644 --- a/cake/tests/cases/libs/model/model.test.php +++ b/cake/tests/cases/libs/model/model.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model diff --git a/cake/tests/cases/libs/model/model_delete.test.php b/cake/tests/cases/libs/model/model_delete.test.php index 0742d80d0..e2d4874f8 100644 --- a/cake/tests/cases/libs/model/model_delete.test.php +++ b/cake/tests/cases/libs/model/model_delete.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model diff --git a/cake/tests/cases/libs/model/model_integration.test.php b/cake/tests/cases/libs/model/model_integration.test.php index 43cd16e47..3da333592 100644 --- a/cake/tests/cases/libs/model/model_integration.test.php +++ b/cake/tests/cases/libs/model/model_integration.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model diff --git a/cake/tests/cases/libs/model/model_read.test.php b/cake/tests/cases/libs/model/model_read.test.php index 2f52bc525..7cb53551e 100644 --- a/cake/tests/cases/libs/model/model_read.test.php +++ b/cake/tests/cases/libs/model/model_read.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model diff --git a/cake/tests/cases/libs/model/model_validation.test.php b/cake/tests/cases/libs/model/model_validation.test.php index 7f452bedd..bd2335db0 100644 --- a/cake/tests/cases/libs/model/model_validation.test.php +++ b/cake/tests/cases/libs/model/model_validation.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model diff --git a/cake/tests/cases/libs/model/model_write.test.php b/cake/tests/cases/libs/model/model_write.test.php index ea216e5f9..f57dc0eb4 100644 --- a/cake/tests/cases/libs/model/model_write.test.php +++ b/cake/tests/cases/libs/model/model_write.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model diff --git a/cake/tests/cases/libs/model/models.php b/cake/tests/cases/libs/model/models.php index b86779ddb..f15217b96 100644 --- a/cake/tests/cases/libs/model/models.php +++ b/cake/tests/cases/libs/model/models.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.model diff --git a/cake/tests/cases/libs/model/schema.test.php b/cake/tests/cases/libs/model/schema.test.php index 2a00095d1..f9cce426e 100644 --- a/cake/tests/cases/libs/model/schema.test.php +++ b/cake/tests/cases/libs/model/schema.test.php @@ -7,13 +7,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/multibyte.test.php b/cake/tests/cases/libs/multibyte.test.php index b33cc3798..bfca25440 100644 --- a/cake/tests/cases/libs/multibyte.test.php +++ b/cake/tests/cases/libs/multibyte.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/object.test.php b/cake/tests/cases/libs/object.test.php index c5894c7cb..8993d8204 100644 --- a/cake/tests/cases/libs/object.test.php +++ b/cake/tests/cases/libs/object.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/overloadable.test.php b/cake/tests/cases/libs/overloadable.test.php index 0b6c9c235..807458011 100644 --- a/cake/tests/cases/libs/overloadable.test.php +++ b/cake/tests/cases/libs/overloadable.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 2f34423c6..409ef9e7b 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/sanitize.test.php b/cake/tests/cases/libs/sanitize.test.php index f32371bf1..159b409d3 100644 --- a/cake/tests/cases/libs/sanitize.test.php +++ b/cake/tests/cases/libs/sanitize.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/security.test.php b/cake/tests/cases/libs/security.test.php index 320f4a508..307d19415 100644 --- a/cake/tests/cases/libs/security.test.php +++ b/cake/tests/cases/libs/security.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/session.test.php b/cake/tests/cases/libs/session.test.php index 9af6d79d4..22b2196a8 100644 --- a/cake/tests/cases/libs/session.test.php +++ b/cake/tests/cases/libs/session.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/set.test.php b/cake/tests/cases/libs/set.test.php index 6f41670c7..a42d0cc9e 100644 --- a/cake/tests/cases/libs/set.test.php +++ b/cake/tests/cases/libs/set.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/socket.test.php b/cake/tests/cases/libs/socket.test.php index e401917bc..d5c0dfa34 100644 --- a/cake/tests/cases/libs/socket.test.php +++ b/cake/tests/cases/libs/socket.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/string.test.php b/cake/tests/cases/libs/string.test.php index 0f6896fa5..738eba270 100644 --- a/cake/tests/cases/libs/string.test.php +++ b/cake/tests/cases/libs/string.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/test_manager.test.php b/cake/tests/cases/libs/test_manager.test.php index f26f8bc0c..19329189f 100644 --- a/cake/tests/cases/libs/test_manager.test.php +++ b/cake/tests/cases/libs/test_manager.test.php @@ -15,8 +15,7 @@ * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/validation.test.php b/cake/tests/cases/libs/validation.test.php index 45e85da10..3adb5d38f 100644 --- a/cake/tests/cases/libs/validation.test.php +++ b/cake/tests/cases/libs/validation.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/view/helper.test.php b/cake/tests/cases/libs/view/helper.test.php index 8be56b040..cdb0eea09 100644 --- a/cake/tests/cases/libs/view/helper.test.php +++ b/cake/tests/cases/libs/view/helper.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/view/helpers/ajax.test.php b/cake/tests/cases/libs/view/helpers/ajax.test.php index 133389350..6df2e9c50 100644 --- a/cake/tests/cases/libs/view/helpers/ajax.test.php +++ b/cake/tests/cases/libs/view/helpers/ajax.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/cache.test.php b/cake/tests/cases/libs/view/helpers/cache.test.php index f6b265e6e..55ca4b0b9 100644 --- a/cake/tests/cases/libs/view/helpers/cache.test.php +++ b/cake/tests/cases/libs/view/helpers/cache.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index c94ea6c2d..db6811142 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -13,7 +13,6 @@ * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/cake/tests/cases/libs/view/helpers/html.test.php index 39249c7c3..2ade552ad 100644 --- a/cake/tests/cases/libs/view/helpers/html.test.php +++ b/cake/tests/cases/libs/view/helpers/html.test.php @@ -13,7 +13,6 @@ * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake diff --git a/cake/tests/cases/libs/view/helpers/javascript.test.php b/cake/tests/cases/libs/view/helpers/javascript.test.php index b5d298f80..e9bffea7a 100644 --- a/cake/tests/cases/libs/view/helpers/javascript.test.php +++ b/cake/tests/cases/libs/view/helpers/javascript.test.php @@ -13,7 +13,6 @@ * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index 8978b4201..60f53167b 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/number.test.php b/cake/tests/cases/libs/view/helpers/number.test.php index 4784a6198..399542e7d 100644 --- a/cake/tests/cases/libs/view/helpers/number.test.php +++ b/cake/tests/cases/libs/view/helpers/number.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/paginator.test.php b/cake/tests/cases/libs/view/helpers/paginator.test.php index 22744f2a1..9f8ca3b0b 100644 --- a/cake/tests/cases/libs/view/helpers/paginator.test.php +++ b/cake/tests/cases/libs/view/helpers/paginator.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/rss.test.php b/cake/tests/cases/libs/view/helpers/rss.test.php index 49c534911..750c89ff0 100644 --- a/cake/tests/cases/libs/view/helpers/rss.test.php +++ b/cake/tests/cases/libs/view/helpers/rss.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/session.test.php b/cake/tests/cases/libs/view/helpers/session.test.php index 9c56ddc81..5d278d25b 100644 --- a/cake/tests/cases/libs/view/helpers/session.test.php +++ b/cake/tests/cases/libs/view/helpers/session.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/text.test.php b/cake/tests/cases/libs/view/helpers/text.test.php index 283e17df0..c6a5ec7bf 100644 --- a/cake/tests/cases/libs/view/helpers/text.test.php +++ b/cake/tests/cases/libs/view/helpers/text.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/time.test.php b/cake/tests/cases/libs/view/helpers/time.test.php index 149e895c0..b2ab6dece 100644 --- a/cake/tests/cases/libs/view/helpers/time.test.php +++ b/cake/tests/cases/libs/view/helpers/time.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/helpers/xml.test.php b/cake/tests/cases/libs/view/helpers/xml.test.php index 6ffa9c2a7..03c8ae1ac 100644 --- a/cake/tests/cases/libs/view/helpers/xml.test.php +++ b/cake/tests/cases/libs/view/helpers/xml.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs.view.helpers diff --git a/cake/tests/cases/libs/view/theme.test.php b/cake/tests/cases/libs/view/theme.test.php index f5f0598f2..3564ab168 100644 --- a/cake/tests/cases/libs/view/theme.test.php +++ b/cake/tests/cases/libs/view/theme.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/view/view.test.php b/cake/tests/cases/libs/view/view.test.php index 03174e592..7be93d513 100644 --- a/cake/tests/cases/libs/view/view.test.php +++ b/cake/tests/cases/libs/view/view.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/cases/libs/xml.test.php b/cake/tests/cases/libs/xml.test.php index e252ed188..bb71e1456 100644 --- a/cake/tests/cases/libs/xml.test.php +++ b/cake/tests/cases/libs/xml.test.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/fixtures/account_fixture.php b/cake/tests/fixtures/account_fixture.php index 0b725813e..fc0ac676a 100644 --- a/cake/tests/fixtures/account_fixture.php +++ b/cake/tests/fixtures/account_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/aco_action_fixture.php b/cake/tests/fixtures/aco_action_fixture.php index 638908666..595c0c7b1 100644 --- a/cake/tests/fixtures/aco_action_fixture.php +++ b/cake/tests/fixtures/aco_action_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/aco_fixture.php b/cake/tests/fixtures/aco_fixture.php index 98f4c5ea6..3bedaed22 100644 --- a/cake/tests/fixtures/aco_fixture.php +++ b/cake/tests/fixtures/aco_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/aco_two_fixture.php b/cake/tests/fixtures/aco_two_fixture.php index 09e383005..e0d94f8d7 100644 --- a/cake/tests/fixtures/aco_two_fixture.php +++ b/cake/tests/fixtures/aco_two_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/ad_fixture.php b/cake/tests/fixtures/ad_fixture.php index 370f98daa..17c873b34 100644 --- a/cake/tests/fixtures/ad_fixture.php +++ b/cake/tests/fixtures/ad_fixture.php @@ -12,7 +12,6 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) * @link http://www.cakephp.org * @package cake diff --git a/cake/tests/fixtures/advertisement_fixture.php b/cake/tests/fixtures/advertisement_fixture.php index 81ad9251e..18a625319 100644 --- a/cake/tests/fixtures/advertisement_fixture.php +++ b/cake/tests/fixtures/advertisement_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/after_tree_fixture.php b/cake/tests/fixtures/after_tree_fixture.php index 68cd6fba7..45e2d0948 100644 --- a/cake/tests/fixtures/after_tree_fixture.php +++ b/cake/tests/fixtures/after_tree_fixture.php @@ -12,7 +12,6 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) * @link http://www.cakephp.org * @package cake diff --git a/cake/tests/fixtures/another_article_fixture.php b/cake/tests/fixtures/another_article_fixture.php index 55762f990..a074e04be 100644 --- a/cake/tests/fixtures/another_article_fixture.php +++ b/cake/tests/fixtures/another_article_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/apple_fixture.php b/cake/tests/fixtures/apple_fixture.php index 737cb327e..16558acdd 100644 --- a/cake/tests/fixtures/apple_fixture.php +++ b/cake/tests/fixtures/apple_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/aro_fixture.php b/cake/tests/fixtures/aro_fixture.php index 39a23160e..ea437a7e8 100644 --- a/cake/tests/fixtures/aro_fixture.php +++ b/cake/tests/fixtures/aro_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/aro_two_fixture.php b/cake/tests/fixtures/aro_two_fixture.php index 439c23dce..c3c7973ff 100644 --- a/cake/tests/fixtures/aro_two_fixture.php +++ b/cake/tests/fixtures/aro_two_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/aros_aco_fixture.php b/cake/tests/fixtures/aros_aco_fixture.php index ef2e788c1..85595a1bd 100644 --- a/cake/tests/fixtures/aros_aco_fixture.php +++ b/cake/tests/fixtures/aros_aco_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/aros_aco_two_fixture.php b/cake/tests/fixtures/aros_aco_two_fixture.php index ef0e8bb73..9d918ca04 100644 --- a/cake/tests/fixtures/aros_aco_two_fixture.php +++ b/cake/tests/fixtures/aros_aco_two_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/article_featured_fixture.php b/cake/tests/fixtures/article_featured_fixture.php index 2e240e9c0..9805521ac 100644 --- a/cake/tests/fixtures/article_featured_fixture.php +++ b/cake/tests/fixtures/article_featured_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/article_featureds_tags_fixture.php b/cake/tests/fixtures/article_featureds_tags_fixture.php index da2186614..e07522b6b 100644 --- a/cake/tests/fixtures/article_featureds_tags_fixture.php +++ b/cake/tests/fixtures/article_featureds_tags_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/article_fixture.php b/cake/tests/fixtures/article_fixture.php index 4756ea553..7c1f12188 100644 --- a/cake/tests/fixtures/article_fixture.php +++ b/cake/tests/fixtures/article_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/articles_tag_fixture.php b/cake/tests/fixtures/articles_tag_fixture.php index 23ab707b5..bb7ea58ae 100644 --- a/cake/tests/fixtures/articles_tag_fixture.php +++ b/cake/tests/fixtures/articles_tag_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/attachment_fixture.php b/cake/tests/fixtures/attachment_fixture.php index 114f58324..83bef4332 100644 --- a/cake/tests/fixtures/attachment_fixture.php +++ b/cake/tests/fixtures/attachment_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/auth_user_custom_field_fixture.php b/cake/tests/fixtures/auth_user_custom_field_fixture.php index 7d8738863..ffb49cb40 100644 --- a/cake/tests/fixtures/auth_user_custom_field_fixture.php +++ b/cake/tests/fixtures/auth_user_custom_field_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/auth_user_fixture.php b/cake/tests/fixtures/auth_user_fixture.php index bfb98b28b..afd73e45c 100644 --- a/cake/tests/fixtures/auth_user_fixture.php +++ b/cake/tests/fixtures/auth_user_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/author_fixture.php b/cake/tests/fixtures/author_fixture.php index 2246c8e32..d61399e07 100644 --- a/cake/tests/fixtures/author_fixture.php +++ b/cake/tests/fixtures/author_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/basket_fixture.php b/cake/tests/fixtures/basket_fixture.php index ee3182294..b6b52ad22 100644 --- a/cake/tests/fixtures/basket_fixture.php +++ b/cake/tests/fixtures/basket_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/bid_fixture.php b/cake/tests/fixtures/bid_fixture.php index aba5dff90..143904dbd 100644 --- a/cake/tests/fixtures/bid_fixture.php +++ b/cake/tests/fixtures/bid_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/binary_test_fixture.php b/cake/tests/fixtures/binary_test_fixture.php index a94fde403..8eaca360f 100644 --- a/cake/tests/fixtures/binary_test_fixture.php +++ b/cake/tests/fixtures/binary_test_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/book_fixture.php b/cake/tests/fixtures/book_fixture.php index b86499c58..805f57a19 100644 --- a/cake/tests/fixtures/book_fixture.php +++ b/cake/tests/fixtures/book_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/cache_test_model_fixture.php b/cake/tests/fixtures/cache_test_model_fixture.php index b31917db3..8685e1488 100644 --- a/cake/tests/fixtures/cache_test_model_fixture.php +++ b/cake/tests/fixtures/cache_test_model_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/callback_fixture.php b/cake/tests/fixtures/callback_fixture.php index e69af02d8..bffecb6bd 100644 --- a/cake/tests/fixtures/callback_fixture.php +++ b/cake/tests/fixtures/callback_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/campaign_fixture.php b/cake/tests/fixtures/campaign_fixture.php index 2e91feb5e..cdb2a1aa0 100644 --- a/cake/tests/fixtures/campaign_fixture.php +++ b/cake/tests/fixtures/campaign_fixture.php @@ -12,7 +12,6 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) * @link http://www.cakephp.org * @package cake diff --git a/cake/tests/fixtures/category_fixture.php b/cake/tests/fixtures/category_fixture.php index 4d479c1e7..3ca2555ab 100644 --- a/cake/tests/fixtures/category_fixture.php +++ b/cake/tests/fixtures/category_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/category_thread_fixture.php b/cake/tests/fixtures/category_thread_fixture.php index 67e28e99a..6f0db6ec3 100644 --- a/cake/tests/fixtures/category_thread_fixture.php +++ b/cake/tests/fixtures/category_thread_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/cd_fixture.php b/cake/tests/fixtures/cd_fixture.php index 241fd7a1e..ee522362e 100644 --- a/cake/tests/fixtures/cd_fixture.php +++ b/cake/tests/fixtures/cd_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/comment_fixture.php b/cake/tests/fixtures/comment_fixture.php index 0f0aea284..4875d4259 100644 --- a/cake/tests/fixtures/comment_fixture.php +++ b/cake/tests/fixtures/comment_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/content_account_fixture.php b/cake/tests/fixtures/content_account_fixture.php index a4b8c4f35..9b1147cdf 100644 --- a/cake/tests/fixtures/content_account_fixture.php +++ b/cake/tests/fixtures/content_account_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/content_fixture.php b/cake/tests/fixtures/content_fixture.php index 88b0eb249..04f8f901b 100644 --- a/cake/tests/fixtures/content_fixture.php +++ b/cake/tests/fixtures/content_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/counter_cache_post_fixture.php b/cake/tests/fixtures/counter_cache_post_fixture.php index 5fa7a50b8..d99df71bf 100644 --- a/cake/tests/fixtures/counter_cache_post_fixture.php +++ b/cake/tests/fixtures/counter_cache_post_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/counter_cache_post_nonstandard_primary_key_fixture.php b/cake/tests/fixtures/counter_cache_post_nonstandard_primary_key_fixture.php index 3d7ba8084..6dfda552c 100644 --- a/cake/tests/fixtures/counter_cache_post_nonstandard_primary_key_fixture.php +++ b/cake/tests/fixtures/counter_cache_post_nonstandard_primary_key_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/counter_cache_user_fixture.php b/cake/tests/fixtures/counter_cache_user_fixture.php index 1e22b5764..b2b45abf5 100644 --- a/cake/tests/fixtures/counter_cache_user_fixture.php +++ b/cake/tests/fixtures/counter_cache_user_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/counter_cache_user_nonstandard_primary_key_fixture.php b/cake/tests/fixtures/counter_cache_user_nonstandard_primary_key_fixture.php index 80b103f1e..1d0b070d4 100644 --- a/cake/tests/fixtures/counter_cache_user_nonstandard_primary_key_fixture.php +++ b/cake/tests/fixtures/counter_cache_user_nonstandard_primary_key_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/data_test_fixture.php b/cake/tests/fixtures/data_test_fixture.php index 12fccd88c..3d7e31cc7 100644 --- a/cake/tests/fixtures/data_test_fixture.php +++ b/cake/tests/fixtures/data_test_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/datatype_fixture.php b/cake/tests/fixtures/datatype_fixture.php index 09b7240c7..6414f2d2c 100644 --- a/cake/tests/fixtures/datatype_fixture.php +++ b/cake/tests/fixtures/datatype_fixture.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.7026 diff --git a/cake/tests/fixtures/dependency_fixture.php b/cake/tests/fixtures/dependency_fixture.php index 4279804f7..e9574b83f 100644 --- a/cake/tests/fixtures/dependency_fixture.php +++ b/cake/tests/fixtures/dependency_fixture.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.6879//Correct version number as needed** diff --git a/cake/tests/fixtures/device_fixture.php b/cake/tests/fixtures/device_fixture.php index 58233484f..0f2f36bcb 100644 --- a/cake/tests/fixtures/device_fixture.php +++ b/cake/tests/fixtures/device_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/device_type_category_fixture.php b/cake/tests/fixtures/device_type_category_fixture.php index d4d324271..34d5e1594 100644 --- a/cake/tests/fixtures/device_type_category_fixture.php +++ b/cake/tests/fixtures/device_type_category_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/device_type_fixture.php b/cake/tests/fixtures/device_type_fixture.php index fdc1650a6..b617f1f3b 100644 --- a/cake/tests/fixtures/device_type_fixture.php +++ b/cake/tests/fixtures/device_type_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/document_directory_fixture.php b/cake/tests/fixtures/document_directory_fixture.php index 30d8767cd..f8f72332c 100644 --- a/cake/tests/fixtures/document_directory_fixture.php +++ b/cake/tests/fixtures/document_directory_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/document_fixture.php b/cake/tests/fixtures/document_fixture.php index 0587dada8..84425d822 100644 --- a/cake/tests/fixtures/document_fixture.php +++ b/cake/tests/fixtures/document_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/exterior_type_category_fixture.php b/cake/tests/fixtures/exterior_type_category_fixture.php index 96a7ff5eb..48fe346bb 100644 --- a/cake/tests/fixtures/exterior_type_category_fixture.php +++ b/cake/tests/fixtures/exterior_type_category_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/feature_set_fixture.php b/cake/tests/fixtures/feature_set_fixture.php index 3d5ce3016..d50300d25 100644 --- a/cake/tests/fixtures/feature_set_fixture.php +++ b/cake/tests/fixtures/feature_set_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/featured_fixture.php b/cake/tests/fixtures/featured_fixture.php index e40e1ccec..c03b259d3 100644 --- a/cake/tests/fixtures/featured_fixture.php +++ b/cake/tests/fixtures/featured_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/film_file_fixture.php b/cake/tests/fixtures/film_file_fixture.php index e815980fd..f5eb15dfb 100644 --- a/cake/tests/fixtures/film_file_fixture.php +++ b/cake/tests/fixtures/film_file_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/flag_tree_fixture.php b/cake/tests/fixtures/flag_tree_fixture.php index 7dbff7ce2..16d12a914 100644 --- a/cake/tests/fixtures/flag_tree_fixture.php +++ b/cake/tests/fixtures/flag_tree_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/fruit_fixture.php b/cake/tests/fixtures/fruit_fixture.php index e8bf6fb91..8e001be52 100644 --- a/cake/tests/fixtures/fruit_fixture.php +++ b/cake/tests/fixtures/fruit_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/fruits_uuid_tag_fixture.php b/cake/tests/fixtures/fruits_uuid_tag_fixture.php index 9640e6d01..0e2e97323 100644 --- a/cake/tests/fixtures/fruits_uuid_tag_fixture.php +++ b/cake/tests/fixtures/fruits_uuid_tag_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/home_fixture.php b/cake/tests/fixtures/home_fixture.php index 2d48f6079..5c622b503 100644 --- a/cake/tests/fixtures/home_fixture.php +++ b/cake/tests/fixtures/home_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/image_fixture.php b/cake/tests/fixtures/image_fixture.php index a3271d9e1..dd9b22d96 100644 --- a/cake/tests/fixtures/image_fixture.php +++ b/cake/tests/fixtures/image_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/item_fixture.php b/cake/tests/fixtures/item_fixture.php index 5ec284934..3ab6d4449 100644 --- a/cake/tests/fixtures/item_fixture.php +++ b/cake/tests/fixtures/item_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/items_portfolio_fixture.php b/cake/tests/fixtures/items_portfolio_fixture.php index d9dae1642..fa746c2aa 100644 --- a/cake/tests/fixtures/items_portfolio_fixture.php +++ b/cake/tests/fixtures/items_portfolio_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/join_a_b_fixture.php b/cake/tests/fixtures/join_a_b_fixture.php index af2245ace..3013fc567 100644 --- a/cake/tests/fixtures/join_a_b_fixture.php +++ b/cake/tests/fixtures/join_a_b_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/join_a_c_fixture.php b/cake/tests/fixtures/join_a_c_fixture.php index bee0c1ac2..f89f3db0e 100644 --- a/cake/tests/fixtures/join_a_c_fixture.php +++ b/cake/tests/fixtures/join_a_c_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/join_a_fixture.php b/cake/tests/fixtures/join_a_fixture.php index 648de4e90..947a5166d 100644 --- a/cake/tests/fixtures/join_a_fixture.php +++ b/cake/tests/fixtures/join_a_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/join_b_fixture.php b/cake/tests/fixtures/join_b_fixture.php index a0508f31a..581a5cf55 100644 --- a/cake/tests/fixtures/join_b_fixture.php +++ b/cake/tests/fixtures/join_b_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/join_c_fixture.php b/cake/tests/fixtures/join_c_fixture.php index 699ff72ff..38abbb167 100644 --- a/cake/tests/fixtures/join_c_fixture.php +++ b/cake/tests/fixtures/join_c_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/join_thing_fixture.php b/cake/tests/fixtures/join_thing_fixture.php index b89a47a29..92df9dbbb 100644 --- a/cake/tests/fixtures/join_thing_fixture.php +++ b/cake/tests/fixtures/join_thing_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/message_fixture.php b/cake/tests/fixtures/message_fixture.php index 18236dd97..0e85e52da 100644 --- a/cake/tests/fixtures/message_fixture.php +++ b/cake/tests/fixtures/message_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/my_categories_my_products_fixture.php b/cake/tests/fixtures/my_categories_my_products_fixture.php index 36b2ab05a..93d0fe803 100644 --- a/cake/tests/fixtures/my_categories_my_products_fixture.php +++ b/cake/tests/fixtures/my_categories_my_products_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/my_categories_my_users_fixture.php b/cake/tests/fixtures/my_categories_my_users_fixture.php index 166c7983f..acdee1906 100644 --- a/cake/tests/fixtures/my_categories_my_users_fixture.php +++ b/cake/tests/fixtures/my_categories_my_users_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/my_category_fixture.php b/cake/tests/fixtures/my_category_fixture.php index 66e837eff..79c02659a 100644 --- a/cake/tests/fixtures/my_category_fixture.php +++ b/cake/tests/fixtures/my_category_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/my_product_fixture.php b/cake/tests/fixtures/my_product_fixture.php index b28fbfa60..59f386ae0 100644 --- a/cake/tests/fixtures/my_product_fixture.php +++ b/cake/tests/fixtures/my_product_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/my_user_fixture.php b/cake/tests/fixtures/my_user_fixture.php index 62c58c8cc..d59f1445c 100644 --- a/cake/tests/fixtures/my_user_fixture.php +++ b/cake/tests/fixtures/my_user_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/node_fixture.php b/cake/tests/fixtures/node_fixture.php index ce06f394b..6329abc52 100644 --- a/cake/tests/fixtures/node_fixture.php +++ b/cake/tests/fixtures/node_fixture.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.tests.fixtures * @since CakePHP(tm) v 1.2.0.6879 //Correct version number as needed** diff --git a/cake/tests/fixtures/number_tree_fixture.php b/cake/tests/fixtures/number_tree_fixture.php index f4aa42ef1..36833ef4c 100644 --- a/cake/tests/fixtures/number_tree_fixture.php +++ b/cake/tests/fixtures/number_tree_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/number_tree_two_fixture.php b/cake/tests/fixtures/number_tree_two_fixture.php index e45e29d80..c7e4b8809 100644 --- a/cake/tests/fixtures/number_tree_two_fixture.php +++ b/cake/tests/fixtures/number_tree_two_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/numeric_article_fixture.php b/cake/tests/fixtures/numeric_article_fixture.php index c51a61ff2..fe0062d94 100644 --- a/cake/tests/fixtures/numeric_article_fixture.php +++ b/cake/tests/fixtures/numeric_article_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/overall_favorite_fixture.php b/cake/tests/fixtures/overall_favorite_fixture.php index 2f0889e83..d0cf1f384 100644 --- a/cake/tests/fixtures/overall_favorite_fixture.php +++ b/cake/tests/fixtures/overall_favorite_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/person_fixture.php b/cake/tests/fixtures/person_fixture.php index 6a803a898..3f0ab5345 100644 --- a/cake/tests/fixtures/person_fixture.php +++ b/cake/tests/fixtures/person_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/portfolio_fixture.php b/cake/tests/fixtures/portfolio_fixture.php index 83d22eed7..5b7dec416 100644 --- a/cake/tests/fixtures/portfolio_fixture.php +++ b/cake/tests/fixtures/portfolio_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/post_fixture.php b/cake/tests/fixtures/post_fixture.php index 543b67302..750714c3b 100644 --- a/cake/tests/fixtures/post_fixture.php +++ b/cake/tests/fixtures/post_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/posts_tag_fixture.php b/cake/tests/fixtures/posts_tag_fixture.php index 02ee01854..32f479087 100644 --- a/cake/tests/fixtures/posts_tag_fixture.php +++ b/cake/tests/fixtures/posts_tag_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/primary_model_fixture.php b/cake/tests/fixtures/primary_model_fixture.php index 119de59ed..89e92bc25 100644 --- a/cake/tests/fixtures/primary_model_fixture.php +++ b/cake/tests/fixtures/primary_model_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/product_fixture.php b/cake/tests/fixtures/product_fixture.php index ccdbf5aa8..6a096f99e 100644 --- a/cake/tests/fixtures/product_fixture.php +++ b/cake/tests/fixtures/product_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/project_fixture.php b/cake/tests/fixtures/project_fixture.php index 88c572063..548293e61 100644 --- a/cake/tests/fixtures/project_fixture.php +++ b/cake/tests/fixtures/project_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/sample_fixture.php b/cake/tests/fixtures/sample_fixture.php index 126d8872d..c95fe484a 100644 --- a/cake/tests/fixtures/sample_fixture.php +++ b/cake/tests/fixtures/sample_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/secondary_model_fixture.php b/cake/tests/fixtures/secondary_model_fixture.php index aa2c02f8d..ec4701570 100644 --- a/cake/tests/fixtures/secondary_model_fixture.php +++ b/cake/tests/fixtures/secondary_model_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/session_fixture.php b/cake/tests/fixtures/session_fixture.php index b5a070471..f75df31ec 100644 --- a/cake/tests/fixtures/session_fixture.php +++ b/cake/tests/fixtures/session_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/something_else_fixture.php b/cake/tests/fixtures/something_else_fixture.php index 80cfecb28..457d3fd54 100644 --- a/cake/tests/fixtures/something_else_fixture.php +++ b/cake/tests/fixtures/something_else_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/something_fixture.php b/cake/tests/fixtures/something_fixture.php index 8d3d6bce2..016e60baa 100644 --- a/cake/tests/fixtures/something_fixture.php +++ b/cake/tests/fixtures/something_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/stories_tag_fixture.php b/cake/tests/fixtures/stories_tag_fixture.php index a5e4163eb..42baf6273 100644 --- a/cake/tests/fixtures/stories_tag_fixture.php +++ b/cake/tests/fixtures/stories_tag_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/story_fixture.php b/cake/tests/fixtures/story_fixture.php index c16a54f6c..6e4b5db98 100644 --- a/cake/tests/fixtures/story_fixture.php +++ b/cake/tests/fixtures/story_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/syfile_fixture.php b/cake/tests/fixtures/syfile_fixture.php index c9251411c..80cbed5c9 100644 --- a/cake/tests/fixtures/syfile_fixture.php +++ b/cake/tests/fixtures/syfile_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/tag_fixture.php b/cake/tests/fixtures/tag_fixture.php index c2b127d4f..0c4c8c65a 100644 --- a/cake/tests/fixtures/tag_fixture.php +++ b/cake/tests/fixtures/tag_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/test_plugin_article_fixture.php b/cake/tests/fixtures/test_plugin_article_fixture.php index dcf6a92d4..896667597 100644 --- a/cake/tests/fixtures/test_plugin_article_fixture.php +++ b/cake/tests/fixtures/test_plugin_article_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/test_plugin_comment_fixture.php b/cake/tests/fixtures/test_plugin_comment_fixture.php index 544ecf093..facc0b220 100644 --- a/cake/tests/fixtures/test_plugin_comment_fixture.php +++ b/cake/tests/fixtures/test_plugin_comment_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/the_paper_monkies_fixture.php b/cake/tests/fixtures/the_paper_monkies_fixture.php index 8eeeac2e6..906c246f7 100644 --- a/cake/tests/fixtures/the_paper_monkies_fixture.php +++ b/cake/tests/fixtures/the_paper_monkies_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/thread_fixture.php b/cake/tests/fixtures/thread_fixture.php index 7e3239666..84326a832 100644 --- a/cake/tests/fixtures/thread_fixture.php +++ b/cake/tests/fixtures/thread_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/translate_article_fixture.php b/cake/tests/fixtures/translate_article_fixture.php index b3ed14a7b..e3df34d9b 100644 --- a/cake/tests/fixtures/translate_article_fixture.php +++ b/cake/tests/fixtures/translate_article_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/translate_fixture.php b/cake/tests/fixtures/translate_fixture.php index 28539aad9..70beac205 100644 --- a/cake/tests/fixtures/translate_fixture.php +++ b/cake/tests/fixtures/translate_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/translate_table_fixture.php b/cake/tests/fixtures/translate_table_fixture.php index 282474990..d694e7678 100644 --- a/cake/tests/fixtures/translate_table_fixture.php +++ b/cake/tests/fixtures/translate_table_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/translate_with_prefix_fixture.php b/cake/tests/fixtures/translate_with_prefix_fixture.php index f8e3fc44a..a26e1e7f0 100644 --- a/cake/tests/fixtures/translate_with_prefix_fixture.php +++ b/cake/tests/fixtures/translate_with_prefix_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/translated_article_fixture.php b/cake/tests/fixtures/translated_article_fixture.php index eb4c63cad..f3e468fc6 100644 --- a/cake/tests/fixtures/translated_article_fixture.php +++ b/cake/tests/fixtures/translated_article_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/translated_item_fixture.php b/cake/tests/fixtures/translated_item_fixture.php index 98b869752..82dc33f05 100644 --- a/cake/tests/fixtures/translated_item_fixture.php +++ b/cake/tests/fixtures/translated_item_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/unconventional_tree_fixture.php b/cake/tests/fixtures/unconventional_tree_fixture.php index 3685b5a2d..6f2c671e3 100644 --- a/cake/tests/fixtures/unconventional_tree_fixture.php +++ b/cake/tests/fixtures/unconventional_tree_fixture.php @@ -6,13 +6,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/underscore_field_fixture.php b/cake/tests/fixtures/underscore_field_fixture.php index ff4facd9c..5e009688c 100644 --- a/cake/tests/fixtures/underscore_field_fixture.php +++ b/cake/tests/fixtures/underscore_field_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/user_fixture.php b/cake/tests/fixtures/user_fixture.php index 16ba42a4a..1464fb183 100644 --- a/cake/tests/fixtures/user_fixture.php +++ b/cake/tests/fixtures/user_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/uuid_fixture.php b/cake/tests/fixtures/uuid_fixture.php index 8a00e9b8f..8713f395e 100644 --- a/cake/tests/fixtures/uuid_fixture.php +++ b/cake/tests/fixtures/uuid_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/uuid_tag_fixture.php b/cake/tests/fixtures/uuid_tag_fixture.php index cb4c6203e..502c8135d 100644 --- a/cake/tests/fixtures/uuid_tag_fixture.php +++ b/cake/tests/fixtures/uuid_tag_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/uuid_tree_fixture.php b/cake/tests/fixtures/uuid_tree_fixture.php index 7fa73e5d1..0063ebe1d 100644 --- a/cake/tests/fixtures/uuid_tree_fixture.php +++ b/cake/tests/fixtures/uuid_tree_fixture.php @@ -6,13 +6,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/uuiditem_fixture.php b/cake/tests/fixtures/uuiditem_fixture.php index 540b30984..4d8764d7e 100644 --- a/cake/tests/fixtures/uuiditem_fixture.php +++ b/cake/tests/fixtures/uuiditem_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php b/cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php index 1c22f17cb..41a7d9cb3 100644 --- a/cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php +++ b/cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php b/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php index c70684bfd..43259dcd7 100644 --- a/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php +++ b/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/uuidportfolio_fixture.php b/cake/tests/fixtures/uuidportfolio_fixture.php index 6006e0dbc..76042573b 100644 --- a/cake/tests/fixtures/uuidportfolio_fixture.php +++ b/cake/tests/fixtures/uuidportfolio_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/groups/acl.group.php b/cake/tests/groups/acl.group.php index a3882d0ab..8c463b659 100644 --- a/cake/tests/groups/acl.group.php +++ b/cake/tests/groups/acl.group.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/cache.group.php b/cake/tests/groups/cache.group.php index 4dd0d69c3..c53e9a3e9 100644 --- a/cake/tests/groups/cache.group.php +++ b/cake/tests/groups/cache.group.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/components.group.php b/cake/tests/groups/components.group.php index 16817efcf..5f8561f9c 100644 --- a/cake/tests/groups/components.group.php +++ b/cake/tests/groups/components.group.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/configure.group.php b/cake/tests/groups/configure.group.php index bc0d02642..afa87fa53 100644 --- a/cake/tests/groups/configure.group.php +++ b/cake/tests/groups/configure.group.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/console.group.php b/cake/tests/groups/console.group.php index bc8f72009..d65c03a41 100644 --- a/cake/tests/groups/console.group.php +++ b/cake/tests/groups/console.group.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/controller.group.php b/cake/tests/groups/controller.group.php index a8504c393..3efc300db 100644 --- a/cake/tests/groups/controller.group.php +++ b/cake/tests/groups/controller.group.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/database.group.php b/cake/tests/groups/database.group.php index 147d077a3..6dc16033c 100644 --- a/cake/tests/groups/database.group.php +++ b/cake/tests/groups/database.group.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/helpers.group.php b/cake/tests/groups/helpers.group.php index 5761386f1..05d6e577d 100644 --- a/cake/tests/groups/helpers.group.php +++ b/cake/tests/groups/helpers.group.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/lib.group.php b/cake/tests/groups/lib.group.php index 367b7ee10..6bb68eee9 100644 --- a/cake/tests/groups/lib.group.php +++ b/cake/tests/groups/lib.group.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/model.group.php b/cake/tests/groups/model.group.php index c1e6c4ab0..fc4d3c96a 100644 --- a/cake/tests/groups/model.group.php +++ b/cake/tests/groups/model.group.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/no_cross_contamination.group.php b/cake/tests/groups/no_cross_contamination.group.php index 71c0dcf8e..f350db8e8 100644 --- a/cake/tests/groups/no_cross_contamination.group.php +++ b/cake/tests/groups/no_cross_contamination.group.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/routing_system.group.php b/cake/tests/groups/routing_system.group.php index a4b9dea60..56020786e 100644 --- a/cake/tests/groups/routing_system.group.php +++ b/cake/tests/groups/routing_system.group.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/socket.group.php b/cake/tests/groups/socket.group.php index ea3a0a608..2475e416c 100644 --- a/cake/tests/groups/socket.group.php +++ b/cake/tests/groups/socket.group.php @@ -13,7 +13,6 @@ * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake diff --git a/cake/tests/groups/test_suite.group.php b/cake/tests/groups/test_suite.group.php index 1dae0759e..9bac0c7b0 100644 --- a/cake/tests/groups/test_suite.group.php +++ b/cake/tests/groups/test_suite.group.php @@ -13,7 +13,6 @@ * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake diff --git a/cake/tests/groups/view.group.php b/cake/tests/groups/view.group.php index 60a7f0828..015608135 100644 --- a/cake/tests/groups/view.group.php +++ b/cake/tests/groups/view.group.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/groups/xml.group.php b/cake/tests/groups/xml.group.php index 15a6a66e0..167dbfa57 100644 --- a/cake/tests/groups/xml.group.php +++ b/cake/tests/groups/xml.group.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.groups diff --git a/cake/tests/lib/cake_reporter.php b/cake/tests/lib/cake_reporter.php index 8e44b12b5..3b4ed090f 100644 --- a/cake/tests/lib/cake_reporter.php +++ b/cake/tests/lib/cake_reporter.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index 857bca729..01190f875 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs diff --git a/cake/tests/lib/cake_test_fixture.php b/cake/tests/lib/cake_test_fixture.php index 1c2227ecc..37be26c51 100644 --- a/cake/tests/lib/cake_test_fixture.php +++ b/cake/tests/lib/cake_test_fixture.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs diff --git a/cake/tests/lib/cake_test_model.php b/cake/tests/lib/cake_test_model.php index bf2cb68bd..e119522bb 100644 --- a/cake/tests/lib/cake_test_model.php +++ b/cake/tests/lib/cake_test_model.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs diff --git a/cake/tests/lib/cake_web_test_case.php b/cake/tests/lib/cake_web_test_case.php index da5a12589..035f57f29 100644 --- a/cake/tests/lib/cake_web_test_case.php +++ b/cake/tests/lib/cake_web_test_case.php @@ -6,13 +6,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.lib diff --git a/cake/tests/lib/cli_reporter.php b/cake/tests/lib/cli_reporter.php index 7902ef998..b260d4040 100644 --- a/cake/tests/lib/cli_reporter.php +++ b/cake/tests/lib/cli_reporter.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index 56e685526..60ead0772 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.lib diff --git a/cake/tests/lib/content.php b/cake/tests/lib/content.php index c07a96260..929382d1c 100644 --- a/cake/tests/lib/content.php +++ b/cake/tests/lib/content.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.lib diff --git a/cake/tests/lib/footer.php b/cake/tests/lib/footer.php index 5509a2719..565cbd23b 100644 --- a/cake/tests/lib/footer.php +++ b/cake/tests/lib/footer.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.lib diff --git a/cake/tests/lib/header.php b/cake/tests/lib/header.php index 6d37b39f5..bfafd3a30 100644 --- a/cake/tests/lib/header.php +++ b/cake/tests/lib/header.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.lib diff --git a/cake/tests/lib/simpletest.php b/cake/tests/lib/simpletest.php index 5a06b7a11..653af49b0 100644 --- a/cake/tests/lib/simpletest.php +++ b/cake/tests/lib/simpletest.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index 6f21d2f5a..5f447612e 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.lib diff --git a/cake/tests/lib/xdebug.php b/cake/tests/lib/xdebug.php index f954f5600..626ed23be 100644 --- a/cake/tests/lib/xdebug.php +++ b/cake/tests/lib/xdebug.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.cake.tests.libs diff --git a/cake/tests/test_app/config/acl.ini.php b/cake/tests/test_app/config/acl.ini.php index b7b95abcd..d5e1b3394 100644 --- a/cake/tests/test_app/config/acl.ini.php +++ b/cake/tests/test_app/config/acl.ini.php @@ -6,15 +6,14 @@ ; * ; * PHP versions 4 and 5 ; * -; * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) -; * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) +; * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) +; * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) ; * ; * Licensed under The MIT License ; * Redistributions of files must retain the above copyright notice. ; * -; * @filesource -; * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) -; * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project +;; * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) +; * @link http://cakephp.org CakePHP(tm) Project ; * @package cake ; * @subpackage cake.app.config ; * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/tests/test_app/controllers/tests_apps_controller.php b/cake/tests/test_app/controllers/tests_apps_controller.php index 1eac7d061..0e465fb0f 100644 --- a/cake/tests/test_app/controllers/tests_apps_controller.php +++ b/cake/tests/test_app/controllers/tests_apps_controller.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers diff --git a/cake/tests/test_app/controllers/tests_apps_posts_controller.php b/cake/tests/test_app/controllers/tests_apps_posts_controller.php index 1634b1b5c..8db1ba2af 100644 --- a/cake/tests/test_app/controllers/tests_apps_posts_controller.php +++ b/cake/tests/test_app/controllers/tests_apps_posts_controller.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers diff --git a/cake/tests/test_app/models/behaviors/persister_one_behavior.php b/cake/tests/test_app/models/behaviors/persister_one_behavior.php index e41957460..703432b7e 100644 --- a/cake/tests/test_app/models/behaviors/persister_one_behavior.php +++ b/cake/tests/test_app/models/behaviors/persister_one_behavior.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.tests.test_app.models * @since CakePHP(tm) v 1.2.0.5669 diff --git a/cake/tests/test_app/models/behaviors/persister_two_behavior.php b/cake/tests/test_app/models/behaviors/persister_two_behavior.php index cebd79858..798913c1d 100644 --- a/cake/tests/test_app/models/behaviors/persister_two_behavior.php +++ b/cake/tests/test_app/models/behaviors/persister_two_behavior.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.tests.test_app.models * @since CakePHP(tm) v 1.2.0.5669 diff --git a/cake/tests/test_app/models/comment.php b/cake/tests/test_app/models/comment.php index 5eb6eba63..497a422da 100644 --- a/cake/tests/test_app/models/comment.php +++ b/cake/tests/test_app/models/comment.php @@ -13,9 +13,8 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @link http://cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.libs. * @since CakePHP v 1.2.0.7726 diff --git a/cake/tests/test_app/models/persister_one.php b/cake/tests/test_app/models/persister_one.php index 8df8a4eac..f3048e4b7 100644 --- a/cake/tests/test_app/models/persister_one.php +++ b/cake/tests/test_app/models/persister_one.php @@ -13,9 +13,8 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @link http://cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.test_app.models * @since CakePHP v 1.2.0.7726 diff --git a/cake/tests/test_app/models/persister_two.php b/cake/tests/test_app/models/persister_two.php index 417cc146b..5f8b56263 100644 --- a/cake/tests/test_app/models/persister_two.php +++ b/cake/tests/test_app/models/persister_two.php @@ -13,9 +13,8 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @link http://cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.tests.test_app.models * @since CakePHP v 1.2.0.7726 diff --git a/cake/tests/test_app/models/post.php b/cake/tests/test_app/models/post.php index 71280e0db..6ab391e99 100644 --- a/cake/tests/test_app/models/post.php +++ b/cake/tests/test_app/models/post.php @@ -13,9 +13,8 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @link http://cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.libs. * @since CakePHP v 1.2.0.7726 diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/components/other_component.php b/cake/tests/test_app/plugins/test_plugin/controllers/components/other_component.php index 8c8c6269b..84bab0969 100644 --- a/cake/tests/test_app/plugins/test_plugin/controllers/components/other_component.php +++ b/cake/tests/test_app/plugins/test_plugin/controllers/components/other_component.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php b/cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php index d66e4eb3c..564671e12 100644 --- a/cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php +++ b/cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php b/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php index 3d98a2961..a24727ce8 100644 --- a/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php +++ b/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php b/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php index 321831152..5f9c8f931 100644 --- a/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php +++ b/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php b/cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php index 10e43fa0a..071a37ccb 100644 --- a/cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php +++ b/cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers diff --git a/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php b/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php index 7ffe580ed..0eb5802bc 100644 --- a/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php +++ b/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.tests.test_app.models * @since CakePHP(tm) v 1.2.0.5669 diff --git a/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php b/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php index 0d5eb05fb..860d8288c 100644 --- a/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php +++ b/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php @@ -7,15 +7,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.tests.test_app.models * @since CakePHP(tm) v 1.2.0.5669 diff --git a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php index 56b963539..ed148e8ef 100644 --- a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php +++ b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php @@ -13,9 +13,8 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @link http://cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.libs. * @since CakePHP v 1.2.0.7726 diff --git a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php index 90e6e9293..d62fa565c 100644 --- a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php +++ b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php @@ -13,9 +13,8 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2008, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @link http://cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.libs. * @since CakePHP v 1.2.0.7726 diff --git a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php index b72cd1eb0..d575d709c 100644 --- a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php +++ b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php @@ -13,9 +13,8 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project + * @link http://cakefoundation.org/projects/info/cakephp CakePHP Project * @package cake * @subpackage cake.cake.tests.test_app.plugins.test_plugin * @since CakePHP v 1.2.0.4487 diff --git a/cake/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php b/cake/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php index 46a40ecb0..944818d12 100644 --- a/cake/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php +++ b/cake/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php b/cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php index 1ce17fe7e..c3a2f9073 100644 --- a/cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php +++ b/cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.cases.libs diff --git a/cake/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php b/cake/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php index f263537c6..49291107a 100644 --- a/cake/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php +++ b/cake/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.vendors.sample diff --git a/cake/tests/test_app/plugins/test_plugin/vendors/shells/example.php b/cake/tests/test_app/plugins/test_plugin/vendors/shells/example.php index e4f71f8ba..c229984a6 100644 --- a/cake/tests/test_app/plugins/test_plugin/vendors/shells/example.php +++ b/cake/tests/test_app/plugins/test_plugin/vendors/shells/example.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.vendors.shells diff --git a/cake/tests/test_app/plugins/test_plugin/vendors/welcome.php b/cake/tests/test_app/plugins/test_plugin/vendors/welcome.php index e116ba975..c8d261473 100644 --- a/cake/tests/test_app/plugins/test_plugin/vendors/welcome.php +++ b/cake/tests/test_app/plugins/test_plugin/vendors/welcome.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.vendors diff --git a/cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php b/cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php index 952a42824..0c74a5544 100644 --- a/cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php +++ b/cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers diff --git a/cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php b/cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php index 7611e129f..12c284e5f 100644 --- a/cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php +++ b/cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin.views.helpers diff --git a/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/example.php b/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/example.php index f4e0635e5..ffbaa3f13 100644 --- a/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/example.php +++ b/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/example.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin_two.vendors.shells diff --git a/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/welcome.php b/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/welcome.php index 5fb0dde2b..d30f55092 100644 --- a/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/welcome.php +++ b/cake/tests/test_app/plugins/test_plugin_two/vendors/shells/welcome.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.plugins.test_plugin_two.vendors.shells diff --git a/cake/tests/test_app/vendors/Test/MyTest.php b/cake/tests/test_app/vendors/Test/MyTest.php index 7662a2d88..f61d691f1 100644 --- a/cake/tests/test_app/vendors/Test/MyTest.php +++ b/cake/tests/test_app/vendors/Test/MyTest.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.vendors.somename diff --git a/cake/tests/test_app/vendors/Test/hello.php b/cake/tests/test_app/vendors/Test/hello.php index 061237d5f..97320a971 100644 --- a/cake/tests/test_app/vendors/Test/hello.php +++ b/cake/tests/test_app/vendors/Test/hello.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.vendors.Test diff --git a/cake/tests/test_app/vendors/sample/configure_test_vendor_sample.php b/cake/tests/test_app/vendors/sample/configure_test_vendor_sample.php index 1776b67b0..774f70839 100644 --- a/cake/tests/test_app/vendors/sample/configure_test_vendor_sample.php +++ b/cake/tests/test_app/vendors/sample/configure_test_vendor_sample.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.vendors.sample diff --git a/cake/tests/test_app/vendors/shells/sample.php b/cake/tests/test_app/vendors/shells/sample.php index 474a855ad..773a27839 100644 --- a/cake/tests/test_app/vendors/shells/sample.php +++ b/cake/tests/test_app/vendors/shells/sample.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.vendors.shells diff --git a/cake/tests/test_app/vendors/somename/some.name.php b/cake/tests/test_app/vendors/somename/some.name.php index 4507ebb35..6a815ffc8 100644 --- a/cake/tests/test_app/vendors/somename/some.name.php +++ b/cake/tests/test_app/vendors/somename/some.name.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.vendors.somename diff --git a/cake/tests/test_app/vendors/welcome.php b/cake/tests/test_app/vendors/welcome.php index 25abe89a6..e3c33c636 100644 --- a/cake/tests/test_app/vendors/welcome.php +++ b/cake/tests/test_app/vendors/welcome.php @@ -8,13 +8,12 @@ * PHP versions 4 and 5 * * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The Open Group Test Suite License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests * @package cake * @subpackage cake.tests.test_app.vendors diff --git a/cake/tests/test_app/views/elements/email/html/default.ctp b/cake/tests/test_app/views/elements/email/html/default.ctp index 374923ef3..a70d09778 100644 --- a/cake/tests/test_app/views/elements/email/html/default.ctp +++ b/cake/tests/test_app/views/elements/email/html/default.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.elements.email.html * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/tests/test_app/views/elements/email/text/default.ctp b/cake/tests/test_app/views/elements/email/text/default.ctp index 284acea16..d3f885b5c 100644 --- a/cake/tests/test_app/views/elements/email/text/default.ctp +++ b/cake/tests/test_app/views/elements/email/text/default.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.elements.email.text * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/tests/test_app/views/elements/email/text/wide.ctp b/cake/tests/test_app/views/elements/email/text/wide.ctp index d9365aa06..312ee2e21 100644 --- a/cake/tests/test_app/views/elements/email/text/wide.ctp +++ b/cake/tests/test_app/views/elements/email/text/wide.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.elements.email.text * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/tests/test_app/views/layouts/ajax.ctp b/cake/tests/test_app/views/layouts/ajax.ctp index e6bd065e0..a3440dd2c 100644 --- a/cake/tests/test_app/views/layouts/ajax.ctp +++ b/cake/tests/test_app/views/layouts/ajax.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/tests/test_app/views/layouts/ajax2.ctp b/cake/tests/test_app/views/layouts/ajax2.ctp index c975fdfe2..779707cdf 100644 --- a/cake/tests/test_app/views/layouts/ajax2.ctp +++ b/cake/tests/test_app/views/layouts/ajax2.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/tests/test_app/views/layouts/cache_layout.ctp b/cake/tests/test_app/views/layouts/cache_layout.ctp index ae9a16593..901b875b6 100644 --- a/cake/tests/test_app/views/layouts/cache_layout.ctp +++ b/cake/tests/test_app/views/layouts/cache_layout.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/tests/test_app/views/layouts/default.ctp b/cake/tests/test_app/views/layouts/default.ctp index 50e5c0300..d47a8533b 100644 --- a/cake/tests/test_app/views/layouts/default.ctp +++ b/cake/tests/test_app/views/layouts/default.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.pages * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/tests/test_app/views/layouts/email/html/default.ctp b/cake/tests/test_app/views/layouts/email/html/default.ctp index 63573ac05..dbf7916be 100644 --- a/cake/tests/test_app/views/layouts/email/html/default.ctp +++ b/cake/tests/test_app/views/layouts/email/html/default.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts.email.html * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/tests/test_app/views/layouts/email/html/thin.ctp b/cake/tests/test_app/views/layouts/email/html/thin.ctp index f568046be..33e905a65 100644 --- a/cake/tests/test_app/views/layouts/email/html/thin.ctp +++ b/cake/tests/test_app/views/layouts/email/html/thin.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts.email.html * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/tests/test_app/views/layouts/email/text/default.ctp b/cake/tests/test_app/views/layouts/email/text/default.ctp index 9a0cf7835..aeef64f2b 100644 --- a/cake/tests/test_app/views/layouts/email/text/default.ctp +++ b/cake/tests/test_app/views/layouts/email/text/default.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts.email.text * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/tests/test_app/views/layouts/flash.ctp b/cake/tests/test_app/views/layouts/flash.ctp index 3f17a4764..8465565d9 100644 --- a/cake/tests/test_app/views/layouts/flash.ctp +++ b/cake/tests/test_app/views/layouts/flash.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/tests/test_app/views/layouts/multi_cache.ctp b/cake/tests/test_app/views/layouts/multi_cache.ctp index 658537659..99f0f37fd 100644 --- a/cake/tests/test_app/views/layouts/multi_cache.ctp +++ b/cake/tests/test_app/views/layouts/multi_cache.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.layouts * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/tests/test_app/views/posts/sequencial_nocache.ctp b/cake/tests/test_app/views/posts/sequencial_nocache.ctp index b0b8d556f..8411db54a 100644 --- a/cake/tests/test_app/views/posts/sequencial_nocache.ctp +++ b/cake/tests/test_app/views/posts/sequencial_nocache.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.pages * @since CakePHP(tm) v 0.10.0.1076 diff --git a/cake/tests/test_app/views/posts/test_nocache_tags.ctp b/cake/tests/test_app/views/posts/test_nocache_tags.ctp index 9dd64d8cb..7a62dddeb 100644 --- a/cake/tests/test_app/views/posts/test_nocache_tags.ctp +++ b/cake/tests/test_app/views/posts/test_nocache_tags.ctp @@ -4,15 +4,14 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs.view.templates.pages * @since CakePHP(tm) v 0.10.0.1076 @@ -122,7 +121,7 @@ if (!empty($filePresent)): <?php __('Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.'); ?> </p> <ul> - <li><a href="http://www.cakefoundation.org/"><?php __('Cake Software Foundation'); ?> </a> + <li><a href="http://cakefoundation.org/"><?php __('Cake Software Foundation'); ?> </a> <ul><li><?php __('Promoting development related to CakePHP'); ?></li></ul></li> <li><a href="http://bakery.cakephp.org"><?php __('The Bakery'); ?> </a> <ul><li><?php __('Everything CakePHP'); ?></li></ul></li> diff --git a/index.php b/index.php index de5df8cfc..d34d6fedc 100644 --- a/index.php +++ b/index.php @@ -10,14 +10,13 @@ * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://www.cakefoundation.org) - * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @since CakePHP(tm) v 0.2.9 * @version $Revision$ From cdd87849cc7a627278fc3d91a8001a7738d0bc1b Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 26 Jan 2010 17:03:03 -0500 Subject: [PATCH 1597/2083] Fixing @link tags to ease merging. --- cake/bootstrap.php | 2 +- cake/console/libs/tasks/template.php | 2 +- cake/console/templates/default/actions/controller_actions.ctp | 2 +- cake/console/templates/default/classes/controller.ctp | 2 +- cake/console/templates/default/classes/fixture.ctp | 2 +- cake/console/templates/default/classes/model.ctp | 2 +- cake/console/templates/default/classes/test.ctp | 2 +- cake/console/templates/skel/webroot/index.php | 2 +- cake/libs/debugger.php | 2 +- cake/tests/cases/console/libs/bake.test.php | 2 +- cake/tests/cases/console/libs/tasks/controller.test.php | 2 +- cake/tests/cases/console/libs/tasks/db_config.test.php | 2 +- cake/tests/cases/console/libs/tasks/fixture.test.php | 2 +- cake/tests/cases/console/libs/tasks/template.test.php | 2 +- cake/tests/cases/libs/model/model_behavior.test.php | 2 +- cake/tests/lib/cake_test_suite_dispatcher.php | 2 +- cake/tests/lib/reporter/cake_base_reporter.php | 2 +- cake/tests/lib/reporter/cake_html_reporter.php | 2 +- cake/tests/lib/reporter/cake_text_reporter.php | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/cake/bootstrap.php b/cake/bootstrap.php index 1aafb6237..4a7046d84 100644 --- a/cake/bootstrap.php +++ b/cake/bootstrap.php @@ -13,7 +13,7 @@ * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake * @since CakePHP(tm) v 0.2.9 diff --git a/cake/console/libs/tasks/template.php b/cake/console/libs/tasks/template.php index 422b775c1..72b2c7d17 100644 --- a/cake/console/libs/tasks/template.php +++ b/cake/console/libs/tasks/template.php @@ -11,7 +11,7 @@ * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.console.libs.tasks * @since CakePHP(tm) v 1.3 diff --git a/cake/console/templates/default/actions/controller_actions.ctp b/cake/console/templates/default/actions/controller_actions.ctp index 1f9baa287..4be40637f 100644 --- a/cake/console/templates/default/actions/controller_actions.ctp +++ b/cake/console/templates/default/actions/controller_actions.ctp @@ -11,7 +11,7 @@ * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.console.libs.template.objects * @since CakePHP(tm) v 1.3 diff --git a/cake/console/templates/default/classes/controller.ctp b/cake/console/templates/default/classes/controller.ctp index 48d7b1b1c..e727fc26d 100644 --- a/cake/console/templates/default/classes/controller.ctp +++ b/cake/console/templates/default/classes/controller.ctp @@ -13,7 +13,7 @@ * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake. * @since CakePHP(tm) v 1.3 diff --git a/cake/console/templates/default/classes/fixture.ctp b/cake/console/templates/default/classes/fixture.ctp index aa8c0678c..0f516e101 100644 --- a/cake/console/templates/default/classes/fixture.ctp +++ b/cake/console/templates/default/classes/fixture.ctp @@ -13,7 +13,7 @@ * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake. * @since CakePHP(tm) v 1.3 diff --git a/cake/console/templates/default/classes/model.ctp b/cake/console/templates/default/classes/model.ctp index 67c40ba4d..dda2814d5 100644 --- a/cake/console/templates/default/classes/model.ctp +++ b/cake/console/templates/default/classes/model.ctp @@ -13,7 +13,7 @@ * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.console.libs.templates.objects * @since CakePHP(tm) v 1.3 diff --git a/cake/console/templates/default/classes/test.ctp b/cake/console/templates/default/classes/test.ctp index f84220c30..a3f96931b 100644 --- a/cake/console/templates/default/classes/test.ctp +++ b/cake/console/templates/default/classes/test.ctp @@ -12,7 +12,7 @@ * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.console.libs.templates.objects * @since CakePHP(tm) v 1.3 diff --git a/cake/console/templates/skel/webroot/index.php b/cake/console/templates/skel/webroot/index.php index 5935a869c..a3e2c63e0 100644 --- a/cake/console/templates/skel/webroot/index.php +++ b/cake/console/templates/skel/webroot/index.php @@ -13,7 +13,7 @@ * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.app.webroot * @since CakePHP(tm) v 0.2.9 diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index e0cefc703..5d0a721ec 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -13,7 +13,7 @@ * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.libs * @since CakePHP(tm) v 1.2.4560 diff --git a/cake/tests/cases/console/libs/bake.test.php b/cake/tests/cases/console/libs/bake.test.php index f8b20c3a5..37a86b259 100644 --- a/cake/tests/cases/console/libs/bake.test.php +++ b/cake/tests/cases/console/libs/bake.test.php @@ -12,7 +12,7 @@ * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.tests.cases.console.libs.tasks * @since CakePHP(tm) v 1.3 diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index dd550ed26..be5ee94d7 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -11,7 +11,7 @@ * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.tests.cases.console.libs.tasks * @since CakePHP(tm) v 1.3 diff --git a/cake/tests/cases/console/libs/tasks/db_config.test.php b/cake/tests/cases/console/libs/tasks/db_config.test.php index e28554955..0297e7adc 100644 --- a/cake/tests/cases/console/libs/tasks/db_config.test.php +++ b/cake/tests/cases/console/libs/tasks/db_config.test.php @@ -11,7 +11,7 @@ * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.tests.cases.console.libs.tasks * @since CakePHP(tm) v 1.3 diff --git a/cake/tests/cases/console/libs/tasks/fixture.test.php b/cake/tests/cases/console/libs/tasks/fixture.test.php index 65678cbd4..ba6642ea2 100644 --- a/cake/tests/cases/console/libs/tasks/fixture.test.php +++ b/cake/tests/cases/console/libs/tasks/fixture.test.php @@ -11,7 +11,7 @@ * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.tests.cases.console.libs.tasks * @since CakePHP(tm) v 1.3 diff --git a/cake/tests/cases/console/libs/tasks/template.test.php b/cake/tests/cases/console/libs/tasks/template.test.php index 243d2aba0..cc3d87950 100644 --- a/cake/tests/cases/console/libs/tasks/template.test.php +++ b/cake/tests/cases/console/libs/tasks/template.test.php @@ -14,7 +14,7 @@ * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.tests.cases.console.libs.tasks * @since CakePHP(tm) v 1.3 diff --git a/cake/tests/cases/libs/model/model_behavior.test.php b/cake/tests/cases/libs/model/model_behavior.test.php index 3a9bc7cae..ab9741964 100644 --- a/cake/tests/cases/libs/model/model_behavior.test.php +++ b/cake/tests/cases/libs/model/model_behavior.test.php @@ -13,7 +13,7 @@ * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.tests.cases.libs.model * @since 1.2 diff --git a/cake/tests/lib/cake_test_suite_dispatcher.php b/cake/tests/lib/cake_test_suite_dispatcher.php index 8b30cb6fa..db7e0ea4b 100644 --- a/cake/tests/lib/cake_test_suite_dispatcher.php +++ b/cake/tests/lib/cake_test_suite_dispatcher.php @@ -11,7 +11,7 @@ * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.cake.tests.lib * @since CakePHP(tm) v 1.3 diff --git a/cake/tests/lib/reporter/cake_base_reporter.php b/cake/tests/lib/reporter/cake_base_reporter.php index c634f89d0..0c1b12d14 100644 --- a/cake/tests/lib/reporter/cake_base_reporter.php +++ b/cake/tests/lib/reporter/cake_base_reporter.php @@ -11,7 +11,7 @@ * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.tests.libs.reporter * @since CakePHP(tm) v 1.3 diff --git a/cake/tests/lib/reporter/cake_html_reporter.php b/cake/tests/lib/reporter/cake_html_reporter.php index 81b2c9663..c6148c218 100644 --- a/cake/tests/lib/reporter/cake_html_reporter.php +++ b/cake/tests/lib/reporter/cake_html_reporter.php @@ -11,7 +11,7 @@ * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.tests.libs.reporter * @since CakePHP(tm) v 1.2.0.4433 diff --git a/cake/tests/lib/reporter/cake_text_reporter.php b/cake/tests/lib/reporter/cake_text_reporter.php index 68dd09b6c..cc4a6ac3e 100644 --- a/cake/tests/lib/reporter/cake_text_reporter.php +++ b/cake/tests/lib/reporter/cake_text_reporter.php @@ -11,7 +11,7 @@ * Redistributions of files must retain the above copyright notice. * * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org + * @link http://cakephp.org CakePHP(tm) Project * @package cake * @subpackage cake.tests.libs.reporter * @since CakePHP(tm) v 1.3 From 66a89108103492d9db5e865a0ccded3bf756a079 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 26 Jan 2010 17:15:15 -0500 Subject: [PATCH 1598/2083] Fixing cakephp domain name. --- app/config/acl.ini.php | 2 +- app/config/bootstrap.php | 2 +- app/config/core.php | 2 +- app/config/database.php.default | 2 +- app/config/inflections.php | 2 +- app/config/routes.php | 2 +- app/config/sql/db_acl.php | 2 +- app/config/sql/i18n.php | 2 +- app/config/sql/sessions.php | 2 +- app/index.php | 2 +- app/webroot/css.php | 2 +- app/webroot/css/cake.generic.css | 2 +- app/webroot/index.php | 2 +- app/webroot/js/vendors.php | 2 +- cake/LICENSE.txt | 2 +- cake/basics.php | 2 +- cake/bootstrap.php | 2 +- cake/config/config.php | 2 +- cake/config/paths.php | 2 +- cake/config/unicode/casefolding/0080_00ff.php | 2 +- cake/config/unicode/casefolding/0100_017f.php | 2 +- cake/config/unicode/casefolding/0180_024F.php | 2 +- cake/config/unicode/casefolding/0250_02af.php | 2 +- cake/config/unicode/casefolding/0370_03ff.php | 2 +- cake/config/unicode/casefolding/0400_04ff.php | 2 +- cake/config/unicode/casefolding/0500_052f.php | 2 +- cake/config/unicode/casefolding/0530_058f.php | 2 +- cake/config/unicode/casefolding/1e00_1eff.php | 2 +- cake/config/unicode/casefolding/1f00_1fff.php | 2 +- cake/config/unicode/casefolding/2100_214f.php | 2 +- cake/config/unicode/casefolding/2150_218f.php | 2 +- cake/config/unicode/casefolding/2460_24ff.php | 2 +- cake/config/unicode/casefolding/2c00_2c5f.php | 2 +- cake/config/unicode/casefolding/2c60_2c7f.php | 2 +- cake/config/unicode/casefolding/2c80_2cff.php | 2 +- cake/config/unicode/casefolding/ff00_ffef.php | 2 +- cake/console/cake | 2 +- cake/console/cake.bat | 2 +- cake/console/cake.php | 2 +- cake/console/error.php | 2 +- cake/console/libs/acl.php | 2 +- cake/console/libs/api.php | 2 +- cake/console/libs/bake.php | 2 +- cake/console/libs/console.php | 2 +- cake/console/libs/i18n.php | 2 +- cake/console/libs/schema.php | 2 +- cake/console/libs/shell.php | 2 +- cake/console/libs/tasks/controller.php | 2 +- cake/console/libs/tasks/db_config.php | 2 +- cake/console/libs/tasks/extract.php | 2 +- cake/console/libs/tasks/model.php | 2 +- cake/console/libs/tasks/plugin.php | 2 +- cake/console/libs/tasks/project.php | 2 +- cake/console/libs/tasks/test.php | 2 +- cake/console/libs/tasks/view.php | 2 +- cake/console/libs/templates/skel/app_controller.php | 2 +- cake/console/libs/templates/skel/app_helper.php | 2 +- cake/console/libs/templates/skel/app_model.php | 2 +- cake/console/libs/templates/skel/config/bootstrap.php | 2 +- cake/console/libs/templates/skel/config/core.php | 2 +- cake/console/libs/templates/skel/config/database.php.default | 2 +- cake/console/libs/templates/skel/config/inflections.php | 2 +- cake/console/libs/templates/skel/config/routes.php | 2 +- cake/console/libs/templates/skel/config/sql/db_acl.php | 2 +- cake/console/libs/templates/skel/config/sql/i18n.php | 2 +- cake/console/libs/templates/skel/config/sql/sessions.php | 2 +- .../libs/templates/skel/controllers/pages_controller.php | 2 +- cake/console/libs/templates/skel/index.php | 2 +- .../libs/templates/skel/views/elements/email/html/default.ctp | 2 +- .../libs/templates/skel/views/elements/email/text/default.ctp | 2 +- cake/console/libs/templates/skel/views/layouts/ajax.ctp | 2 +- cake/console/libs/templates/skel/views/layouts/default.ctp | 2 +- .../libs/templates/skel/views/layouts/email/html/default.ctp | 2 +- .../libs/templates/skel/views/layouts/email/text/default.ctp | 2 +- cake/console/libs/templates/skel/views/layouts/flash.ctp | 2 +- cake/console/libs/templates/skel/webroot/css.php | 2 +- cake/console/libs/templates/skel/webroot/css/cake.generic.css | 2 +- cake/console/libs/templates/skel/webroot/index.php | 2 +- cake/console/libs/templates/skel/webroot/js/vendors.php | 2 +- cake/console/libs/templates/views/form.ctp | 2 +- cake/console/libs/templates/views/index.ctp | 2 +- cake/console/libs/templates/views/view.ctp | 2 +- cake/dispatcher.php | 2 +- cake/libs/cache.php | 2 +- cake/libs/cache/apc.php | 2 +- cake/libs/cache/file.php | 2 +- cake/libs/cache/memcache.php | 2 +- cake/libs/cache/xcache.php | 2 +- cake/libs/cake_log.php | 2 +- cake/libs/class_registry.php | 2 +- cake/libs/configure.php | 2 +- cake/libs/controller/app_controller.php | 2 +- cake/libs/controller/component.php | 2 +- cake/libs/controller/components/acl.php | 2 +- cake/libs/controller/components/auth.php | 2 +- cake/libs/controller/components/cookie.php | 2 +- cake/libs/controller/components/email.php | 2 +- cake/libs/controller/components/request_handler.php | 2 +- cake/libs/controller/components/security.php | 2 +- cake/libs/controller/components/session.php | 2 +- cake/libs/controller/controller.php | 2 +- cake/libs/controller/pages_controller.php | 2 +- cake/libs/controller/scaffold.php | 2 +- cake/libs/debugger.php | 2 +- cake/libs/error.php | 2 +- cake/libs/file.php | 2 +- cake/libs/flay.php | 2 +- cake/libs/folder.php | 2 +- cake/libs/http_socket.php | 2 +- cake/libs/i18n.php | 2 +- cake/libs/inflector.php | 2 +- cake/libs/l10n.php | 2 +- cake/libs/magic_db.php | 2 +- cake/libs/model/app_model.php | 2 +- cake/libs/model/behavior.php | 2 +- cake/libs/model/behaviors/acl.php | 2 +- cake/libs/model/behaviors/containable.php | 2 +- cake/libs/model/behaviors/translate.php | 2 +- cake/libs/model/behaviors/tree.php | 2 +- cake/libs/model/connection_manager.php | 2 +- cake/libs/model/datasources/datasource.php | 2 +- cake/libs/model/datasources/dbo/dbo_adodb.php | 2 +- cake/libs/model/datasources/dbo/dbo_db2.php | 2 +- cake/libs/model/datasources/dbo/dbo_firebird.php | 2 +- cake/libs/model/datasources/dbo/dbo_mssql.php | 2 +- cake/libs/model/datasources/dbo/dbo_mysql.php | 2 +- cake/libs/model/datasources/dbo/dbo_mysqli.php | 2 +- cake/libs/model/datasources/dbo/dbo_odbc.php | 2 +- cake/libs/model/datasources/dbo/dbo_oracle.php | 2 +- cake/libs/model/datasources/dbo/dbo_postgres.php | 2 +- cake/libs/model/datasources/dbo/dbo_sqlite.php | 2 +- cake/libs/model/datasources/dbo/dbo_sybase.php | 2 +- cake/libs/model/datasources/dbo_source.php | 2 +- cake/libs/model/db_acl.php | 2 +- cake/libs/model/model.php | 2 +- cake/libs/model/schema.php | 2 +- cake/libs/multibyte.php | 2 +- cake/libs/object.php | 2 +- cake/libs/overloadable.php | 2 +- cake/libs/overloadable_php4.php | 2 +- cake/libs/overloadable_php5.php | 2 +- cake/libs/router.php | 2 +- cake/libs/sanitize.php | 2 +- cake/libs/security.php | 2 +- cake/libs/session.php | 2 +- cake/libs/set.php | 2 +- cake/libs/socket.php | 2 +- cake/libs/string.php | 2 +- cake/libs/validation.php | 2 +- cake/libs/view/elements/dump.ctp | 2 +- cake/libs/view/elements/email/html/default.ctp | 2 +- cake/libs/view/elements/email/text/default.ctp | 2 +- cake/libs/view/errors/error404.ctp | 2 +- cake/libs/view/errors/missing_action.ctp | 2 +- cake/libs/view/errors/missing_component_class.ctp | 2 +- cake/libs/view/errors/missing_component_file.ctp | 2 +- cake/libs/view/errors/missing_connection.ctp | 2 +- cake/libs/view/errors/missing_controller.ctp | 2 +- cake/libs/view/errors/missing_helper_class.ctp | 2 +- cake/libs/view/errors/missing_helper_file.ctp | 2 +- cake/libs/view/errors/missing_layout.ctp | 2 +- cake/libs/view/errors/missing_model.ctp | 2 +- cake/libs/view/errors/missing_scaffolddb.ctp | 2 +- cake/libs/view/errors/missing_table.ctp | 2 +- cake/libs/view/errors/missing_view.ctp | 2 +- cake/libs/view/errors/private_action.ctp | 2 +- cake/libs/view/errors/scaffold_error.ctp | 2 +- cake/libs/view/helper.php | 2 +- cake/libs/view/helpers/ajax.php | 2 +- cake/libs/view/helpers/app_helper.php | 2 +- cake/libs/view/helpers/cache.php | 2 +- cake/libs/view/helpers/form.php | 2 +- cake/libs/view/helpers/html.php | 2 +- cake/libs/view/helpers/javascript.php | 2 +- cake/libs/view/helpers/js.php | 2 +- cake/libs/view/helpers/number.php | 2 +- cake/libs/view/helpers/paginator.php | 2 +- cake/libs/view/helpers/rss.php | 2 +- cake/libs/view/helpers/session.php | 2 +- cake/libs/view/helpers/text.php | 2 +- cake/libs/view/helpers/time.php | 2 +- cake/libs/view/helpers/xml.php | 2 +- cake/libs/view/layouts/ajax.ctp | 2 +- cake/libs/view/layouts/default.ctp | 2 +- cake/libs/view/layouts/email/html/default.ctp | 2 +- cake/libs/view/layouts/email/text/default.ctp | 2 +- cake/libs/view/layouts/flash.ctp | 2 +- cake/libs/view/media.php | 2 +- cake/libs/view/pages/home.ctp | 2 +- cake/libs/view/scaffolds/edit.ctp | 2 +- cake/libs/view/scaffolds/index.ctp | 2 +- cake/libs/view/scaffolds/view.ctp | 2 +- cake/libs/view/theme.php | 2 +- cake/libs/view/view.php | 2 +- cake/libs/xml.php | 2 +- cake/tests/cases/console/libs/acl.test.php | 2 +- cake/tests/cases/console/libs/api.test.php | 2 +- cake/tests/cases/console/libs/schema.test.php | 2 +- cake/tests/cases/console/libs/shell.test.php | 2 +- cake/tests/cases/console/libs/tasks/extract.test.php | 2 +- cake/tests/cases/console/libs/tasks/model.test.php | 2 +- cake/tests/cases/console/libs/tasks/test.test.php | 2 +- cake/tests/cases/libs/cake_test_case.test.php | 2 +- cake/tests/cases/libs/magic_db.test.php | 2 +- cake/tests/cases/libs/model/behavior.test.php | 4 ++-- cake/tests/cases/libs/model/behaviors/acl.test.php | 2 +- .../tests/cases/libs/model/datasources/dbo/dbo_adodb.test.php | 2 +- .../tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php | 2 +- .../tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php | 2 +- .../cases/libs/model/datasources/dbo/dbo_mysqli.test.php | 2 +- .../cases/libs/model/datasources/dbo/dbo_oracle.test.php | 2 +- .../cases/libs/model/datasources/dbo/dbo_postgres.test.php | 2 +- .../cases/libs/model/datasources/dbo/dbo_sqlite.test.php | 2 +- cake/tests/fixtures/ad_fixture.php | 4 ++-- cake/tests/fixtures/after_tree_fixture.php | 4 ++-- cake/tests/fixtures/campaign_fixture.php | 4 ++-- cake/tests/fixtures/datatype_fixture.php | 2 +- cake/tests/fixtures/dependency_fixture.php | 2 +- cake/tests/fixtures/node_fixture.php | 2 +- cake/tests/test_app/config/acl.ini.php | 2 +- .../test_app/models/behaviors/persister_one_behavior.php | 2 +- .../test_app/models/behaviors/persister_two_behavior.php | 2 +- cake/tests/test_app/models/comment.php | 2 +- cake/tests/test_app/models/persister_one.php | 2 +- cake/tests/test_app/models/persister_two.php | 2 +- cake/tests/test_app/models/post.php | 2 +- .../models/behaviors/test_plugin_persister_one.php | 2 +- .../models/behaviors/test_plugin_persister_two.php | 2 +- .../plugins/test_plugin/models/test_plugin_authors.php | 2 +- .../plugins/test_plugin/models/test_plugin_comment.php | 2 +- .../test_app/plugins/test_plugin/models/test_plugin_post.php | 2 +- cake/tests/test_app/views/elements/email/html/default.ctp | 2 +- cake/tests/test_app/views/elements/email/text/default.ctp | 2 +- cake/tests/test_app/views/elements/email/text/wide.ctp | 2 +- cake/tests/test_app/views/layouts/ajax.ctp | 2 +- cake/tests/test_app/views/layouts/ajax2.ctp | 2 +- cake/tests/test_app/views/layouts/cache_layout.ctp | 2 +- cake/tests/test_app/views/layouts/default.ctp | 2 +- cake/tests/test_app/views/layouts/email/html/default.ctp | 2 +- cake/tests/test_app/views/layouts/email/html/thin.ctp | 2 +- cake/tests/test_app/views/layouts/email/text/default.ctp | 2 +- cake/tests/test_app/views/layouts/flash.ctp | 2 +- cake/tests/test_app/views/layouts/multi_cache.ctp | 2 +- cake/tests/test_app/views/posts/sequencial_nocache.ctp | 2 +- cake/tests/test_app/views/posts/test_nocache_tags.ctp | 2 +- index.php | 2 +- 246 files changed, 250 insertions(+), 250 deletions(-) diff --git a/app/config/acl.ini.php b/app/config/acl.ini.php index a6e9c97fb..924a949a8 100644 --- a/app/config/acl.ini.php +++ b/app/config/acl.ini.php @@ -6,7 +6,7 @@ ; * ; * PHP versions 4 and 5 ; * -; * CakePHP(tm) : Rapid Development Framework http://www.cakephp.org/ +; * CakePHP(tm) : Rapid Development Framework http://cakephp.org ; * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) ; * ; * Licensed under The MIT License diff --git a/app/config/bootstrap.php b/app/config/bootstrap.php index 22bd4a938..c0ff386a5 100644 --- a/app/config/bootstrap.php +++ b/app/config/bootstrap.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/app/config/core.php b/app/config/core.php index 283eba4d1..8e0a6c556 100644 --- a/app/config/core.php +++ b/app/config/core.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/app/config/database.php.default b/app/config/database.php.default index c30e368ae..fb731bce5 100644 --- a/app/config/database.php.default +++ b/app/config/database.php.default @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/app/config/inflections.php b/app/config/inflections.php index 2c73fd884..db309bd1f 100644 --- a/app/config/inflections.php +++ b/app/config/inflections.php @@ -8,7 +8,7 @@ * * PHP versions 4 and % * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/app/config/routes.php b/app/config/routes.php index 32094aa62..2858312c4 100644 --- a/app/config/routes.php +++ b/app/config/routes.php @@ -9,7 +9,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/app/config/sql/db_acl.php b/app/config/sql/db_acl.php index 72530d65c..0c874eb4d 100644 --- a/app/config/sql/db_acl.php +++ b/app/config/sql/db_acl.php @@ -8,7 +8,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/app/config/sql/i18n.php b/app/config/sql/i18n.php index ac0e7f5a9..ec37040b1 100644 --- a/app/config/sql/i18n.php +++ b/app/config/sql/i18n.php @@ -8,7 +8,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/app/config/sql/sessions.php b/app/config/sql/sessions.php index 8880e49b5..068a8f106 100644 --- a/app/config/sql/sessions.php +++ b/app/config/sql/sessions.php @@ -8,7 +8,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/app/index.php b/app/index.php index a8cca5d89..bb7acbc0e 100644 --- a/app/index.php +++ b/app/index.php @@ -3,7 +3,7 @@ /** * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/app/webroot/css.php b/app/webroot/css.php index bb29d0362..0c78a5b98 100644 --- a/app/webroot/css.php +++ b/app/webroot/css.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/app/webroot/css/cake.generic.css b/app/webroot/css/cake.generic.css index 3c244c5ba..a5dee0374 100644 --- a/app/webroot/css/cake.generic.css +++ b/app/webroot/css/cake.generic.css @@ -3,7 +3,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/app/webroot/index.php b/app/webroot/index.php index 8608f07dd..4f4250ee1 100644 --- a/app/webroot/index.php +++ b/app/webroot/index.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/app/webroot/js/vendors.php b/app/webroot/js/vendors.php index d9d38f690..0e4890eb1 100644 --- a/app/webroot/js/vendors.php +++ b/app/webroot/js/vendors.php @@ -8,7 +8,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/LICENSE.txt b/cake/LICENSE.txt index d699c53c7..bf6f82dd4 100644 --- a/cake/LICENSE.txt +++ b/cake/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License -CakePHP(tm) : The Rapid Development PHP Framework (http://www.cakephp.org) +CakePHP(tm) : The Rapid Development PHP Framework (http://cakephp.org) Copyright 2005-2010, Cake Software Foundation, Inc. Permission is hereby granted, free of charge, to any person obtaining a diff --git a/cake/basics.php b/cake/basics.php index 19cfc5bbb..8a35e00b3 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/bootstrap.php b/cake/bootstrap.php index 473530fd6..9b2d2877e 100644 --- a/cake/bootstrap.php +++ b/cake/bootstrap.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/config/config.php b/cake/config/config.php index ce1b9ba83..ee189ca96 100644 --- a/cake/config/config.php +++ b/cake/config/config.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/config/paths.php b/cake/config/paths.php index 781ce0ce9..232fef6c0 100644 --- a/cake/config/paths.php +++ b/cake/config/paths.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/config/unicode/casefolding/0080_00ff.php b/cake/config/unicode/casefolding/0080_00ff.php index a3917c776..9fe621991 100644 --- a/cake/config/unicode/casefolding/0080_00ff.php +++ b/cake/config/unicode/casefolding/0080_00ff.php @@ -11,7 +11,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/config/unicode/casefolding/0100_017f.php b/cake/config/unicode/casefolding/0100_017f.php index e3df9f639..734041445 100644 --- a/cake/config/unicode/casefolding/0100_017f.php +++ b/cake/config/unicode/casefolding/0100_017f.php @@ -11,7 +11,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/config/unicode/casefolding/0180_024F.php b/cake/config/unicode/casefolding/0180_024F.php index 73fb18d7d..f75336049 100644 --- a/cake/config/unicode/casefolding/0180_024F.php +++ b/cake/config/unicode/casefolding/0180_024F.php @@ -11,7 +11,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/config/unicode/casefolding/0250_02af.php b/cake/config/unicode/casefolding/0250_02af.php index df1b95321..ef4adedd8 100644 --- a/cake/config/unicode/casefolding/0250_02af.php +++ b/cake/config/unicode/casefolding/0250_02af.php @@ -11,7 +11,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/config/unicode/casefolding/0370_03ff.php b/cake/config/unicode/casefolding/0370_03ff.php index aff493514..38fb80b82 100644 --- a/cake/config/unicode/casefolding/0370_03ff.php +++ b/cake/config/unicode/casefolding/0370_03ff.php @@ -11,7 +11,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/config/unicode/casefolding/0400_04ff.php b/cake/config/unicode/casefolding/0400_04ff.php index 4b789a8ae..0e5cb041f 100644 --- a/cake/config/unicode/casefolding/0400_04ff.php +++ b/cake/config/unicode/casefolding/0400_04ff.php @@ -11,7 +11,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/config/unicode/casefolding/0500_052f.php b/cake/config/unicode/casefolding/0500_052f.php index 6747ce752..04a47eac3 100644 --- a/cake/config/unicode/casefolding/0500_052f.php +++ b/cake/config/unicode/casefolding/0500_052f.php @@ -11,7 +11,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/config/unicode/casefolding/0530_058f.php b/cake/config/unicode/casefolding/0530_058f.php index 68f3c6562..0d3e4bf6a 100644 --- a/cake/config/unicode/casefolding/0530_058f.php +++ b/cake/config/unicode/casefolding/0530_058f.php @@ -11,7 +11,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/config/unicode/casefolding/1e00_1eff.php b/cake/config/unicode/casefolding/1e00_1eff.php index 12f58212a..008d9a170 100644 --- a/cake/config/unicode/casefolding/1e00_1eff.php +++ b/cake/config/unicode/casefolding/1e00_1eff.php @@ -11,7 +11,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/config/unicode/casefolding/1f00_1fff.php b/cake/config/unicode/casefolding/1f00_1fff.php index 59a451ae0..7ed195305 100644 --- a/cake/config/unicode/casefolding/1f00_1fff.php +++ b/cake/config/unicode/casefolding/1f00_1fff.php @@ -11,7 +11,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/config/unicode/casefolding/2100_214f.php b/cake/config/unicode/casefolding/2100_214f.php index c39d3ff2d..5571cec8d 100644 --- a/cake/config/unicode/casefolding/2100_214f.php +++ b/cake/config/unicode/casefolding/2100_214f.php @@ -11,7 +11,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/config/unicode/casefolding/2150_218f.php b/cake/config/unicode/casefolding/2150_218f.php index 0cc85d0ee..33584d3c3 100644 --- a/cake/config/unicode/casefolding/2150_218f.php +++ b/cake/config/unicode/casefolding/2150_218f.php @@ -11,7 +11,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/config/unicode/casefolding/2460_24ff.php b/cake/config/unicode/casefolding/2460_24ff.php index ff9508812..3ae117f31 100644 --- a/cake/config/unicode/casefolding/2460_24ff.php +++ b/cake/config/unicode/casefolding/2460_24ff.php @@ -11,7 +11,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/config/unicode/casefolding/2c00_2c5f.php b/cake/config/unicode/casefolding/2c00_2c5f.php index f7c97b85d..1dcafa5b3 100644 --- a/cake/config/unicode/casefolding/2c00_2c5f.php +++ b/cake/config/unicode/casefolding/2c00_2c5f.php @@ -11,7 +11,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/config/unicode/casefolding/2c60_2c7f.php b/cake/config/unicode/casefolding/2c60_2c7f.php index ca1d527eb..c21ce14cb 100644 --- a/cake/config/unicode/casefolding/2c60_2c7f.php +++ b/cake/config/unicode/casefolding/2c60_2c7f.php @@ -11,7 +11,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/config/unicode/casefolding/2c80_2cff.php b/cake/config/unicode/casefolding/2c80_2cff.php index bad418bcb..2aa0343b6 100644 --- a/cake/config/unicode/casefolding/2c80_2cff.php +++ b/cake/config/unicode/casefolding/2c80_2cff.php @@ -11,7 +11,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/config/unicode/casefolding/ff00_ffef.php b/cake/config/unicode/casefolding/ff00_ffef.php index f4facbe76..0be09c9a4 100644 --- a/cake/config/unicode/casefolding/ff00_ffef.php +++ b/cake/config/unicode/casefolding/ff00_ffef.php @@ -11,7 +11,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/cake b/cake/console/cake index 890457ba6..632133897 100755 --- a/cake/console/cake +++ b/cake/console/cake @@ -4,7 +4,7 @@ # Bake is a shell script for running CakePHP bake script # PHP versions 4 and 5 # -# CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) +# CakePHP(tm) : Rapid Development Framework (http://cakephp.org) # Copyright 2005-2010, Cake Software Foundation, Inc. # # Licensed under The MIT License diff --git a/cake/console/cake.bat b/cake/console/cake.bat index 09701dea7..cac0a3a63 100644 --- a/cake/console/cake.bat +++ b/cake/console/cake.bat @@ -3,7 +3,7 @@ :: Bake is a shell script for running CakePHP bake script :: PHP versions 4 and 5 :: -:: CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) +:: CakePHP(tm) : Rapid Development Framework (http://cakephp.org) :: Copyright 2005-2010, Cake Software Foundation, Inc. :: :: Licensed under The MIT License diff --git a/cake/console/cake.php b/cake/console/cake.php index 517437069..b5942fdd0 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -8,7 +8,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/console/error.php b/cake/console/error.php index 1eebc436f..de9a2fb5a 100644 --- a/cake/console/error.php +++ b/cake/console/error.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/acl.php b/cake/console/libs/acl.php index 74d4895ff..0e4d0f831 100644 --- a/cake/console/libs/acl.php +++ b/cake/console/libs/acl.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/api.php b/cake/console/libs/api.php index 593e90d84..7721545b9 100644 --- a/cake/console/libs/api.php +++ b/cake/console/libs/api.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index cf20acff0..646fecbbf 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -9,7 +9,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/console.php b/cake/console/libs/console.php index 56f90c23f..601c347f5 100644 --- a/cake/console/libs/console.php +++ b/cake/console/libs/console.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/i18n.php b/cake/console/libs/i18n.php index 875c63ff5..ca731d9cc 100644 --- a/cake/console/libs/i18n.php +++ b/cake/console/libs/i18n.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/schema.php b/cake/console/libs/schema.php index 1c643fa98..033c683b1 100644 --- a/cake/console/libs/schema.php +++ b/cake/console/libs/schema.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php index 4e477f1af..b09cc42e7 100644 --- a/cake/console/libs/shell.php +++ b/cake/console/libs/shell.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 404f5cacd..9031f6c5c 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/console/libs/tasks/db_config.php b/cake/console/libs/tasks/db_config.php index a19eb6114..3780f6d85 100644 --- a/cake/console/libs/tasks/db_config.php +++ b/cake/console/libs/tasks/db_config.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/tasks/extract.php b/cake/console/libs/tasks/extract.php index b93f29320..2e5b9d01c 100644 --- a/cake/console/libs/tasks/extract.php +++ b/cake/console/libs/tasks/extract.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 13c321be8..2ece02e16 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index 4cf68d802..70287cb1c 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php index d6a3a547b..237405346 100644 --- a/cake/console/libs/tasks/project.php +++ b/cake/console/libs/tasks/project.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 26d056a70..2b187eecb 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 14b8029be..0f4d8a410 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/app_controller.php b/cake/console/libs/templates/skel/app_controller.php index d88316a2b..078966d97 100644 --- a/cake/console/libs/templates/skel/app_controller.php +++ b/cake/console/libs/templates/skel/app_controller.php @@ -8,7 +8,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/app_helper.php b/cake/console/libs/templates/skel/app_helper.php index b5c962f8f..0fa824c1d 100644 --- a/cake/console/libs/templates/skel/app_helper.php +++ b/cake/console/libs/templates/skel/app_helper.php @@ -8,7 +8,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/app_model.php b/cake/console/libs/templates/skel/app_model.php index bb6b950b5..ac03cf684 100644 --- a/cake/console/libs/templates/skel/app_model.php +++ b/cake/console/libs/templates/skel/app_model.php @@ -9,7 +9,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/config/bootstrap.php b/cake/console/libs/templates/skel/config/bootstrap.php index 22bd4a938..c0ff386a5 100644 --- a/cake/console/libs/templates/skel/config/bootstrap.php +++ b/cake/console/libs/templates/skel/config/bootstrap.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/config/core.php b/cake/console/libs/templates/skel/config/core.php index a8bc5b9ee..3f997fd11 100644 --- a/cake/console/libs/templates/skel/config/core.php +++ b/cake/console/libs/templates/skel/config/core.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/config/database.php.default b/cake/console/libs/templates/skel/config/database.php.default index c30e368ae..fb731bce5 100644 --- a/cake/console/libs/templates/skel/config/database.php.default +++ b/cake/console/libs/templates/skel/config/database.php.default @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/config/inflections.php b/cake/console/libs/templates/skel/config/inflections.php index fe45e4d2f..0baa65a26 100644 --- a/cake/console/libs/templates/skel/config/inflections.php +++ b/cake/console/libs/templates/skel/config/inflections.php @@ -8,7 +8,7 @@ * * PHP versions 4 and % * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/config/routes.php b/cake/console/libs/templates/skel/config/routes.php index 32094aa62..2858312c4 100644 --- a/cake/console/libs/templates/skel/config/routes.php +++ b/cake/console/libs/templates/skel/config/routes.php @@ -9,7 +9,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/config/sql/db_acl.php b/cake/console/libs/templates/skel/config/sql/db_acl.php index 72530d65c..0c874eb4d 100644 --- a/cake/console/libs/templates/skel/config/sql/db_acl.php +++ b/cake/console/libs/templates/skel/config/sql/db_acl.php @@ -8,7 +8,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/config/sql/i18n.php b/cake/console/libs/templates/skel/config/sql/i18n.php index ac0e7f5a9..ec37040b1 100644 --- a/cake/console/libs/templates/skel/config/sql/i18n.php +++ b/cake/console/libs/templates/skel/config/sql/i18n.php @@ -8,7 +8,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/config/sql/sessions.php b/cake/console/libs/templates/skel/config/sql/sessions.php index 8880e49b5..068a8f106 100644 --- a/cake/console/libs/templates/skel/config/sql/sessions.php +++ b/cake/console/libs/templates/skel/config/sql/sessions.php @@ -8,7 +8,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/controllers/pages_controller.php b/cake/console/libs/templates/skel/controllers/pages_controller.php index 4001408c0..23a172264 100644 --- a/cake/console/libs/templates/skel/controllers/pages_controller.php +++ b/cake/console/libs/templates/skel/controllers/pages_controller.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/index.php b/cake/console/libs/templates/skel/index.php index a8cca5d89..bb7acbc0e 100644 --- a/cake/console/libs/templates/skel/index.php +++ b/cake/console/libs/templates/skel/index.php @@ -3,7 +3,7 @@ /** * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/views/elements/email/html/default.ctp b/cake/console/libs/templates/skel/views/elements/email/html/default.ctp index b7c906233..0727c586e 100644 --- a/cake/console/libs/templates/skel/views/elements/email/html/default.ctp +++ b/cake/console/libs/templates/skel/views/elements/email/html/default.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/views/elements/email/text/default.ctp b/cake/console/libs/templates/skel/views/elements/email/text/default.ctp index d3f885b5c..f4dbc133d 100644 --- a/cake/console/libs/templates/skel/views/elements/email/text/default.ctp +++ b/cake/console/libs/templates/skel/views/elements/email/text/default.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/views/layouts/ajax.ctp b/cake/console/libs/templates/skel/views/layouts/ajax.ctp index a3440dd2c..94d922b5f 100644 --- a/cake/console/libs/templates/skel/views/layouts/ajax.ctp +++ b/cake/console/libs/templates/skel/views/layouts/ajax.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/views/layouts/default.ctp b/cake/console/libs/templates/skel/views/layouts/default.ctp index f9b1423ab..5096fcff0 100644 --- a/cake/console/libs/templates/skel/views/layouts/default.ctp +++ b/cake/console/libs/templates/skel/views/layouts/default.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/views/layouts/email/html/default.ctp b/cake/console/libs/templates/skel/views/layouts/email/html/default.ctp index dbf7916be..e68167aea 100644 --- a/cake/console/libs/templates/skel/views/layouts/email/html/default.ctp +++ b/cake/console/libs/templates/skel/views/layouts/email/html/default.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/views/layouts/email/text/default.ctp b/cake/console/libs/templates/skel/views/layouts/email/text/default.ctp index aeef64f2b..262938d63 100644 --- a/cake/console/libs/templates/skel/views/layouts/email/text/default.ctp +++ b/cake/console/libs/templates/skel/views/layouts/email/text/default.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/views/layouts/flash.ctp b/cake/console/libs/templates/skel/views/layouts/flash.ctp index 9ec3209f4..f96285cee 100644 --- a/cake/console/libs/templates/skel/views/layouts/flash.ctp +++ b/cake/console/libs/templates/skel/views/layouts/flash.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/webroot/css.php b/cake/console/libs/templates/skel/webroot/css.php index b95cb8a36..86c16392d 100644 --- a/cake/console/libs/templates/skel/webroot/css.php +++ b/cake/console/libs/templates/skel/webroot/css.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/webroot/css/cake.generic.css b/cake/console/libs/templates/skel/webroot/css/cake.generic.css index 6769c99ca..21bbdcdd0 100644 --- a/cake/console/libs/templates/skel/webroot/css/cake.generic.css +++ b/cake/console/libs/templates/skel/webroot/css/cake.generic.css @@ -3,7 +3,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/webroot/index.php b/cake/console/libs/templates/skel/webroot/index.php index 798b026f5..59027fa96 100644 --- a/cake/console/libs/templates/skel/webroot/index.php +++ b/cake/console/libs/templates/skel/webroot/index.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/skel/webroot/js/vendors.php b/cake/console/libs/templates/skel/webroot/js/vendors.php index d9d38f690..0e4890eb1 100644 --- a/cake/console/libs/templates/skel/webroot/js/vendors.php +++ b/cake/console/libs/templates/skel/webroot/js/vendors.php @@ -8,7 +8,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/views/form.ctp b/cake/console/libs/templates/views/form.ctp index 91c9f77db..7094fbb65 100644 --- a/cake/console/libs/templates/views/form.ctp +++ b/cake/console/libs/templates/views/form.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/views/index.ctp b/cake/console/libs/templates/views/index.ctp index 13de4923b..0cc11cb63 100644 --- a/cake/console/libs/templates/views/index.ctp +++ b/cake/console/libs/templates/views/index.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/console/libs/templates/views/view.ctp b/cake/console/libs/templates/views/view.ctp index 362d57c89..657627081 100644 --- a/cake/console/libs/templates/views/view.ctp +++ b/cake/console/libs/templates/views/view.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 69eb962f5..a073b870a 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -8,7 +8,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/cache.php b/cake/libs/cache.php index bc93aa9a2..e707137ae 100644 --- a/cake/libs/cache.php +++ b/cake/libs/cache.php @@ -6,7 +6,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/cache/apc.php b/cake/libs/cache/apc.php index ecf8f746c..84871e674 100644 --- a/cake/libs/cache/apc.php +++ b/cake/libs/cache/apc.php @@ -6,7 +6,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/cache/file.php b/cake/libs/cache/file.php index c98ccc6d3..b4c0403f2 100644 --- a/cake/libs/cache/file.php +++ b/cake/libs/cache/file.php @@ -6,7 +6,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/cache/memcache.php b/cake/libs/cache/memcache.php index fb293176d..f2b48956c 100644 --- a/cake/libs/cache/memcache.php +++ b/cake/libs/cache/memcache.php @@ -6,7 +6,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/cache/xcache.php b/cake/libs/cache/xcache.php index f25dbdd2c..6c8643b9b 100644 --- a/cake/libs/cache/xcache.php +++ b/cake/libs/cache/xcache.php @@ -6,7 +6,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/cake_log.php b/cake/libs/cake_log.php index b0b6404b3..879aaf830 100644 --- a/cake/libs/cake_log.php +++ b/cake/libs/cake_log.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/class_registry.php b/cake/libs/class_registry.php index a825e800e..cbfe447b0 100644 --- a/cake/libs/class_registry.php +++ b/cake/libs/class_registry.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 4d0ed0a2f..b9b9a3ffe 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/controller/app_controller.php b/cake/libs/controller/app_controller.php index 57d35bada..8ca9bc12c 100644 --- a/cake/libs/controller/app_controller.php +++ b/cake/libs/controller/app_controller.php @@ -8,7 +8,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php index 3e740003c..bf5fab8d7 100644 --- a/cake/libs/controller/component.php +++ b/cake/libs/controller/component.php @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/controller/components/acl.php b/cake/libs/controller/components/acl.php index 2d53b3283..711b03f1a 100644 --- a/cake/libs/controller/components/acl.php +++ b/cake/libs/controller/components/acl.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index ec1a03051..801385ca7 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -8,7 +8,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/controller/components/cookie.php b/cake/libs/controller/components/cookie.php index 04ac59918..79210b6a0 100644 --- a/cake/libs/controller/components/cookie.php +++ b/cake/libs/controller/components/cookie.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index 61f6e2ed1..61e49b72c 100644 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php index 25342941b..c5bc6184e 100644 --- a/cake/libs/controller/components/request_handler.php +++ b/cake/libs/controller/components/request_handler.php @@ -7,7 +7,7 @@ * and the like. These units have no use for Ajax requests, and this Component can tell how Cake * should respond to the different needs of a handheld computer and a desktop machine. * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/controller/components/security.php b/cake/libs/controller/components/security.php index 306080d41..f702c194a 100644 --- a/cake/libs/controller/components/security.php +++ b/cake/libs/controller/components/security.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/controller/components/session.php b/cake/libs/controller/components/session.php index 483ddba31..5300ab6f4 100644 --- a/cake/libs/controller/components/session.php +++ b/cake/libs/controller/components/session.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 2f12be5d2..16524a986 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/controller/pages_controller.php b/cake/libs/controller/pages_controller.php index 4001408c0..23a172264 100644 --- a/cake/libs/controller/pages_controller.php +++ b/cake/libs/controller/pages_controller.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/controller/scaffold.php b/cake/libs/controller/scaffold.php index d885e8a2e..fb2b55d11 100644 --- a/cake/libs/controller/scaffold.php +++ b/cake/libs/controller/scaffold.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index a4cd47a7b..5ff17dc9b 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/error.php b/cake/libs/error.php index e3c0a3d14..8f33ff37b 100644 --- a/cake/libs/error.php +++ b/cake/libs/error.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/file.php b/cake/libs/file.php index fba1f3aa3..334c0da14 100644 --- a/cake/libs/file.php +++ b/cake/libs/file.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/flay.php b/cake/libs/flay.php index 1a81930af..1df0a2aba 100644 --- a/cake/libs/flay.php +++ b/cake/libs/flay.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/folder.php b/cake/libs/folder.php index bd0ef42cf..05dd150b2 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/http_socket.php b/cake/libs/http_socket.php index ccd5aa037..3539afc68 100644 --- a/cake/libs/http_socket.php +++ b/cake/libs/http_socket.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index 8fdb30b15..34f6094c9 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index 9ce5714d4..4012b1a8d 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/l10n.php b/cake/libs/l10n.php index 13a2e9a6b..db82c59da 100644 --- a/cake/libs/l10n.php +++ b/cake/libs/l10n.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/magic_db.php b/cake/libs/magic_db.php index a5784441a..9e6a66850 100644 --- a/cake/libs/magic_db.php +++ b/cake/libs/magic_db.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/model/app_model.php b/cake/libs/model/app_model.php index e09b1f970..becea6f5a 100644 --- a/cake/libs/model/app_model.php +++ b/cake/libs/model/app_model.php @@ -8,7 +8,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/model/behavior.php b/cake/libs/model/behavior.php index d91bf0eb3..b9633ae59 100644 --- a/cake/libs/model/behavior.php +++ b/cake/libs/model/behavior.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/model/behaviors/acl.php b/cake/libs/model/behaviors/acl.php index e2c7038c0..86ba27445 100644 --- a/cake/libs/model/behaviors/acl.php +++ b/cake/libs/model/behaviors/acl.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * CakePHP : Rapid Development Framework (http://cakephp.org) * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/libs/model/behaviors/containable.php b/cake/libs/model/behaviors/containable.php index 221cb8f1e..7aa02f55e 100644 --- a/cake/libs/model/behaviors/containable.php +++ b/cake/libs/model/behaviors/containable.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/model/behaviors/translate.php b/cake/libs/model/behaviors/translate.php index bba76be4d..81c7ac4a9 100644 --- a/cake/libs/model/behaviors/translate.php +++ b/cake/libs/model/behaviors/translate.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/model/behaviors/tree.php b/cake/libs/model/behaviors/tree.php index ab1d2ff9c..aaca0994f 100644 --- a/cake/libs/model/behaviors/tree.php +++ b/cake/libs/model/behaviors/tree.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * CakePHP : Rapid Development Framework (http://cakephp.org) * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/libs/model/connection_manager.php b/cake/libs/model/connection_manager.php index 581cd3b2d..ce9347439 100644 --- a/cake/libs/model/connection_manager.php +++ b/cake/libs/model/connection_manager.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/model/datasources/datasource.php b/cake/libs/model/datasources/datasource.php index e57fbfcd6..bc69839ae 100644 --- a/cake/libs/model/datasources/datasource.php +++ b/cake/libs/model/datasources/datasource.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/model/datasources/dbo/dbo_adodb.php b/cake/libs/model/datasources/dbo/dbo_adodb.php index e089e1f10..1619f0ac9 100644 --- a/cake/libs/model/datasources/dbo/dbo_adodb.php +++ b/cake/libs/model/datasources/dbo/dbo_adodb.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/model/datasources/dbo/dbo_db2.php b/cake/libs/model/datasources/dbo/dbo_db2.php index 0a5600bca..030d4fdd3 100644 --- a/cake/libs/model/datasources/dbo/dbo_db2.php +++ b/cake/libs/model/datasources/dbo/dbo_db2.php @@ -9,7 +9,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2007, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/libs/model/datasources/dbo/dbo_firebird.php b/cake/libs/model/datasources/dbo/dbo_firebird.php index 06454fef6..5c6e5bd54 100644 --- a/cake/libs/model/datasources/dbo/dbo_firebird.php +++ b/cake/libs/model/datasources/dbo/dbo_firebird.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/model/datasources/dbo/dbo_mssql.php b/cake/libs/model/datasources/dbo/dbo_mssql.php index dadf67660..9b2912bfd 100644 --- a/cake/libs/model/datasources/dbo/dbo_mssql.php +++ b/cake/libs/model/datasources/dbo/dbo_mssql.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/model/datasources/dbo/dbo_mysql.php b/cake/libs/model/datasources/dbo/dbo_mysql.php index 190d96aa1..f888a7a8c 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysql.php +++ b/cake/libs/model/datasources/dbo/dbo_mysql.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/model/datasources/dbo/dbo_mysqli.php b/cake/libs/model/datasources/dbo/dbo_mysqli.php index d7e991476..174977e5c 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysqli.php +++ b/cake/libs/model/datasources/dbo/dbo_mysqli.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/model/datasources/dbo/dbo_odbc.php b/cake/libs/model/datasources/dbo/dbo_odbc.php index d35f5e7a8..89d872e6f 100644 --- a/cake/libs/model/datasources/dbo/dbo_odbc.php +++ b/cake/libs/model/datasources/dbo/dbo_odbc.php @@ -8,7 +8,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/model/datasources/dbo/dbo_oracle.php b/cake/libs/model/datasources/dbo/dbo_oracle.php index db6a1586c..f222bdf23 100644 --- a/cake/libs/model/datasources/dbo/dbo_oracle.php +++ b/cake/libs/model/datasources/dbo/dbo_oracle.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index 959a23826..ede59a231 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -8,7 +8,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/model/datasources/dbo/dbo_sqlite.php b/cake/libs/model/datasources/dbo/dbo_sqlite.php index 3b13e7980..4e106da9b 100644 --- a/cake/libs/model/datasources/dbo/dbo_sqlite.php +++ b/cake/libs/model/datasources/dbo/dbo_sqlite.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/model/datasources/dbo/dbo_sybase.php b/cake/libs/model/datasources/dbo/dbo_sybase.php index 21c87b62b..23cde4993 100644 --- a/cake/libs/model/datasources/dbo/dbo_sybase.php +++ b/cake/libs/model/datasources/dbo/dbo_sybase.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 94c060cc7..5fd829efb 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/model/db_acl.php b/cake/libs/model/db_acl.php index 49b3d04fb..fddbc60c8 100644 --- a/cake/libs/model/db_acl.php +++ b/cake/libs/model/db_acl.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 158ee86ea..d3d2696d0 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -7,7 +7,7 @@ * * PHP versions 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/model/schema.php b/cake/libs/model/schema.php index 7457968af..30c1a37da 100644 --- a/cake/libs/model/schema.php +++ b/cake/libs/model/schema.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/multibyte.php b/cake/libs/multibyte.php index 069136ccc..f77617dbf 100644 --- a/cake/libs/multibyte.php +++ b/cake/libs/multibyte.php @@ -6,7 +6,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/object.php b/cake/libs/object.php index 0b83127e6..e6790d817 100644 --- a/cake/libs/object.php +++ b/cake/libs/object.php @@ -8,7 +8,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/overloadable.php b/cake/libs/overloadable.php index 2714ae81c..6962f6ebd 100644 --- a/cake/libs/overloadable.php +++ b/cake/libs/overloadable.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/overloadable_php4.php b/cake/libs/overloadable_php4.php index e4977bc16..b61a5f3fa 100644 --- a/cake/libs/overloadable_php4.php +++ b/cake/libs/overloadable_php4.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/overloadable_php5.php b/cake/libs/overloadable_php5.php index 27aadff1a..471d32c95 100644 --- a/cake/libs/overloadable_php5.php +++ b/cake/libs/overloadable_php5.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/router.php b/cake/libs/router.php index c3fca15ce..51d452cec 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/sanitize.php b/cake/libs/sanitize.php index 45a8b5689..c36d39853 100644 --- a/cake/libs/sanitize.php +++ b/cake/libs/sanitize.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/security.php b/cake/libs/security.php index 4dba07c55..bcd68ad30 100644 --- a/cake/libs/security.php +++ b/cake/libs/security.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/session.php b/cake/libs/session.php index b3ba09e7a..8dbbdb78a 100644 --- a/cake/libs/session.php +++ b/cake/libs/session.php @@ -10,7 +10,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/set.php b/cake/libs/set.php index f6b13a9b4..fc921b26a 100644 --- a/cake/libs/set.php +++ b/cake/libs/set.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/socket.php b/cake/libs/socket.php index 1ec8bf4b3..bbdd29e2f 100644 --- a/cake/libs/socket.php +++ b/cake/libs/socket.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/string.php b/cake/libs/string.php index 9717896ae..978f3163e 100644 --- a/cake/libs/string.php +++ b/cake/libs/string.php @@ -6,7 +6,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/validation.php b/cake/libs/validation.php index fbe6bdf46..6638f6973 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/elements/dump.ctp b/cake/libs/view/elements/dump.ctp index 622a531d0..a9205d3c0 100644 --- a/cake/libs/view/elements/dump.ctp +++ b/cake/libs/view/elements/dump.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/elements/email/html/default.ctp b/cake/libs/view/elements/email/html/default.ctp index b7c906233..0727c586e 100644 --- a/cake/libs/view/elements/email/html/default.ctp +++ b/cake/libs/view/elements/email/html/default.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/elements/email/text/default.ctp b/cake/libs/view/elements/email/text/default.ctp index d3f885b5c..f4dbc133d 100644 --- a/cake/libs/view/elements/email/text/default.ctp +++ b/cake/libs/view/elements/email/text/default.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/errors/error404.ctp b/cake/libs/view/errors/error404.ctp index b1bc0686d..e5863dd5b 100644 --- a/cake/libs/view/errors/error404.ctp +++ b/cake/libs/view/errors/error404.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/errors/missing_action.ctp b/cake/libs/view/errors/missing_action.ctp index 1e9cc196d..0832f9f44 100644 --- a/cake/libs/view/errors/missing_action.ctp +++ b/cake/libs/view/errors/missing_action.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/errors/missing_component_class.ctp b/cake/libs/view/errors/missing_component_class.ctp index ce8ff52bb..d873a3079 100644 --- a/cake/libs/view/errors/missing_component_class.ctp +++ b/cake/libs/view/errors/missing_component_class.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/errors/missing_component_file.ctp b/cake/libs/view/errors/missing_component_file.ctp index 83520da99..af4daeeb1 100644 --- a/cake/libs/view/errors/missing_component_file.ctp +++ b/cake/libs/view/errors/missing_component_file.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/errors/missing_connection.ctp b/cake/libs/view/errors/missing_connection.ctp index 754c2a3d5..2ee6a04ad 100644 --- a/cake/libs/view/errors/missing_connection.ctp +++ b/cake/libs/view/errors/missing_connection.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/errors/missing_controller.ctp b/cake/libs/view/errors/missing_controller.ctp index f50b8d6e8..ad4776700 100644 --- a/cake/libs/view/errors/missing_controller.ctp +++ b/cake/libs/view/errors/missing_controller.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/errors/missing_helper_class.ctp b/cake/libs/view/errors/missing_helper_class.ctp index ac7877682..252097db7 100644 --- a/cake/libs/view/errors/missing_helper_class.ctp +++ b/cake/libs/view/errors/missing_helper_class.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/errors/missing_helper_file.ctp b/cake/libs/view/errors/missing_helper_file.ctp index d5a72f9b8..472abf002 100644 --- a/cake/libs/view/errors/missing_helper_file.ctp +++ b/cake/libs/view/errors/missing_helper_file.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/errors/missing_layout.ctp b/cake/libs/view/errors/missing_layout.ctp index febe11d33..5fcb4bb34 100644 --- a/cake/libs/view/errors/missing_layout.ctp +++ b/cake/libs/view/errors/missing_layout.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/errors/missing_model.ctp b/cake/libs/view/errors/missing_model.ctp index e7e45c484..fa4161d00 100644 --- a/cake/libs/view/errors/missing_model.ctp +++ b/cake/libs/view/errors/missing_model.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/errors/missing_scaffolddb.ctp b/cake/libs/view/errors/missing_scaffolddb.ctp index f6355a850..23545fb37 100644 --- a/cake/libs/view/errors/missing_scaffolddb.ctp +++ b/cake/libs/view/errors/missing_scaffolddb.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/errors/missing_table.ctp b/cake/libs/view/errors/missing_table.ctp index a1775a4e5..a31b9254e 100644 --- a/cake/libs/view/errors/missing_table.ctp +++ b/cake/libs/view/errors/missing_table.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/errors/missing_view.ctp b/cake/libs/view/errors/missing_view.ctp index 503179f96..3d001c665 100644 --- a/cake/libs/view/errors/missing_view.ctp +++ b/cake/libs/view/errors/missing_view.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/errors/private_action.ctp b/cake/libs/view/errors/private_action.ctp index 23beb5052..27ff6c9c1 100644 --- a/cake/libs/view/errors/private_action.ctp +++ b/cake/libs/view/errors/private_action.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/errors/scaffold_error.ctp b/cake/libs/view/errors/scaffold_error.ctp index 48b8db4db..fff6870d7 100644 --- a/cake/libs/view/errors/scaffold_error.ctp +++ b/cake/libs/view/errors/scaffold_error.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index 2cd51639c..4b69c3318 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/helpers/ajax.php b/cake/libs/view/helpers/ajax.php index 600c93327..c393e3fb5 100644 --- a/cake/libs/view/helpers/ajax.php +++ b/cake/libs/view/helpers/ajax.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/helpers/app_helper.php b/cake/libs/view/helpers/app_helper.php index b5c962f8f..0fa824c1d 100644 --- a/cake/libs/view/helpers/app_helper.php +++ b/cake/libs/view/helpers/app_helper.php @@ -8,7 +8,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/helpers/cache.php b/cake/libs/view/helpers/cache.php index f3043ba2a..045a22e74 100644 --- a/cake/libs/view/helpers/cache.php +++ b/cake/libs/view/helpers/cache.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index fc90a5a6c..bec46c6b9 100644 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php index 446188650..de68c6861 100644 --- a/cake/libs/view/helpers/html.php +++ b/cake/libs/view/helpers/html.php @@ -5,7 +5,7 @@ * * Simplifies the construction of HTML elements. * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/helpers/javascript.php b/cake/libs/view/helpers/javascript.php index aacfd4e0e..3e07ef9bd 100644 --- a/cake/libs/view/helpers/javascript.php +++ b/cake/libs/view/helpers/javascript.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 8cc82c9fa..fcf10cce8 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * CakePHP : Rapid Development Framework (http://cakephp.org) * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/libs/view/helpers/number.php b/cake/libs/view/helpers/number.php index 69b7e1130..55fdf3c1f 100644 --- a/cake/libs/view/helpers/number.php +++ b/cake/libs/view/helpers/number.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index d00477853..87eaf227c 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -5,7 +5,7 @@ * * Generates pagination links * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/helpers/rss.php b/cake/libs/view/helpers/rss.php index 5ab558308..3a7855a71 100644 --- a/cake/libs/view/helpers/rss.php +++ b/cake/libs/view/helpers/rss.php @@ -5,7 +5,7 @@ * * Simplifies the output of RSS feeds. * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/helpers/session.php b/cake/libs/view/helpers/session.php index d8303fb7b..cec43c1fe 100644 --- a/cake/libs/view/helpers/session.php +++ b/cake/libs/view/helpers/session.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/helpers/text.php b/cake/libs/view/helpers/text.php index 546b0e632..680d931e6 100644 --- a/cake/libs/view/helpers/text.php +++ b/cake/libs/view/helpers/text.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/helpers/time.php b/cake/libs/view/helpers/time.php index 637514cb2..1181f9e6c 100644 --- a/cake/libs/view/helpers/time.php +++ b/cake/libs/view/helpers/time.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/helpers/xml.php b/cake/libs/view/helpers/xml.php index aeec5ab36..df7033bd1 100644 --- a/cake/libs/view/helpers/xml.php +++ b/cake/libs/view/helpers/xml.php @@ -5,7 +5,7 @@ * * Simplifies the output of XML documents. * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/layouts/ajax.ctp b/cake/libs/view/layouts/ajax.ctp index a3440dd2c..94d922b5f 100644 --- a/cake/libs/view/layouts/ajax.ctp +++ b/cake/libs/view/layouts/ajax.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/layouts/default.ctp b/cake/libs/view/layouts/default.ctp index 79efc313a..b3c4852d1 100644 --- a/cake/libs/view/layouts/default.ctp +++ b/cake/libs/view/layouts/default.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/layouts/email/html/default.ctp b/cake/libs/view/layouts/email/html/default.ctp index fdac9bd00..b37812ffc 100644 --- a/cake/libs/view/layouts/email/html/default.ctp +++ b/cake/libs/view/layouts/email/html/default.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/layouts/email/text/default.ctp b/cake/libs/view/layouts/email/text/default.ctp index 8131e4710..c518b4211 100644 --- a/cake/libs/view/layouts/email/text/default.ctp +++ b/cake/libs/view/layouts/email/text/default.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/layouts/flash.ctp b/cake/libs/view/layouts/flash.ctp index c48aaf62e..9c0b8aa47 100644 --- a/cake/libs/view/layouts/flash.ctp +++ b/cake/libs/view/layouts/flash.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/media.php b/cake/libs/view/media.php index 2ec12d66b..71c4e43a2 100644 --- a/cake/libs/view/media.php +++ b/cake/libs/view/media.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/pages/home.ctp b/cake/libs/view/pages/home.ctp index d63519b95..8c99ccbf7 100644 --- a/cake/libs/view/pages/home.ctp +++ b/cake/libs/view/pages/home.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/scaffolds/edit.ctp b/cake/libs/view/scaffolds/edit.ctp index 215a77aed..40dbfe0fe 100644 --- a/cake/libs/view/scaffolds/edit.ctp +++ b/cake/libs/view/scaffolds/edit.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/scaffolds/index.ctp b/cake/libs/view/scaffolds/index.ctp index 79039c02d..f45f8ad9f 100644 --- a/cake/libs/view/scaffolds/index.ctp +++ b/cake/libs/view/scaffolds/index.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/scaffolds/view.ctp b/cake/libs/view/scaffolds/view.ctp index 11ff93796..77d06737d 100644 --- a/cake/libs/view/scaffolds/view.ctp +++ b/cake/libs/view/scaffolds/view.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/theme.php b/cake/libs/view/theme.php index 0c318e643..0f4b33971 100644 --- a/cake/libs/view/theme.php +++ b/cake/libs/view/theme.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index ca2319a0b..5fb2f605f 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/libs/xml.php b/cake/libs/xml.php index 81acb6921..ba37d5d96 100644 --- a/cake/libs/xml.php +++ b/cake/libs/xml.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/cases/console/libs/acl.test.php b/cake/tests/cases/console/libs/acl.test.php index 145d7b70e..808b163a5 100644 --- a/cake/tests/cases/console/libs/acl.test.php +++ b/cake/tests/cases/console/libs/acl.test.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * CakePHP : Rapid Development Framework (http://cakephp.org) * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/tests/cases/console/libs/api.test.php b/cake/tests/cases/console/libs/api.test.php index 29f84eafe..93f8ddda6 100644 --- a/cake/tests/cases/console/libs/api.test.php +++ b/cake/tests/cases/console/libs/api.test.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * CakePHP : Rapid Development Framework (http://cakephp.org) * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/tests/cases/console/libs/schema.test.php b/cake/tests/cases/console/libs/schema.test.php index 57c850590..9e3eda076 100644 --- a/cake/tests/cases/console/libs/schema.test.php +++ b/cake/tests/cases/console/libs/schema.test.php @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * CakePHP : Rapid Development Framework (http://cakephp.org) * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/tests/cases/console/libs/shell.test.php b/cake/tests/cases/console/libs/shell.test.php index 5117da879..418c31afa 100644 --- a/cake/tests/cases/console/libs/shell.test.php +++ b/cake/tests/cases/console/libs/shell.test.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * CakePHP : Rapid Development Framework (http://cakephp.org) * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/tests/cases/console/libs/tasks/extract.test.php b/cake/tests/cases/console/libs/tasks/extract.test.php index 51c50d89b..354292f00 100644 --- a/cake/tests/cases/console/libs/tasks/extract.test.php +++ b/cake/tests/cases/console/libs/tasks/extract.test.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * CakePHP : Rapid Development Framework (http://cakephp.org) * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index e47d35bf0..a7d89b1ba 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * CakePHP : Rapid Development Framework (http://cakephp.org) * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index a07f26989..598d10ed3 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * CakePHP : Rapid Development Framework (http://cakephp.org) * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/tests/cases/libs/cake_test_case.test.php b/cake/tests/cases/libs/cake_test_case.test.php index 7b0a486b8..ae2719959 100644 --- a/cake/tests/cases/libs/cake_test_case.test.php +++ b/cake/tests/cases/libs/cake_test_case.test.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * CakePHP : Rapid Development Framework (http://cakephp.org) * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/tests/cases/libs/magic_db.test.php b/cake/tests/cases/libs/magic_db.test.php index 1ef07f6b9..e040e6041 100644 --- a/cake/tests/cases/libs/magic_db.test.php +++ b/cake/tests/cases/libs/magic_db.test.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/cases/libs/model/behavior.test.php b/cake/tests/cases/libs/model/behavior.test.php index 93516ab86..10ddad8d9 100644 --- a/cake/tests/cases/libs/model/behavior.test.php +++ b/cake/tests/cases/libs/model/behavior.test.php @@ -7,12 +7,12 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * @copyright CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * @link http://www.cakephp.org * @package cake * @subpackage cake.tests.cases.libs.model diff --git a/cake/tests/cases/libs/model/behaviors/acl.test.php b/cake/tests/cases/libs/model/behaviors/acl.test.php index c43d52c25..d1a468a6b 100644 --- a/cake/tests/cases/libs/model/behaviors/acl.test.php +++ b/cake/tests/cases/libs/model/behaviors/acl.test.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * CakePHP : Rapid Development Framework (http://cakephp.org) * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_adodb.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_adodb.test.php index 5188f24fd..76d71396e 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_adodb.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_adodb.test.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php index 286569656..7ea712a42 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php index f3dccc199..1da1ba3fd 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php index f3de27127..ce14552a4 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php index 40063ddf8..e1298054a 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php index 03ebfd919..e7d2de630 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php index 3cf4cbf1a..ca795e16e 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php @@ -5,7 +5,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/fixtures/ad_fixture.php b/cake/tests/fixtures/ad_fixture.php index 17c873b34..c5ee0257e 100644 --- a/cake/tests/fixtures/ad_fixture.php +++ b/cake/tests/fixtures/ad_fixture.php @@ -7,12 +7,12 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * @copyright CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * @link http://www.cakephp.org * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/after_tree_fixture.php b/cake/tests/fixtures/after_tree_fixture.php index 45e2d0948..1b2fa5dc6 100644 --- a/cake/tests/fixtures/after_tree_fixture.php +++ b/cake/tests/fixtures/after_tree_fixture.php @@ -7,12 +7,12 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * @copyright CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * @link http://www.cakephp.org * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/campaign_fixture.php b/cake/tests/fixtures/campaign_fixture.php index cdb2a1aa0..511ecb107 100644 --- a/cake/tests/fixtures/campaign_fixture.php +++ b/cake/tests/fixtures/campaign_fixture.php @@ -7,12 +7,12 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @copyright CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * @copyright CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * @link http://www.cakephp.org * @package cake * @subpackage cake.tests.fixtures diff --git a/cake/tests/fixtures/datatype_fixture.php b/cake/tests/fixtures/datatype_fixture.php index 6414f2d2c..fc2071063 100644 --- a/cake/tests/fixtures/datatype_fixture.php +++ b/cake/tests/fixtures/datatype_fixture.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/fixtures/dependency_fixture.php b/cake/tests/fixtures/dependency_fixture.php index e9574b83f..7ee654b32 100644 --- a/cake/tests/fixtures/dependency_fixture.php +++ b/cake/tests/fixtures/dependency_fixture.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/fixtures/node_fixture.php b/cake/tests/fixtures/node_fixture.php index 6329abc52..aeb176ae9 100644 --- a/cake/tests/fixtures/node_fixture.php +++ b/cake/tests/fixtures/node_fixture.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/test_app/config/acl.ini.php b/cake/tests/test_app/config/acl.ini.php index d5e1b3394..1b27291e6 100644 --- a/cake/tests/test_app/config/acl.ini.php +++ b/cake/tests/test_app/config/acl.ini.php @@ -6,7 +6,7 @@ ; * ; * PHP versions 4 and 5 ; * -; * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) +; * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) ; * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) ; * ; * Licensed under The MIT License diff --git a/cake/tests/test_app/models/behaviors/persister_one_behavior.php b/cake/tests/test_app/models/behaviors/persister_one_behavior.php index 703432b7e..b7ee6189c 100644 --- a/cake/tests/test_app/models/behaviors/persister_one_behavior.php +++ b/cake/tests/test_app/models/behaviors/persister_one_behavior.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/test_app/models/behaviors/persister_two_behavior.php b/cake/tests/test_app/models/behaviors/persister_two_behavior.php index 798913c1d..c083614d3 100644 --- a/cake/tests/test_app/models/behaviors/persister_two_behavior.php +++ b/cake/tests/test_app/models/behaviors/persister_two_behavior.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/test_app/models/comment.php b/cake/tests/test_app/models/comment.php index 497a422da..166e67380 100644 --- a/cake/tests/test_app/models/comment.php +++ b/cake/tests/test_app/models/comment.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * CakePHP : Rapid Development Framework (http://cakephp.org) * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/tests/test_app/models/persister_one.php b/cake/tests/test_app/models/persister_one.php index f3048e4b7..3e4a8ca5f 100644 --- a/cake/tests/test_app/models/persister_one.php +++ b/cake/tests/test_app/models/persister_one.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * CakePHP : Rapid Development Framework (http://cakephp.org) * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/tests/test_app/models/persister_two.php b/cake/tests/test_app/models/persister_two.php index 5f8b56263..69b4bf8d6 100644 --- a/cake/tests/test_app/models/persister_two.php +++ b/cake/tests/test_app/models/persister_two.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * CakePHP : Rapid Development Framework (http://cakephp.org) * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/tests/test_app/models/post.php b/cake/tests/test_app/models/post.php index 6ab391e99..65eef04d3 100644 --- a/cake/tests/test_app/models/post.php +++ b/cake/tests/test_app/models/post.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * CakePHP : Rapid Development Framework (http://cakephp.org) * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php b/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php index 0eb5802bc..adfda0ab0 100644 --- a/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php +++ b/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_one.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php b/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php index 860d8288c..dff3d6b1f 100644 --- a/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php +++ b/cake/tests/test_app/plugins/test_plugin/models/behaviors/test_plugin_persister_two.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php index ed148e8ef..f447c3735 100644 --- a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php +++ b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * CakePHP : Rapid Development Framework (http://cakephp.org) * Copyright 2006-2008, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php index d62fa565c..5330ba97c 100644 --- a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php +++ b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * CakePHP : Rapid Development Framework (http://cakephp.org) * Copyright 2006-2008, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php index d575d709c..33b4ab186 100644 --- a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php +++ b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php @@ -7,7 +7,7 @@ * * PHP versions 4 and 5 * - * CakePHP : Rapid Development Framework (http://www.cakephp.org) + * CakePHP : Rapid Development Framework (http://cakephp.org) * Copyright 2006-2010, Cake Software Foundation, Inc. * * Licensed under The MIT License diff --git a/cake/tests/test_app/views/elements/email/html/default.ctp b/cake/tests/test_app/views/elements/email/html/default.ctp index a70d09778..c12b78061 100644 --- a/cake/tests/test_app/views/elements/email/html/default.ctp +++ b/cake/tests/test_app/views/elements/email/html/default.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/test_app/views/elements/email/text/default.ctp b/cake/tests/test_app/views/elements/email/text/default.ctp index d3f885b5c..f4dbc133d 100644 --- a/cake/tests/test_app/views/elements/email/text/default.ctp +++ b/cake/tests/test_app/views/elements/email/text/default.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/test_app/views/elements/email/text/wide.ctp b/cake/tests/test_app/views/elements/email/text/wide.ctp index 312ee2e21..3483ef7df 100644 --- a/cake/tests/test_app/views/elements/email/text/wide.ctp +++ b/cake/tests/test_app/views/elements/email/text/wide.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/test_app/views/layouts/ajax.ctp b/cake/tests/test_app/views/layouts/ajax.ctp index a3440dd2c..94d922b5f 100644 --- a/cake/tests/test_app/views/layouts/ajax.ctp +++ b/cake/tests/test_app/views/layouts/ajax.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/test_app/views/layouts/ajax2.ctp b/cake/tests/test_app/views/layouts/ajax2.ctp index 779707cdf..11384e044 100644 --- a/cake/tests/test_app/views/layouts/ajax2.ctp +++ b/cake/tests/test_app/views/layouts/ajax2.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/test_app/views/layouts/cache_layout.ctp b/cake/tests/test_app/views/layouts/cache_layout.ctp index 901b875b6..41d7918fd 100644 --- a/cake/tests/test_app/views/layouts/cache_layout.ctp +++ b/cake/tests/test_app/views/layouts/cache_layout.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/test_app/views/layouts/default.ctp b/cake/tests/test_app/views/layouts/default.ctp index d47a8533b..e824126d5 100644 --- a/cake/tests/test_app/views/layouts/default.ctp +++ b/cake/tests/test_app/views/layouts/default.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/test_app/views/layouts/email/html/default.ctp b/cake/tests/test_app/views/layouts/email/html/default.ctp index dbf7916be..e68167aea 100644 --- a/cake/tests/test_app/views/layouts/email/html/default.ctp +++ b/cake/tests/test_app/views/layouts/email/html/default.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/test_app/views/layouts/email/html/thin.ctp b/cake/tests/test_app/views/layouts/email/html/thin.ctp index 33e905a65..3da2c728b 100644 --- a/cake/tests/test_app/views/layouts/email/html/thin.ctp +++ b/cake/tests/test_app/views/layouts/email/html/thin.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/test_app/views/layouts/email/text/default.ctp b/cake/tests/test_app/views/layouts/email/text/default.ctp index aeef64f2b..262938d63 100644 --- a/cake/tests/test_app/views/layouts/email/text/default.ctp +++ b/cake/tests/test_app/views/layouts/email/text/default.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/test_app/views/layouts/flash.ctp b/cake/tests/test_app/views/layouts/flash.ctp index 8465565d9..a76a858a7 100644 --- a/cake/tests/test_app/views/layouts/flash.ctp +++ b/cake/tests/test_app/views/layouts/flash.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/test_app/views/layouts/multi_cache.ctp b/cake/tests/test_app/views/layouts/multi_cache.ctp index 99f0f37fd..73af70d4e 100644 --- a/cake/tests/test_app/views/layouts/multi_cache.ctp +++ b/cake/tests/test_app/views/layouts/multi_cache.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/test_app/views/posts/sequencial_nocache.ctp b/cake/tests/test_app/views/posts/sequencial_nocache.ctp index 8411db54a..f14619e09 100644 --- a/cake/tests/test_app/views/posts/sequencial_nocache.ctp +++ b/cake/tests/test_app/views/posts/sequencial_nocache.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/cake/tests/test_app/views/posts/test_nocache_tags.ctp b/cake/tests/test_app/views/posts/test_nocache_tags.ctp index 7a62dddeb..20c6baa6f 100644 --- a/cake/tests/test_app/views/posts/test_nocache_tags.ctp +++ b/cake/tests/test_app/views/posts/test_nocache_tags.ctp @@ -4,7 +4,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License diff --git a/index.php b/index.php index d34d6fedc..f3ed13b7d 100644 --- a/index.php +++ b/index.php @@ -9,7 +9,7 @@ * * PHP versions 4 and 5 * - * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License From 2d81d25f410ec9c2527fab92c769e72e04134a0e Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 27 Jan 2010 11:08:04 -0500 Subject: [PATCH 1599/2083] Fixing issue where webroot paths would be incorrect when using a virtual host setup and no mod_rewrite. An additional app/webroot would be appended. Incorrect tests updated. Fixes #259 --- cake/dispatcher.php | 17 ++++++++++------- cake/tests/cases/dispatcher.test.php | 14 +++++++------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 7c241473c..3aa8b9510 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -367,21 +367,24 @@ function baseUrl() { $this->webroot = $base .'/'; return $base; } - $file = '/' . basename($baseUrl); - $base = dirname($baseUrl); - if ($base === DS || $base === '.') { - $base = ''; - } - $this->webroot = $base .'/'; + $file = '/' . basename($baseUrl); + $base = dirname($baseUrl); + if ($base === DS || $base === '.') { + $base = ''; + } + $this->webroot = $base .'/'; + + if (!empty($base)) { if (strpos($this->webroot, $dir) === false) { $this->webroot .= $dir . '/' ; } if (strpos($this->webroot, $webroot) === false) { $this->webroot .= $webroot . '/'; } - return $base . $file; + } + return $base . $file; } /** * Restructure params in case we're serving a plugin. diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index 98f6312fb..f7da2949b 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -1103,7 +1103,7 @@ function testBaseUrlAndWebrootWithBaseUrl() { $result = $Dispatcher->baseUrl(); $expected = '/index.php'; $this->assertEqual($expected, $result); - $expectedWebroot = '/app/webroot/'; + $expectedWebroot = '/'; $this->assertEqual($expectedWebroot, $Dispatcher->webroot); Configure::write('App.baseUrl', '/CakeBB/app/webroot/index.php'); @@ -1174,12 +1174,12 @@ function testBaseUrlAndWebrootWithBase() { */ function testMissingController() { $Dispatcher =& new TestDispatcher(); - Configure::write('App.baseUrl','/index.php'); + Configure::write('App.baseUrl', '/index.php'); $url = 'some_controller/home/param:value/param2:value2'; $controller = $Dispatcher->dispatch($url, array('return' => 1)); $expected = array('missingController', array(array( 'className' => 'SomeControllerController', - 'webroot' => '/app/webroot/', + 'webroot' => '/', 'url' => 'some_controller/home/param:value/param2:value2', 'base' => '/index.php' ))); @@ -1201,7 +1201,7 @@ function testPrivate() { $expected = array('privateAction', array(array( 'className' => 'SomePagesController', 'action' => '_protected', - 'webroot' => '/app/webroot/', + 'webroot' => '/', 'url' => 'some_pages/_protected/param:value/param2:value2', 'base' => '/index.php' ))); @@ -1215,7 +1215,7 @@ function testPrivate() { */ function testMissingAction() { $Dispatcher =& new TestDispatcher(); - Configure::write('App.baseUrl','/index.php'); + Configure::write('App.baseUrl', '/index.php'); $url = 'some_pages/home/param:value/param2:value2'; $controller = $Dispatcher->dispatch($url, array('return'=> 1)); @@ -1223,7 +1223,7 @@ function testMissingAction() { $expected = array('missingAction', array(array( 'className' => 'SomePagesController', 'action' => 'home', - 'webroot' => '/app/webroot/', + 'webroot' => '/', 'url' => '/index.php/some_pages/home/param:value/param2:value2', 'base' => '/index.php' ))); @@ -1238,7 +1238,7 @@ function testMissingAction() { $expected = array('missingAction', array(array( 'className' => 'SomePagesController', 'action' => 'redirect', - 'webroot' => '/app/webroot/', + 'webroot' => '/', 'url' => '/index.php/some_pages/redirect/param:value/param2:value2', 'base' => '/index.php' ))); From 57997e770c5b2eea9e62dbd6329ec355c4eabc2d Mon Sep 17 00:00:00 2001 From: Juan Basso <jrbasso@gmail.com> Date: Sun, 17 Jan 2010 02:14:19 -0200 Subject: [PATCH 1600/2083] Refactory of DboSource::name() to improve performance. Added more tests to it. Signed-off-by: Mark Story <mark@mark-story.com> --- cake/libs/model/datasources/dbo_source.php | 72 ++++++------------- .../model/datasources/dbo_source.test.php | 16 +++++ 2 files changed, 39 insertions(+), 49 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 94560c2bc..f9bd20d7f 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -469,63 +469,37 @@ function field($name, $sql) { * @access public */ function name($data) { - if ($data == '*') { + if ($data === '*') { return '*'; } if (is_object($data) && isset($data->type)) { return $data->value; } - $array = is_array($data); - $data = (array)$data; - $count = count($data); - - for ($i = 0; $i < $count; $i++) { - if ($data[$i] == '*') { - continue; - } - if (strpos($data[$i], '(') !== false && preg_match_all('/([^(]*)\((.*)\)(.*)/', $data[$i], $fields)) { - $fields = Set::extract($fields, '{n}.0'); - - if (!empty($fields[1])) { - if (!empty($fields[2])) { - $data[$i] = $fields[1] . '(' . $this->name($fields[2]) . ')' . $fields[3]; - } else { - $data[$i] = $fields[1] . '()' . $fields[3]; - } - } - } - $data[$i] = str_replace('.', $this->endQuote . '.' . $this->startQuote, $data[$i]); - $data[$i] = $this->startQuote . $data[$i] . $this->endQuote; - $data[$i] = str_replace($this->startQuote . $this->startQuote, $this->startQuote, $data[$i]); - $data[$i] = str_replace($this->startQuote . '(', '(', $data[$i]); - $data[$i] = str_replace(')' . $this->startQuote, ')', $data[$i]); - $alias = !empty($this->alias) ? $this->alias : 'AS '; - - if (preg_match('/\s+' . $alias . '\s*/', $data[$i])) { - if (preg_match('/\w+\s+' . $alias . '\s*/', $data[$i])) { - $quoted = $this->endQuote . ' ' . $alias . $this->startQuote; - $data[$i] = str_replace(' ' . $alias, $quoted, $data[$i]); - } else { - $quoted = $alias . $this->startQuote; - $data[$i] = str_replace($alias, $quoted, $data[$i]) . $this->endQuote; - } + if (is_array($data)) { + foreach ($data as $i => $dataItem) { + $data[$i] = $this->name($dataItem); } - - if (!empty($this->endQuote) && $this->endQuote == $this->startQuote) { - if (substr_count($data[$i], $this->endQuote) % 2 == 1) { - if (substr($data[$i], -2) == $this->endQuote . $this->endQuote) { - $data[$i] = substr($data[$i], 0, -1); - } else { - $data[$i] = trim($data[$i], $this->endQuote); - } - } - } - if (strpos($data[$i], '*')) { - $data[$i] = str_replace($this->endQuote . '*' . $this->endQuote, '*', $data[$i]); + return $data; + } + $data = trim($data); + if (preg_match('/^\w+(\.\w+)*$/', $data)) { // string, string.string + if (strpos($data, '.') === false) { // string + return $this->startQuote . $data . $this->endQuote; } - $data[$i] = str_replace($this->endQuote . $this->endQuote, $this->endQuote, $data[$i]); + $items = explode('.', $data); + return $this->startQuote . implode($this->endQuote . '.' . $this->startQuote, $items) . $this->endQuote; + } + if (preg_match('/^\w+\.\*$/', $data)) { // string.* + $items = explode('.', $data); + return $this->startQuote . str_replace('.*', $this->endQuote . '.*', $data); + } + if (preg_match('/^(\w+)\((.*)\)$/', $data, $matches)) { // Functions + return $matches[1] . '(' . $this->name($matches[2]) . ')'; } - return (!$array) ? $data[0] : $data; + if (preg_match('/^(\w+(\.\w+|\(.*\))*)\s+' . preg_quote($this->alias) . '\s*(\w+)$/', $data, $matches)) { + return preg_replace('/\s{2,}/', ' ', $this->name($matches[1]) . ' ' . $this->alias . ' ' . $this->name($matches[3])); + } + return $data; } /** diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index 99d1a47c8..bef71f773 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -4014,9 +4014,25 @@ function testName() { $expected = '(sm)'; $this->assertEqual($result, $expected); + $result = $this->testDb->name('name AS x'); + $expected = '`name` AS `x`'; + $this->assertEqual($result, $expected); + + $result = $this->testDb->name('Model.name AS x'); + $expected = '`Model`.`name` AS `x`'; + $this->assertEqual($result, $expected); + $result = $this->testDb->name('Function(Something.foo)'); $expected = 'Function(`Something`.`foo`)'; $this->assertEqual($result, $expected); + + $result = $this->testDb->name('Function(SubFunction(Something.foo))'); + $expected = 'Function(SubFunction(`Something`.`foo`))'; + $this->assertEqual($result, $expected); + + $result = $this->testDb->name('Function(Something.foo) AS x'); + $expected = 'Function(`Something`.`foo`) AS `x`'; + $this->assertEqual($result, $expected); } /** From c9e047ce370145148b41ca10d218a67d6188f7b1 Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Thu, 28 Jan 2010 01:48:53 +0530 Subject: [PATCH 1601/2083] Adding 'orderYear' option for FormHelper::year to allow control over ordering of select options --- cake/libs/view/helpers/form.php | 22 +++++++++++++------ .../cases/libs/view/helpers/form.test.php | 15 +++++++++++++ 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 045a95fec..1ba1ccdae 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -306,7 +306,7 @@ function create($model = null, $options = array()) { * * {{{ * array usage: - * + * * array('label' => 'save'); value="save" * array('label' => 'save', 'name' => 'Whatever'); value="save" name="Whatever" * array('name' => 'Whatever'); value="Submit" name="Whatever" @@ -389,7 +389,7 @@ function secure($fields = array()) { } /** - * Determine which fields of a form should be used for hash. + * Determine which fields of a form should be used for hash. * Populates $this->fields * * @param mixed $field Reference to field to be secured @@ -644,7 +644,7 @@ function inputs($fields = null, $blacklist = null) { * * - `type` - Force the type of widget you want. e.g. `type => 'select'` * - `label` - Either a string label, or an array of options for the label. See FormHelper::label() - * - `div` - Either `false` to disable the div, or an array of options for the div. + * - `div` - Either `false` to disable the div, or an array of options for the div. * See HtmlHelper::div() for more options. * - `options` - for widgets that take options e.g. radio, select * - `error` - control the error message that is produced @@ -1412,6 +1412,8 @@ function day($fieldName, $selected = null, $attributes = array()) { * * - `empty` - If true, the empty select option is shown. If a string, * that string is displayed as the empty element. + * - `orderYear` - Ordering of year values in select options. + * Possible values 'asc', 'desc'. Default 'desc' * * @param string $fieldName Prefix name for the SELECT element * @param integer $minYear First year in sequence @@ -1446,9 +1448,13 @@ function year($fieldName, $minYear = null, $maxYear = null, $selected = null, $a } elseif ($selected === false) { $selected = null; } - $yearOptions = array('min' => $minYear, 'max' => $maxYear); + $yearOptions = array('min' => $minYear, 'max' => $maxYear, 'order' => 'desc'); + if (isset($attributes['orderYear'])) { + $yearOptions['order'] = $attributes['orderYear']; + unset($attributes['orderYear']); + } return $this->select( - $fieldName . ".year", $this->__generateOptions('year', $yearOptions), + $fieldName . '.year', $this->__generateOptions('year', $yearOptions), $selected, $attributes ); } @@ -1862,7 +1868,7 @@ function __selectOptions($elements = array(), $selected = null, $parents = array if ($name !== null) { if ( - (!$selectedIsArray && !$selectedIsEmpty && (string)$selected == (string)$name) || + (!$selectedIsArray && !$selectedIsEmpty && (string)$selected == (string)$name) || ($selectedIsArray && in_array($name, $selected)) ) { if ($attributes['style'] === 'checkbox') { @@ -2005,7 +2011,9 @@ function __generateOptions($name, $options = array()) { for ($i = $min; $i <= $max; $i++) { $data[$i] = $i; } - $data = array_reverse($data, true); + if ($options['order'] != 'asc') { + $data = array_reverse($data, true); + } break; } $this->__options[$name] = $data; diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 01da0727f..aa128f7e0 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -4465,6 +4465,21 @@ function testYear() { ); $this->assertTags($result, $expected); + $result = $this->Form->year('Model.field', 2006, 2007, null, array('orderYear' => 'asc')); + $expected = array( + array('select' => array('name' => 'data[Model][field][year]', 'id' => 'ModelFieldYear')), + array('option' => array('value' => '')), + '/option', + array('option' => array('value' => '2006')), + '2006', + '/option', + array('option' => array('value' => '2007')), + '2007', + '/option', + '/select', + ); + $this->assertTags($result, $expected); + $this->data['Contact']['published'] = ''; $result = $this->Form->year('Contact.published', 2006, 2007, null, array('class' => 'year')); $expected = array( From 2b353e90f83280abfb8a93f42e624bc1417af0be Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 27 Jan 2010 15:38:18 -0500 Subject: [PATCH 1602/2083] Minor optimizations in Router --- cake/libs/router.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index 7a8157e12..b5905fd18 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -788,7 +788,7 @@ function url($url = null, $full = false) { $prefixExists = (array_intersect_key($url, array_flip($self->__prefixes))); foreach ($self->__prefixes as $prefix) { - if (!isset($url[$prefix]) && !empty($params[$prefix]) && !$prefixExists) { + if (!empty($params[$prefix]) && !$prefixExists) { $url[$prefix] = true; } elseif (isset($url[$prefix]) && !$url[$prefix]) { unset($url[$prefix]); @@ -812,7 +812,6 @@ function url($url = null, $full = false) { if ($match = $self->routes[$i]->match($url)) { $output = trim($match, '/'); - $url = array(); break; } $url = $originalUrl; @@ -1537,14 +1536,12 @@ function _writeUrl($params) { $instance =& Router::getInstance(); $separator = $instance->named['separator']; - if (!empty($params['named'])) { - if (is_array($params['named'])) { - $named = array(); - foreach ($params['named'] as $key => $value) { - $named[] = $key . $separator . $value; - } - $params['pass'] = $params['pass'] . '/' . implode('/', $named);; + if (!empty($params['named']) && is_array($params['named'])) { + $named = array(); + foreach ($params['named'] as $key => $value) { + $named[] = $key . $separator . $value; } + $params['pass'] = $params['pass'] . '/' . implode('/', $named); } $out = $this->template; @@ -1554,7 +1551,7 @@ function _writeUrl($params) { if (isset($params[$key])) { $string = $params[$key]; } elseif (strpos($out, $key) != strlen($out) - strlen($key)) { - $key = $key . '/'; + $key .= '/'; } $search[] = ':' . $key; $replace[] = $string; From 30cb38eb93b416f53abd946b5a48e2794cf61b70 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 28 Jan 2010 11:11:19 -0500 Subject: [PATCH 1603/2083] Refactoring extensions in ScaffoldView to reflect removal of magic .thtml extension. Adding test for interaction of Themed views and Scaffolded views. Fixes #255 --- cake/libs/controller/scaffold.php | 12 +++++++----- .../cases/libs/controller/scaffold.test.php | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/cake/libs/controller/scaffold.php b/cake/libs/controller/scaffold.php index e0bf3bef0..1abd00c2c 100644 --- a/cake/libs/controller/scaffold.php +++ b/cake/libs/controller/scaffold.php @@ -584,11 +584,13 @@ function _getViewFileName($name = null) { $names[] = 'scaffolds' . DS . $subDir . $name; $paths = $this->_paths($this->plugin); - - $exts = array($this->ext, '.ctp', '.thtml'); - foreach ($paths as $path) { - foreach ($names as $name) { - foreach ($exts as $ext) { + $exts = array($this->ext); + if ($this->ext !== '.ctp') { + array_push($exts, '.ctp'); + } + foreach ($exts as $ext) { + foreach ($paths as $path) { + foreach ($names as $name) { if (file_exists($path . $name . $ext)) { return $path . $name . $ext; } diff --git a/cake/tests/cases/libs/controller/scaffold.test.php b/cake/tests/cases/libs/controller/scaffold.test.php index 6ddd3c150..63ebba91e 100644 --- a/cake/tests/cases/libs/controller/scaffold.test.php +++ b/cake/tests/cases/libs/controller/scaffold.test.php @@ -380,6 +380,23 @@ function testGetViewFilename() { Configure::write('Routing.prefixes', $_admin); } +/** + * test getting the view file name for themed scaffolds. + * + * @return void + */ + function testGetViewFileNameWithTheme() { + $this->Controller->action = 'index'; + $this->Controller->viewPath = 'posts'; + $this->Controller->theme = 'test_theme'; + $ScaffoldView =& new TestScaffoldView($this->Controller); + + $result = $ScaffoldView->testGetFilename('index'); + $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS + . 'themed' . DS . 'test_theme' . DS . 'posts' . DS . 'scaffold.index.ctp'; + $this->assertEqual($result, $expected); + } + /** * test default index scaffold generation * From e8be5bac8da79d8396013e678e4b6ab3d02ee3bc Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 28 Jan 2010 13:30:34 -0500 Subject: [PATCH 1604/2083] Expanding doc blocks for router::url. --- cake/libs/router.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cake/libs/router.php b/cake/libs/router.php index b5905fd18..36ad1b21c 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -717,6 +717,15 @@ function promote($which = null) { * - '/' - the method will find base URL of application. * - A combination of controller/action - the method will find url for it. * + * There are a few 'special' parameters that can change the final URL string that is generated + * + * - `base` - Set to false to remove the base path from the generated url. If your application + * is not in the root directory, this can be used to generate urls that are 'cake relative'. + * cake relative urls are required when using requestAction. + * - `?` - Takes an array of query string parameters + * - `#` - Allows you to set url hash fragments. + * - `full_base` - If true the `FULL_BASE_URL` constant will be prepended to generated urls. + * * @param mixed $url Cake-relative URL, like "/products/edit/92" or "/presidents/elect/4" * or an array specifying any of the following: 'controller', 'action', * and/or 'plugin', in addition to named arguments (keyed array elements), From 38365924eb58cbd7aae737e07f288b193002ee9d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 28 Jan 2010 13:30:55 -0500 Subject: [PATCH 1605/2083] Removing deprecated and unused class property. --- cake/libs/set.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cake/libs/set.php b/cake/libs/set.php index 43f166316..9f0bc2ef2 100644 --- a/cake/libs/set.php +++ b/cake/libs/set.php @@ -26,12 +26,6 @@ */ class Set { -/** - * Deprecated - * - */ - var $value = array(); - /** * This function can be thought of as a hybrid between PHP's array_merge and array_merge_recursive. The difference * to the two is that if an array key contains another array then the function behaves recursive (unlike array_merge) From 832b15ba3eb050aab9c2dd29648c3a0183be6548 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 29 Jan 2010 10:06:47 -0500 Subject: [PATCH 1606/2083] Fixing issues in JqueryEngineHelper where eval()'ed responses wouldn't run code contained inside $js->domReady() due to implementation differences between $(document).ready() and $(document).bind('ready'). Tests updated. --- cake/libs/view/helpers/jquery_engine.php | 10 +++++++--- .../cases/libs/view/helpers/jquery_engine.test.php | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cake/libs/view/helpers/jquery_engine.php b/cake/libs/view/helpers/jquery_engine.php index 0d66561e3..c16c08745 100644 --- a/cake/libs/view/helpers/jquery_engine.php +++ b/cake/libs/view/helpers/jquery_engine.php @@ -178,15 +178,19 @@ function event($type, $callback, $options = array()) { } /** - * Create a domReady event. For jQuery + * Create a domReady event. For jQuery. This method does not + * bind a 'traditional event' as `$(document).bind('ready', fn)` + * Works in an entirely different fashion than `$(document).ready()` + * The first will not run the function when eval()'d as part of a response + * The second will. Because of the way that ajax pagination is done + * `$().ready()` is used. * * @param string $functionBody The code to run on domReady * @return string completed domReady method * @access public */ function domReady($functionBody) { - $this->get('document'); - return $this->event('ready', $functionBody, array('stop' => false)); + return $this->jQueryObject . '(document).ready(function () {' . $functionBody . '});'; } /** diff --git a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php index dd9665482..1a2ba66c6 100644 --- a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php @@ -89,7 +89,7 @@ function testEvent() { */ function testDomReady() { $result = $this->Jquery->domReady('foo.name = "bar";'); - $expected = '$(document).bind("ready", function (event) {foo.name = "bar";});'; + $expected = '$(document).ready(function () {foo.name = "bar";});'; $this->assertEqual($result, $expected); } From 1dd0a6470cb51d1462be8c7a2f0088188264e276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Fri, 29 Jan 2010 10:57:40 -0430 Subject: [PATCH 1607/2083] Optimizations for DbouSource. Now the result for some methods is stored in a memory cache inside the poperty $methodCache --- cake/libs/model/datasources/dbo_source.php | 95 +++++++++++++++------- 1 file changed, 65 insertions(+), 30 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index f9bd20d7f..836b375fb 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -53,12 +53,12 @@ class DboSource extends DataSource { var $alias = 'AS '; /** - * Caches fields quoted in DboSource::name() + * Caches result from query parsing operations * * @var array * @access public */ - var $fieldCache = array(); + var $methodCache = array(); /** * Bypass automatic adding of joined fields/associations. @@ -481,6 +481,10 @@ function name($data) { } return $data; } + $cacheKey = crc32($data); + if (isset($this->methodCache[__FUNCTION__][$cacheKey])) { + return $this->methodCache[__FUNCTION__][$cacheKey]; + } $data = trim($data); if (preg_match('/^\w+(\.\w+)*$/', $data)) { // string, string.string if (strpos($data, '.') === false) { // string @@ -499,7 +503,7 @@ function name($data) { if (preg_match('/^(\w+(\.\w+|\(.*\))*)\s+' . preg_quote($this->alias) . '\s*(\w+)$/', $data, $matches)) { return preg_replace('/\s{2,}/', ' ', $this->name($matches[1]) . ' ' . $this->alias . ' ' . $this->name($matches[3])); } - return $data; + return $this->methodCache[__FUNCTION__][$cacheKey] = $data; } /** @@ -1848,6 +1852,20 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) { if (empty($alias)) { $alias = $model->alias; } + $cacheKey = array( + $model->useDbConfig, + $model->table, + array_keys($model->schema()), + $model->name, + $model->getVirtualField(), + $alias, + $fields, + $quote + ); + $cacheKey = crc32(serialize($cacheKey)); + if (isset($this->methodCache[__FUNCTION__][$cacheKey])) { + return $this->methodCache[__FUNCTION__][$cacheKey]; + } $allFields = empty($fields); if ($allFields) { $fields = array_keys($model->schema()); @@ -1930,7 +1948,7 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) { } else { $field[0] = explode('.', $field[1]); if (!Set::numeric($field[0])) { - $field[0] = implode('.', array_map(array($this, 'name'), $field[0])); + $field[0] = implode('.', array_map(array(&$this, 'name'), $field[0])); $fields[$i] = preg_replace('/\(' . $field[1] . '\)/', '(' . $field[0] . ')', $fields[$i], 1); } } @@ -1941,7 +1959,7 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) { if (!empty($virtual)) { $fields = array_merge($fields, $this->_constructVirtualFields($model, $alias, $virtual)); } - return array_unique($fields); + return $this->methodCache[__FUNCTION__][$cacheKey] = array_unique($fields); } /** @@ -1957,6 +1975,25 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) { * @access public */ function conditions($conditions, $quoteValues = true, $where = true, $model = null) { + if (is_object($model)) { + $cacheKey = array( + $model->useDbConfig, + $model->table, + $model->schema(), + $model->name, + $model->getVirtualField(), + $conditions, + $quoteValues, + $where + ); + } else { + $cacheKey = array($conditions, $quoteValues, $where); + } + $cacheKey = crc32(serialize($cacheKey)); + if (isset($this->methodCache[__FUNCTION__][$cacheKey])) { + return $this->methodCache[__FUNCTION__][$cacheKey]; + } + $clause = $out = ''; if ($where) { @@ -1967,16 +2004,16 @@ function conditions($conditions, $quoteValues = true, $where = true, $model = nu $out = $this->conditionKeysToString($conditions, $quoteValues, $model); if (empty($out)) { - return $clause . ' 1 = 1'; + return $this->methodCache[__FUNCTION__][$cacheKey] = $clause . ' 1 = 1'; } - return $clause . implode(' AND ', $out); + return $this->methodCache[__FUNCTION__][$cacheKey] = $clause . implode(' AND ', $out); } if ($conditions === false || $conditions === true) { - return $clause . (int)$conditions . ' = 1'; + return $this->methodCache[__FUNCTION__][$cacheKey] = $clause . (int)$conditions . ' = 1'; } if (empty($conditions) || trim($conditions) == '') { - return $clause . '1 = 1'; + return $this->methodCache[__FUNCTION__][$cacheKey] = $clause . '1 = 1'; } $clauses = '/^WHERE\\x20|^GROUP\\x20BY\\x20|^HAVING\\x20|^ORDER\\x20BY\\x20/i'; @@ -1988,7 +2025,7 @@ function conditions($conditions, $quoteValues = true, $where = true, $model = nu } else { $conditions = $this->__quoteFields($conditions); } - return $clause . $conditions; + return $this->methodCache[__FUNCTION__][$cacheKey] = $clause . $conditions; } /** @@ -2088,9 +2125,6 @@ function conditionKeysToString($conditions, $quoteValues = true, $model = null) } if ($data != null) { - if (preg_match('/^\(\(\((.+)\)\)\)$/', $data)) { - $data = substr($data, 1, strlen($data) - 2); - } $out[] = $data; $data = null; } @@ -2153,7 +2187,7 @@ function __parseKey(&$model, $key, $value) { } if ($bound) { - return String::insert($key . ' ' . trim($operator), $value); + return String::insert($key . ' ' . trim($operator), $value); } if (!preg_match($operatorMatch, trim($operator))) { @@ -2209,21 +2243,28 @@ function __quoteFields($conditions) { $end = preg_quote($this->endQuote); } $conditions = str_replace(array($start, $end), '', $conditions); - preg_match_all('/(?:[\'\"][^\'\"\\\]*(?:\\\.[^\'\"\\\]*)*[\'\"])|([a-z0-9_' . $start . $end . ']*\\.[a-z0-9_' . $start . $end . ']*)/i', $conditions, $replace, PREG_PATTERN_ORDER); - - if (isset($replace['1']['0'])) { - $pregCount = count($replace['1']); + $conditions = preg_replace_callback('/(?:[\'\"][^\'\"\\\]*(?:\\\.[^\'\"\\\]*)*[\'\"])|([a-z0-9_' . $start . $end . ']*\\.[a-z0-9_' . $start . $end . ']*)/i', array(&$this, '__quoteMatchedField'), $conditions); - for ($i = 0; $i < $pregCount; $i++) { - if (!empty($replace['1'][$i]) && !is_numeric($replace['1'][$i])) { - $conditions = preg_replace('/\b' . preg_quote($replace['1'][$i]) . '\b/', $this->name($replace['1'][$i]), $conditions); - } - } + if ($conditions !== null) { return $conditions; } return $original; } +/** + * Auxiliary function to qoute matches `Model.fields` from a preg_replace_callback call + * + * @param string matched string + * @return string quoted strig + * @access private + */ + function __quoteMatchedField($match) { + if (is_numeric($match[0])) { + return $match[0]; + } + return $this->name($match[0]); + } + /** * Returns a limit statement in the correct format for the particular database. * @@ -2295,13 +2336,7 @@ function order($keys, $direction = 'ASC', $model = null) { } if (strpos($key, '.')) { - preg_match_all('/([a-zA-Z0-9_]{1,})\\.([a-zA-Z0-9_]{1,})/', $key, $matches, PREG_PATTERN_ORDER); - $pregCount = count($matches[0]); - for ($i = 0; $i < $pregCount; $i++) { - if (!is_numeric($matches[0][$i])) { - $key = preg_replace('/' . $matches[0][$i] . '/', $this->name($matches[0][$i]), $key); - } - } + $key = preg_replace_callback('/([a-zA-Z0-9_]{1,})\\.([a-zA-Z0-9_]{1,})/', array(&$this, '__quoteMatchedField'), $key); } $key = trim($key); From 7cfb5aba8ddcba05fe9d55a3182efd5477d0905a Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 29 Jan 2010 11:21:37 -0500 Subject: [PATCH 1608/2083] Minor refactor of Model::_deleteLinks to improve readability. --- cake/libs/model/model.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 78be07d47..1d82dbaca 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1825,14 +1825,15 @@ function _deleteDependent($id, $cascade) { */ function _deleteLinks($id) { foreach ($this->hasAndBelongsToMany as $assoc => $data) { - $records = $this->{$data['with']}->find('all', array( - 'conditions' => array_merge(array($this->{$data['with']}->escapeField($data['foreignKey']) => $id)), - 'fields' => $this->{$data['with']}->primaryKey, + $joinModel = $data['with']; + $records = $this->{$joinModel}->find('all', array( + 'conditions' => array_merge(array($this->{$joinModel}->escapeField($data['foreignKey']) => $id)), + 'fields' => $this->{$joinModel}->primaryKey, 'recursive' => -1 )); if (!empty($records)) { foreach ($records as $record) { - $this->{$data['with']}->delete($record[$this->{$data['with']}->alias][$this->{$data['with']}->primaryKey]); + $this->{$joinModel}->delete($record[$this->{$joinModel}->alias][$this->{$joinModel}->primaryKey]); } } } From 887ddb95756ca746194426432448d5382af019af Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 29 Jan 2010 11:55:18 -0500 Subject: [PATCH 1609/2083] Adding tests for deletion of multiple habtm associations. Reverting changes made in [15518b8c9ac6e022eda29cd907b8f1fe3537a188] that caused incorrect removal of links when deleting records. Fixes #247 --- cake/libs/model/model.php | 13 +++---- .../cases/libs/model/model_delete.test.php | 35 +++++++++++++++++++ 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 4f293f636..e41208325 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1868,18 +1868,15 @@ function _deleteDependent($id, $cascade) { */ function _deleteLinks($id) { foreach ($this->hasAndBelongsToMany as $assoc => $data) { - $with = $data['with']; - $records = $this->{$data['with']}->find('all', array( - 'conditions' => array_merge(array( - $this->{$with}->escapeField($data['foreignKey']) => $id - )), - 'fields' => $this->{$with}->primaryKey, + $joinModel = $data['with']; + $records = $this->{$joinModel}->find('all', array( + 'conditions' => array_merge(array($this->{$joinModel}->escapeField($data['foreignKey']) => $id)), + 'fields' => $this->{$joinModel}->primaryKey, 'recursive' => -1 )); if (!empty($records)) { foreach ($records as $record) { - $id = $record[$this->{$with}->alias][$this->{$with}->primaryKey]; - $this->{$with}->delete($id); + $this->{$joinModel}->delete($record[$this->{$joinModel}->alias][$this->{$joinModel}->primaryKey]); } } } diff --git a/cake/tests/cases/libs/model/model_delete.test.php b/cake/tests/cases/libs/model/model_delete.test.php index 81484dd9f..e6c448548 100644 --- a/cake/tests/cases/libs/model/model_delete.test.php +++ b/cake/tests/cases/libs/model/model_delete.test.php @@ -500,6 +500,41 @@ function testDeleteLinks() { $this->assertTrue($result, 'deleteAll returned false when all no records matched conditions. %s'); } +/** + * test deleteLinks with Multiple habtm associations + * + * @return void + */ + function testDeleteLinksWithMultipleHabtmAssociations() { + $this->loadFixtures('JoinA', 'JoinB', 'JoinC', 'JoinAB', 'JoinAC'); + $JoinA =& new JoinA(); + + //create two new join records to expose the issue. + $JoinA->JoinAsJoinC->create(array( + 'join_a_id' => 1, + 'join_c_id' => 2, + )); + $JoinA->JoinAsJoinC->save(); + $JoinA->JoinAsJoinB->create(array( + 'join_a_id' => 1, + 'join_b_id' => 2, + )); + $JoinA->JoinAsJoinB->save(); + + $result = $JoinA->delete(1); + $this->assertTrue($result, 'Delete failed %s'); + + $joinedBs = $JoinA->JoinAsJoinB->find('count', array( + 'conditions' => array('JoinAsJoinB.join_a_id' => 1) + )); + $this->assertEqual($joinedBs, 0, 'JoinA/JoinB link records left over. %s'); + + $joinedBs = $JoinA->JoinAsJoinC->find('count', array( + 'conditions' => array('JoinAsJoinC.join_a_id' => 1) + )); + $this->assertEqual($joinedBs, 0, 'JoinA/JoinC link records left over. %s'); + } + /** * testHabtmDeleteLinksWhenNoPrimaryKeyInJoinTable method * From f2a94f595960e8258c26260f1b409792fe7f4638 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 29 Jan 2010 11:55:51 -0500 Subject: [PATCH 1610/2083] Adding file omitted from [30cb38eb93b416f53abd946b5a48e2794cf61b70] --- .../test_app/views/themed/test_theme/posts/scaffold.index.ctp | 1 + 1 file changed, 1 insertion(+) create mode 100644 cake/tests/test_app/views/themed/test_theme/posts/scaffold.index.ctp diff --git a/cake/tests/test_app/views/themed/test_theme/posts/scaffold.index.ctp b/cake/tests/test_app/views/themed/test_theme/posts/scaffold.index.ctp new file mode 100644 index 000000000..a7829877c --- /dev/null +++ b/cake/tests/test_app/views/themed/test_theme/posts/scaffold.index.ctp @@ -0,0 +1 @@ +I'm a themed scaffold file. \ No newline at end of file From fde10b1e62ceb397527601495043310409999921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Fri, 29 Jan 2010 15:31:07 -0430 Subject: [PATCH 1611/2083] Improving performance of Set::diff() --- cake/libs/set.php | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/cake/libs/set.php b/cake/libs/set.php index 9f0bc2ef2..ef3728334 100644 --- a/cake/libs/set.php +++ b/cake/libs/set.php @@ -777,7 +777,8 @@ function check($data, $path = null) { * * @param mixed $val1 First value * @param mixed $val2 Second value - * @return array Computed difference + * @return array Returns the key => value pairs that are not common in $val1 and $val2 + * The expression for this function is ($val1 - $val2) + ($val2 - ($val1 - $val2)) * @access public * @static */ @@ -788,25 +789,15 @@ function diff($val1, $val2 = null) { if (empty($val2)) { return (array)$val1; } - $out = array(); - - foreach ($val1 as $key => $val) { - $exists = array_key_exists($key, $val2); - - if ($exists && $val2[$key] != $val) { - $out[$key] = $val; - } elseif (!$exists) { - $out[$key] = $val; + $intersection = array_intersect_key($val1,$val2); + while (list($key,) = each($intersection)) { + if ($val1[$key] == $val2[$key]) { + unset($val1[$key]); + unset($val2[$key]); } - unset($val2[$key]); } - foreach ($val2 as $key => $val) { - if (!array_key_exists($key, $out)) { - $out[$key] = $val; - } - } - return $out; + return $val1 + $val2; } /** From 3f9813a9ec2364c5371268d6019f787f6b015a62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Fri, 29 Jan 2010 16:15:03 -0430 Subject: [PATCH 1612/2083] Removing unused statement, thanks jrbasso --- cake/libs/model/datasources/dbo_source.php | 1 - cake/libs/set.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 836b375fb..ef42d0138 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -494,7 +494,6 @@ function name($data) { return $this->startQuote . implode($this->endQuote . '.' . $this->startQuote, $items) . $this->endQuote; } if (preg_match('/^\w+\.\*$/', $data)) { // string.* - $items = explode('.', $data); return $this->startQuote . str_replace('.*', $this->endQuote . '.*', $data); } if (preg_match('/^(\w+)\((.*)\)$/', $data, $matches)) { // Functions diff --git a/cake/libs/set.php b/cake/libs/set.php index ef3728334..95275b45a 100644 --- a/cake/libs/set.php +++ b/cake/libs/set.php @@ -789,7 +789,7 @@ function diff($val1, $val2 = null) { if (empty($val2)) { return (array)$val1; } - $intersection = array_intersect_key($val1,$val2); + $intersection = array_intersect_key($val1, $val2); while (list($key,) = each($intersection)) { if ($val1[$key] == $val2[$key]) { unset($val1[$key]); From 7ac87d8543dfbdf0e8b087524f647e81fe3b814b Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 29 Jan 2010 21:35:00 -0500 Subject: [PATCH 1613/2083] Updating links on home.ctp to point at github and lighthouse. --- cake/libs/view/pages/home.ctp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cake/libs/view/pages/home.ctp b/cake/libs/view/pages/home.ctp index 61c427c60..c8534b115 100644 --- a/cake/libs/view/pages/home.ctp +++ b/cake/libs/view/pages/home.ctp @@ -26,7 +26,7 @@ if (Configure::read() == 0): endif; ?> <h2><?php echo sprintf(__('Release Notes for CakePHP %s.', true), Configure::version()); ?></h2> -<a href="http://code.cakephp.org/wiki/changelog/1_2_x_x"><?php __('Read the changelog'); ?> </a> +<a href="http://cakephp.lighthouseapp.com/projects/42648/changelog-1-2-5"><?php __('Read the changelog'); ?> </a> <?php if (Configure::read() > 0): Debugger::checkSessionKey(); @@ -136,8 +136,10 @@ You can also add some CSS styles for your pages at: APP/webroot/css.'); <ul><li><?php __('Community mailing list'); ?></li></ul></li> <li><a href="irc://irc.freenode.net/cakephp">irc.freenode.net #cakephp</a> <ul><li><?php __('Live chat about CakePHP'); ?></li></ul></li> - <li><a href="https://code.cakephp.org/"><?php __('CakePHP Code'); ?> </a> - <ul><li><?php __('For the Development of CakePHP (Tickets, Git browser, Roadmap, Changelogs)'); ?></li></ul></li> + <li><a href="http://github.com/cakephp/"><?php __('CakePHP Code'); ?> </a> + <ul><li><?php __('For the Development of CakePHP Git repository, Downloads'); ?></li></ul></li> + <li><a href="http://cakephp.lighthouseapp.com/"><?php __('CakePHP Lighthouse'); ?> </a> + <ul><li><?php __('CakePHP Tickets, Wiki pages, Roadmap'); ?></li></ul></li> <li><a href="http://www.cakeforge.org"><?php __('CakeForge'); ?> </a> <ul><li><?php __('Open Development for CakePHP'); ?></li></ul></li> <li><a href="http://astore.amazon.com/cakesoftwaref-20/"><?php __('Book Store'); ?> </a> From be7ddfb972a1fc508c3e4b0d8c78494923bc20e2 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 29 Jan 2010 21:54:54 -0500 Subject: [PATCH 1614/2083] Updating version numbers to 1.2.6 --- cake/VERSION.txt | 2 +- cake/config/config.php | 2 +- cake/libs/view/pages/home.ctp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cake/VERSION.txt b/cake/VERSION.txt index 3a1f10eae..7e099ec5d 100644 --- a/cake/VERSION.txt +++ b/cake/VERSION.txt @@ -1 +1 @@ -1.2.5 \ No newline at end of file +1.2.6 \ No newline at end of file diff --git a/cake/config/config.php b/cake/config/config.php index f4f248de0..fff46b1a1 100644 --- a/cake/config/config.php +++ b/cake/config/config.php @@ -22,5 +22,5 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ -return $config['Cake.version'] = '1.2.5'; +return $config['Cake.version'] = '1.2.6'; ?> \ No newline at end of file diff --git a/cake/libs/view/pages/home.ctp b/cake/libs/view/pages/home.ctp index c8534b115..38db9ba3f 100644 --- a/cake/libs/view/pages/home.ctp +++ b/cake/libs/view/pages/home.ctp @@ -26,7 +26,7 @@ if (Configure::read() == 0): endif; ?> <h2><?php echo sprintf(__('Release Notes for CakePHP %s.', true), Configure::version()); ?></h2> -<a href="http://cakephp.lighthouseapp.com/projects/42648/changelog-1-2-5"><?php __('Read the changelog'); ?> </a> +<a href="http://cakephp.lighthouseapp.com/projects/42648/changelog-1-2-6"><?php __('Read the changelog'); ?> </a> <?php if (Configure::read() > 0): Debugger::checkSessionKey(); From 59a4732eb8a1252174ba1b01624128526fa3b411 Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Sun, 31 Jan 2010 23:37:54 +0530 Subject: [PATCH 1615/2083] Fixing issue where value of '$and' was appended to output string even when list array contained only one element. Fixed #285 --- cake/libs/view/helpers/text.php | 6 +++++- cake/tests/cases/libs/view/helpers/text.test.php | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/text.php b/cake/libs/view/helpers/text.php index 9249480a5..6a4daa12f 100644 --- a/cake/libs/view/helpers/text.php +++ b/cake/libs/view/helpers/text.php @@ -336,7 +336,11 @@ function excerpt($text, $phrase, $radius = 100, $ending = '...') { * @access public */ function toList($list, $and = 'and', $separator = ', ') { - return implode($separator, array_slice($list, null, -1)) . ' ' . $and . ' ' . array_pop($list); + if (count($list) > 1) { + return implode($separator, array_slice($list, null, -1)) . ' ' . $and . ' ' . array_pop($list); + } else { + return array_pop($list); + } } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/text.test.php b/cake/tests/cases/libs/view/helpers/text.test.php index 39f7bed3f..00e880539 100644 --- a/cake/tests/cases/libs/view/helpers/text.test.php +++ b/cake/tests/cases/libs/view/helpers/text.test.php @@ -355,6 +355,12 @@ function testExcerptCaseInsensitivity() { * @return void */ function testListGeneration() { + $result = $this->Text->toList(array()); + $this->assertEqual($result, ''); + + $result = $this->Text->toList(array('One')); + $this->assertEqual($result, 'One'); + $result = $this->Text->toList(array('Larry', 'Curly', 'Moe')); $this->assertEqual($result, 'Larry, Curly and Moe'); From a89d9e483001a6b4f6dafd86f0683de7182a8da6 Mon Sep 17 00:00:00 2001 From: Juan Basso <jrbasso@gmail.com> Date: Sun, 31 Jan 2010 21:23:32 -0200 Subject: [PATCH 1616/2083] Extra optimization for Set::diff(). Refer commit fde10b1. --- cake/libs/set.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cake/libs/set.php b/cake/libs/set.php index 95275b45a..1e667ae86 100644 --- a/cake/libs/set.php +++ b/cake/libs/set.php @@ -790,11 +790,12 @@ function diff($val1, $val2 = null) { return (array)$val1; } $intersection = array_intersect_key($val1, $val2); - while (list($key,) = each($intersection)) { + while (($key = key($intersection)) !== null) { if ($val1[$key] == $val2[$key]) { unset($val1[$key]); unset($val2[$key]); } + next($intersection); } return $val1 + $val2; From aadf62de6eaac39db632abb7e58fa3b0b84398ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Sun, 31 Jan 2010 20:26:57 -0430 Subject: [PATCH 1617/2083] Improving tests for Set::diff --- cake/tests/cases/libs/set.test.php | 43 +++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/set.test.php b/cake/tests/cases/libs/set.test.php index a3820cdc3..3b6018c2e 100644 --- a/cake/tests/cases/libs/set.test.php +++ b/cake/tests/cases/libs/set.test.php @@ -1032,7 +1032,7 @@ function testExtract() { /** * testExtractWithArrays method - * + * * @access public * @return void */ @@ -1456,6 +1456,47 @@ function testDiff() { 0 => array('name' => 'main') ); $this->assertIdentical($result, $expected); + + $a = array(); + $b = array('name' => 'bob', 'address' => 'home'); + $result = Set::diff($a, $b); + $this->assertIdentical($result, $b); + + + $a = array('name' => 'bob', 'address' => 'home'); + $b = array(); + $result = Set::diff($a, $b); + $this->assertIdentical($result, $a); + + $a = array('key' => true, 'another' => false, 'name' => 'me'); + $b = array('key' => 1, 'another' => 0); + $expected = array('name' => 'me'); + $result = Set::diff($a, $b); + $this->assertIdentical($result, $expected); + + $a = array('key' => 'value', 'another' => null, 'name' => 'me'); + $b = array('key' => 'differentValue', 'another' => null); + $expected = array('key' => 'value', 'name' => 'me'); + $result = Set::diff($a, $b); + $this->assertIdentical($result, $expected); + + $a = array('key' => 'value', 'another' => null, 'name' => 'me'); + $b = array('key' => 'differentValue', 'another' => 'value'); + $expected = array('key' => 'value', 'another' => null, 'name' => 'me'); + $result = Set::diff($a, $b); + $this->assertIdentical($result, $expected); + + $a = array('key' => 'value', 'another' => null, 'name' => 'me'); + $b = array('key' => 'differentValue', 'another' => 'value'); + $expected = array('key' => 'differentValue', 'another' => 'value', 'name' => 'me'); + $result = Set::diff($b, $a); + $this->assertIdentical($result, $expected); + + $a = array('key' => 'value', 'another' => null, 'name' => 'me'); + $b = array(0 => 'differentValue', 1 => 'value'); + $expected = $a + $b; + $result = Set::diff($a, $b); + $this->assertIdentical($result, $expected); } /** From a81d57a0803a02cf9df1d7ef9723540ddaee522d Mon Sep 17 00:00:00 2001 From: Juan Basso <jrbasso@gmail.com> Date: Sun, 17 Jan 2010 03:29:39 -0200 Subject: [PATCH 1618/2083] Changing the class name to lowercase before ordering the ClassRegistry in PHP 4 to not have problems of duplication of tasks in the shell. Fixes #186. --- cake/console/libs/shell.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php index 63335efd7..c4d6c212d 100644 --- a/cake/console/libs/shell.php +++ b/cake/console/libs/shell.php @@ -293,12 +293,16 @@ function loadTasks() { } } } - if (ClassRegistry::isKeySet($taskClass)) { + $taskClassCheck = $taskClass; + if (!PHP5) { + $taskClassCheck = strtolower($taskClass); + } + if (ClassRegistry::isKeySet($taskClassCheck)) { $this->taskNames[] = $taskName; if (!PHP5) { - $this->{$taskName} =& ClassRegistry::getObject($taskClass); + $this->{$taskName} =& ClassRegistry::getObject($taskClassCheck); } else { - $this->{$taskName} = ClassRegistry::getObject($taskClass); + $this->{$taskName} = ClassRegistry::getObject($taskClassCheck); } } else { $this->taskNames[] = $taskName; From 8d382d9168e98140367e908d1855e70292b71f5f Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Tue, 2 Feb 2010 09:13:52 +1100 Subject: [PATCH 1619/2083] Fixes #288. TextHelper truncation not playing nice with html in ending. --- cake/libs/view/helpers/text.php | 3 +-- cake/tests/cases/libs/view/helpers/text.test.php | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cake/libs/view/helpers/text.php b/cake/libs/view/helpers/text.php index 737681ef9..37d25ac8b 100644 --- a/cake/libs/view/helpers/text.php +++ b/cake/libs/view/helpers/text.php @@ -168,7 +168,7 @@ function truncate($text, $length = 100, $ending = '...', $exact = true, $conside if (mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length) { return $text; } - $totalLength = mb_strlen($ending); + $totalLength = mb_strlen(strip_tags($ending)); $openTags = array(); $truncate = ''; preg_match_all('/(<\/?([\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER); @@ -210,7 +210,6 @@ function truncate($text, $length = 100, $ending = '...', $exact = true, $conside break; } } - } else { if (mb_strlen($text) <= $length) { return $text; diff --git a/cake/tests/cases/libs/view/helpers/text.test.php b/cake/tests/cases/libs/view/helpers/text.test.php index 283e17df0..6aa35d21d 100644 --- a/cake/tests/cases/libs/view/helpers/text.test.php +++ b/cake/tests/cases/libs/view/helpers/text.test.php @@ -100,7 +100,9 @@ function testTruncate() { $this->assertIdentical($this->Text->{$m}($text7, 255), $text7); $this->assertIdentical($this->Text->{$m}($text7, 15), 'El moño está...'); $this->assertIdentical($this->Text->{$m}($text8, 15), 'Vive la R'.chr(195).chr(169).'pu...'); - + $this->assertIdentical($this->Text->{$m}($text1, 25, 'Read more'), 'The quick brown Read more'); + $this->assertIdentical($this->Text->{$m}($text1, 25, '<a href="http://www.google.com/">Read more</a>', true, true), 'The quick brown <a href="http://www.google.com/">Read more</a>'); + if ($this->method == 'truncate') { $this->method = 'trim'; $this->testTruncate(); From 205c95ef65e3a41cfef6ab11ffa1fa044e967470 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Perras?= <joel.perras@gmail.com> Date: Tue, 2 Feb 2010 11:45:57 -0500 Subject: [PATCH 1620/2083] Fix array_values() warning when using Tree Behavior under certain situations. In TreeBehavior::_setParent(), if the $Model->find('first') returned false, then array_values() would throw a warning. --- cake/libs/model/behaviors/tree.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cake/libs/model/behaviors/tree.php b/cake/libs/model/behaviors/tree.php index addd8c6c2..126f5aac1 100644 --- a/cake/libs/model/behaviors/tree.php +++ b/cake/libs/model/behaviors/tree.php @@ -808,11 +808,16 @@ function _setParent(&$Model, $parentId = null, $created = false) { $this->__sync($Model, $edge - $node[$left] + 1, '+', 'BETWEEN ' . $node[$left] . ' AND ' . $node[$right], $created); $this->__sync($Model, $node[$right] - $node[$left] + 1, '-', '> ' . $node[$left], $created); } else { - $parentNode = array_values($Model->find('first', array( + $values = $Model->find('first', array( 'conditions' => array($scope, $Model->escapeField() => $parentId), 'fields' => array($Model->primaryKey, $left, $right), 'recursive' => $recursive - ))); + )); + + if ($values === false) { + return false; + } + $parentNode = array_values($values); if (empty($parentNode) || empty($parentNode[0])) { return false; From 2adac05dad25062d1d6bcf5a4124a6f88dfefbcd Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 2 Feb 2010 20:39:05 -0500 Subject: [PATCH 1621/2083] Fixing RequestHandler::beforeRedirect() and issues with array urls, where incompatibilities between standard url arrays and requestAction url arrays caused incorrect results. Tests added. Fixes #276 --- .../controller/components/request_handler.php | 3 ++ .../components/request_handler.test.php | 39 +++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php index 89d0e7f81..4a21c3f7e 100644 --- a/cake/libs/controller/components/request_handler.php +++ b/cake/libs/controller/components/request_handler.php @@ -241,6 +241,9 @@ function beforeRedirect(&$controller, $url) { foreach ($_POST as $key => $val) { unset($_POST[$key]); } + if (is_array($url)) { + $url = Router::url($url + array('base' => false)); + } echo $this->requestAction($url, array('return')); $this->_stop(); } diff --git a/cake/tests/cases/libs/controller/components/request_handler.test.php b/cake/tests/cases/libs/controller/components/request_handler.test.php index a0a4e5da7..f8d0047fc 100644 --- a/cake/tests/cases/libs/controller/components/request_handler.test.php +++ b/cake/tests/cases/libs/controller/components/request_handler.test.php @@ -69,6 +69,15 @@ function destination() { $this->viewPath = 'posts'; $this->render('index'); } +/** + * test method for ajax redirection + parameter parsing + * + * @return void + */ + function param_method($one = null, $two = null) { + echo "one: $one two: $two"; + $this->autoRender = false; + } } /** @@ -576,5 +585,35 @@ function testAjaxRedirectAsRequestAction() { unset($_SERVER['HTTP_X_REQUESTED_WITH']); App::build(); } + +/** + * test that the beforeRedirect callback properly converts + * array urls into their correct string ones, and adds base => false so + * the correct urls are generated. + * + * @link http://cakephp.lighthouseapp.com/projects/42648-cakephp-1x/tickets/276 + * @return void + */ + function testBeforeRedirectCallbackWithArrayUrl() { + $_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'; + App::build(array( + 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS) + ), true); + Router::setRequestInfo(array( + array('plugin' => null, 'controller' => 'accounts', 'action' => 'index', 'pass' => array(), 'named' => array(), 'form' => array(), 'url' => array('url' => 'accounts/'), 'bare' => 0), + array('base' => '/officespace', 'here' => '/officespace/accounts/', 'webroot' => '/officespace/') + )); + + $RequestHandler =& new NoStopRequestHandler(); + + ob_start(); + $RequestHandler->beforeRedirect( + $this->Controller, + array('controller' => 'request_handler_test', 'action' => 'param_method', 'first', 'second') + ); + $result = ob_get_clean(); + $this->assertEqual($result, 'one: first two: second'); + App::build(); + } } ?> \ No newline at end of file From 4b269e3170a5e4724e7bd05d83537905cab27f4e Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 2 Feb 2010 20:39:05 -0500 Subject: [PATCH 1622/2083] Fixing RequestHandler::beforeRedirect() and issues with array urls, where incompatibilities between standard url arrays and requestAction url arrays caused incorrect results. Tests added. Fixes #276 --- .../controller/components/request_handler.php | 3 ++ .../components/request_handler.test.php | 39 +++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php index c5bc6184e..681d8b34a 100644 --- a/cake/libs/controller/components/request_handler.php +++ b/cake/libs/controller/components/request_handler.php @@ -230,6 +230,9 @@ function beforeRedirect(&$controller, $url) { foreach ($_POST as $key => $val) { unset($_POST[$key]); } + if (is_array($url)) { + $url = Router::url($url + array('base' => false)); + } echo $this->requestAction($url, array('return')); $this->_stop(); } diff --git a/cake/tests/cases/libs/controller/components/request_handler.test.php b/cake/tests/cases/libs/controller/components/request_handler.test.php index b9cc6e762..97f1e0751 100644 --- a/cake/tests/cases/libs/controller/components/request_handler.test.php +++ b/cake/tests/cases/libs/controller/components/request_handler.test.php @@ -70,6 +70,15 @@ function destination() { $this->viewPath = 'posts'; $this->render('index'); } +/** + * test method for ajax redirection + parameter parsing + * + * @return void + */ + function param_method($one = null, $two = null) { + echo "one: $one two: $two"; + $this->autoRender = false; + } } /** * RequestHandlerTestDisabledController class @@ -541,5 +550,35 @@ function testAjaxRedirectAsRequestAction() { Configure::write('viewPaths', $_paths); unset($_SERVER['HTTP_X_REQUESTED_WITH']); } + +/** + * test that the beforeRedirect callback properly converts + * array urls into their correct string ones, and adds base => false so + * the correct urls are generated. + * + * @link http://cakephp.lighthouseapp.com/projects/42648-cakephp-1x/tickets/276 + * @return void + */ + function testBeforeRedirectCallbackWithArrayUrl() { + $_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'; + App::build(array( + 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS) + ), true); + Router::setRequestInfo(array( + array('plugin' => null, 'controller' => 'accounts', 'action' => 'index', 'pass' => array(), 'named' => array(), 'form' => array(), 'url' => array('url' => 'accounts/'), 'bare' => 0), + array('base' => '/officespace', 'here' => '/officespace/accounts/', 'webroot' => '/officespace/') + )); + + $RequestHandler =& new NoStopRequestHandler(); + + ob_start(); + $RequestHandler->beforeRedirect( + $this->Controller, + array('controller' => 'request_handler_test', 'action' => 'param_method', 'first', 'second') + ); + $result = ob_get_clean(); + $this->assertEqual($result, 'one: first two: second'); + App::build(); + } } ?> \ No newline at end of file From 447e953bd1722522a4b442dbc6b1433467bfb892 Mon Sep 17 00:00:00 2001 From: Martin Radosta <mradosta@pragmatia.com> Date: Wed, 3 Feb 2010 07:09:52 -0300 Subject: [PATCH 1623/2083] Add exact comparison to Debugger::checkSecurityKeys(). Fixes issues with modifying the value by one digit. Fixes #298 Signed-off-by: Mark Story <mark@mark-story.com> --- cake/libs/debugger.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index 7a1e0b2ba..980e435bd 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -674,7 +674,7 @@ function checkSecurityKeys() { trigger_error(__('Please change the value of \'Security.salt\' in app/config/core.php to a salt value specific to your application', true), E_USER_NOTICE); } - if (Configure::read('Security.cipherSeed') == '76859309657453542496749683645') { + if (Configure::read('Security.cipherSeed') === '76859309657453542496749683645') { trigger_error(__('Please change the value of \'Security.cipherSeed\' in app/config/core.php to a numeric (digits only) seed value specific to your application', true), E_USER_NOTICE); } } From a20c809796bf143b53488b9d3f7c50728a46ac06 Mon Sep 17 00:00:00 2001 From: rchavik <rchavik@xintesa.com> Date: Thu, 4 Feb 2010 09:13:11 +0700 Subject: [PATCH 1624/2083] EmailComponent: Accept arrays for $to variable (closes #293) --- cake/libs/controller/components/email.php | 35 ++++++++++++++++++----- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index cbd5acd7b..d96f2811d 100644 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -363,7 +363,7 @@ function send($content = null, $template = null, $layout = null) { */ function reset() { $this->template = null; - $this->to = null; + $this->to = array(); $this->from = null; $this->replyTo = null; $this->return = null; @@ -473,7 +473,11 @@ function __createBoundary() { */ function __createHeader() { if ($this->delivery == 'smtp') { - $this->__header[] = 'To: ' . $this->__formatAddress($this->to); + if (is_array($this->to)) { + $this->__header[] = 'To: ' . implode(', ', array_map(array($this, '__formatAddress'), $this->to)); + } else { + $this->__header[] = 'To: ' . $this->__formatAddress($this->to); + } } $this->__header[] = 'From: ' . $this->__formatAddress($this->from); @@ -692,10 +696,15 @@ function __strip($value, $message = false) { function __mail() { $header = implode("\n", $this->__header); $message = implode("\n", $this->__message); + if (is_array($this->to)) { + $to = implode(', ', array_map(array($this, '__formatAddress'), $this->to)); + } else { + $to = $this->to; + } if (ini_get('safe_mode')) { - return @mail($this->to, $this->__encode($this->subject), $message, $header); + return @mail($to, $this->__encode($this->subject), $message, $header); } - return @mail($this->to, $this->__encode($this->subject), $message, $header, $this->additionalParams); + return @mail($to, $this->__encode($this->subject), $message, $header, $this->additionalParams); } /** @@ -748,8 +757,15 @@ function __smtp() { return false; } - if (!$this->__smtpSend('RCPT TO: ' . $this->__formatAddress($this->to, true))) { - return false; + if (!is_array($this->to)) { + $tos = array($this->to); + } else { + $tos = $this->to; + } + foreach ($tos as $to) { + if (!$this->__smtpSend('RCPT TO: ' . $this->__formatAddress($to, true))) { + return false; + } } foreach ($this->cc as $cc) { @@ -814,12 +830,17 @@ function __debug() { $message = implode($nl, $this->__message); $fm = '<pre>'; + if (is_array($this->to)) { + $to = implode(', ', array_map(array($this, '__formatAddress'), $this->to)); + } else { + $to = $this->to; + } if ($this->delivery == 'smtp') { $fm .= sprintf('%s %s%s', 'Host:', $this->smtpOptions['host'], $nl); $fm .= sprintf('%s %s%s', 'Port:', $this->smtpOptions['port'], $nl); $fm .= sprintf('%s %s%s', 'Timeout:', $this->smtpOptions['timeout'], $nl); } - $fm .= sprintf('%s %s%s', 'To:', $this->to, $nl); + $fm .= sprintf('%s %s%s', 'To:', $to, $nl); $fm .= sprintf('%s %s%s', 'From:', $this->from, $nl); $fm .= sprintf('%s %s%s', 'Subject:', $this->__encode($this->subject), $nl); $fm .= sprintf('%s%3$s%3$s%s', 'Header:', $header, $nl); From f585630286297452f71f1778fa7f9f6fd9869eca Mon Sep 17 00:00:00 2001 From: rchavik <rchavik@xintesa.com> Date: Thu, 4 Feb 2010 09:35:33 +0700 Subject: [PATCH 1625/2083] Test case: EmailComponent $to accepts array (closes 293) --- .../libs/controller/components/email.test.php | 52 ++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/controller/components/email.test.php b/cake/tests/cases/libs/controller/components/email.test.php index 80b51a3bf..078cfda5b 100644 --- a/cake/tests/cases/libs/controller/components/email.test.php +++ b/cake/tests/cases/libs/controller/components/email.test.php @@ -278,6 +278,56 @@ function testSmtpSend() { This is the body of the message +</pre> +TEMPDOC; + $this->assertTrue($this->Controller->EmailTest->send('This is the body of the message')); + $this->assertEqual($this->Controller->Session->read('Message.email.message'), $this->__osFix($expect)); + } + + +/** + * testSmtpSendMultipleTo method + * + * @access public + * @return void + */ + function testSmtpSendMultipleTo() { + if (!$this->skipIf(!fsockopen('localhost', 25), '%s No SMTP server running on localhost')) { + return; + } + $this->Controller->EmailTest->reset(); + $this->Controller->EmailTest->to = array('postmaster@localhost', 'root@localhost'); + $this->Controller->EmailTest->from = 'noreply@example.com'; + $this->Controller->EmailTest->subject = 'Cake SMTP multiple To test'; + $this->Controller->EmailTest->replyTo = 'noreply@example.com'; + $this->Controller->EmailTest->template = null; + + $this->Controller->EmailTest->delivery = 'smtp'; + $this->assertTrue($this->Controller->EmailTest->send('This is the body of the message')); + + $this->Controller->EmailTest->_debug = true; + $this->Controller->EmailTest->sendAs = 'text'; + $expect = <<<TEMPDOC +<pre>Host: localhost +Port: 25 +Timeout: 30 +To: postmaster@localhost, root@localhost +From: noreply@example.com +Subject: Cake SMTP multiple To test +Header: + +To: postmaster@localhost, root@localhost +From: noreply@example.com +Reply-To: noreply@example.com +Subject: Cake SMTP multiple To test +X-Mailer: CakePHP Email Component +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 7bitParameters: + +Message: + +This is the body of the message + </pre> TEMPDOC; $this->assertTrue($this->Controller->EmailTest->send('This is the body of the message')); @@ -664,7 +714,7 @@ function testReset() { $this->Controller->EmailTest->reset(); $this->assertNull($this->Controller->EmailTest->template); - $this->assertNull($this->Controller->EmailTest->to); + $this->assertIdentical($this->Controller->EmailTest->to, array()); $this->assertNull($this->Controller->EmailTest->from); $this->assertNull($this->Controller->EmailTest->replyTo); $this->assertNull($this->Controller->EmailTest->return); From 2c1e6de7d628f38904f79ad631d5378254399305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Perras?= <joel.perras@gmail.com> Date: Fri, 5 Feb 2010 13:18:46 -0500 Subject: [PATCH 1626/2083] Another fix for array_values() throwing a warning when using Tree Behavior under certain situations. --- cake/libs/model/behaviors/tree.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cake/libs/model/behaviors/tree.php b/cake/libs/model/behaviors/tree.php index 5ccc21591..311ff2efb 100644 --- a/cake/libs/model/behaviors/tree.php +++ b/cake/libs/model/behaviors/tree.php @@ -163,10 +163,15 @@ function beforeSave(&$Model) { $Model->data[$Model->alias][$parent] = null; $this->_addToWhitelist($Model, $parent); } else { - list($node) = array_values($Model->find('first', array( + $values = $Model->find('first', array( 'conditions' => array($scope,$Model->escapeField() => $Model->id), 'fields' => array($Model->primaryKey, $parent, $left, $right ), 'recursive' => $recursive) - )); + ); + + if ($values === false) { + return false; + } + list($node) = array_values($values); $parentNode = $Model->find('first', array( 'conditions' => array($scope, $Model->escapeField() => $Model->data[$Model->alias][$parent]), From e6404f2d06170fa94518b0aac9cf7568e7df3068 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 6 Feb 2010 14:20:28 -0500 Subject: [PATCH 1627/2083] Making built-in Canadian postal code validation accept postal codes with no spaces. Fixes #289 --- cake/libs/validation.php | 2 +- cake/tests/cases/libs/validation.test.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cake/libs/validation.php b/cake/libs/validation.php index 4ea3df2a3..4b732f25e 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -760,7 +760,7 @@ function postal($check, $regex = null, $country = null) { $_this->regex = '/\\A\\b[A-Z]{1,2}[0-9][A-Z0-9]? [0-9][ABD-HJLNP-UW-Z]{2}\\b\\z/i'; break; case 'ca': - $_this->regex = '/\\A\\b[ABCEGHJKLMNPRSTVXY][0-9][A-Z] [0-9][A-Z][0-9]\\b\\z/i'; + $_this->regex = '/\\A\\b[ABCEGHJKLMNPRSTVXY][0-9][A-Z] ?[0-9][A-Z][0-9]\\b\\z/i'; break; case 'it': case 'de': diff --git a/cake/tests/cases/libs/validation.test.php b/cake/tests/cases/libs/validation.test.php index 8acf5d8fe..d3db2e7df 100644 --- a/cake/tests/cases/libs/validation.test.php +++ b/cake/tests/cases/libs/validation.test.php @@ -2121,6 +2121,7 @@ function testPostal() { $this->assertFalse(Validation::postal('B2A 2AB', null, 'ca')); $this->assertTrue(Validation::postal('X0A 0A2', null, 'ca')); $this->assertTrue(Validation::postal('G4V 4C3', null, 'ca')); + $this->assertTrue(Validation::postal('L4J8D6', null, 'ca')); $this->assertFalse(Validation::postal('111', null, 'us')); $this->assertFalse(Validation::postal('1111', null, 'us')); From 104da15a737a13283f827d049beb1d0bea5344d5 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 6 Feb 2010 14:20:28 -0500 Subject: [PATCH 1628/2083] Making built-in Canadian postal code validation accept postal codes with no spaces. Fixes #289 --- cake/libs/validation.php | 2 +- cake/tests/cases/libs/validation.test.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cake/libs/validation.php b/cake/libs/validation.php index 6638f6973..09bdbcc5c 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -713,7 +713,7 @@ function postal($check, $regex = null, $country = null) { $_this->regex = '/\\A\\b[A-Z]{1,2}[0-9][A-Z0-9]? [0-9][ABD-HJLNP-UW-Z]{2}\\b\\z/i'; break; case 'ca': - $_this->regex = '/\\A\\b[ABCEGHJKLMNPRSTVXY][0-9][A-Z] [0-9][A-Z][0-9]\\b\\z/i'; + $_this->regex = '/\\A\\b[ABCEGHJKLMNPRSTVXY][0-9][A-Z] ?[0-9][A-Z][0-9]\\b\\z/i'; break; case 'it': case 'de': diff --git a/cake/tests/cases/libs/validation.test.php b/cake/tests/cases/libs/validation.test.php index 3adb5d38f..ecac28cc2 100644 --- a/cake/tests/cases/libs/validation.test.php +++ b/cake/tests/cases/libs/validation.test.php @@ -1928,6 +1928,7 @@ function testPostal() { $this->assertFalse(Validation::postal('B2A 2AB', null, 'ca')); $this->assertTrue(Validation::postal('X0A 0A2', null, 'ca')); $this->assertTrue(Validation::postal('G4V 4C3', null, 'ca')); + $this->assertTrue(Validation::postal('L4J8D6', null, 'ca')); $this->assertFalse(Validation::postal('111', null, 'us')); $this->assertFalse(Validation::postal('1111', null, 'us')); From 2cf294a749144b2cca2d06bab5db24abcb20f3c8 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 6 Feb 2010 14:30:39 -0500 Subject: [PATCH 1629/2083] Fixing typo in Finland for sv-fi language. Fixes #308 --- cake/libs/l10n.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/l10n.php b/cake/libs/l10n.php index db82c59da..96d334ae5 100644 --- a/cake/libs/l10n.php +++ b/cake/libs/l10n.php @@ -294,7 +294,7 @@ class L10n extends Object { 'sq' => array('language' => 'Albanian', 'locale' => 'alb', 'localeFallback' => 'alb', 'charset' => 'utf-8'), 'sr' => array('language' => 'Serbian', 'locale' => 'scc', 'localeFallback' => 'scc', 'charset' => 'utf-8'), 'sv' => array('language' => 'Swedish', 'locale' => 'swe', 'localeFallback' => 'swe', 'charset' => 'utf-8'), - 'sv-fi' => array('language' => 'Swedish (Findland)', 'locale' => 'sv_fi', 'localeFallback' => 'swe', 'charset' => 'utf-8'), + 'sv-fi' => array('language' => 'Swedish (Finland)', 'locale' => 'sv_fi', 'localeFallback' => 'swe', 'charset' => 'utf-8'), 'sx' => array('language' => 'Sutu', 'locale' => 'sx', 'localeFallback' => 'sx', 'charset' => 'utf-8'), 'sz' => array('language' => 'Sami (Lappish)', 'locale' => 'smi', 'localeFallback' => 'smi', 'charset' => 'utf-8'), 'th' => array('language' => 'Thai', 'locale' => 'tha', 'localeFallback' => 'tha', 'charset' => 'utf-8'), From 6f08d86c8ee1da4458ae0937213723f642983ed3 Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Sun, 7 Feb 2010 23:56:50 +0530 Subject: [PATCH 1630/2083] Links generated by PaginatorHelper::prev and PaginatorHelper::next are now wrapped in 'span' or the tag specified in options. Fixes #311 --- cake/libs/view/helpers/paginator.php | 12 +-- .../libs/view/helpers/paginator.test.php | 74 +++++++++++++++---- 2 files changed, 64 insertions(+), 22 deletions(-) diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index 6be7d57d6..870c94223 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -67,7 +67,7 @@ class PaginatorHelper extends AppHelper { * - `$options['escape']` Defines if the title field for the link should be escaped (default: true). * - `$options['update']` DOM id of the element updated with the results of the AJAX call. * If this key isn't specified Paginator will use plain HTML links. - * - `$options['indicator']` DOM id of the element that will be shown when doing AJAX requests. **Only supported by + * - `$options['indicator']` DOM id of the element that will be shown when doing AJAX requests. **Only supported by * AjaxHelper** * * @var array @@ -368,7 +368,7 @@ function link($title, $url = array(), $options = array()) { * Merges passed URL options with current pagination state to generate a pagination URL. * * @param array $options Pagination/URL options array - * @param boolean $asArray Return the url as an array, or a URI string + * @param boolean $asArray Return the url as an array, or a URI string * @param string $model Which model to paginate on * @return mixed By default, returns a full pagination URL string for use in non-standard contexts (i.e. JavaScript) * @access public @@ -427,7 +427,7 @@ function __pagingLink($which, $title = null, $options = array(), $disabledTitle $url = array_merge(array('page' => $paging['page'] + ($which == 'Prev' ? $step * -1 : $step)), $url); if ($this->{$check}($model)) { - return $this->link($title, $url, array_merge($options, compact('escape', 'class'))); + return $this->Html->tag($tag, $this->link($title, $url, array_merge($options, compact('escape', 'class')))); } else { return $this->Html->tag($tag, $title, array_merge($options, compact('escape', 'class'))); } @@ -514,7 +514,7 @@ function defaultModel() { * * - `model` The model to use, defaults to PaginatorHelper::defaultModel(); * - `format` The format string you want to use, defaults to 'pages' Which generates output like '1 of 5' - * set to 'range' to generate output like '1 - 3 of 13'. Can also be set to a custom string, containing + * set to 'range' to generate output like '1 - 3 of 13'. Can also be set to a custom string, containing * the following placeholders `%page%`, `%pages%`, `%current%`, `%count%`, `%start%`, `%end%` and any * custom content you would like. * - `separator` The separator string to use, default to ' of ' @@ -592,9 +592,9 @@ function counter($options = array()) { * - `modulus` how many numbers to include on either side of the current page, defaults to 8. * - `separator` Separator content defaults to ' | ' * - `tag` The tag to wrap links in, defaults to 'span' - * - `first` Whether you want first links generated, set to an integer to define the number of 'first' + * - `first` Whether you want first links generated, set to an integer to define the number of 'first' * links to generate - * - `last` Whether you want last links generated, set to an integer to define the number of 'last' + * - `last` Whether you want last links generated, set to an integer to define the number of 'last' * links to generate * * @param mixed $options Options for the numbers, (before, after, model, modulus, separator) diff --git a/cake/tests/cases/libs/view/helpers/paginator.test.php b/cake/tests/cases/libs/view/helpers/paginator.test.php index 87d1c5f03..9333c4e89 100644 --- a/cake/tests/cases/libs/view/helpers/paginator.test.php +++ b/cake/tests/cases/libs/view/helpers/paginator.test.php @@ -193,7 +193,7 @@ function testSortLinks() { $this->Paginator->params['paging']['Article']['options']['sort'] = null; $result = $this->Paginator->sort('title'); $this->assertPattern('/\/accounts\/index\/param\/page:1\/sort:title\/direction:desc" class="asc">Title<\/a>$/', $result); - + $this->Paginator->params['paging']['Article']['options']['order'] = array('Article.title' => 'desc'); $this->Paginator->params['paging']['Article']['options']['sort'] = null; $result = $this->Paginator->sort('Title', 'title', array('direction' => 'desc')); @@ -396,9 +396,11 @@ function testSortAdminLinks() { $this->Paginator->params['paging']['Article']['page'] = 1; $result = $this->Paginator->next('Next'); $expected = array( + '<span', 'a' => array('href' => '/admin/users/index/page:2', 'class' => 'next'), 'Next', - '/a' + '/a', + '/span' ); $this->assertTags($result, $expected); @@ -497,17 +499,21 @@ function testUrlGenerationWithPrefixes() { $result = $this->Paginator->next('next', array('url' => $options)); $expected = array( + '<span', 'a' => array('href' => '/members/posts/index/page:3', 'class' => 'next'), 'next', - '/a' + '/a', + '/span' ); $this->assertTags($result, $expected); $result = $this->Paginator->prev('prev', array('url' => $options)); $expected = array( + '<span', 'a' => array('href' => '/members/posts/index/page:1', 'class' => 'prev'), 'prev', - '/a' + '/a', + '/span' ); $this->assertTags($result, $expected); @@ -587,7 +593,7 @@ function testPassedArgsMergingWithUrlOptions() { )); $this->Paginator->params['paging'] = array( 'Article' => array( - 'page' => 1, 'current' => 3, 'count' => 13, + 'page' => 1, 'current' => 3, 'count' => 13, 'prevPage' => false, 'nextPage' => true, 'pageCount' => 8, 'defaults' => array( 'limit' => 3, 'step' => 1, 'order' => array(), 'conditions' => array() @@ -630,9 +636,11 @@ function testPassedArgsMergingWithUrlOptions() { $result = $this->Paginator->next('Next'); $expected = array( + '<span', 'a' => array('href' => '/articles/index/2/page:2/foo:bar', 'class' => 'next'), 'Next', - '/a' + '/a', + '/span' ); $this->assertTags($result, $expected); } @@ -669,33 +677,51 @@ function testPagingLinks() { $this->Paginator->params['paging']['Client']['prevPage'] = true; $result = $this->Paginator->prev('<< Previous', null, null, array('class' => 'disabled')); $expected = array( + '<span', 'a' => array('href' => '/index/page:1', 'class' => 'prev'), '<< Previous', - '/a' + '/a', + '/span' ); $this->assertTags($result, $expected); $result = $this->Paginator->next('Next'); $expected = array( + '<span', 'a' => array('href' => '/index/page:3', 'class' => 'next'), 'Next', - '/a' + '/a', + '/span' + ); + $this->assertTags($result, $expected); + + $result = $this->Paginator->next('Next', array('tag' => 'li')); + $expected = array( + '<li', + 'a' => array('href' => '/index/page:3', 'class' => 'next'), + 'Next', + '/a', + '/li' ); $this->assertTags($result, $expected); $result = $this->Paginator->prev('<< Previous', array('escape' => true)); $expected = array( + '<span', 'a' => array('href' => '/index/page:1', 'class' => 'prev'), '<< Previous', - '/a' + '/a', + '/span' ); $this->assertTags($result, $expected); $result = $this->Paginator->prev('<< Previous', array('escape' => false)); $expected = array( + '<span', 'a' => array('href' => '/index/page:1', 'class' => 'prev'), 'preg:/<< Previous/', - '/a' + '/a', + '/span' ); $this->assertTags($result, $expected); @@ -739,17 +765,21 @@ function testPagingLinks() { $this->Paginator->params['paging']['Client']['prevPage'] = true; $result = $this->Paginator->prev('<< Previous', null, null, array('class' => 'disabled')); $expected = array( + '<span', 'a' => array('href' => '/index/page:1/limit:3/sort:Client.name/direction:DESC', 'class' => 'prev'), '<< Previous', - '/a' + '/a', + '/span' ); $this->assertTags($result, $expected, true); $result = $this->Paginator->next('Next'); $expected = array( + '<span', 'a' => array('href' => '/index/page:3/limit:3/sort:Client.name/direction:DESC', 'class' => 'next'), 'Next', - '/a' + '/a', + '/span' ); $this->assertTags($result, $expected); @@ -760,15 +790,17 @@ function testPagingLinks() { )); $result = $this->Paginator->prev('Prev'); $expected = array( + '<span', 'a' => array('href' => '/index/page:1/limit:10', 'class' => 'prev'), 'Prev', '/a', + '/span' ); $this->assertTags($result, $expected); $this->Paginator->params['paging'] = array( 'Client' => array( - 'page' => 2, 'current' => 1, 'count' => 13, 'prevPage' => true, + 'page' => 2, 'current' => 1, 'count' => 13, 'prevPage' => true, 'nextPage' => false, 'pageCount' => 2, 'defaults' => array(), 'options' => array( @@ -779,9 +811,11 @@ function testPagingLinks() { $this->Paginator->options(array('url' => array(12, 'page' => 3))); $result = $this->Paginator->prev('Prev', array('url' => array('foo' => 'bar'))); $expected = array( + '<span', 'a' => array('href' => '/index/12/page:1/limit:10/foo:bar', 'class' => 'prev'), 'Prev', '/a', + '/span' ); $this->assertTags($result, $expected); } @@ -815,9 +849,11 @@ function testPagingLinksOptionsReplaceEmptyDisabledOptions() { $result = $this->Paginator->next('Next >>', array('escape' => false)); $expected = array( + '<span', 'a' => array('href' => '/index/page:2', 'class' => 'next'), 'preg:/Next >>/', - '/a' + '/a', + '/span' ); $this->assertTags($result, $expected); } @@ -846,7 +882,11 @@ function testPagingLinksNotDefaultModel() { ); $result = $this->Paginator->next('Next', array('model' => 'Client')); $expected = array( - 'a' => array('href' => '/index/page:2', 'class' => 'next'), 'Next', '/a' + '<span', + 'a' => array('href' => '/index/page:2', 'class' => 'next'), + 'Next', + '/a', + '/span' ); $this->assertTags($result, $expected); @@ -1784,9 +1824,11 @@ function testNextLinkUsingDotNotation() { $result = $this->Paginator->next('Next'); $expected = array( + '<span', 'a' => array('href' => '/officespace/accounts/index/page:2/sort:Article.title/direction:asc', 'class' => 'next'), 'Next', - '/a' + '/a', + '/span', ); $this->assertTags($result, $expected); } From 1febd776bd6afe2139a86a6019543de555fff49d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 7 Feb 2010 15:19:47 -0500 Subject: [PATCH 1631/2083] Fixing include errors caused by empty asset filters in Dispatcher::asset(). Fixes #313 --- cake/dispatcher.php | 16 +++++++++++----- cake/tests/cases/dispatcher.test.php | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 8d46e22b3..9046c2794 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -596,12 +596,18 @@ function asset($url) { if (strpos($url, '..') !== false || strpos($url, '.') === false) { return false; } - - if (strpos($url, 'ccss/') === 0) { - include WWW_ROOT . DS . Configure::read('Asset.filter.css'); + $filters = Configure::read('Asset.filter'); + $isCss = strpos($url, 'ccss/') === 0; + $isJs = strpos($url, 'cjs/') === 0; + + if (($isCss && empty($filters['css'])) || ($isJs && empty($filters['js']))) { + header('HTTP/1.1 404 Not Found'); + return $this->_stop(); + } elseif ($isCss) { + include WWW_ROOT . DS . $filter['css']; $this->_stop(); - } elseif (strpos($url, 'cjs/') === 0) { - include WWW_ROOT . DS . Configure::read('Asset.filter.js'); + } elseif ($isJs) { + include WWW_ROOT . DS . $filters['js']; $this->_stop(); } $controller = null; diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index c2e521677..9cbc28afc 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -1974,6 +1974,26 @@ function testAssets() { header('Content-type: text/html'); } +/** + * test that missing asset processors trigger a 404 with no response body. + * + * @return void + */ + function testMissingAssetProcessor404() { + $Dispatcher =& new TestDispatcher(); + Configure::write('Asset.filter', array( + 'js' => '', + 'css' => null + )); + $this->assertNoErrors(); + + $Dispatcher->params = $Dispatcher->parseParams('ccss/cake.generic.css'); + ob_start(); + $Dispatcher->asset('ccss/cake.generic.css'); + + header('HTTP/1.1 200 Ok'); + } + /** * testFullPageCachingDispatch method * From 8c1c0e63c0b9641d5ebd61f4d210c161b2f001af Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Mon, 8 Feb 2010 03:00:43 +0530 Subject: [PATCH 1632/2083] Allowing a html tag's attribute to be omitted from ouput by setting its value to null or false. Closes #316 --- cake/libs/view/helper.php | 12 +- .../cases/libs/view/helpers/form.test.php | 152 ++++++++++-------- 2 files changed, 91 insertions(+), 73 deletions(-) diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index 043ef1dc2..516919a1a 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -302,10 +302,12 @@ function clean($output) { * 'escape' is a special option in that it controls the conversion of * attributes to their html-entity encoded equivalents. Set to false to disable html-encoding. * + * If value for any option key is set to `null` or `false`, that option will be excluded from output. + * * @param array $options Array of options. * @param array $exclude Array of options to be excluded, the options here will not be part of the return. * @param string $insertBefore String to be inserted before options. - * @param string $insertAfter String to be inserted ater options. + * @param string $insertAfter String to be inserted after options. * @return string Composed attributes. * @access public */ @@ -322,7 +324,9 @@ function _parseAttributes($options, $exclude = null, $insertBefore = ' ', $inser $attributes = array(); foreach ($keys as $index => $key) { - $attributes[] = $this->__formatAttribute($key, $values[$index], $escape); + if ($values[$index] !== false && $values[$index] !== null) { + $attributes[] = $this->__formatAttribute($key, $values[$index], $escape); + } } $out = implode(' ', $attributes); } else { @@ -711,7 +715,7 @@ function value($options = array(), $field = null, $key = 'value') { } /** - * Sets the defaults for an input tag. Will set the + * Sets the defaults for an input tag. Will set the * name, value, and id attributes for an array of html attributes. Will also * add a 'form-error' class if the field contains validation errors. * @@ -737,7 +741,7 @@ function _initInputField($field, $options = array()) { /** * Adds the given class to the element options * - * @param array $options Array options/attributes to add a class to + * @param array $options Array options/attributes to add a class to * @param string $class The classname being added. * @param string $key the key to use for class. * @return array Array of options with $key set. diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index aa128f7e0..1469ef939 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -843,7 +843,7 @@ function testTextFieldGenerationForFloats() { '/label', array('input' => array( 'type' => 'text', 'name' => 'data[Contact][foo]', - 'value' => '', 'id' => 'ContactFoo' + 'id' => 'ContactFoo' )), '/div' ); @@ -1094,7 +1094,7 @@ function testFormSecuredInput() { '/label', array('input' => array( 'type' => 'text', 'name' => 'data[UserForm][published]', - 'value' => '', 'id' => 'UserFormPublished' + 'id' => 'UserFormPublished' )), '/div' ); @@ -1108,7 +1108,7 @@ function testFormSecuredInput() { '/label', array('input' => array( 'type' => 'text', 'name' => 'data[UserForm][other]', - 'value' => '', 'id' => 'UserFormOther' + 'id' => 'UserFormOther' )), '/div' ); @@ -1117,7 +1117,7 @@ function testFormSecuredInput() { $result = $this->Form->hidden('UserForm.stuff'); $expected = array('input' => array( 'type' => 'hidden', 'name' => 'data[UserForm][stuff]', - 'value' => '', 'id' => 'UserFormStuff' + 'id' => 'UserFormStuff' )); $this->assertTags($result, $expected); @@ -1240,7 +1240,7 @@ function testPasswordValidation() { '/label', 'input' => array( 'type' => 'password', 'name' => 'data[Contact][password]', - 'value' => '', 'id' => 'ContactPassword', 'class' => 'form-error' + 'id' => 'ContactPassword', 'class' => 'form-error' ), array('div' => array('class' => 'error-message')), 'Please provide a password', @@ -1400,7 +1400,7 @@ function testFormValidationMultiRecord() { 'preg:/[^<]+/', '/label', 'input' => array( - 'type' => 'text', 'name', 'value' => '', 'id', + 'type' => 'text', 'name', 'id', 'class' => 'form-error', 'maxlength' => 255 ), array('div' => array('class' => 'error-message')), @@ -1421,7 +1421,7 @@ function testFormValidationMultiRecord() { 'preg:/[^<]+/', '/label', 'input' => array( - 'type' => 'text', 'name', 'value' => '', 'id', 'class' => 'form-error' + 'type' => 'text', 'name', 'id', 'class' => 'form-error' ), array('div' => array('class' => 'error-message')), 'You must provide a URL', @@ -1451,7 +1451,7 @@ function testMultipleInputValidation() { 'preg:/[^<]+/', '/label', 'input' => array( - 'type' => 'text', 'name', 'value' => '', 'id', 'class' => 'form-error' + 'type' => 'text', 'name', 'id', 'class' => 'form-error' ), array('div' => array('class' => 'error-message')), 'This field cannot be empty', @@ -1466,7 +1466,7 @@ function testMultipleInputValidation() { 'label' => array('for'), 'preg:/[^<]+/', '/label', - 'input' => array('type' => 'text', 'name', 'value' => '', 'id', 'class' => 'form-error'), + 'input' => array('type' => 'text', 'name', 'id', 'class' => 'form-error'), array('div' => array('class' => 'error-message')), 'This field cannot be empty', '/div', @@ -1480,7 +1480,7 @@ function testMultipleInputValidation() { 'label' => array('for'), 'preg:/[^<]+/', '/label', - 'input' => array('type' => 'text', 'name', 'value' => '', 'id'), + 'input' => array('type' => 'text', 'name', 'id'), '/div' ); $this->assertTags($result, $expected); @@ -1492,7 +1492,7 @@ function testMultipleInputValidation() { 'preg:/[^<]+/', '/label', 'input' => array( - 'type' => 'text', 'name' => 'preg:/[^<]+/', 'value' => '', + 'type' => 'text', 'name' => 'preg:/[^<]+/', 'id' => 'preg:/[^<]+/', 'class' => 'form-error' ), array('div' => array('class' => 'error-message')), @@ -1518,7 +1518,7 @@ function testInput() { 'label' => array('for'), 'Balance', '/label', - 'input' => array('name', 'type' => 'text', 'maxlength' => 8, 'value' => '', 'id'), + 'input' => array('name', 'type' => 'text', 'maxlength' => 8, 'id'), '/div', ); $this->assertTags($result, $expected); @@ -1530,17 +1530,31 @@ function testInput() { 'Email', '/label', array('input' => array( - 'type' => 'text', 'name' => 'data[Contact][email]', 'value' => '', + 'type' => 'text', 'name' => 'data[Contact][email]', 'id' => 'custom', 'maxlength' => 255 )), '/div' ); $this->assertTags($result, $expected); + $result = $this->Form->input('Contact.email', array('div' => array('class' => false))); + $expected = array( + '<div', + 'label' => array('for' => 'ContactEmail'), + 'Email', + '/label', + array('input' => array( + 'type' => 'text', 'name' => 'data[Contact][email]', + 'id' => 'ContactEmail', 'maxlength' => 255 + )), + '/div' + ); + $this->assertTags($result, $expected); + $result = $this->Form->hidden('Contact.idontexist'); $expected = array('input' => array( 'type' => 'hidden', 'name' => 'data[Contact][idontexist]', - 'value' => '', 'id' => 'ContactIdontexist' + 'id' => 'ContactIdontexist' )); $this->assertTags($result, $expected); @@ -1552,7 +1566,7 @@ function testInput() { '/label', array('input' => array( 'type' => 'text', 'name' => 'data[Contact][email]', - 'value' => '', 'id' => 'ContactEmail' + 'id' => 'ContactEmail' )), '/div' ); @@ -1566,7 +1580,7 @@ function testInput() { '/label', array('input' => array( 'type' => 'text', 'name' => 'data[Contact][5][email]', - 'value' => '', 'id' => 'Contact5Email' + 'id' => 'Contact5Email' )), '/div' ); @@ -1580,7 +1594,7 @@ function testInput() { '/label', array('input' => array( 'type' => 'password', 'name' => 'data[Contact][password]', - 'value' => '', 'id' => 'ContactPassword' + 'id' => 'ContactPassword' )), '/div' ); @@ -1596,7 +1610,7 @@ function testInput() { '/label', array('input' => array( 'type' => 'file', 'name' => 'data[Contact][email]', 'class' => 'textbox', - 'value' => '', 'id' => 'ContactEmail' + 'id' => 'ContactEmail' )), '/div' ); @@ -1643,7 +1657,7 @@ function testInput() { 'Field', '/label', 'input' => array( - 'type' => 'text', 'name' => 'data[Model][field]', 'value' => '', + 'type' => 'text', 'name' => 'data[Model][field]', 'id' => 'ModelField', 'class' => 'form-error' ), array('div' => array('class' => 'error-message')), @@ -1661,7 +1675,7 @@ function testInput() { 'Field', '/label', 'input' => array( - 'type' => 'text', 'name' => 'data[Model][field]', 'value' => '', + 'type' => 'text', 'name' => 'data[Model][field]', 'id' => 'ModelField', 'class' => 'form-error' ), array('span' => array('class' => 'error-message')), @@ -1679,7 +1693,7 @@ function testInput() { 'Field', '/label', 'input' => array( - 'type' => 'text', 'name' => 'data[Model][field]', 'value' => '', + 'type' => 'text', 'name' => 'data[Model][field]', 'id' => 'ModelField', 'class' => 'form-error' ), 'Badness!', @@ -1694,7 +1708,7 @@ function testInput() { 'Field', '/label', 'input' => array( - 'type' => 'text', 'name' => 'data[Model][field]', 'value' => '', + 'type' => 'text', 'name' => 'data[Model][field]', 'id' => 'ModelField', 'class' => 'form-error' ), 'A message to you, Rudy', @@ -1715,7 +1729,7 @@ function testInput() { 'label' => array('for' => 'ModelField'), 'Field', '/label', - 'input' => array('type' => 'text', 'name' => 'data[Model][field]', 'value' => '', 'id' => 'ModelField', 'class' => 'form-error'), + 'input' => array('type' => 'text', 'name' => 'data[Model][field]', 'id' => 'ModelField', 'class' => 'form-error'), 'A message to you, Rudy', '/div' ); @@ -1728,7 +1742,7 @@ function testInput() { 'label' => array('for' => 'ModelField'), 'Field', '/label', - 'input' => array('type' => 'text', 'name' => 'data[Model][field]', 'value' => '', 'id' => 'ModelField'), + 'input' => array('type' => 'text', 'name' => 'data[Model][field]', 'id' => 'ModelField'), 'A message to you, Rudy', '/div' ); @@ -1741,7 +1755,7 @@ function testInput() { 'label' => array('for' => 'ModelField'), 'Field', '/label', - 'input' => array('type' => 'text', 'name' => 'data[Model][field]', 'value' => '', 'id' => 'ModelField', 'class' => 'form-error'), + 'input' => array('type' => 'text', 'name' => 'data[Model][field]', 'id' => 'ModelField', 'class' => 'form-error'), array('div' => array('class' => 'error-message')), 'Le login doit contenir au moins 2 caractères', '/div', @@ -2043,7 +2057,7 @@ function testInputOverridingMagicSelectType() { $expected = array( 'div' => array('class' => 'input text'), 'label' => array('for' => 'ModelUserId'), 'User', '/label', - 'input' => array('name' => 'data[Model][user_id]', 'type' => 'text', 'id' => 'ModelUserId', 'value' => ''), + 'input' => array('name' => 'data[Model][user_id]', 'type' => 'text', 'id' => 'ModelUserId'), '/div' ); $this->assertTags($result, $expected); @@ -2108,7 +2122,7 @@ function testFormInputs() { $this->Form->create('Contact'); $result = $this->Form->inputs(false); $expected = array( - 'input' => array('type' => 'hidden', 'name' => 'data[Contact][id]', 'value' => '', 'id' => 'ContactId'), + 'input' => array('type' => 'hidden', 'name' => 'data[Contact][id]', 'id' => 'ContactId'), array('div' => array('class' => 'input text')), '*/div', array('div' => array('class' => 'input text')), @@ -2131,7 +2145,7 @@ function testFormInputs() { $this->Form->create('Contact'); $result = $this->Form->inputs(array('fieldset' => false, 'legend' => false)); $expected = array( - 'input' => array('type' => 'hidden', 'name' => 'data[Contact][id]', 'value' => '', 'id' => 'ContactId'), + 'input' => array('type' => 'hidden', 'name' => 'data[Contact][id]', 'id' => 'ContactId'), array('div' => array('class' => 'input text')), '*/div', array('div' => array('class' => 'input text')), @@ -2155,7 +2169,7 @@ function testFormInputs() { $result = $this->Form->inputs(array('fieldset' => true, 'legend' => false)); $expected = array( 'fieldset' => array(), - 'input' => array('type' => 'hidden', 'name' => 'data[Contact][id]', 'value' => '', 'id' => 'ContactId'), + 'input' => array('type' => 'hidden', 'name' => 'data[Contact][id]', 'id' => 'ContactId'), array('div' => array('class' => 'input text')), '*/div', array('div' => array('class' => 'input text')), @@ -2179,7 +2193,7 @@ function testFormInputs() { $this->Form->create('Contact'); $result = $this->Form->inputs(array('fieldset' => false, 'legend' => 'Hello')); $expected = array( - 'input' => array('type' => 'hidden', 'name' => 'data[Contact][id]', 'value' => '', 'id' => 'ContactId'), + 'input' => array('type' => 'hidden', 'name' => 'data[Contact][id]', 'id' => 'ContactId'), array('div' => array('class' => 'input text')), '*/div', array('div' => array('class' => 'input text')), @@ -2206,7 +2220,7 @@ function testFormInputs() { 'legend' => array(), 'Hello', '/legend', - 'input' => array('type' => 'hidden', 'name' => 'data[Contact][id]', 'value' => '', 'id' => 'ContactId'), + 'input' => array('type' => 'hidden', 'name' => 'data[Contact][id]', 'id' => 'ContactId'), array('div' => array('class' => 'input text')), '*/div', array('div' => array('class' => 'input text')), @@ -2234,7 +2248,7 @@ function testFormInputs() { 'legend' => array(), 'Hello', '/legend', - 'input' => array('type' => 'hidden', 'name' => 'data[Contact][id]', 'value' => '', 'id' => 'ContactId'), + 'input' => array('type' => 'hidden', 'name' => 'data[Contact][id]', 'id' => 'ContactId'), array('div' => array('class' => 'input text')), '*/div', array('div' => array('class' => 'input text')), @@ -2336,13 +2350,13 @@ function testLabel() { */ function testTextbox() { $result = $this->Form->text('Model.field'); - $this->assertTags($result, array('input' => array('type' => 'text', 'name' => 'data[Model][field]', 'value' => '', 'id' => 'ModelField'))); + $this->assertTags($result, array('input' => array('type' => 'text', 'name' => 'data[Model][field]', 'id' => 'ModelField'))); $result = $this->Form->text('Model.field', array('type' => 'password')); - $this->assertTags($result, array('input' => array('type' => 'password', 'name' => 'data[Model][field]', 'value' => '', 'id' => 'ModelField'))); + $this->assertTags($result, array('input' => array('type' => 'password', 'name' => 'data[Model][field]', 'id' => 'ModelField'))); $result = $this->Form->text('Model.field', array('id' => 'theID')); - $this->assertTags($result, array('input' => array('type' => 'text', 'name' => 'data[Model][field]', 'value' => '', 'id' => 'theID'))); + $this->assertTags($result, array('input' => array('type' => 'text', 'name' => 'data[Model][field]', 'id' => 'theID'))); $this->Form->data['Model']['text'] = 'test <strong>HTML</strong> values'; $result = $this->Form->text('Model.text'); @@ -2450,7 +2464,7 @@ function testInputErrorEscape() { */ function testPassword() { $result = $this->Form->password('Model.field'); - $this->assertTags($result, array('input' => array('type' => 'password', 'name' => 'data[Model][field]', 'value' => '', 'id' => 'ModelField'))); + $this->assertTags($result, array('input' => array('type' => 'password', 'name' => 'data[Model][field]', 'id' => 'ModelField'))); $this->Form->validationErrors['Model']['passwd'] = 1; $this->Form->data['Model']['passwd'] = 'test'; @@ -4719,7 +4733,7 @@ function testHiddenField() { */ function testFileUploadField() { $result = $this->Form->file('Model.upload'); - $this->assertTags($result, array('input' => array('type' => 'file', 'name' => 'data[Model][upload]', 'id' => 'ModelUpload', 'value' => ''))); + $this->assertTags($result, array('input' => array('type' => 'file', 'name' => 'data[Model][upload]', 'id' => 'ModelUpload'))); $this->Form->data['Model.upload'] = array("name" => "", "type" => "", "tmp_name" => "", "error" => 4, "size" => 0); $result = $this->Form->input('Model.upload', array('type' => 'file')); @@ -4728,7 +4742,7 @@ function testFileUploadField() { 'label' => array('for' => 'ModelUpload'), 'Upload', '/label', - 'input' => array('type' => 'file', 'name' => 'data[Model][upload]', 'id' => 'ModelUpload', 'value' => ''), + 'input' => array('type' => 'file', 'name' => 'data[Model][upload]', 'id' => 'ModelUpload'), '/div' ); $this->assertTags($result, $expected); @@ -4750,7 +4764,7 @@ function testFileUploadOnOtherModel() { $this->Form->create('ValidateUser', array('type' => 'file')); $result = $this->Form->file('ValidateProfile.city'); $expected = array( - 'input' => array('type' => 'file', 'name' => 'data[ValidateProfile][city]', 'value' => '', 'id' => 'ValidateProfileCity') + 'input' => array('type' => 'file', 'name' => 'data[ValidateProfile][city]', 'id' => 'ValidateProfileCity') ); $this->assertTags($result, $expected); } @@ -5133,7 +5147,7 @@ function testCreateWithInputDefaults() { )); $result = $this->Form->input('username'); $expected = array( - 'input' => array('type' => 'text', 'name' => 'data[User][username]', 'id' => 'UserUsername', 'value' => '') + 'input' => array('type' => 'text', 'name' => 'data[User][username]', 'id' => 'UserUsername') ); $this->assertTags($result, $expected); @@ -5141,7 +5155,7 @@ function testCreateWithInputDefaults() { $expected = array( 'div' => array('class' => 'input text'), 'label' => array('for' => 'UserUsername'), 'username', '/label', - 'input' => array('type' => 'text', 'name' => 'data[User][username]', 'id' => 'UserUsername', 'value' => ''), + 'input' => array('type' => 'text', 'name' => 'data[User][username]', 'id' => 'UserUsername'), '/div' ); $this->assertTags($result, $expected); @@ -5214,18 +5228,18 @@ function testGetFormCreate() { $result = $this->Form->text('Contact.name'); $this->assertTags($result, array('input' => array( - 'name' => 'name', 'type' => 'text', 'value' => '', 'id' => 'ContactName', + 'name' => 'name', 'type' => 'text', 'id' => 'ContactName', ))); $result = $this->Form->password('password'); $this->assertTags($result, array('input' => array( - 'name' => 'password', 'type' => 'password', 'value' => '', 'id' => 'ContactPassword' + 'name' => 'password', 'type' => 'password', 'id' => 'ContactPassword' ))); $this->assertNoPattern('/<input[^<>]+[^id|name|type|value]=[^<>]*>$/', $result); $result = $this->Form->text('user_form'); $this->assertTags($result, array('input' => array( - 'name' => 'user_form', 'type' => 'text', 'value' => '', 'id' => 'ContactUserForm' + 'name' => 'user_form', 'type' => 'text', 'id' => 'ContactUserForm' ))); } @@ -5289,7 +5303,7 @@ function testFormMagicInput() { 'Name', '/label', 'input' => array( - 'type' => 'text', 'name' => 'data[Contact][name]', 'value' => '', + 'type' => 'text', 'name' => 'data[Contact][name]', 'id' => 'ContactName', 'maxlength' => '255' ), '/div' @@ -5304,7 +5318,7 @@ function testFormMagicInput() { '/label', 'input' => array( 'type' => 'text', 'name' => 'data[Contact][non_existing_field_in_contact_model]', - 'value' => '', 'id' => 'ContactNonExistingFieldInContactModel' + 'id' => 'ContactNonExistingFieldInContactModel' ), '/div' ); @@ -5318,7 +5332,7 @@ function testFormMagicInput() { '/label', 'input' => array( 'type' => 'text', 'name' => 'data[Address][street]', - 'value' => '', 'id' => 'AddressStreet' + 'id' => 'AddressStreet' ), '/div' ); @@ -5332,7 +5346,7 @@ function testFormMagicInput() { '/label', 'input' => array( 'type' => 'text', 'name' => 'data[Address][non_existing_field_in_model]', - 'value' => '', 'id' => 'AddressNonExistingFieldInModel' + 'id' => 'AddressNonExistingFieldInModel' ), '/div' ); @@ -5345,7 +5359,7 @@ function testFormMagicInput() { '/label', 'input' => array( 'type' => 'text', 'name' => 'data[Contact][name]', - 'value' => '', 'id' => 'ContactName', 'maxlength' => '255' + 'id' => 'ContactName', 'maxlength' => '255' ) ); $this->assertTags($result, $expected); @@ -5358,7 +5372,7 @@ function testFormMagicInput() { '/label', 'input' => array( 'type' => 'text', 'name' => 'data[Contact][non_existing]', - 'value' => '', 'id' => 'ContactNonExisting' + 'id' => 'ContactNonExisting' ), '/div' ); @@ -5372,7 +5386,7 @@ function testFormMagicInput() { '/label', 'input' => array( 'type' => 'text', 'name' => 'data[Contact][imrequired]', - 'value' => '', 'id' => 'ContactImrequired' + 'id' => 'ContactImrequired' ), '/div' ); @@ -5386,7 +5400,7 @@ function testFormMagicInput() { '/label', 'input' => array( 'type' => 'text', 'name' => 'data[Contact][imalsorequired]', - 'value' => '', 'id' => 'ContactImalsorequired' + 'id' => 'ContactImalsorequired' ), '/div' ); @@ -5400,7 +5414,7 @@ function testFormMagicInput() { '/label', 'input' => array( 'type' => 'text', 'name' => 'data[Contact][imnotrequired]', - 'value' => '', 'id' => 'ContactImnotrequired' + 'id' => 'ContactImnotrequired' ), '/div' ); @@ -5414,7 +5428,7 @@ function testFormMagicInput() { '/label', 'input' => array( 'type' => 'text', 'name' => 'data[Contact][imalsonotrequired]', - 'value' => '', 'id' => 'ContactImalsonotrequired' + 'id' => 'ContactImalsonotrequired' ), '/div' ); @@ -5517,7 +5531,7 @@ function testForMagicInputNonExistingNorValidated() { '/label', 'input' => array( 'type' => 'text', 'name' => 'data[Contact][non_existing_nor_validated]', - 'value' => '', 'id' => 'ContactNonExistingNorValidated' + 'id' => 'ContactNonExistingNorValidated' ) ); $this->assertTags($result, $expected); @@ -5575,7 +5589,7 @@ function testFormMagicInputLabel() { $result = $this->Form->input('Contact.name', array('div' => false, 'label' => false)); $this->assertTags($result, array('input' => array( 'name' => 'data[Contact][name]', 'type' => 'text', - 'value' => '', 'id' => 'ContactName', 'maxlength' => '255') + 'id' => 'ContactName', 'maxlength' => '255') )); $result = $this->Form->input('Contact.name', array('div' => false, 'label' => 'My label')); @@ -5585,7 +5599,7 @@ function testFormMagicInputLabel() { '/label', 'input' => array( 'type' => 'text', 'name' => 'data[Contact][name]', - 'value' => '', 'id' => 'ContactName', 'maxlength' => '255' + 'id' => 'ContactName', 'maxlength' => '255' ) ); $this->assertTags($result, $expected); @@ -5598,7 +5612,7 @@ function testFormMagicInputLabel() { 'Name', '/label', 'input' => array( - 'type' => 'text', 'name' => 'data[Contact][name]', 'value' => '', + 'type' => 'text', 'name' => 'data[Contact][name]', 'id' => 'ContactName', 'maxlength' => '255' ) ); @@ -5612,7 +5626,7 @@ function testFormMagicInputLabel() { 'My label', '/label', 'input' => array( - 'type' => 'text', 'name' => 'data[Contact][name]', 'value' => '', + 'type' => 'text', 'name' => 'data[Contact][name]', 'id' => 'ContactName', 'maxlength' => '255' ) ); @@ -5627,7 +5641,7 @@ function testFormMagicInputLabel() { '/label', 'input' => array( 'type' => 'text', 'name' => 'data[Contact][name]', - 'value' => '', 'id' => 'my_id', 'maxlength' => '255' + 'id' => 'my_id', 'maxlength' => '255' ) ); $this->assertTags($result, $expected); @@ -5635,7 +5649,7 @@ function testFormMagicInputLabel() { $result = $this->Form->input('1.id'); $this->assertTags($result, array('input' => array( 'type' => 'hidden', 'name' => 'data[Contact][1][id]', - 'value' => '', 'id' => 'Contact1Id' + 'id' => 'Contact1Id' ))); $result = $this->Form->input("1.name"); @@ -5645,7 +5659,7 @@ function testFormMagicInputLabel() { 'Name', '/label', 'input' => array( - 'type' => 'text', 'name' => 'data[Contact][1][name]', 'value' => '', + 'type' => 'text', 'name' => 'data[Contact][1][name]', 'id' => 'Contact1Name', 'maxlength' => '255' ), '/div' @@ -5656,7 +5670,7 @@ function testFormMagicInputLabel() { $this->assertTags($result, array( 'input' => array( 'type' => 'hidden', 'name' => 'data[Contact][1][id]', - 'value' => '', 'id' => 'Contact1Id' + 'id' => 'Contact1Id' ) )); @@ -5668,7 +5682,7 @@ function testFormMagicInputLabel() { '/label', 'input' => array( 'type' => 'text', 'name' => 'data[Model][1][name]', - 'value' => '', 'id' => 'Model1Name' + 'id' => 'Model1Name' ), '/div' ); @@ -5752,19 +5766,19 @@ function testMultipleFormWithIdFields() { $result = $this->Form->input('id'); $this->assertTags($result, array('input' => array( - 'type' => 'hidden', 'name' => 'data[UserForm][id]', 'value' => '', 'id' => 'UserFormId' + 'type' => 'hidden', 'name' => 'data[UserForm][id]', 'id' => 'UserFormId' ))); $result = $this->Form->input('ValidateItem.id'); $this->assertTags($result, array('input' => array( 'type' => 'hidden', 'name' => 'data[ValidateItem][id]', - 'value' => '', 'id' => 'ValidateItemId' + 'id' => 'ValidateItemId' ))); $result = $this->Form->input('ValidateUser.id'); $this->assertTags($result, array('input' => array( 'type' => 'hidden', 'name' => 'data[ValidateUser][id]', - 'value' => '', 'id' => 'ValidateUserId' + 'id' => 'ValidateUserId' ))); } @@ -5785,7 +5799,7 @@ function testDbLessModel() { '/label', 'input' => array( 'name' => 'data[TestMail][name]', 'type' => 'text', - 'value' => '', 'id' => 'TestMailName' + 'id' => 'TestMailName' ), '/div' ); @@ -5801,7 +5815,7 @@ function testDbLessModel() { '/label', 'input' => array( 'name' => 'data[TestMail][name]', 'type' => 'text', - 'value' => '', 'id' => 'TestMailName' + 'id' => 'TestMailName' ), '/div' ); From 7384f56144ffcf5d635d7ca6bf7693d4a2eacb1f Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 7 Feb 2010 16:45:36 -0500 Subject: [PATCH 1633/2083] Fixing issues with old method names being used in EmailComponent. --- cake/libs/controller/components/email.php | 26 +++++++++---------- .../libs/controller/components/email.test.php | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index ffd29b01f..ef4a93eb0 100755 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -513,11 +513,11 @@ function _createboundary() { * @access public * @param array Associative array containing headers to be set. */ - function header($headers) { - foreach ($headers as $header => $value) { - $this->__header[] = sprintf('%s: %s', trim($header), trim($value)); - } - } + function header($headers) { + foreach ($headers as $header => $value) { + $this->__header[] = sprintf('%s: %s', trim($header), trim($value)); + } + } /** * Create emails headers including (but not limited to) from email address, reply to, * bcc and cc. @@ -529,12 +529,12 @@ function _createHeader() { if ($this->delivery == 'smtp') { if (is_array($this->to)) { - $this->__header[] = 'To: ' . implode(', ', array_map(array($this, '__formatAddress'), $this->to)); + $headers['To'] = implode(', ', array_map(array($this, '_formatAddress'), $this->to)); } else { - $this->__header[] = 'To: ' . $this->__formatAddress($this->to); + $headers['To'] = $this->_formatAddress($this->to); } } - $this->__header[] = 'From: ' . $this->__formatAddress($this->from); + $headers['From'] = $this->_formatAddress($this->from); if (!empty($this->replyTo)) { $headers['Reply-To'] = $this->_formatAddress($this->replyTo); @@ -763,14 +763,14 @@ function _mail() { $header = implode("\n", $this->__header); $message = implode("\n", $this->__message); if (is_array($this->to)) { - $to = implode(', ', array_map(array($this, '__formatAddress'), $this->to)); + $to = implode(', ', array_map(array($this, '_formatAddress'), $this->to)); } else { $to = $this->to; } if (ini_get('safe_mode')) { - return @mail($to, $this->__encode($this->subject), $message, $header); + return @mail($to, $this->_encode($this->subject), $message, $header); } - return @mail($to, $this->__encode($this->subject), $message, $header, $this->additionalParams); + return @mail($to, $this->_encode($this->subject), $message, $header, $this->additionalParams); } /** @@ -829,7 +829,7 @@ function _smtp() { $tos = $this->to; } foreach ($tos as $to) { - if (!$this->__smtpSend('RCPT TO: ' . $this->__formatAddress($to, true))) { + if (!$this->_smtpSend('RCPT TO: ' . $this->_formatAddress($to, true))) { return false; } } @@ -897,7 +897,7 @@ function _debug() { $fm = '<pre>'; if (is_array($this->to)) { - $to = implode(', ', array_map(array($this, '__formatAddress'), $this->to)); + $to = implode(', ', array_map(array($this, '_formatAddress'), $this->to)); } else { $to = $this->to; } diff --git a/cake/tests/cases/libs/controller/components/email.test.php b/cake/tests/cases/libs/controller/components/email.test.php index 76b9623a6..75fea8f1d 100755 --- a/cake/tests/cases/libs/controller/components/email.test.php +++ b/cake/tests/cases/libs/controller/components/email.test.php @@ -303,7 +303,7 @@ function testSmtpSend() { * @return void */ function testSmtpSendMultipleTo() { - if (!$this->skipIf(!fsockopen('localhost', 25), '%s No SMTP server running on localhost')) { + if (!$this->skipIf(!@fsockopen('localhost', 25), '%s No SMTP server running on localhost')) { return; } $this->Controller->EmailTest->reset(); From b90a64c04453d31ab987b6fb9d3b22444f7fa9bf Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 8 Feb 2010 21:11:56 -0500 Subject: [PATCH 1634/2083] Adding Android and iPod as Mobile useragent names. Fixes #319 --- cake/libs/controller/components/request_handler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php index 4a21c3f7e..bc18cdf55 100644 --- a/cake/libs/controller/components/request_handler.php +++ b/cake/libs/controller/components/request_handler.php @@ -21,7 +21,7 @@ */ if (!defined('REQUEST_MOBILE_UA')) { - define('REQUEST_MOBILE_UA', '(iPhone|MIDP|AvantGo|BlackBerry|J2ME|Opera Mini|DoCoMo|NetFront|Nokia|PalmOS|PalmSource|portalmmm|Plucker|ReqwirelessWeb|SonyEricsson|Symbian|UP\.Browser|Windows CE|Xiino)'); + define('REQUEST_MOBILE_UA', '(Android|iPod|iPhone|MIDP|AvantGo|BlackBerry|J2ME|Opera Mini|DoCoMo|NetFront|Nokia|PalmOS|PalmSource|portalmmm|Plucker|ReqwirelessWeb|SonyEricsson|Symbian|UP\.Browser|Windows CE|Xiino)'); } /** From 0fda18d11c95d285d7c0ac4064175e6d65136817 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 8 Feb 2010 23:07:13 -0500 Subject: [PATCH 1635/2083] Fixing entity encoding of url strings inside remoteFunctions contained in safe CDATA blocks. Fixes #127 --- cake/libs/view/helpers/ajax.php | 10 +++++++++- cake/tests/cases/libs/view/helpers/ajax.test.php | 7 +++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/ajax.php b/cake/libs/view/helpers/ajax.php index c393e3fb5..a575213fd 100644 --- a/cake/libs/view/helpers/ajax.php +++ b/cake/libs/view/helpers/ajax.php @@ -212,6 +212,7 @@ function link($title, $href = null, $options = array(), $confirm = null, $escape unset($confirm); } $htmlOptions = $this->__getHtmlOptions($options, array('url')); + $options += array('safe' => true); if (empty($options['fallback']) || !isset($options['fallback'])) { $options['fallback'] = $href; @@ -257,7 +258,14 @@ function remoteFunction($options) { $func = "new Ajax.Request("; } - $func .= "'" . $this->url(isset($options['url']) ? $options['url'] : "") . "'"; + $url = isset($options['url']) ? $options['url'] : ""; + if (empty($options['safe'])) { + $url = $this->url($url); + } else { + $url = Router::url($url); + } + + $func .= "'" . $url . "'"; $func .= ", " . $this->__optionsForAjax($options) . ")"; if (isset($options['before'])) { diff --git a/cake/tests/cases/libs/view/helpers/ajax.test.php b/cake/tests/cases/libs/view/helpers/ajax.test.php index 6df2e9c50..3cdddaf74 100644 --- a/cake/tests/cases/libs/view/helpers/ajax.test.php +++ b/cake/tests/cases/libs/view/helpers/ajax.test.php @@ -557,6 +557,13 @@ function testLink() { $this->assertPattern("/Event.observe\('link[0-9]+', [\w\d,'\(\)\s{}]+Ajax\.Request\([\w\d\s,'\(\){}:\/]+onComplete:function\(request, json\) {test}/", $result); $this->assertNoPattern('/^<a[^<>]+complete="test"[^<>]*>Ajax Link<\/a>/', $result); $this->assertNoPattern('/^<a\s+[^<>]*url="[^"]*"[^<>]*>/', $result); + + $result = $this->Ajax->link( + 'Ajax Link', + array('controller' => 'posts', 'action' => 'index', '?' => array('one' => '1', 'two' => '2')), + array('update' => 'myDiv', 'id' => 'myLink') + ); + $this->assertPattern('#/posts/\?one\=1\&two\=2#', $result); } /** * testRemoteTimer method From 3a0367237993ec2c8d431ae1c6cf4c604054847d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 9 Feb 2010 21:05:01 -0500 Subject: [PATCH 1636/2083] Fixing formatting of code. --- cake/libs/configure.php | 5 ++--- cake/libs/view/helpers/paginator.php | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 02118f9bc..310490846 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -1237,9 +1237,8 @@ function __paths($type) { if ($type === 'core') { return App::core('libs'); } - - if (isset($this->{$type.'s'})) { - return $this->{$type.'s'}; + if (isset($this->{$type . 's'})) { + return $this->{$type . 's'}; } return $paths; } diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index 870c94223..47f0652ef 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -360,7 +360,7 @@ function link($title, $url = array(), $options = array()) { $obj = isset($options['update']) ? $this->_ajaxHelperClass : 'Html'; $url = array_merge(array('page' => $this->current($model)), $url); - $url = array_merge(Set::filter($url, true), array_intersect_key($url, array('plugin'=>true))); + $url = array_merge(Set::filter($url, true), array_intersect_key($url, array('plugin' => true))); return $this->{$obj}->link($title, $url, $options); } From 0611f1b1f3ad9bdbd493623a73fb40cc18eeef3d Mon Sep 17 00:00:00 2001 From: "renan.saddam" <renan.saddam@gmail.com> Date: Thu, 11 Feb 2010 16:59:49 -0200 Subject: [PATCH 1637/2083] Flushing the CR after a model file is created, so a controller can be full baked without the need of restarting an bake session. Fixes #310. --- cake/console/libs/tasks/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index af43a37a4..3f70e6e57 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -741,6 +741,7 @@ function bake($name, $data = array()) { $filename = $path . Inflector::underscore($name) . '.php'; $this->out("\nBaking model class for $name..."); $this->createFile($filename, $out); + ClassRegistry::flush(); return $out; } From 0ce14ceb7ea42b23ff809765545b7f101348458d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 11 Feb 2010 22:03:43 -0500 Subject: [PATCH 1638/2083] Adding return statement, preventing infinite loops when no default fields are bound, and unbindTranslation() is called with no fields. Fixes #307 --- cake/libs/model/behaviors/translate.php | 3 +++ .../libs/model/behaviors/translate.test.php | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/cake/libs/model/behaviors/translate.php b/cake/libs/model/behaviors/translate.php index 60edbeab3..f9cfed4ca 100644 --- a/cake/libs/model/behaviors/translate.php +++ b/cake/libs/model/behaviors/translate.php @@ -465,6 +465,9 @@ function bindTranslation(&$model, $fields, $reset = true) { * @return bool */ function unbindTranslation(&$model, $fields = null) { + if (empty($fields) && empty($this->settings[$model->alias])) { + return false; + } if (empty($fields)) { return $this->unbindTranslation($model, $this->settings[$model->alias]); } diff --git a/cake/tests/cases/libs/model/behaviors/translate.test.php b/cake/tests/cases/libs/model/behaviors/translate.test.php index 9642c29fb..425bacb57 100644 --- a/cake/tests/cases/libs/model/behaviors/translate.test.php +++ b/cake/tests/cases/libs/model/behaviors/translate.test.php @@ -877,5 +877,23 @@ function testTranslateTableWithPrefix() { )); $this->assertEqual($result, $expected); } + +/** + * Test infinite loops not occuring with unbindTranslation() + * + * @return void + */ + function testUnbindTranslationInfinteLoop() { + $this->loadFixtures('Translate', 'TranslatedItem'); + + $TestModel =& new TranslatedItem(); + $TestModel->Behaviors->detach('Translate'); + $TestModel->actsAs = array(); + $TestModel->Behaviors->attach('Translate'); + $TestModel->bindTranslation(array('title', 'content'), true); + $result = $TestModel->unbindTranslation(); + + $this->assertFalse($result); + } } ?> \ No newline at end of file From d5ea6b7c2a99bbda503f2247702aa4a6953dcf1b Mon Sep 17 00:00:00 2001 From: "renan.saddam" <renan.saddam@gmail.com> Date: Fri, 12 Feb 2010 01:57:04 -0200 Subject: [PATCH 1639/2083] Flushing the CR after a model is baked, tests added. Refs #310. --- cake/console/libs/tasks/model.php | 1 + .../cases/console/libs/tasks/model.test.php | 22 +++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index fac911605..95136bb88 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -666,6 +666,7 @@ function bake($name, $associations = array(), $validate = array(), $primaryKey } $out .= "}\n"; $out .= "?>"; + ClassRegistry::flush(); $filename = $this->path . Inflector::underscore($name) . '.php'; $this->out("\nBaking model class for $name..."); return $this->createFile($filename, $out); diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index f61262f21..0b4fc2af0 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -44,7 +44,7 @@ ); Mock::generatePartial( 'ModelTask', 'MockModelTask', - array('in', 'out', 'createFile') + array('in', 'out', 'createFile', '_checkUnitTest') ); /** * ModelTaskTest class @@ -53,7 +53,7 @@ * @subpackage cake.tests.cases.console.libs.tasks */ class ModelTaskTest extends CakeTestCase { - var $fixtures = array('core.datatype', 'core.binary_test'); + var $fixtures = array('core.datatype', 'core.binary_test', 'core.article'); /** * setUp method * @@ -88,5 +88,23 @@ function testFixtureGeneration() { $result = $this->Task->fixture('BinaryTest'); $this->assertPattern("/'data' => 'Lorem ipsum dolor sit amet'/", $result); } +/** + * test that execute passes runs bake depending with named model. + * + * @return void + * @access public + */ + function testBakeModel() { + $this->Task->connection = 'test_suite'; + $this->Task->path = '/my/path/'; + $filename = '/my/path/article.php'; + $this->Task->setReturnValue('_checkUnitTest', 1); + $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class Article extends AppModel/'))); + $model =& new Model(array('name' => 'Article', 'table' => 'articles', 'ds' => 'test_suite')); + $this->Task->bake($model); + + $this->assertEqual(count(ClassRegistry::keys()), 0); + $this->assertEqual(count(ClassRegistry::mapKeys()), 0); + } } ?> \ No newline at end of file From 46948dd2c046049bae07baeedb62c8fa4cf258f0 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 11 Feb 2010 22:57:24 -0500 Subject: [PATCH 1640/2083] Fixing memory leak in ThemeView where __paths would grow each time _paths() was called. Fixes #329 --- cake/libs/view/theme.php | 3 +- cake/tests/cases/libs/view/theme.test.php | 38 ++++++++++++++++++----- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/cake/libs/view/theme.php b/cake/libs/view/theme.php index d3d206a9c..5bda2f720 100644 --- a/cake/libs/view/theme.php +++ b/cake/libs/view/theme.php @@ -68,8 +68,7 @@ function _paths($plugin = null, $cached = true) { } $paths = array_merge($themePaths, $paths); } - $this->__paths = $paths; - return $this->__paths; + return $paths; } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/theme.test.php b/cake/tests/cases/libs/view/theme.test.php index 76c27044d..ae75e243f 100644 --- a/cake/tests/cases/libs/view/theme.test.php +++ b/cake/tests/cases/libs/view/theme.test.php @@ -190,8 +190,6 @@ function startTest() { 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS) )); - $Configure = App::getInstance(); - array_shift($Configure->views); } /** @@ -217,7 +215,7 @@ function testPluginThemedGetTemplate() { $this->Controller->action = 'index'; $this->Controller->theme = 'test_theme'; - $ThemeView = new TestThemeView($this->Controller); + $ThemeView =& new TestThemeView($this->Controller); $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'plugins' . DS . 'test_plugin' . DS . 'tests' . DS .'index.ctp'; $result = $ThemeView->getViewFileName('index'); $this->assertEqual($result, $expected); @@ -225,7 +223,7 @@ function testPluginThemedGetTemplate() { $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'plugins' . DS . 'test_plugin' . DS . 'layouts' . DS .'plugin_default.ctp'; $result = $ThemeView->getLayoutFileName('plugin_default'); $this->assertEqual($result, $expected); - + $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'themed' . DS . 'test_theme' . DS . 'layouts' . DS .'default.ctp'; $result = $ThemeView->getLayoutFileName('default'); $this->assertEqual($result, $expected); @@ -244,7 +242,7 @@ function testGetTemplate() { $this->Controller->action = 'display'; $this->Controller->params['pass'] = array('home'); - $ThemeView = new TestThemeView($this->Controller); + $ThemeView =& new TestThemeView($this->Controller); $ThemeView->theme = 'test_theme'; $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS .'pages' . DS .'home.ctp'; $result = $ThemeView->getViewFileName('home'); @@ -285,7 +283,7 @@ function testMissingView() { $this->Controller->params['pass'] = array('home'); restore_error_handler(); - $View = new TestThemeView($this->Controller); + $View =& new TestThemeView($this->Controller); ob_start(); $result = $View->getViewFileName('does_not_exist'); $expected = str_replace(array("\t", "\r\n", "\n"), "", ob_get_clean()); @@ -308,7 +306,7 @@ function testMissingLayout() { $this->Controller->theme = 'my_theme'; restore_error_handler(); - $View = new TestThemeView($this->Controller); + $View =& new TestThemeView($this->Controller); ob_start(); $result = $View->getLayoutFileName(); $expected = str_replace(array("\t", "\r\n", "\n"), "", ob_get_clean()); @@ -316,5 +314,31 @@ function testMissingLayout() { $this->assertPattern("/Missing Layout/", $expected); $this->assertPattern("/views(\/|\\\)themed(\/|\\\)my_theme(\/|\\\)layouts(\/|\\\)whatever.ctp/", $expected); } + +/** + * test memory leaks that existed in _paths at one point. + * + * @return void + */ + function testMemoryLeakInPaths() { + if ($this->skipIf(function_exists('get_memory_usage'), 'No memory measurement function, fail. %s')) { + return; + } + $this->Controller->plugin = null; + $this->Controller->name = 'Posts'; + $this->Controller->viewPath = 'posts'; + $this->Controller->layout = 'whatever'; + $this->Controller->theme = 'test_theme'; + + $View =& new ThemeView($this->Controller); + $View->element('test_element'); + + $start = memory_get_usage(); + for ($i = 0; $i < 10; $i++) { + $View->element('test_element'); + } + $end = memory_get_usage(); + $this->assertWithinMargin($start, $end, 2000); + } } ?> \ No newline at end of file From d975dc3190c76067e50e331018552b54f03d5116 Mon Sep 17 00:00:00 2001 From: "renan.saddam" <renan.saddam@gmail.com> Date: Fri, 12 Feb 2010 02:01:54 -0200 Subject: [PATCH 1641/2083] Adding tests for previous commit. Refs #310. --- cake/tests/cases/console/libs/tasks/model.test.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index dd8cc4311..157dc1c78 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -683,6 +683,9 @@ function testBakeWithPlugin() { $this->Task->expectAt(1, 'createFile', array( $path, new PatternExpectation('/Article extends ControllerTestAppModel/'))); $this->Task->bake('Article', array(), array()); + + $this->assertEqual(count(ClassRegistry::keys()), 0); + $this->assertEqual(count(ClassRegistry::mapKeys()), 0); } /** @@ -699,6 +702,9 @@ function testExecuteWithNamedModel() { $this->Task->setReturnValue('_checkUnitTest', 1); $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class Article extends AppModel/'))); $this->Task->execute(); + + $this->assertEqual(count(ClassRegistry::keys()), 0); + $this->assertEqual(count(ClassRegistry::mapKeys()), 0); } /** @@ -732,6 +738,9 @@ function testExecuteIntoAll() { $this->Task->expectAt(4, 'createFile', array($filename, new PatternExpectation('/class Tag/'))); $this->Task->execute(); + + $this->assertEqual(count(ClassRegistry::keys()), 0); + $this->assertEqual(count(ClassRegistry::mapKeys()), 0); } /** @@ -762,6 +771,9 @@ function testExecuteIntoInteractive() { $this->Task->expectOnce('createFile'); $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class Article/'))); $this->Task->execute(); + + $this->assertEqual(count(ClassRegistry::keys()), 0); + $this->assertEqual(count(ClassRegistry::mapKeys()), 0); } /** From f6f04b6425a22f1921ab283b87967bef9d205cd2 Mon Sep 17 00:00:00 2001 From: "renan.saddam" <renan.saddam@gmail.com> Date: Fri, 12 Feb 2010 11:20:43 -0200 Subject: [PATCH 1642/2083] Clearing variables after running all the methods. Fixes #333. --- cake/console/libs/tasks/extract.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cake/console/libs/tasks/extract.php b/cake/console/libs/tasks/extract.php index aee3b4526..54e97e631 100644 --- a/cake/console/libs/tasks/extract.php +++ b/cake/console/libs/tasks/extract.php @@ -174,6 +174,12 @@ function __extract() { $this->out(__('Output Directory: ', true) . $this->__output); $this->hr(); $this->__extractTokens(); + $this->__buildFiles(); + $this->__writeFiles(); + $this->__paths = $this->__files = $this->__storage = array(); + $this->__strings = $this->__tokens = array(); + $this->out(); + $this->out(__('Done.', true)); } /** @@ -244,10 +250,6 @@ function __extractTokens() { $this->__parse('__dn', array('domain', 'singular', 'plural')); $this->__parse('__dcn', array('domain', 'singular', 'plural')); } - $this->__buildFiles(); - $this->__writeFiles(); - $this->out(); - $this->out(__('Done.', true)); } /** From 5653c720f08a830ab6df5b8f1e721846ef2740df Mon Sep 17 00:00:00 2001 From: "renan.saddam" <renan.saddam@gmail.com> Date: Fri, 12 Feb 2010 11:52:58 -0200 Subject: [PATCH 1643/2083] Fixing an small error with token parsing, tests added. Refs #333. --- cake/console/libs/tasks/extract.php | 10 +++++----- .../tests/cases/console/libs/tasks/extract.test.php | 13 ++++++++++--- cake/tests/test_app/views/pages/extract.ctp | 7 +++++-- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/cake/console/libs/tasks/extract.php b/cake/console/libs/tasks/extract.php index 54e97e631..ceb6b0c23 100644 --- a/cake/console/libs/tasks/extract.php +++ b/cake/console/libs/tasks/extract.php @@ -264,7 +264,7 @@ function __parse($functionName, $map) { $count = 0; $tokenCount = count($this->__tokens); - while (($tokenCount - $count) > 7) { + while (($tokenCount - $count) > 1) { list($countToken, $firstParenthesis) = array($this->__tokens[$count], $this->__tokens[$count + 1]); if (!is_array($countToken)) { $count++; @@ -321,12 +321,12 @@ function __parse($functionName, $map) { function __buildFiles() { foreach ($this->__strings as $domain => $strings) { foreach ($strings as $string => $files) { - $occurances = array(); + $occurences = array(); foreach ($files as $file => $lines) { - $occurances[] = $file . ':' . implode(';', $lines); + $occurences[] = $file . ':' . implode(';', $lines); } - $occurances = implode("\n#: ", $occurances); - $header = '#: ' . str_replace($this->__paths, '', $occurances) . "\n"; + $occurences = implode("\n#: ", $occurences); + $header = '#: ' . str_replace($this->__paths, '', $occurences) . "\n"; if (strpos($string, "\0") === false) { $sentence = "msgid \"{$string}\"\n"; diff --git a/cake/tests/cases/console/libs/tasks/extract.test.php b/cake/tests/cases/console/libs/tasks/extract.test.php index d83989378..bbef0da97 100644 --- a/cake/tests/cases/console/libs/tasks/extract.test.php +++ b/cake/tests/cases/console/libs/tasks/extract.test.php @@ -126,9 +126,17 @@ function testExecute() { $this->assertPattern($pattern, $result); // extract.ctp - $pattern = '/msgid "You have %d new message."\nmsgid_plural "You have %d new messages."/'; + $pattern = '/\#: (\\\\|\/)extract\.ctp:6\n'; + $pattern .= 'msgid "You have %d new message."\nmsgid_plural "You have %d new messages."/'; $this->assertPattern($pattern, $result); - $pattern = '/msgid "You deleted %d message."\nmsgid_plural "You deleted %d messages."/'; + + $pattern = '/\#: (\\\\|\/)extract\.ctp:7\n'; + $pattern .= 'msgid "You deleted %d message."\nmsgid_plural "You deleted %d messages."/'; + $this->assertPattern($pattern, $result); + + $pattern = '/\#: (\\\\|\/)extract\.ctp:14\n'; + $pattern .= '\#: (\\\\|\/)home\.ctp:74\n'; + $pattern .= 'msgid "Editing this Page"\nmsgstr ""/'; $this->assertPattern($pattern, $result); // extract.ctp - reading the domain.pot @@ -144,7 +152,6 @@ function testExecute() { $pattern = '/msgid "You deleted %d message \(domain\)."\nmsgid_plural "You deleted %d messages \(domain\)."/'; $this->assertPattern($pattern, $result); - $Folder = new Folder($path); $Folder->delete(); } diff --git a/cake/tests/test_app/views/pages/extract.ctp b/cake/tests/test_app/views/pages/extract.ctp index 1244223f3..e3eede1c1 100644 --- a/cake/tests/test_app/views/pages/extract.ctp +++ b/cake/tests/test_app/views/pages/extract.ctp @@ -1,6 +1,6 @@ <?php $count = 10; -$message = array('count' => 10); +$messages = array('count' => 10); // Plural __n('You have %d new message.', 'You have %d new messages.', $count); @@ -8,4 +8,7 @@ __n('You deleted %d message.', 'You deleted %d messages.', $messages['count']); // Domain Plural __dn('domain', 'You have %d new message (domain).', 'You have %d new messages (domain).', '10'); -__dn('domain', 'You deleted %d message (domain).', 'You deleted %d messages (domain).', $messages['count']); \ No newline at end of file +__dn('domain', 'You deleted %d message (domain).', 'You deleted %d messages (domain).', $messages['count']); + +// Duplicated Message +__('Editing this Page'); \ No newline at end of file From 7a655f7fdebbe467512803c3d16e68b67b7c703d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 12 Feb 2010 23:51:02 -0500 Subject: [PATCH 1644/2083] Fixing broken skipIf commited in 46948dd2c046049bae07baeedb62c8fa4cf258f0 --- cake/tests/cases/libs/view/theme.test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/view/theme.test.php b/cake/tests/cases/libs/view/theme.test.php index ae75e243f..6d1cfae3e 100644 --- a/cake/tests/cases/libs/view/theme.test.php +++ b/cake/tests/cases/libs/view/theme.test.php @@ -321,7 +321,7 @@ function testMissingLayout() { * @return void */ function testMemoryLeakInPaths() { - if ($this->skipIf(function_exists('get_memory_usage'), 'No memory measurement function, fail. %s')) { + if ($this->skipIf(!function_exists('memory_get_usage'), 'No memory measurement function, fail. %s')) { return; } $this->Controller->plugin = null; From a479f32da5384c312496b4b57c28c572abf96ea0 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 12 Feb 2010 23:58:35 -0500 Subject: [PATCH 1645/2083] Clarifying the behaviour of FormHelper::button() fixes #335 --- cake/libs/view/helpers/form.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 1ba1ccdae..9e2309839 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -1174,7 +1174,8 @@ function file($fieldName, $options = array()) { } /** - * Creates a `<button>` tag. + * Creates a `<button>` tag. The type attribute defaults to `type="submit"` + * You can change it to a different value by using `$options['type']`. * * ### Options: * From 2e8e233f73c26da8680bb25399e94628c1cc6816 Mon Sep 17 00:00:00 2001 From: Mitchell Amihod <mitchell.amihod@gmail.com> Date: Sat, 13 Feb 2010 14:42:16 -0500 Subject: [PATCH 1646/2083] Fixing syntax error for baked component test case. Updated relevant test case. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #342. Signed-off-by: Joël Perras <joel.perras@gmail.com> --- cake/console/libs/tasks/test.php | 2 +- cake/tests/cases/console/libs/tasks/test.test.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 0e68d1bbb..843599db9 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -421,7 +421,7 @@ function generateConstructor($type, $fullClassName) { $className = substr($fullClassName, 0, strlen($fullClassName) - 10); return "new Test$fullClassName();\n\t\t\$this->{$className}->constructClasses();\n"; } - return "new $fullClassName()\n"; + return "new $fullClassName();\n"; } /** diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index 5995d235d..1b3d6f92c 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -520,7 +520,7 @@ function testBakeControllerTest() { * @return void * @access public */ - function testGenerateContsructor() { + function testGenerateConstructor() { $result = $this->Task->generateConstructor('controller', 'PostsController'); $expected = "new TestPostsController();\n\t\t\$this->Posts->constructClasses();\n"; $this->assertEqual($result, $expected); @@ -530,7 +530,7 @@ function testGenerateContsructor() { $this->assertEqual($result, $expected); $result = $this->Task->generateConstructor('helper', 'FormHelper'); - $expected = "new FormHelper()\n"; + $expected = "new FormHelper();\n"; $this->assertEqual($result, $expected); } From 5f5aae71e77e9c147a995afb90439f1c723eeb24 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 13 Feb 2010 17:51:49 -0500 Subject: [PATCH 1647/2083] Adding property to signal which actions to skip finding templates for. Fixes #330 --- cake/console/libs/tasks/view.php | 19 +++++++++++--- .../cases/console/libs/tasks/view.test.php | 25 +++++++++++++++++-- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 75ac9652c..baf159d4e 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -83,6 +83,15 @@ class ViewTask extends Shell { */ var $scaffoldActions = array('index', 'view', 'add', 'edit'); +/** + * An array of action names that don't require templates. These + * actions will not emit errors when doing bakeActions() + * + * @var array + * @access public + */ + var $noTemplateActions = array('delete'); + /** * Override initialize * @@ -381,10 +390,9 @@ function getContent($action, $vars = null) { $this->Template->set('action', $action); $this->Template->set('plugin', $this->plugin); $this->Template->set($vars); - $output = $this->Template->generate('views', $this->getTemplate($action)); - - if (!empty($output)) { - return $output; + $template = $this->getTemplate($action); + if ($template) { + return $this->Template->generate('views', $template); } return false; } @@ -397,6 +405,9 @@ function getContent($action, $vars = null) { * @access public */ function getTemplate($action) { + if ($action != $this->template && in_array($action, $this->noTemplateActions)) { + return false; + } if (!empty($this->template) && $action != $this->template) { return $this->template; } diff --git a/cake/tests/cases/console/libs/tasks/view.test.php b/cake/tests/cases/console/libs/tasks/view.test.php index 70715288f..fb49c4efa 100644 --- a/cake/tests/cases/console/libs/tasks/view.test.php +++ b/cake/tests/cases/console/libs/tasks/view.test.php @@ -113,7 +113,7 @@ class ViewTaskArticle extends Model { } /** - * Test View Task Comments Controller + * Test View Task Comments Controller * * @package cake * @subpackage cake.tests.cases.console.libs.tasks @@ -261,6 +261,8 @@ function startTest() { $this->Task->Project =& new ViewTaskMockProjectTask(); $this->Task->path = TMP; $this->Task->Template->params['theme'] = 'default'; + + $this->_routing = Configure::read('Routing'); } /** @@ -271,6 +273,7 @@ function startTest() { */ function endTest() { ClassRegistry::flush(); + Configure::write('Routing', $this->_routing); } /** @@ -554,7 +557,7 @@ function testExecuteWithAlternateTemplates() { $this->Task->connection = 'test_suite'; $this->Task->args = array('ViewTaskComments', 'index', 'list'); $this->Task->params = array(); - + $this->Task->expectCallCount('createFile', 1); $this->Task->expectAt(0, 'createFile', array( TMP . 'view_task_comments' . DS . 'list.ctp', @@ -600,5 +603,23 @@ function testExecuteInteractiveWithAdmin() { $this->Task->execute(); } + +/** + * test getting templates, make sure noTemplateActions works + * + * @return void + */ + function testGetTemplate() { + $result = $this->Task->getTemplate('delete'); + $this->assertFalse($result); + + $result = $this->Task->getTemplate('add'); + $this->assertEqual($result, 'form'); + + Configure::write('Routing.prefixes', array('admin')); + + $result = $this->Task->getTemplate('admin_add'); + $this->assertEqual($result, 'form'); + } } ?> \ No newline at end of file From 8b6423e9c38e1ad409b9c81bea87bf925cf73d4d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 13 Feb 2010 17:55:34 -0500 Subject: [PATCH 1648/2083] Renaming properties to be protected. --- cake/console/libs/tasks/model.php | 46 ++++++++++++++++--------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 3f70e6e57..97d28eb6a 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -62,15 +62,17 @@ class ModelTask extends Shell { * Holds tables found on connection. * * @var array + * @access protected */ - var $__tables = array(); + var $_tables = array(); /** * Holds validation method map. * * @var array + * @access protected */ - var $__validations = array(); + var $_validations = array(); /** * Execution method always used for tasks @@ -111,7 +113,7 @@ function execute() { function all() { $this->listAll($this->connection, false); $unitTestExists = $this->_checkUnitTest(); - foreach ($this->__tables as $table) { + foreach ($this->_tables as $table) { $modelClass = Inflector::classify($table); $this->out(sprintf(__('Baking %s', true), $modelClass)); $object = $this->_getModelObject($modelClass); @@ -184,7 +186,7 @@ function __interactive() { $db =& ConnectionManager::getDataSource($this->connection); $fullTableName = $db->fullTableName($useTable); - if (in_array($useTable, $this->__tables)) { + if (in_array($useTable, $this->_tables)) { $tempModel = new Model(array('name' => $currentModelName, 'table' => $useTable, 'ds' => $this->connection)); $fields = $tempModel->schema(true); if (!array_key_exists('id', $fields)) { @@ -202,7 +204,7 @@ function __interactive() { $prompt = __("Would you like to supply validation criteria \nfor the fields in your model?", true); $wannaDoValidation = $this->in($prompt, array('y','n'), 'y'); - if (array_search($useTable, $this->__tables) !== false && strtolower($wannaDoValidation) == 'y') { + if (array_search($useTable, $this->_tables) !== false && strtolower($wannaDoValidation) == 'y') { $validate = $this->doValidation($tempModel); } @@ -335,7 +337,7 @@ function doValidation(&$model) { } /** - * Populate the __validations array + * Populate the _validations array * * @return void */ @@ -354,7 +356,7 @@ function initValidations() { $default++; } } - $this->__validations = $choices; + $this->_validations = $choices; return $choices; } @@ -366,7 +368,7 @@ function initValidations() { * @return array Array of validation for the field. */ function fieldValidation($fieldName, $metaData, $primaryKey = 'id') { - $defaultChoice = count($this->__validations); + $defaultChoice = count($this->_validations); $validate = $alreadyChosen = array(); $anotherValidator = 'y'; @@ -382,12 +384,12 @@ function fieldValidation($fieldName, $metaData, $primaryKey = 'id') { $prompt = ''; for ($i = 1; $i < $defaultChoice; $i++) { - $prompt .= $i . ' - ' . $this->__validations[$i] . "\n"; + $prompt .= $i . ' - ' . $this->_validations[$i] . "\n"; } $prompt .= sprintf(__("%s - Do not do any validation on this field.\n", true), $defaultChoice); $prompt .= __("... or enter in a valid regex validation string.\n", true); - $methods = array_flip($this->__validations); + $methods = array_flip($this->_validations); $guess = $defaultChoice; if ($metaData['null'] != 1 && !in_array($fieldName, array($primaryKey, 'created', 'modified', 'updated'))) { if ($fieldName == 'email') { @@ -415,10 +417,10 @@ function fieldValidation($fieldName, $metaData, $primaryKey = 'id') { } else { $choice = $guess; } - $validatorName = $this->__validations[$choice]; + $validatorName = $this->_validations[$choice]; if ($choice != $defaultChoice) { - if (is_numeric($choice) && isset($this->__validations[$choice])) { - $validate[$validatorName] = $this->__validations[$choice]; + if (is_numeric($choice) && isset($this->_validations[$choice])) { + $validate[$validatorName] = $this->_validations[$choice]; } else { $validate[$validatorName] = $choice; } @@ -517,7 +519,7 @@ function findBelongsTo(&$model, $associations) { */ function findHasOneAndMany(&$model, $associations) { $foreignKey = $this->_modelKey($model->name); - foreach ($this->__tables as $otherTable) { + foreach ($this->_tables as $otherTable) { $tempOtherModel = $this->_getModelObject($this->_modelName($otherTable), $otherTable); $modelFieldsTemp = $tempOtherModel->schema(); @@ -560,7 +562,7 @@ function findHasOneAndMany(&$model, $associations) { */ function findHasAndBelongsToMany(&$model, $associations) { $foreignKey = $this->_modelKey($model->name); - foreach ($this->__tables as $otherTable) { + foreach ($this->_tables as $otherTable) { $tempOtherModel = $this->_getModelObject($this->_modelName($otherTable), $otherTable); $modelFieldsTemp = $tempOtherModel->schema(true); @@ -647,7 +649,7 @@ function doMoreAssociations($model, $associations) { $suggestedForeignKey = $this->_modelKey($alias); } else { $otherTable = Inflector::tableize($className); - if (in_array($otherTable, $this->__tables)) { + if (in_array($otherTable, $this->_tables)) { if ($assocType < 3) { $showKeys = $possibleKeys[$otherTable]; } else { @@ -693,7 +695,7 @@ function doMoreAssociations($model, $associations) { */ function _generatePossibleKeys() { $possible = array(); - foreach ($this->__tables as $otherTable) { + foreach ($this->_tables as $otherTable) { $tempOtherModel = & new Model(array('table' => $otherTable, 'ds' => $this->connection)); $modelFieldsTemp = $tempOtherModel->schema(true); foreach ($modelFieldsTemp as $fieldName => $field) { @@ -764,18 +766,18 @@ function bakeTest($className) { * @access public */ function listAll($useDbConfig = null) { - $this->__tables = $this->getAllTables($useDbConfig); + $this->_tables = $this->getAllTables($useDbConfig); if ($this->interactive === true) { $this->out(__('Possible Models based on your current database:', true)); $this->_modelNames = array(); - $count = count($this->__tables); + $count = count($this->_tables); for ($i = 0; $i < $count; $i++) { - $this->_modelNames[] = $this->_modelName($this->__tables[$i]); + $this->_modelNames[] = $this->_modelName($this->_tables[$i]); $this->out($i + 1 . ". " . $this->_modelNames[$i]); } } - return $this->__tables; + return $this->_tables; } /** @@ -796,7 +798,7 @@ function getTable($modelName, $useDbConfig = null) { $fullTableName = $db->fullTableName($useTable, false); $tableIsGood = false; - if (array_search($useTable, $this->__tables) === false) { + if (array_search($useTable, $this->_tables) === false) { $this->out(); $this->out(sprintf(__("Given your model named '%s',\nCake would expect a database table named '%s'", true), $modelName, $fullTableName)); $tableIsGood = $this->in(__('Do you want to use this table?', true), array('y','n'), 'y'); From b89f40be80b91fceaec2c44494b0c14dc8ee5585 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 13 Feb 2010 17:56:19 -0500 Subject: [PATCH 1649/2083] Adding file omitted from [46948dd2c046049bae07baeedb62c8fa4cf258f0] --- .../test_app/views/themed/test_theme/elements/test_element.ctp | 1 + 1 file changed, 1 insertion(+) create mode 100644 cake/tests/test_app/views/themed/test_theme/elements/test_element.ctp diff --git a/cake/tests/test_app/views/themed/test_theme/elements/test_element.ctp b/cake/tests/test_app/views/themed/test_theme/elements/test_element.ctp new file mode 100644 index 000000000..745dddbf2 --- /dev/null +++ b/cake/tests/test_app/views/themed/test_theme/elements/test_element.ctp @@ -0,0 +1 @@ +Hi, I'm the test element. \ No newline at end of file From 3f667eb4122369e45c5f0f1f6eb28702cb21e7b8 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 13 Feb 2010 18:15:11 -0500 Subject: [PATCH 1650/2083] Adding skipTables to ModelTask. Allows skipping of predefined tables. Adding i18n table to the default list of skipped tables. Fixes #327 --- cake/console/libs/tasks/model.php | 11 +++++++ .../cases/console/libs/tasks/model.test.php | 30 +++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 97d28eb6a..30ebe6fd2 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -58,6 +58,14 @@ class ModelTask extends Shell { */ var $tasks = array('DbConfig', 'Fixture', 'Test', 'Template'); +/** + * Tables to skip when running all() + * + * @var array + * @access protected + */ + var $skipTables = array('i18n'); + /** * Holds tables found on connection. * @@ -114,6 +122,9 @@ function all() { $this->listAll($this->connection, false); $unitTestExists = $this->_checkUnitTest(); foreach ($this->_tables as $table) { + if (in_array($table, $this->skipTables)) { + continue; + } $modelClass = Inflector::classify($table); $this->out(sprintf(__('Baking %s', true), $modelClass)); $object = $this->_getModelObject($modelClass); diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index 157dc1c78..967c04bfb 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -743,6 +743,36 @@ function testExecuteIntoAll() { $this->assertEqual(count(ClassRegistry::mapKeys()), 0); } +/** + * test that skipTables changes how all() works. + * + * @return void + */ + function testSkipTablesAndAll() { + $this->Task->connection = 'test_suite'; + $this->Task->path = '/my/path/'; + $this->Task->args = array('all'); + $this->Task->setReturnValue('_checkUnitTest', true); + $this->Task->skipTables = array('tags'); + + $this->Task->Fixture->expectCallCount('bake', 4); + $this->Task->Test->expectCallCount('bake', 4); + + $filename = '/my/path/article.php'; + $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class Article/'))); + + $filename = '/my/path/articles_tag.php'; + $this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/class ArticlesTag/'))); + + $filename = '/my/path/category_thread.php'; + $this->Task->expectAt(2, 'createFile', array($filename, new PatternExpectation('/class CategoryThread/'))); + + $filename = '/my/path/comment.php'; + $this->Task->expectAt(3, 'createFile', array($filename, new PatternExpectation('/class Comment/'))); + + $this->Task->execute(); + } + /** * test the interactive side of bake. * From 6ccc43d776e5a57d8ca2365f07dc7e4342018ba1 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 13 Feb 2010 18:51:39 -0500 Subject: [PATCH 1651/2083] Adding tests for Cache not generating errors when Cache.disable = true. Refs #286 --- cake/tests/cases/libs/cache.test.php | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/cake/tests/cases/libs/cache.test.php b/cake/tests/cases/libs/cache.test.php index 5733be94c..e741b2116 100644 --- a/cake/tests/cases/libs/cache.test.php +++ b/cake/tests/cases/libs/cache.test.php @@ -68,6 +68,23 @@ function testConfig() { $this->assertTrue(isset($results['settings'])); } +/** + * Check that no fatal errors are issued doing normal things when Cache.disable is true. + * + * @return void + */ + function testNonFatalErrorsWithCachedisable() { + Configure::write('Cache.disable', true); + Cache::config('test', array('engine' => 'File', 'path' => TMP, 'prefix' => 'error_test_')); + + Cache::write('no_save', 'Noooo!', 'test'); + Cache::read('no_save', 'test'); + Cache::delete('no_save', 'test'); + Cache::set('duration', '+10 minutes'); + + Configure::write('Cache.disable', false); + } + /** * test configuring CacheEngines in App/libs * @@ -157,7 +174,7 @@ function testConfigSettingDefaultConfigKey() { Cache::config('test_name'); $result = Cache::read('value_one'); $this->assertEqual($result, 'I am cached'); - + Cache::delete('value_one'); Cache::config('default'); Cache::delete('value_one'); @@ -190,7 +207,7 @@ function testWritingWithConfig() { } /** - * test that configured returns an array of the currently configured cache + * test that configured returns an array of the currently configured cache * settings * * @return void @@ -225,7 +242,7 @@ function testInitSettings() { } /** - * test that drop removes cache configs, and that further attempts to use that config + * test that drop removes cache configs, and that further attempts to use that config * do not work. * * @return void @@ -242,7 +259,7 @@ function testDrop() { $_testsConfig = Cache::config('tests'); $result = Cache::drop('tests'); $this->assertTrue($result); - + Cache::config('unconfigTest', array( 'engine' => 'TestAppCache' )); From effbbeca336afbff1a64aa31c4bb8af710775917 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 13 Feb 2010 19:06:52 -0500 Subject: [PATCH 1652/2083] Simplifying App::core() path generation. --- cake/libs/configure.php | 50 ++++++++++++++--------------------------- 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 310490846..5c3672c11 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -740,39 +740,23 @@ function core($type = null) { } if (!$paths) { $paths = array(); - $openBasedir = ini_get('open_basedir'); - if ($openBasedir) { - $all = explode(PATH_SEPARATOR, $openBasedir); - $all = array_flip(array_flip(array_merge(array(CAKE_CORE_INCLUDE_PATH), $all))); - } else { - $all = explode(PATH_SEPARATOR, ini_get('include_path')); - $all = array_flip(array_flip((array_merge(array(CAKE_CORE_INCLUDE_PATH), $all)))); - } - foreach ($all as $path) { - if ($path !== DS) { - $path = rtrim($path, DS); - } - if (empty($path) || $path === '.') { - continue; - } - $cake = $path . DS . 'cake' . DS; - $libs = $cake . 'libs' . DS; - if (is_dir($libs)) { - $paths['cake'][] = $cake; - $paths['libs'][] = $libs; - $paths['models'][] = $libs . 'model' . DS; - $paths['datasources'][] = $libs . 'model' . DS . 'datasources' . DS; - $paths['behaviors'][] = $libs . 'model' . DS . 'behaviors' . DS; - $paths['controllers'][] = $libs . 'controller' . DS; - $paths['components'][] = $libs . 'controller' . DS . 'components' . DS; - $paths['views'][] = $libs . 'view' . DS; - $paths['helpers'][] = $libs . 'view' . DS . 'helpers' . DS; - $paths['plugins'][] = $path . DS . 'plugins' . DS; - $paths['vendors'][] = $path . DS . 'vendors' . DS; - $paths['shells'][] = $cake . 'console' . DS . 'libs' . DS; - break; - } - } + $libs = dirname(__FILE__) . DS; + $cake = dirname($libs) . DS; + $path = dirname($cake) . DS; + + $paths['cake'][] = $cake; + $paths['libs'][] = $libs; + $paths['models'][] = $libs . 'model' . DS; + $paths['datasources'][] = $libs . 'model' . DS . 'datasources' . DS; + $paths['behaviors'][] = $libs . 'model' . DS . 'behaviors' . DS; + $paths['controllers'][] = $libs . 'controller' . DS; + $paths['components'][] = $libs . 'controller' . DS . 'components' . DS; + $paths['views'][] = $libs . 'view' . DS; + $paths['helpers'][] = $libs . 'view' . DS . 'helpers' . DS; + $paths['plugins'][] = $path . 'plugins' . DS; + $paths['vendors'][] = $path . 'vendors' . DS; + $paths['shells'][] = $cake . 'console' . DS . 'libs' . DS; + Cache::write('core_paths', array_filter($paths), '_cake_core_'); } if ($type && isset($paths[$type])) { From d7dd63de82283f5b724cfe10d4848c323c5c6a44 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 9 Feb 2010 21:13:20 -0500 Subject: [PATCH 1653/2083] Adding the ability to bake all views for one specific action. Tests added. Fixes #251 --- cake/console/libs/tasks/view.php | 11 ++++++++++- .../cases/console/libs/tasks/view.test.php | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index baf159d4e..62047a3b9 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -189,6 +189,10 @@ function all() { $this->Controller->interactive = false; $tables = $this->Controller->listAll($this->connection, false); + $actions = null; + if (isset($this->args[1])) { + $actions = array($this->args[1]); + } $this->interactive = false; foreach ($tables as $table) { $model = $this->_modelName($table); @@ -196,7 +200,9 @@ function all() { $this->controllerPath = Inflector::underscore($this->controllerName); if (App::import('Model', $model)) { $vars = $this->__loadController(); - $actions = $this->_methodsToBake(); + if (!$actions) { + $actions = $this->_methodsToBake(); + } $this->bakeActions($actions, $vars); } } @@ -441,6 +447,9 @@ function help() { $this->out("\tName of the controller views to bake. Can use Plugin.name"); $this->out("\tas a shortcut for plugin baking."); $this->out(); + $this->out("<action>"); + $this->out("\tName of the action view to bake"); + $this->out(); $this->out('Commands:'); $this->out(); $this->out("view <controller>"); diff --git a/cake/tests/cases/console/libs/tasks/view.test.php b/cake/tests/cases/console/libs/tasks/view.test.php index fb49c4efa..66fb6b73c 100644 --- a/cake/tests/cases/console/libs/tasks/view.test.php +++ b/cake/tests/cases/console/libs/tasks/view.test.php @@ -453,6 +453,24 @@ function testExecuteIntoAll() { $this->Task->execute(); } +/** + * Test all() with action parameter + * + * @return void + * @access public + */ + function testExecuteIntoAllWithActionName() { + $this->Task->args = array('all', 'index'); + + $this->Task->Controller->setReturnValue('listAll', array('view_task_comments')); + $this->Task->Controller->expectOnce('listAll'); + + $this->Task->expectCallCount('createFile', 1); + $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'index.ctp', '*')); + + $this->Task->execute(); + } + /** * test `cake bake view $controller view` * From dc8f49fedafb1ac6efaef8a54ac43e7e4c433692 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 13 Feb 2010 19:39:11 -0500 Subject: [PATCH 1654/2083] Modifying the bootstrap process, to match the documented changes. $pluginPaths style variables will no longer work. You need to use App::build() to set paths in the bootstrap file. Added a build() call before the bootstrap is included. This allows cold cache import() calls to work from bootstrap.php. --- cake/libs/configure.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 5c3672c11..8629eb1e4 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -384,8 +384,6 @@ function buildPaths($paths) { * @access private */ function __loadBootstrap($boot) { - $libPaths = $modelPaths = $behaviorPaths = $controllerPaths = $componentPaths = $viewPaths = $helperPaths = $pluginPaths = $vendorPaths = $localePaths = $shellPaths = null; - if ($boot) { Configure::write('App', array('base' => false, 'baseUrl' => false, 'dir' => APP_DIR, 'webroot' => WEBROOT_DIR, 'www_root' => WWW_ROOT)); @@ -429,19 +427,10 @@ function __loadBootstrap($boot) { } Cache::config('default'); } - + App::build(); if (!include(CONFIGS . 'bootstrap.php')) { trigger_error(sprintf(__("Can't find application bootstrap file. Please create %sbootstrap.php, and make sure it is readable by PHP.", true), CONFIGS), E_USER_ERROR); } - - if (App::path('controllers') == array()) { - App::build(array( - 'models' => $modelPaths, 'views' => $viewPaths, 'controllers' => $controllerPaths, - 'helpers' => $helperPaths, 'components' => $componentPaths, 'behaviors' => $behaviorPaths, - 'plugins' => $pluginPaths, 'vendors' => $vendorPaths, 'locales' => $localePaths, - 'shells' => $shellPaths, 'libs' => $libPaths - )); - } } } } From f04add4f793aae4b67189b11ad485c5d697890e2 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 13 Feb 2010 20:43:02 -0500 Subject: [PATCH 1655/2083] Fixing querystring parameters being chopped off of absolute webroot asset paths. --- cake/libs/view/helper.php | 2 +- cake/tests/cases/libs/view/helper.test.php | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index 516919a1a..43ef30f8f 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -224,7 +224,7 @@ function webroot($file) { } } if (strpos($webPath, '//') !== false) { - return str_replace('//', '/', $webPath); + return str_replace('//', '/', $webPath . $asset[1]); } return $webPath . $asset[1]; } diff --git a/cake/tests/cases/libs/view/helper.test.php b/cake/tests/cases/libs/view/helper.test.php index 0867eb670..d546a6877 100644 --- a/cake/tests/cases/libs/view/helper.test.php +++ b/cake/tests/cases/libs/view/helper.test.php @@ -661,42 +661,46 @@ function testMultiDimensionalField() { $result = $this->Helper->value('My.title'); $this->assertEqual($result,'My Title'); } - + function testWebrootPaths() { $this->Helper->webroot = '/'; $result = $this->Helper->webroot('/img/cake.power.gif'); $expected = '/img/cake.power.gif'; $this->assertEqual($result, $expected); - + $this->Helper->theme = 'test_theme'; - + App::build(array( 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS) )); - + $result = $this->Helper->webroot('/img/cake.power.gif'); $expected = '/theme/test_theme/img/cake.power.gif'; $this->assertEqual($result, $expected); - + $result = $this->Helper->webroot('/img/test.jpg'); $expected = '/theme/test_theme/img/test.jpg'; $this->assertEqual($result, $expected); $webRoot = Configure::read('App.www_root'); Configure::write('App.www_root', TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'webroot' . DS); - + $result = $this->Helper->webroot('/img/cake.power.gif'); $expected = '/theme/test_theme/img/cake.power.gif'; $this->assertEqual($result, $expected); - + $result = $this->Helper->webroot('/img/test.jpg'); $expected = '/theme/test_theme/img/test.jpg'; $this->assertEqual($result, $expected); - + $result = $this->Helper->webroot('/img/cake.icon.gif'); $expected = '/img/cake.icon.gif'; $this->assertEqual($result, $expected); - + + $result = $this->Helper->webroot('/img/cake.icon.gif?some=param'); + $expected = '/img/cake.icon.gif?some=param'; + $this->assertEqual($result, $expected); + Configure::write('App.www_root', $webRoot); } From d7b49e349454c4f0e35e5b74762b4b424cf43775 Mon Sep 17 00:00:00 2001 From: "renan.saddam" <renan.saddam@gmail.com> Date: Mon, 15 Feb 2010 14:46:18 -0300 Subject: [PATCH 1656/2083] Not forcing the use of ds, so will use $useDbConfig instead, tests added. Fixes #324. --- cake/libs/model/cake_schema.php | 4 +- .../cases/libs/model/cake_schema.test.php | 137 +++++++++++++++++- .../test_plugin/test_plugin_app_model.php | 2 +- 3 files changed, 134 insertions(+), 9 deletions(-) diff --git a/cake/libs/model/cake_schema.php b/cake/libs/model/cake_schema.php index 07961fba9..f72d148b9 100644 --- a/cake/libs/model/cake_schema.php +++ b/cake/libs/model/cake_schema.php @@ -238,9 +238,9 @@ function read($options = array()) { $model = $this->plugin . '.' . $model; } if (PHP5) { - $Object = ClassRegistry::init(array('class' => $model, 'ds' => $connection)); + $Object = ClassRegistry::init(array('class' => $model, 'ds' => null)); } else { - $Object =& ClassRegistry::init(array('class' => $model, 'ds' => $connection)); + $Object =& ClassRegistry::init(array('class' => $model, 'ds' => null)); } if (is_object($Object) && $Object->useTable !== false) { diff --git a/cake/tests/cases/libs/model/cake_schema.test.php b/cake/tests/cases/libs/model/cake_schema.test.php index 6e602b775..ac1f42b6a 100644 --- a/cake/tests/cases/libs/model/cake_schema.test.php +++ b/cake/tests/cases/libs/model/cake_schema.test.php @@ -369,6 +369,85 @@ class Testdescribe extends CakeTestModel { var $name = 'Testdescribe'; } +/** + * SchemaCrossDatabase class + * + * @package cake + * @subpackage cake.tests.cases.libs.model + */ +class SchemaCrossDatabase extends CakeTestModel { + +/** + * name property + * + * @var string 'SchemaCrossDatabase' + * @access public + */ + var $name = 'SchemaCrossDatabase'; + +/** + * useTable property + * + * @var string 'posts' + * @access public + */ + var $useTable = 'cross_database'; + +/** + * useDbConfig property + * + * @var string 'test2' + * @access public + */ + var $useDbConfig = 'test2'; +} + +/** + * SchemaCrossDatabaseFixture class + * + * @package cake + * @subpackage cake.tests.cases.libs.model + */ +class SchemaCrossDatabaseFixture extends CakeTestFixture { + +/** + * name property + * + * @var string 'CrossDatabase' + * @access public + */ + var $name = 'CrossDatabase'; + +/** + * table property + * + * @access public + */ + var $table = 'cross_database'; + +/** + * fields property + * + * @var array + * @access public + */ + var $fields = array( + 'id' => array('type' => 'integer', 'key' => 'primary'), + 'name' => 'string' + ); + +/** + * records property + * + * @var array + * @access public + */ + var $records = array( + array('id' => 1, 'name' => 'First'), + array('id' => 2, 'name' => 'Second'), + ); +} + /** * CakeSchemaTest * @@ -384,7 +463,7 @@ class CakeSchemaTest extends CakeTestCase { * @access public */ var $fixtures = array( - 'core.post', 'core.tag', 'core.posts_tag', 'core.comment', 'core.datatype', 'core.auth_user' + 'core.post', 'core.tag', 'core.posts_tag', 'core.comment', 'core.datatype', 'core.auth_user', 'core.author' ); /** @@ -406,6 +485,7 @@ function startTest() { function tearDown() { @unlink(TMP . 'tests' . DS .'schema.php'); unset($this->Schema); + ClassRegistry::flush(); } /** @@ -468,6 +548,7 @@ function testSchemaRead() { )); $this->assertFalse(isset($read['tables']['missing']['posts']), 'Posts table was not read from tablePrefix %s'); } + /** * test reading schema from plugins. * @@ -486,14 +567,58 @@ function testSchemaReadWithPlugins() { 'models' => true )); unset($read['tables']['missing']); - $this->assertTrue(isset($read['tables']['posts'])); $this->assertTrue(isset($read['tables']['auth_users'])); - $this->assertEqual(count($read['tables']), 2); - + $this->assertTrue(isset($read['tables']['authors'])); + $this->assertTrue(isset($read['tables']['comments'])); + $this->assertTrue(isset($read['tables']['posts'])); + $this->assertEqual(count($read['tables']), 4); App::build(); } +/** + * test reading schema with tables from another database. + * + * @return void + */ + function testSchemaReadWithCrossDatabase() { + $config = new DATABASE_CONFIG(); + $skip = $this->skipIf( + !isset($config->test) || !isset($config->test2), + '%s Primary and secondary test databases not configured, skipping cross-database ' + .'join tests.' + .' To run these tests, you must define $test and $test2 in your database configuration.' + ); + if ($skip) { + return; + } + + $db2 =& ConnectionManager::getDataSource('test2'); + $fixture = new SchemaCrossDatabaseFixture(); + $fixture->create($db2); + $fixture->insert($db2); + + $read = $this->Schema->read(array( + 'connection' => 'test_suite', + 'name' => 'TestApp', + 'models' => array('SchemaCrossDatabase', 'SchemaPost') + )); + unset($read['tables']['missing']); + $this->assertTrue(isset($read['tables']['posts'])); + $this->assertFalse(isset($read['tables']['cross_database'])); + + $read = $this->Schema->read(array( + 'connection' => 'test2', + 'name' => 'TestApp', + 'models' => array('SchemaCrossDatabase', 'SchemaPost') + )); + unset($read['tables']['missing']); + $this->assertFalse(isset($read['tables']['posts'])); + $this->assertTrue(isset($read['tables']['cross_database'])); + + $fixture->drop($db2); + } + /** * test that tables are generated correctly * @@ -642,7 +767,7 @@ function testTableParametersAndIndexComparison() { ), 'change' => array( 'tableParameters' => array( - 'charset' => 'utf8', + 'charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM' ) @@ -654,7 +779,7 @@ function testTableParametersAndIndexComparison() { ), 'change' => array( 'tableParameters' => array( - 'charset' => 'utf8', + 'charset' => 'utf8', 'collate' => 'utf8_general_ci', ) ) diff --git a/cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php b/cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php index 6d59b22bf..a09ca1c60 100644 --- a/cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php +++ b/cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php @@ -17,5 +17,5 @@ * @since CakePHP(tm) v 1.2.0.5432 * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ -class TestPluginAppModel extends AppModel {} +class TestPluginAppModel extends CakeTestModel {} ?> \ No newline at end of file From fc499ac48f9caa7e99d656f64c25b64d13348f98 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 16 Feb 2010 22:05:50 -0500 Subject: [PATCH 1657/2083] Reversing order of short cut checks. Fixes issues in PHP 5.1.x. Fixes #351 --- cake/libs/model/datasources/dbo_source.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 5fd829efb..9f087946d 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -380,12 +380,12 @@ function field($name, $sql) { * @return string SQL field */ function name($data) { - if ($data == '*') { - return '*'; - } if (is_object($data) && isset($data->type)) { return $data->value; } + if ($data == '*') { + return '*'; + } $array = is_array($data); $data = (array)$data; $count = count($data); From 2279b1a736ca772622aa63f809b54b5368805857 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 16 Feb 2010 22:35:16 -0500 Subject: [PATCH 1658/2083] Adding patches, and tests from tkykmw. Add support for plugin datasource drivers. Fixes #297 --- cake/libs/model/connection_manager.php | 14 ++-- .../libs/model/connection_manager.test.php | 71 +++++++++++++++++++ .../datasources/test/test_local_driver.php | 6 ++ .../models/datasources/dbo/dbo_dummy.php | 9 +++ .../models/datasources/test/test_driver.php | 6 ++ 5 files changed, 102 insertions(+), 4 deletions(-) create mode 100644 cake/tests/test_app/models/datasources/test/test_local_driver.php create mode 100644 cake/tests/test_app/plugins/test_plugin/models/datasources/dbo/dbo_dummy.php create mode 100644 cake/tests/test_app/plugins/test_plugin/models/datasources/test/test_driver.php diff --git a/cake/libs/model/connection_manager.php b/cake/libs/model/connection_manager.php index 4de4d406d..4ce71ab38 100644 --- a/cake/libs/model/connection_manager.php +++ b/cake/libs/model/connection_manager.php @@ -256,11 +256,17 @@ function __connectionData($config) { $filename = $classname = $parent = $plugin = null; if (!empty($config['driver'])) { - $source = $config['datasource'] . '_' . $config['driver']; - - $filename = $config['datasource'] . DS . $source; - $classname = Inflector::camelize(strtolower($source)); $parent = $this->__connectionData(array('datasource' => $config['datasource'])); + $parentSource = preg_replace('/_source$/', '', $parent['filename']); + + if (strpos($config['driver'], '.') !== false) { + list($plugin, $classname) = explode('.', $config['driver']); + $source = Inflector::underscore($classname); + } else { + $source = $parentSource . '_' . $config['driver']; + $classname = Inflector::camelize(strtolower($source)); + } + $filename = $parentSource . DS . $source; } else { if (strpos($config['datasource'], '.') !== false) { list($plugin, $classname) = explode('.', $config['datasource']); diff --git a/cake/tests/cases/libs/model/connection_manager.test.php b/cake/tests/cases/libs/model/connection_manager.test.php index 5c2530ec2..a4336a28a 100644 --- a/cake/tests/cases/libs/model/connection_manager.test.php +++ b/cake/tests/cases/libs/model/connection_manager.test.php @@ -113,6 +113,77 @@ function testGetPluginDataSource() { App::build(); } +/** + * testGetPluginDataSourceAndPluginDriver method + * + * @access public + * @return void + */ + function testGetPluginDataSourceAndPluginDriver() { + App::build(array( + 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) + )); + + $name = 'test_plugin_source_and_driver'; + $config = array('datasource' => 'TestPlugin.TestSource', 'driver' => 'TestPlugin.TestDriver'); + + $connection = ConnectionManager::create($name, $config); + + $this->assertTrue(class_exists('TestSource')); + $this->assertTrue(class_exists('TestDriver')); + $this->assertEqual($connection->configKeyName, $name); + $this->assertEqual($connection->config, $config); + + App::build(); + } + +/** + * testGetLocalDataSourceAndPluginDriver method + * + * @access public + * @return void + */ + function testGetLocalDataSourceAndPluginDriver() { + App::build(array( + 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) + )); + + $name = 'test_local_source_and_plugin_driver'; + $config = array('datasource' => 'dbo', 'driver' => 'TestPlugin.DboDummy'); + + $connection = ConnectionManager::create($name, $config); + + $this->assertTrue(class_exists('DboSource')); + $this->assertTrue(class_exists('DboDummy')); + $this->assertEqual($connection->configKeyName, $name); + + App::build(); + } + +/** + * testGetPluginDataSourceAndLocalDriver method + * + * @access public + * @return void + */ + function testGetPluginDataSourceAndLocalDriver() { + App::build(array( + 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), + 'datasources' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS . 'datasources' . DS) + )); + + $name = 'test_plugin_source_and_local_driver'; + $config = array('datasource' => 'TestPlugin.TestSource', 'driver' => 'local_driver'); + + $connection = ConnectionManager::create($name, $config); + + $this->assertTrue(class_exists('TestSource')); + $this->assertTrue(class_exists('TestLocalDriver')); + $this->assertEqual($connection->configKeyName, $name); + $this->assertEqual($connection->config, $config); + App::build(); + } + /** * testSourceList method * diff --git a/cake/tests/test_app/models/datasources/test/test_local_driver.php b/cake/tests/test_app/models/datasources/test/test_local_driver.php new file mode 100644 index 000000000..fe9c9fdd3 --- /dev/null +++ b/cake/tests/test_app/models/datasources/test/test_local_driver.php @@ -0,0 +1,6 @@ +<?php + +class TestLocalDriver extends TestSource { +} + +?> \ No newline at end of file diff --git a/cake/tests/test_app/plugins/test_plugin/models/datasources/dbo/dbo_dummy.php b/cake/tests/test_app/plugins/test_plugin/models/datasources/dbo/dbo_dummy.php new file mode 100644 index 000000000..aee12a17a --- /dev/null +++ b/cake/tests/test_app/plugins/test_plugin/models/datasources/dbo/dbo_dummy.php @@ -0,0 +1,9 @@ +<?php + +class DboDummy extends DboSource { + function connect() { + return true; + } +} + +?> \ No newline at end of file diff --git a/cake/tests/test_app/plugins/test_plugin/models/datasources/test/test_driver.php b/cake/tests/test_app/plugins/test_plugin/models/datasources/test/test_driver.php new file mode 100644 index 000000000..beae8d0b6 --- /dev/null +++ b/cake/tests/test_app/plugins/test_plugin/models/datasources/test/test_driver.php @@ -0,0 +1,6 @@ +<?php + +class TestDriver extends TestSource { +} + +?> \ No newline at end of file From eb96f4ac3a60b0354baf9c396ebf5d9fb236fb0a Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 16 Feb 2010 22:42:06 -0500 Subject: [PATCH 1659/2083] Minor refactor of ConnectionManager::__connectionData(). Uses pluginSplit() now to consolidate plugin dot notation handling. --- cake/libs/model/connection_manager.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cake/libs/model/connection_manager.php b/cake/libs/model/connection_manager.php index 4ce71ab38..a0c9174d3 100644 --- a/cake/libs/model/connection_manager.php +++ b/cake/libs/model/connection_manager.php @@ -259,8 +259,8 @@ function __connectionData($config) { $parent = $this->__connectionData(array('datasource' => $config['datasource'])); $parentSource = preg_replace('/_source$/', '', $parent['filename']); - if (strpos($config['driver'], '.') !== false) { - list($plugin, $classname) = explode('.', $config['driver']); + list($plugin, $classname) = pluginSplit($config['driver']); + if ($plugin) { $source = Inflector::underscore($classname); } else { $source = $parentSource . '_' . $config['driver']; @@ -268,8 +268,8 @@ function __connectionData($config) { } $filename = $parentSource . DS . $source; } else { - if (strpos($config['datasource'], '.') !== false) { - list($plugin, $classname) = explode('.', $config['datasource']); + list($plugin, $classname) = pluginSplit($config['datasource']); + if ($plugin) { $filename = Inflector::underscore($classname); } else { $filename = $config['datasource'] . '_source'; From 0b1efd3e86084dd65ab78e799d879e835cefe99f Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 16 Feb 2010 23:18:49 -0500 Subject: [PATCH 1660/2083] Fixing delivery of plugin assets that reside in the root of a plugin webroot directory. Tests added. --- cake/dispatcher.php | 2 +- cake/tests/cases/dispatcher.test.php | 6 ++++++ cake/tests/test_app/plugins/test_plugin/webroot/root.js | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 cake/tests/test_app/plugins/test_plugin/webroot/root.js diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 9046c2794..c1bfc2954 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -617,7 +617,7 @@ function asset($url) { if ($parts[0] === 'theme') { $pos = strlen($parts[0] . $parts[1]) + 1; - } elseif (count($parts) > 2) { + } else { $pos = strlen($parts[0]); } $assetFile = null; diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index 9cbc28afc..f44a815f7 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -1904,6 +1904,12 @@ function testAssets() { $result = ob_get_clean(); $this->assertEqual('nested theme js file', $result); + ob_start(); + $Dispatcher->asset('test_plugin/root.js'); + $result = ob_get_clean(); + $expected = file_get_contents(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'webroot' . DS . 'root.js'); + $this->assertEqual($result, $expected); + ob_start(); $Dispatcher->dispatch('test_plugin/flash/plugin_test.swf'); $result = ob_get_clean(); diff --git a/cake/tests/test_app/plugins/test_plugin/webroot/root.js b/cake/tests/test_app/plugins/test_plugin/webroot/root.js new file mode 100644 index 000000000..529e1c18c --- /dev/null +++ b/cake/tests/test_app/plugins/test_plugin/webroot/root.js @@ -0,0 +1 @@ +alert('I am a root level file!'); \ No newline at end of file From bff7ce692582e931a97a24eb52bcea616f92f944 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 16 Feb 2010 23:31:54 -0500 Subject: [PATCH 1661/2083] Refactoring Dispatcher::asset() to remove code left behind from previous refactoring. Simplifies asset location as well. --- cake/dispatcher.php | 53 +++++++++++++++------------------------------ 1 file changed, 18 insertions(+), 35 deletions(-) diff --git a/cake/dispatcher.php b/cake/dispatcher.php index c1bfc2954..1a4587d9a 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -612,47 +612,30 @@ function asset($url) { } $controller = null; $ext = array_pop(explode('.', $url)); - $pos = 0; $parts = explode('/', $url); - - if ($parts[0] === 'theme') { - $pos = strlen($parts[0] . $parts[1]) + 1; - } else { - $pos = strlen($parts[0]); - } $assetFile = null; - $paths = array(); - $matched = false; - - if ($pos > 0) { - $plugin = substr($url, 0, $pos); - $url = preg_replace('/^' . preg_quote($plugin, '/') . '\//i', '', $url); - - if (strpos($plugin, '/') !== false) { - list($plugin, $theme) = explode('/', $plugin); - $themePaths = App::path('views'); - - foreach ($themePaths as $viewPath) { - $path = $viewPath . 'themed' . DS . $theme . DS . 'webroot' . DS; - if ($plugin === 'theme' && (is_file($path . $url) && file_exists($path . $url))) { - $assetFile = $path . $url; - break; - } - } - } - if ($matched === false) { - $paths[] = App::pluginPath($plugin) . 'webroot' . DS; - } - } - - if ($matched === false) { - foreach ($paths as $path) { - if (is_file($path . $url) && file_exists($path . $url)) { - $assetFile = $path . $url; + if ($parts[0] === 'theme') { + $themeName = $parts[1]; + unset($parts[0], $parts[1]); + $fileFragment = implode('/', $parts); + + $viewPaths = App::path('views'); + foreach ($viewPaths as $viewPath) { + $path = $viewPath . 'themed' . DS . $themeName . DS . 'webroot' . DS; + if (file_exists($path . $fileFragment)) { + $assetFile = $path . $fileFragment; break; } } + } else { + $plugin = $parts[0]; + unset($parts[0]); + $fileFragment = implode('/', $parts); + $pluginWebroot = App::pluginPath($plugin) . 'webroot' . DS; + if (file_exists($pluginWebroot . $fileFragment)) { + $assetFile = $pluginWebroot . $fileFragment; + } } if ($assetFile !== null) { From 14911cf720e16acdd155c3c52c36470478c07cd2 Mon Sep 17 00:00:00 2001 From: "renan.saddam" <renan.saddam@gmail.com> Date: Wed, 17 Feb 2010 21:41:15 -0300 Subject: [PATCH 1662/2083] Fixing typo and introducing 'Overwrite all' functionallity. Fixes #333. --- cake/console/libs/tasks/extract.php | 32 +++++++++++++++-------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/cake/console/libs/tasks/extract.php b/cake/console/libs/tasks/extract.php index ceb6b0c23..f2a1275d8 100644 --- a/cake/console/libs/tasks/extract.php +++ b/cake/console/libs/tasks/extract.php @@ -321,12 +321,12 @@ function __parse($functionName, $map) { function __buildFiles() { foreach ($this->__strings as $domain => $strings) { foreach ($strings as $string => $files) { - $occurences = array(); + $occurrences = array(); foreach ($files as $file => $lines) { - $occurences[] = $file . ':' . implode(';', $lines); + $occurrences[] = $file . ':' . implode(';', $lines); } - $occurences = implode("\n#: ", $occurences); - $header = '#: ' . str_replace($this->__paths, '', $occurences) . "\n"; + $occurrences = implode("\n#: ", $occurrences); + $header = '#: ' . str_replace($this->__paths, '', $occurrences) . "\n"; if (strpos($string, "\0") === false) { $sentence = "msgid \"{$string}\"\n"; @@ -371,6 +371,7 @@ function __store($domain, $header, $sentence) { * @access private */ function __writeFiles() { + $overwriteAll = false; foreach ($this->__storage as $domain => $sentences) { $output = $this->__writeHeader(); foreach ($sentences as $sentence => $header) { @@ -379,18 +380,19 @@ function __writeFiles() { $filename = $domain . '.pot'; $File = new File($this->__output . $filename); - if ($File->exists()) { - $response = ''; - while ($response == '') { - $this->out(); - $response = $this->in(sprintf(__('Error: %s already exists in this location. Overwrite?', true), $filename), array('y', 'n'), 'y'); - if (strtoupper($response) === 'N') { - $response = ''; - while ($response == '') { - $response = $this->in(sprintf(__("What would you like to name this file?\nExample: %s", true), 'new_' . $filename), null, 'new_' . $filename); - $File = new File($this->__output . $response); - } + $response = ''; + while ($overwriteAll === false && $File->exists() && strtoupper($response) !== 'Y') { + $this->out(); + $response = $this->in(sprintf(__('Error: %s already exists in this location. Overwrite? [Y]es, [N]o, [A]ll', true), $filename), array('y', 'n', 'a'), 'y'); + if (strtoupper($response) === 'N') { + $response = ''; + while ($response == '') { + $response = $this->in(sprintf(__("What would you like to name this file?\nExample: %s", true), 'new_' . $filename), null, 'new_' . $filename); + $File = new File($this->__output . $response); + $filename = $response; } + } elseif (strtoupper($response) === 'A') { + $overwriteAll = true; } } $File->write($output); From 63f7900ba1647e2111b85d9445d3973f746f93f5 Mon Sep 17 00:00:00 2001 From: "renan.saddam" <renan.saddam@gmail.com> Date: Wed, 17 Feb 2010 22:31:00 -0300 Subject: [PATCH 1663/2083] Checking if the last query returned a error, tests added. Fixes #72. --- cake/libs/model/datasources/dbo/dbo_mssql.php | 18 +++++++++---- .../model/datasources/dbo/dbo_mssql.test.php | 25 +++++++++++++++++++ 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/cake/libs/model/datasources/dbo/dbo_mssql.php b/cake/libs/model/datasources/dbo/dbo_mssql.php index 9b2912bfd..9e08bd190 100644 --- a/cake/libs/model/datasources/dbo/dbo_mssql.php +++ b/cake/libs/model/datasources/dbo/dbo_mssql.php @@ -99,6 +99,13 @@ class DboMssql extends DboSource { 'commit' => 'COMMIT', 'rollback' => 'ROLLBACK' ); +/** + * Define if the last query had error + * + * @var string + * @access private + */ + var $__lastQueryHadError = false; /** * MS SQL DBO driver constructor; sets SQL Server error reporting defaults * @@ -177,7 +184,9 @@ function disconnect() { * @access protected */ function _execute($sql) { - return mssql_query($sql, $this->connection); + $result = @mssql_query($sql, $this->connection); + $this->__lastQueryHadError = ($result === false); + return $result; } /** * Returns an array of sources (tables) in the database. @@ -411,10 +420,9 @@ function update(&$model, $fields = array(), $values = null, $conditions = null) * @return string Error message with error number */ function lastError() { - $error = mssql_get_last_message(); - - if ($error) { - if (!preg_match('/contexto de la base de datos a|contesto di database|changed database|contexte de la base de don|datenbankkontext/i', $error)) { + if ($this->__lastQueryHadError) { + $error = mssql_get_last_message(); + if ($error && !preg_match('/contexto de la base de datos a|contesto di database|changed database|contexte de la base de don|datenbankkontext/i', $error)) { return $error; } } diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php index 7ea712a42..cfc5440d6 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php @@ -627,5 +627,30 @@ function testInsertMulti() { ); $this->assertEqual($result, $expected); } +/** + * testLastError + * + * @return void + * @access public + */ + function testLastError() { + $debug = Configure::read('debug'); + Configure::write('debug', 0); + + $this->db->simulate = false; + $query = 'SELECT [name] FROM [categories]'; + $this->assertTrue($this->db->execute($query) !== false); + $this->assertNull($this->db->lastError()); + + $query = 'SELECT [inexistent_field] FROM [categories]'; + $this->assertFalse($this->db->execute($query)); + $this->assertNotNull($this->db->lastError()); + + $query = 'SELECT [name] FROM [categories]'; + $this->assertTrue($this->db->execute($query) !== false); + $this->assertNull($this->db->lastError()); + + Configure::write('debug', $debug); + } } ?> \ No newline at end of file From 2209f198f88197e0600d5c0ca375e78e572c2e11 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 17 Feb 2010 22:21:48 -0500 Subject: [PATCH 1664/2083] Adding test to check that postfix and prefix options don't go into inner objects. Tests added, fixes #348 --- cake/libs/view/helpers/javascript.php | 5 ++++- cake/tests/cases/libs/view/helpers/javascript.test.php | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/javascript.php b/cake/libs/view/helpers/javascript.php index 3af318274..86a101b58 100644 --- a/cake/libs/view/helpers/javascript.php +++ b/cake/libs/view/helpers/javascript.php @@ -639,7 +639,10 @@ function object($data = array(), $options = array()) { foreach ($data as $key => $val) { if (is_array($val) || is_object($val)) { - $val = $this->object($val, array_merge($options, array('block' => false))); + $val = $this->object( + $val, + array_merge($options, array('block' => false, 'prefix' => '', 'postfix' => '')) + ); } else { $quoteStrings = ( !count($options['stringKeys']) || diff --git a/cake/tests/cases/libs/view/helpers/javascript.test.php b/cake/tests/cases/libs/view/helpers/javascript.test.php index 88df27926..22b570b8c 100644 --- a/cake/tests/cases/libs/view/helpers/javascript.test.php +++ b/cake/tests/cases/libs/view/helpers/javascript.test.php @@ -404,6 +404,13 @@ function testObjectGeneration() { $result = $this->Javascript->object($data); $this->assertEqual($result, $expected); } + + $object = array('title' => 'New thing', 'indexes' => array(5, 6, 7, 8), 'object' => array('inner' => array('value' => 1))); + $result = $this->Javascript->object($object, array('prefix' => 'PREFIX', 'postfix' => 'POSTFIX')); + $this->assertPattern('/^PREFIX/', $result); + $this->assertPattern('/POSTFIX$/', $result); + $this->assertNoPattern('/.PREFIX./', $result); + $this->assertNoPattern('/.POSTFIX./', $result); if ($this->Javascript->useNative) { $this->Javascript->useNative = false; From ab688b88f408132a272b71b1c93dbb8ec42fcbad Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 17 Feb 2010 22:21:48 -0500 Subject: [PATCH 1665/2083] Adding test to check that postfix and prefix options don't go into inner objects. Tests added, fixes #348 --- cake/libs/view/helpers/javascript.php | 5 ++++- cake/tests/cases/libs/view/helpers/javascript.test.php | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/javascript.php b/cake/libs/view/helpers/javascript.php index 3e07ef9bd..ec66579aa 100644 --- a/cake/libs/view/helpers/javascript.php +++ b/cake/libs/view/helpers/javascript.php @@ -632,7 +632,10 @@ function object($data = array(), $options = array(), $prefix = null, $postfix = foreach ($data as $key => $val) { if (is_array($val) || is_object($val)) { - $val = $this->object($val, array_merge($options, array('block' => false))); + $val = $this->object( + $val, + array_merge($options, array('block' => false, 'prefix' => '', 'postfix' => '')) + ); } else { $quoteStrings = ( !count($options['stringKeys']) || diff --git a/cake/tests/cases/libs/view/helpers/javascript.test.php b/cake/tests/cases/libs/view/helpers/javascript.test.php index e9bffea7a..83c1b74d0 100644 --- a/cake/tests/cases/libs/view/helpers/javascript.test.php +++ b/cake/tests/cases/libs/view/helpers/javascript.test.php @@ -392,6 +392,13 @@ function testObjectGeneration() { $result = $this->Javascript->object($data); $this->assertEqual($result, $expected); } + + $object = array('title' => 'New thing', 'indexes' => array(5, 6, 7, 8), 'object' => array('inner' => array('value' => 1))); + $result = $this->Javascript->object($object, array('prefix' => 'PREFIX', 'postfix' => 'POSTFIX')); + $this->assertPattern('/^PREFIX/', $result); + $this->assertPattern('/POSTFIX$/', $result); + $this->assertNoPattern('/.PREFIX./', $result); + $this->assertNoPattern('/.POSTFIX./', $result); if ($this->Javascript->useNative) { $this->Javascript->useNative = false; From 96bbbb2d72891b5d04b2b401339f29b2b87e6d25 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 17 Feb 2010 22:27:52 -0500 Subject: [PATCH 1666/2083] Applying fixes made to JavascriptHelper to JsBaseEngine. --- cake/libs/view/helpers/js.php | 2 +- cake/tests/cases/libs/view/helpers/js.test.php | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 8f07f3e58..6f47374f9 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -590,7 +590,7 @@ function object($data = array(), $options = array()) { foreach ($data as $key => $val) { if (is_array($val) || is_object($val)) { - $val = $this->object($val, $options); + $val = $this->object($val); } else { $val = $this->value($val); } diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index 38c658fc2..3138e73d3 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -502,7 +502,7 @@ function testSetVarsAtTopOfBufferedScripts() { $this->Js->alert('hey you!', array('buffer' => true)); $this->Js->confirm('Are you sure?', array('buffer' => true)); $result = $this->Js->getBuffer(false); - + $expected = 'window.app = {"height":"tall","color":"purple"};'; $this->assertEqual($result[0], $expected); $this->assertEqual($result[1], 'alert("hey you!");'); @@ -665,6 +665,13 @@ function testObject() { $result = $this->JsEngine->object($data); $this->assertEqual($result, $expected); } + + $object = array('title' => 'New thing', 'indexes' => array(5, 6, 7, 8), 'object' => array('inner' => array('value' => 1))); + $result = $this->JsEngine->object($object, array('prefix' => 'PREFIX', 'postfix' => 'POSTFIX')); + $this->assertPattern('/^PREFIX/', $result); + $this->assertPattern('/POSTFIX$/', $result); + $this->assertNoPattern('/.PREFIX./', $result); + $this->assertNoPattern('/.POSTFIX./', $result); } /** From f4c670e5be6bf6a9599d394669999fcadd01e4b1 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 20 Feb 2010 01:38:16 -0500 Subject: [PATCH 1667/2083] Fixing lack of space in meta tags lacking a link attribute. Fixes #371 --- cake/libs/view/helpers/html.php | 2 +- cake/tests/cases/libs/view/helpers/html.test.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php index de68c6861..3e8ff83fc 100644 --- a/cake/libs/view/helpers/html.php +++ b/cake/libs/view/helpers/html.php @@ -237,7 +237,7 @@ function meta($type, $url = null, $attributes = array(), $inline = true) { } $out .= sprintf($this->tags['metalink'], $attributes['link'], $this->_parseAttributes($attributes, array('link'), ' ', ' ')); } else { - $out = sprintf($this->tags['meta'], $this->_parseAttributes($attributes, array('type'))); + $out = sprintf($this->tags['meta'], $this->_parseAttributes($attributes, array('type'), ' ', ' ')); } if ($inline) { diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/cake/tests/cases/libs/view/helpers/html.test.php index 2ade552ad..d6d3be54e 100644 --- a/cake/tests/cases/libs/view/helpers/html.test.php +++ b/cake/tests/cases/libs/view/helpers/html.test.php @@ -844,6 +844,8 @@ function testMeta() { $result = $this->Html->meta('keywords', 'these, are, some, meta, keywords'); $this->assertTags($result, array('meta' => array('name' => 'keywords', 'content' => 'these, are, some, meta, keywords'))); + $this->assertPattern('/\s+\/>$/', $result); + $result = $this->Html->meta('description', 'this is the meta description'); $this->assertTags($result, array('meta' => array('name' => 'description', 'content' => 'this is the meta description'))); From 06fc87fc2d6b4b17562a478d8a1a48b7a68bf4b0 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 20 Feb 2010 01:38:16 -0500 Subject: [PATCH 1668/2083] Fixing lack of space in meta tags lacking a link attribute. Fixes #371 --- cake/libs/view/helpers/html.php | 2 +- cake/tests/cases/libs/view/helpers/html.test.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php index 9d38e0c54..3161a96fb 100644 --- a/cake/libs/view/helpers/html.php +++ b/cake/libs/view/helpers/html.php @@ -227,7 +227,7 @@ function meta($type, $url = null, $options = array()) { } $out .= sprintf($this->tags['metalink'], $options['link'], $this->_parseAttributes($options, array('link'), ' ', ' ')); } else { - $out = sprintf($this->tags['meta'], $this->_parseAttributes($options, array('type'))); + $out = sprintf($this->tags['meta'], $this->_parseAttributes($options, array('type'), ' ', ' ')); } if ($inline) { diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/cake/tests/cases/libs/view/helpers/html.test.php index 40907c023..17011ae5c 100644 --- a/cake/tests/cases/libs/view/helpers/html.test.php +++ b/cake/tests/cases/libs/view/helpers/html.test.php @@ -1089,6 +1089,8 @@ function testMeta() { $result = $this->Html->meta('keywords', 'these, are, some, meta, keywords'); $this->assertTags($result, array('meta' => array('name' => 'keywords', 'content' => 'these, are, some, meta, keywords'))); + $this->assertPattern('/\s+\/>$/', $result); + $result = $this->Html->meta('description', 'this is the meta description'); $this->assertTags($result, array('meta' => array('name' => 'description', 'content' => 'this is the meta description'))); From 763aa524b95f666d1a20d7e58b896f39d830dbd0 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 20 Feb 2010 11:25:46 -0500 Subject: [PATCH 1669/2083] Fixing recursive directory creation when nested create() calls fail. Fixes #347 --- cake/libs/folder.php | 2 +- cake/tests/cases/libs/folder.test.php | 42 +++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/cake/libs/folder.php b/cake/libs/folder.php index 05dd150b2..6b71be4e3 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -473,7 +473,7 @@ function create($pathname, $mode = false) { } } } - return true; + return false; } /** * Returns the size in bytes of this Folder. diff --git a/cake/tests/cases/libs/folder.test.php b/cake/tests/cases/libs/folder.test.php index ecdf13e99..a95555e54 100644 --- a/cake/tests/cases/libs/folder.test.php +++ b/cake/tests/cases/libs/folder.test.php @@ -82,6 +82,48 @@ function testInPath() { $result = $Folder->inPath(DS . 'non-existing' . $inside); $this->assertFalse($result); } + +/** + * test creation of single and mulitple paths. + * + * @return void + */ + function testCreation() { + $folder =& new Folder(TMP . 'tests'); + $result = $folder->create(TMP . 'tests' . DS . 'first' . DS . 'second' . DS . 'third'); + $this->assertTrue($result); + + rmdir(TMP . 'tests' . DS . 'first' . DS . 'second' . DS . 'third'); + rmdir(TMP . 'tests' . DS . 'first' . DS . 'second'); + rmdir(TMP . 'tests' . DS . 'first'); + + $folder =& new Folder(TMP . 'tests'); + $result = $folder->create(TMP . 'tests' . DS . 'first'); + $this->assertTrue($result); + rmdir(TMP . 'tests' . DS . 'first'); + } +/** + * test recurisve directory create failure. + * + * @return void + */ + function testRecursiveCreateFailure() { + if ($this->skipIf(DS == '\\', 'Cant perform operations using permissions on windows. %s')) { + return; + } + $path = TMP . 'tests' . DS . 'one'; + mkdir($path); + chmod($path, '0444'); + + $this->expectError(); + + $folder =& new Folder($path); + $result = $folder->create($path . DS . 'two' . DS . 'three'); + $this->assertFalse($result); + + chmod($path, '0777'); + rmdir($path); + } /** * testOperations method * From 416abed211cb4af4d0729b1400977e719c079a66 Mon Sep 17 00:00:00 2001 From: Juan Basso <juan.basso@digitro.com.br> Date: Fri, 19 Feb 2010 13:41:52 -0200 Subject: [PATCH 1670/2083] Test of ticket #323. Signed-off-by: Mark Story <mark@mark-story.com> --- cake/tests/cases/libs/model/datasources/dbo_source.test.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index bef71f773..59fc56e66 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -4033,6 +4033,10 @@ function testName() { $result = $this->testDb->name('Function(Something.foo) AS x'); $expected = 'Function(`Something`.`foo`) AS `x`'; $this->assertEqual($result, $expected); + + $result = $this->testDb->name('name-with-minus'); + $expected = '`name-with-minus`'; + $this->assertEqual($result, $expected); } /** From 7075aa5e868a2ee8a5ae19dc4f67eb0dd07c149d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 20 Feb 2010 11:42:17 -0500 Subject: [PATCH 1671/2083] Fixing DboSource not quoting table/field names with - in them. Tests expanded . Fixes #323 --- cake/libs/model/datasources/dbo_source.php | 11 ++++------- .../cases/libs/model/datasources/dbo_source.test.php | 4 ++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 3795d6f9c..ab63108a6 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -472,9 +472,6 @@ function name($data) { if (is_object($data) && isset($data->type)) { return $data->value; } - if ($data == '*') { - return '*'; - } if ($data === '*') { return '*'; } @@ -492,20 +489,20 @@ function name($data) { return $this->methodCache[__FUNCTION__][$cacheKey]; } $data = trim($data); - if (preg_match('/^\w+(\.\w+)*$/', $data)) { // string, string.string + if (preg_match('/^[\w-]+(\.[\w-]+)*$/', $data)) { // string, string.string if (strpos($data, '.') === false) { // string return $this->startQuote . $data . $this->endQuote; } $items = explode('.', $data); return $this->startQuote . implode($this->endQuote . '.' . $this->startQuote, $items) . $this->endQuote; } - if (preg_match('/^\w+\.\*$/', $data)) { // string.* + if (preg_match('/^[\w-]+\.\*$/', $data)) { // string.* return $this->startQuote . str_replace('.*', $this->endQuote . '.*', $data); } - if (preg_match('/^(\w+)\((.*)\)$/', $data, $matches)) { // Functions + if (preg_match('/^([\w-]+)\((.*)\)$/', $data, $matches)) { // Functions return $matches[1] . '(' . $this->name($matches[2]) . ')'; } - if (preg_match('/^(\w+(\.\w+|\(.*\))*)\s+' . preg_quote($this->alias) . '\s*(\w+)$/', $data, $matches)) { + if (preg_match('/^([\w-]+(\.[\w-]+|\(.*\))*)\s+' . preg_quote($this->alias) . '\s*([\w-]+)$/', $data, $matches)) { return preg_replace('/\s{2,}/', ' ', $this->name($matches[1]) . ' ' . $this->alias . ' ' . $this->name($matches[3])); } return $this->methodCache[__FUNCTION__][$cacheKey] = $data; diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index 59fc56e66..f143820ce 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -4037,6 +4037,10 @@ function testName() { $result = $this->testDb->name('name-with-minus'); $expected = '`name-with-minus`'; $this->assertEqual($result, $expected); + + $result = $this->testDb->name(array('my-name', 'Foo-Model.*')); + $expected = array('`my-name`', '`Foo-Model`.*'); + $this->assertEqual($result, $expected); } /** From 8ce9560f4107125a0b4b8128ee5f9c51c86e3179 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 20 Feb 2010 19:57:17 -0500 Subject: [PATCH 1672/2083] Correcting forcing of debug = 1 in console. Updating order of bootstrapping to match the one used for web requests. Fixes #366 --- cake/console/cake.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cake/console/cake.php b/cake/console/cake.php index 67527f154..cb9e42ce2 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -264,14 +264,10 @@ function __bootstrap() { } } - Configure::getInstance(file_exists(CONFIGS . 'bootstrap.php')); - if (!file_exists(APP_PATH . 'config' . DS . 'core.php')) { include_once CORE_PATH . 'cake' . DS . 'console' . DS . 'templates' . DS . 'skel' . DS . 'config' . DS . 'core.php'; - App::build(); } - - Configure::write('debug', 1); + Configure::getInstance(file_exists(CONFIGS . 'bootstrap.php')); return true; } From 8615274e7f263803219aaf7540db71ec6dac142d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 20 Feb 2010 20:13:42 -0500 Subject: [PATCH 1673/2083] Fixing issue where baking a model non-interactively would omit hasMany associations. Tests added. --- cake/console/libs/tasks/model.php | 6 +++++- .../cases/console/libs/tasks/model.test.php | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 30ebe6fd2..461740f75 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -465,6 +465,10 @@ function doAssociations(&$model) { return false; } + if (empty($this->_tables)) { + $this->_tables = $this->getAllTables(); + } + $associations = array( 'belongsTo' => array(), 'hasMany' => array(), 'hasOne'=> array(), 'hasAndBelongsToMany' => array() ); @@ -532,7 +536,7 @@ function findHasOneAndMany(&$model, $associations) { $foreignKey = $this->_modelKey($model->name); foreach ($this->_tables as $otherTable) { $tempOtherModel = $this->_getModelObject($this->_modelName($otherTable), $otherTable); - $modelFieldsTemp = $tempOtherModel->schema(); + $modelFieldsTemp = $tempOtherModel->schema(true); $pattern = '/_' . preg_quote($model->table, '/') . '|' . preg_quote($model->table, '/') . '_/'; $possibleJoinTable = preg_match($pattern , $otherTable); diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index 967c04bfb..949c54628 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -707,6 +707,22 @@ function testExecuteWithNamedModel() { $this->assertEqual(count(ClassRegistry::mapKeys()), 0); } +/** + * test that execute with a model name picks up hasMany associations. + * + * @return void + * @access public + */ + function testExecuteWithNamedModelHasManyCreated() { + $this->Task->connection = 'test_suite'; + $this->Task->path = '/my/path/'; + $this->Task->args = array('article'); + $filename = '/my/path/article.php'; + $this->Task->setReturnValue('_checkUnitTest', 1); + $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation("/'Comment' \=\> array\(/"))); + $this->Task->execute(); + } + /** * test that execute runs all() when args[0] = all * From b1a3e053746430f182d5a7eec2307a301754d12d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 21 Feb 2010 22:37:18 -0500 Subject: [PATCH 1674/2083] Fixing failing tests in ControllerTask. --- .../cases/console/libs/tasks/controller.test.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index be5ee94d7..3f713f585 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -318,21 +318,22 @@ function testBakeActionsUsingSessions() { $this->assertTrue(strpos($result, "\$this->set('articles', \$this->paginate());") !== false); $this->assertTrue(strpos($result, 'function view($id = null)') !== false); - $this->assertTrue(strpos($result, "\$this->Session->setFlash(__('Invalid article', true))") !== false); + $this->assertTrue(strpos($result, "\$this->Session->setFlash(sprintf(__('Invalid %s', true), 'article'));") !== false); $this->assertTrue(strpos($result, "\$this->set('article', \$this->Article->read(null, \$id)") !== false); $this->assertTrue(strpos($result, 'function add()') !== false); $this->assertTrue(strpos($result, 'if (!empty($this->data))') !== false); $this->assertTrue(strpos($result, 'if ($this->Article->save($this->data))') !== false); - $this->assertTrue(strpos($result, "\$this->Session->setFlash(__('The article has been saved', true))") !== false); + $this->assertTrue(strpos($result, "\$this->Session->setFlash(sprintf(__('The %s has been saved', true), 'article'));") !== false); $this->assertTrue(strpos($result, 'function edit($id = null)') !== false); - $this->assertTrue(strpos($result, "\$this->Session->setFlash(__('The article could not be saved. Please, try again.', true));") !== false); + $this->assertTrue(strpos($result, "\$this->Session->setFlash(sprintf(__('The %s could not be saved. Please, try again.', true), 'article'));") !== false); $this->assertTrue(strpos($result, 'function delete($id = null)') !== false); $this->assertTrue(strpos($result, 'if ($this->Article->delete($id))') !== false); - $this->assertTrue(strpos($result, "\$this->Session->setFlash(__('Article deleted', true))") !== false); + $this->assertTrue(strpos($result, "\$this->Session->setFlash(sprintf(__('%s deleted', true), 'Article'));") !== false); +debug($result, true); $result = $this->Task->bakeActions('Articles', 'admin_', true); @@ -362,13 +363,13 @@ function testBakeActionsWithNoSessions() { $this->assertTrue(strpos($result, "\$this->set('articles', \$this->paginate());") !== false); $this->assertTrue(strpos($result, 'function view($id = null)') !== false); - $this->assertTrue(strpos($result, "\$this->flash(__('Invalid article', true), array('action' => 'index'))") !== false); + $this->assertTrue(strpos($result, "\$this->flash(sprintf(__('Invalid %s', true), 'article'), array('action' => 'index'))") !== false); $this->assertTrue(strpos($result, "\$this->set('article', \$this->Article->read(null, \$id)") !== false); $this->assertTrue(strpos($result, 'function add()') !== false); $this->assertTrue(strpos($result, 'if (!empty($this->data))') !== false); $this->assertTrue(strpos($result, 'if ($this->Article->save($this->data))') !== false); - $this->assertTrue(strpos($result, "\$this->flash(__('The article has been saved.', true), array('action' => 'index'))") !== false); + $this->assertTrue(strpos($result, "\$this->flash(sprintf(__('The %s has been saved.', true), 'article'), array('action' => 'index'))") !== false); $this->assertTrue(strpos($result, 'function edit($id = null)') !== false); $this->assertTrue(strpos($result, "\$this->Article->Tag->find('list')") !== false); @@ -376,7 +377,7 @@ function testBakeActionsWithNoSessions() { $this->assertTrue(strpos($result, 'function delete($id = null)') !== false); $this->assertTrue(strpos($result, 'if ($this->Article->delete($id))') !== false); - $this->assertTrue(strpos($result, "\$this->flash(__('Article deleted', true), array('action' => 'index'))") !== false); + $this->assertTrue(strpos($result, "\$this->flash(sprintf(__('%s deleted', true), 'Article'), array('action' => 'index'))") !== false); } /** From fbf054b22b04e6d8205e3a523afa9d40c74981c7 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 22 Feb 2010 23:21:30 -0500 Subject: [PATCH 1675/2083] Making FileEngine emit errors when a path does not exist but is used for caching. Should make cryptic errors coming from Cache easier to figure out. Removed useless private property. Tests added. Fixes #384 --- cake/libs/cache/file.php | 24 +++++++---------------- cake/tests/cases/libs/cache/file.test.php | 18 +++++++++++++++++ 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/cake/libs/cache/file.php b/cake/libs/cache/file.php index 7241c8648..1907c84e9 100644 --- a/cake/libs/cache/file.php +++ b/cake/libs/cache/file.php @@ -19,6 +19,9 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +if (!class_exists('File')) { + require LIBS . 'file.php'; +} /** * File Storage engine for cache * @@ -50,14 +53,6 @@ class FileEngine extends CacheEngine { */ var $settings = array(); -/** - * Set to true if FileEngine::init(); and FileEngine::__active(); do not fail. - * - * @var boolean - * @access private - */ - var $__active = false; - /** * True unless FileEngine::__active(); fails * @@ -85,9 +80,6 @@ function init($settings = array()) { $settings )); if (!isset($this->__File)) { - if (!class_exists('File')) { - require LIBS . 'file.php'; - } $this->__File =& new File($this->settings['path'] . DS . 'cake'); } @@ -95,9 +87,9 @@ function init($settings = array()) { $this->settings['isWindows'] = true; } - $this->settings['path'] = $this->__File->Folder->cd($this->settings['path']); - if (empty($this->settings['path'])) { - return false; + $path = $this->__File->Folder->cd($this->settings['path']); + if ($path) { + $this->settings['path'] = $path; } return $this->__active(); } @@ -266,11 +258,9 @@ function __setKey($key) { * @access private */ function __active() { - if (!$this->__active && $this->__init && !is_writable($this->settings['path'])) { + if ($this->__init && !is_writable($this->settings['path'])) { $this->__init = false; trigger_error(sprintf(__('%s is not writable', true), $this->settings['path']), E_USER_WARNING); - } else { - $this->__active = true; } return true; } diff --git a/cake/tests/cases/libs/cache/file.test.php b/cake/tests/cases/libs/cache/file.test.php index ad093787c..16a7bc705 100644 --- a/cake/tests/cases/libs/cache/file.test.php +++ b/cake/tests/cases/libs/cache/file.test.php @@ -355,5 +355,23 @@ function testWriteQuotedString() { Cache::write('App.singleQuoteTest', "'this is a quoted string'"); $this->assertIdentical(Cache::read('App.singleQuoteTest'), "'this is a quoted string'"); } + +/** + * check that FileEngine generates an error when a configured Path does not exist. + * + * @return void + */ + function testErrorWhenPathDoesNotExist() { + if ($this->skipIf(is_dir(TMP . 'tests' . DS . 'file_failure'), 'Cannot run test directory exists. %s')) { + return; + } + $this->expectError(); + Cache::config('failure', array( + 'engine' => 'File', + 'path' => TMP . 'tests' . DS . 'file_failure' + )); + + Cache::drop('failure'); + } } ?> \ No newline at end of file From 753721c77751328d52035774a8a223e6a4c1aac6 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 22 Feb 2010 23:36:47 -0500 Subject: [PATCH 1676/2083] Making private properties and methods in FileEngine protected. Will make any possible subclasses easier to work with. --- cake/libs/cache/file.php | 68 ++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/cake/libs/cache/file.php b/cake/libs/cache/file.php index 1907c84e9..31dd70a5d 100644 --- a/cake/libs/cache/file.php +++ b/cake/libs/cache/file.php @@ -35,9 +35,9 @@ class FileEngine extends CacheEngine { * Instance of File class * * @var File - * @access private + * @access protected */ - var $__File = null; + var $_File = null; /** * Settings @@ -57,9 +57,9 @@ class FileEngine extends CacheEngine { * True unless FileEngine::__active(); fails * * @var boolean - * @access private + * @access protected */ - var $__init = true; + var $_init = true; /** * Initialize the Cache Engine @@ -79,15 +79,15 @@ function init($settings = array()) { ), $settings )); - if (!isset($this->__File)) { - $this->__File =& new File($this->settings['path'] . DS . 'cake'); + if (!isset($this->_File)) { + $this->_File =& new File($this->settings['path'] . DS . 'cake'); } if (DIRECTORY_SEPARATOR === '\\') { $this->settings['isWindows'] = true; } - $path = $this->__File->Folder->cd($this->settings['path']); + $path = $this->_File->Folder->cd($this->settings['path']); if ($path) { $this->settings['path'] = $path; } @@ -114,11 +114,11 @@ function gc() { * @access public */ function write($key, &$data, $duration) { - if ($data === '' || !$this->__init) { + if ($data === '' || !$this->_init) { return false; } - if ($this->__setKey($key) === false) { + if ($this->_setKey($key) === false) { return false; } @@ -137,12 +137,12 @@ function write($key, &$data, $duration) { } if ($this->settings['lock']) { - $this->__File->lock = true; + $this->_File->lock = true; } $expires = time() + $duration; $contents = $expires . $lineBreak . $data . $lineBreak; - $success = $this->__File->write($contents); - $this->__File->close(); + $success = $this->_File->write($contents); + $this->_File->close(); return $success; } @@ -154,20 +154,20 @@ function write($key, &$data, $duration) { * @access public */ function read($key) { - if ($this->__setKey($key) === false || !$this->__init || !$this->__File->exists()) { + if ($this->_setKey($key) === false || !$this->_init || !$this->_File->exists()) { return false; } if ($this->settings['lock']) { - $this->__File->lock = true; + $this->_File->lock = true; } $time = time(); - $cachetime = intval($this->__File->read(11)); + $cachetime = intval($this->_File->read(11)); if ($cachetime !== false && ($cachetime < $time || ($time + $this->settings['duration']) < $cachetime)) { - $this->__File->close(); + $this->_File->close(); return false; } - $data = $this->__File->read(true); + $data = $this->_File->read(true); if ($data !== '' && !empty($this->settings['serialize'])) { if ($this->settings['isWindows']) { @@ -175,7 +175,7 @@ function read($key) { } $data = unserialize((string)$data); } - $this->__File->close(); + $this->_File->close(); return $data; } @@ -187,10 +187,10 @@ function read($key) { * @access public */ function delete($key) { - if ($this->__setKey($key) === false || !$this->__init) { + if ($this->_setKey($key) === false || !$this->_init) { return false; } - return $this->__File->delete(); + return $this->_File->delete(); } /** @@ -201,7 +201,7 @@ function delete($key) { * @access public */ function clear($check) { - if (!$this->__init) { + if (!$this->_init) { return false; } $dir = dir($this->settings['path']); @@ -210,24 +210,24 @@ function clear($check) { $threshold = $now - $this->settings['duration']; } while (($entry = $dir->read()) !== false) { - if ($this->__setKey($entry) === false) { + if ($this->_setKey($entry) === false) { continue; } if ($check) { - $mtime = $this->__File->lastChange(); + $mtime = $this->_File->lastChange(); if ($mtime === false || $mtime > $threshold) { continue; } - $expires = $this->__File->read(11); - $this->__File->close(); + $expires = $this->_File->read(11); + $this->_File->close(); if ($expires > $now) { continue; } } - $this->__File->delete(); + $this->_File->delete(); } $dir->close(); return true; @@ -240,13 +240,13 @@ function clear($check) { * @return mixed Absolute cache file for the given key or false if erroneous * @access private */ - function __setKey($key) { - $this->__File->Folder->cd($this->settings['path']); - if ($key !== $this->__File->name) { - $this->__File->name = $key; - $this->__File->path = null; + function _setKey($key) { + $this->_File->Folder->cd($this->settings['path']); + if ($key !== $this->_File->name) { + $this->_File->name = $key; + $this->_File->path = null; } - if (!$this->__File->Folder->inPath($this->__File->pwd(), true)) { + if (!$this->_File->Folder->inPath($this->_File->pwd(), true)) { return false; } } @@ -258,8 +258,8 @@ function __setKey($key) { * @access private */ function __active() { - if ($this->__init && !is_writable($this->settings['path'])) { - $this->__init = false; + if ($this->_init && !is_writable($this->settings['path'])) { + $this->_init = false; trigger_error(sprintf(__('%s is not writable', true), $this->settings['path']), E_USER_WARNING); } return true; From 9a4de854d602b307fbd1ee48b525877abcf2e07f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Tue, 23 Feb 2010 09:55:01 -0430 Subject: [PATCH 1677/2083] Improving the guessing process of required fields in the form helper. Now it does not rely on the "required" property of the validation array anymore, which was misleading --- cake/libs/view/helpers/form.php | 47 ++++++++++++++----- .../cases/libs/view/helpers/form.test.php | 36 ++++++++++++-- 2 files changed, 68 insertions(+), 15 deletions(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 9e2309839..d4b52cd73 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -123,28 +123,51 @@ function &_introspectModel($model) { $validates = array(); if (!empty($object->validate)) { foreach ($object->validate as $validateField => $validateProperties) { - if (is_array($validateProperties)) { - $dims = Set::countDim($validateProperties); - if (($dims == 1 && !isset($validateProperties['required']) || (array_key_exists('required', $validateProperties) && $validateProperties['required'] !== false))) { - $validates[] = $validateField; - } elseif ($dims > 1) { - foreach ($validateProperties as $rule => $validateProp) { - if (is_array($validateProp) && (array_key_exists('required', $validateProp) && $validateProp['required'] !== false)) { - $validates[] = $validateField; - } - } - } + if ($this->_isRequiredField($validateProperties)) { + $validates[] = $validateField; } } } $defaults = array('fields' => array(), 'key' => 'id', 'validates' => array()); $key = $object->primaryKey; - $this->fieldset[$object->name] = array_merge($defaults,compact('fields', 'key', 'validates')); + $this->fieldset[$object->name] = array_merge($defaults, compact('fields', 'key', 'validates')); } return $object; } +/** + * Returns if a field is required to be filled based on validation properties from the validating object + * + * @return boolean true if field is required to be filled, false otherwise + * @access protected + */ + function _isRequiredField($validateProperties) { + $required = false; + if (is_array($validateProperties)) { + + $dims = Set::countDim($validateProperties); + if ($dims == 1) { + $validateProperties = array($validateProperties); + } + + foreach ($validateProperties as $rule => $validateProp) { + $rule = isset($validateProp['rule']) ? $validateProp['rule'] : false; + if ($rule) { + $rule = is_array($rule) ? array_shift($rule) : $rule; + $rule = is_string($rule) ? strtolower($rule) : $rule; + } + $required = empty($validateProp); + $required = $required || (!empty($rule) && $rule === 'notempty'); + $required = $required || (isset($validateProp['allowEmpty']) && $validateProp['allowEmpty'] !== true); + if ($required) { + break; + } + } + } + return $required; + } + /** * Returns an HTML FORM element. * diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 1469ef939..61e3cd9c9 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -104,10 +104,12 @@ class Contact extends CakeTestModel { var $validate = array( 'non_existing' => array(), 'idontexist' => array(), - 'imrequired' => array('rule' => array('between', 5, 30), 'required' => true), - 'imalsorequired' => array('rule' => 'alphaNumeric', 'required' => true), + 'imrequired' => array('rule' => array('between', 5, 30), 'allowEmpty' => false), + 'imalsorequired' => array('rule' => 'alphaNumeric', 'allowEmpty' => false), + 'imrequiredtoo' => array('rule' => 'notEmpty'), + 'required_one' => array('required' => array('rule' => array('notEmpty'))), 'imnotrequired' => array('required' => false, 'rule' => 'alphaNumeric'), - 'imalsonotrequired' => array('alpha' => array('rule' => 'alphaNumeric','required' => false), + 'imalsonotrequired' => array('alpha' => array('rule' => 'alphaNumeric','allowEmpty' => true), 'between' => array('rule' => array('between', 5, 30)))); /** @@ -5406,6 +5408,34 @@ function testFormMagicInput() { ); $this->assertTags($result, $expected); + $result = $this->Form->input('Contact.imrequiredtoo'); + $expected = array( + 'div' => array('class' => 'input text required'), + 'label' => array('for' => 'ContactImrequiredtoo'), + 'Imrequiredtoo', + '/label', + 'input' => array( + 'type' => 'text', 'name' => 'data[Contact][imrequiredtoo]', + 'id' => 'ContactImrequiredtoo' + ), + '/div' + ); + $this->assertTags($result, $expected); + + $result = $this->Form->input('Contact.required_one'); + $expected = array( + 'div' => array('class' => 'input text required'), + 'label' => array('for' => 'ContactRequiredOne'), + 'Required One', + '/label', + 'input' => array( + 'type' => 'text', 'name' => 'data[Contact][required_one]', + 'id' => 'ContactRequiredOne' + ), + '/div' + ); + $this->assertTags($result, $expected); + $result = $this->Form->input('Contact.imnotrequired'); $expected = array( 'div' => array('class' => 'input text'), From 6ae54fda8d4a57bb249b6205482563e4b0d2d40d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Tue, 23 Feb 2010 10:09:11 -0430 Subject: [PATCH 1678/2083] Using the method cache for the rest of the return statements in DboSource::name --- cake/libs/model/datasources/dbo_source.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index ab63108a6..2dc87e90b 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -484,26 +484,26 @@ function name($data) { } return $data; } - $cacheKey = crc32($data); + $cacheKey = crc32($this->startQuote.$data.$this->endQuote); if (isset($this->methodCache[__FUNCTION__][$cacheKey])) { return $this->methodCache[__FUNCTION__][$cacheKey]; } $data = trim($data); if (preg_match('/^[\w-]+(\.[\w-]+)*$/', $data)) { // string, string.string if (strpos($data, '.') === false) { // string - return $this->startQuote . $data . $this->endQuote; + return $this->methodCache[__FUNCTION__][$cacheKey] = $this->startQuote . $data . $this->endQuote; } $items = explode('.', $data); - return $this->startQuote . implode($this->endQuote . '.' . $this->startQuote, $items) . $this->endQuote; + return $this->methodCache[__FUNCTION__][$cacheKey] = $this->startQuote . implode($this->endQuote . '.' . $this->startQuote, $items) . $this->endQuote; } if (preg_match('/^[\w-]+\.\*$/', $data)) { // string.* - return $this->startQuote . str_replace('.*', $this->endQuote . '.*', $data); + return $this->methodCache[__FUNCTION__][$cacheKey] = $this->startQuote . str_replace('.*', $this->endQuote . '.*', $data); } if (preg_match('/^([\w-]+)\((.*)\)$/', $data, $matches)) { // Functions - return $matches[1] . '(' . $this->name($matches[2]) . ')'; + return $this->methodCache[__FUNCTION__][$cacheKey] = $matches[1] . '(' . $this->name($matches[2]) . ')'; } if (preg_match('/^([\w-]+(\.[\w-]+|\(.*\))*)\s+' . preg_quote($this->alias) . '\s*([\w-]+)$/', $data, $matches)) { - return preg_replace('/\s{2,}/', ' ', $this->name($matches[1]) . ' ' . $this->alias . ' ' . $this->name($matches[3])); + return $this->methodCache[__FUNCTION__][$cacheKey] = preg_replace('/\s{2,}/', ' ', $this->name($matches[1]) . ' ' . $this->alias . ' ' . $this->name($matches[3])); } return $this->methodCache[__FUNCTION__][$cacheKey] = $data; } From 48cd4d5738ac5d4b107f2986485bb769e2883e5e Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Wed, 24 Feb 2010 07:58:33 +1100 Subject: [PATCH 1679/2083] Fix newline in VERSION.txt --- cake/VERSION.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cake/VERSION.txt b/cake/VERSION.txt index 9a5527022..ab0db2cda 100644 --- a/cake/VERSION.txt +++ b/cake/VERSION.txt @@ -1,5 +1,6 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// -// +--------------------------------------------------------------------------------------------+ // // CakePHP Version +// +--------------------------------------------------------------------------------------------+ // +// CakePHP Version // // Holds a static string representing the current version of CakePHP // From 9632e74cfc3a4ee394880a49b7173445b534acec Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 24 Feb 2010 22:23:09 -0500 Subject: [PATCH 1680/2083] Making bake model.ctp only include the association comment when there is a non empty association. Fixes #393 --- cake/console/templates/default/classes/model.ctp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cake/console/templates/default/classes/model.ctp b/cake/console/templates/default/classes/model.ctp index dda2814d5..7ac659b5b 100644 --- a/cake/console/templates/default/classes/model.ctp +++ b/cake/console/templates/default/classes/model.ctp @@ -56,9 +56,15 @@ if (!empty($validate)): echo "\t);\n"; endif; +foreach ($associations as $assoc): + if (!empty($assoc)): ?> //The Associations below have been created with all possible keys, those that are not needed can be removed <?php + break; + endif; +endforeach; + foreach (array('hasOne', 'belongsTo') as $assocType): if (!empty($associations[$assocType])): $typeCount = count($associations[$assocType]); From 585f731ae2e0632da56756fd491b616aacd9142e Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 24 Feb 2010 22:35:20 -0500 Subject: [PATCH 1681/2083] Mostly reverting changes made in [8ce9560f4107125a0b4b8128ee5f9c51c86e3179]. Using a console like project bake from outside a cake app no longer causes errors from Configure. Fixes #387 --- cake/console/cake.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cake/console/cake.php b/cake/console/cake.php index cb9e42ce2..7d65b8346 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -264,10 +264,13 @@ function __bootstrap() { } } + Configure::getInstance(file_exists(CONFIGS . 'bootstrap.php')); + if (!file_exists(APP_PATH . 'config' . DS . 'core.php')) { include_once CORE_PATH . 'cake' . DS . 'console' . DS . 'templates' . DS . 'skel' . DS . 'config' . DS . 'core.php'; + App::build(); } - Configure::getInstance(file_exists(CONFIGS . 'bootstrap.php')); + return true; } From 348fe6f57463aaa20d77984254f493d9ca4fe9f1 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 24 Feb 2010 22:45:49 -0500 Subject: [PATCH 1682/2083] Expanding documentation for FormHelper::submit() Fixes #390 --- cake/libs/view/helpers/form.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index bec46c6b9..0f81c320e 100644 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -1097,11 +1097,17 @@ function button($title, $options = array()) { /** * Creates a submit button element. * + * ### Options + * + * - `div` - Include a wrapping div? Defaults to true. Accepts sub options similar to + * FormHelper::input(). + * - Other attributes will be assigned to the input element. + * * @param string $caption The label appearing on the button OR if string contains :// or the * extension .jpg, .jpe, .jpeg, .gif, .png use an image if the extension * exists, AND the first character is /, image is relative to webroot, * OR if the first character is not /, image is relative to webroot/img. - * @param array $options + * @param array $options Array of options. See above. * @return string A HTML submit button */ function submit($caption = null, $options = array()) { From 47afceea225ebde98703e8a82dfb2c007c56c4c3 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 24 Feb 2010 22:45:49 -0500 Subject: [PATCH 1683/2083] Expanding documentation for FormHelper::submit() Fixes #390 --- cake/libs/view/helpers/form.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 9e2309839..444323544 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -1202,11 +1202,17 @@ function button($title, $options = array()) { /** * Creates a submit button element. * + * ### Options + * + * - `div` - Include a wrapping div? Defaults to true. Accepts sub options similar to + * FormHelper::input(). + * - Other attributes will be assigned to the input element. + * * @param string $caption The label appearing on the button OR if string contains :// or the * extension .jpg, .jpe, .jpeg, .gif, .png use an image if the extension * exists, AND the first character is /, image is relative to webroot, * OR if the first character is not /, image is relative to webroot/img. - * @param array $options + * @param array $options Array of options. See above. * @return string A HTML submit button * @access public */ From e4b392a4ffeef3551d4c92171a467ceddee03598 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 24 Feb 2010 22:58:09 -0500 Subject: [PATCH 1684/2083] Updating and expanding form helper submit documentation. Refs #335 --- cake/libs/view/helpers/form.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 444323544..c6b5c4906 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -1200,12 +1200,17 @@ function button($title, $options = array()) { } /** - * Creates a submit button element. + * Creates a submit button element. This method will generate `<input />` elements that + * can be used to submit, and reset forms by using $options. image submits can be created by supplying an + * image path for $caption. * * ### Options * * - `div` - Include a wrapping div? Defaults to true. Accepts sub options similar to * FormHelper::input(). + * - `before` - Content to include before the input. + * - `after` - Content to include after the input. + * - `type` - Set to 'reset' for reset inputs. Defaults to 'submit' * - Other attributes will be assigned to the input element. * * @param string $caption The label appearing on the button OR if string contains :// or the From 056b87d13a2f9e6e8a273fe934dc87d6a4ee0bdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Fri, 26 Feb 2010 18:39:33 -0430 Subject: [PATCH 1685/2083] Implementing template for input formats, test pending --- cake/libs/view/helpers/form.php | 90 +++++++++++++++++---------------- 1 file changed, 47 insertions(+), 43 deletions(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index d4b52cd73..b7fd98873 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -585,7 +585,7 @@ function label($fieldName = null, $text = null, $options = array()) { */ function inputs($fields = null, $blacklist = null) { $fieldset = $legend = true; - + $model = $this->model(); if (is_array($fields)) { if (array_key_exists('legend', $fields)) { $legend = $fields['legend']; @@ -605,7 +605,7 @@ function inputs($fields = null, $blacklist = null) { } if (empty($fields)) { - $fields = array_keys($this->fieldset[$this->model()]['fields']); + $fields = array_keys($this->fieldset[$model]['fields']); } if ($legend === true) { @@ -617,7 +617,7 @@ function inputs($fields = null, $blacklist = null) { if ($isEdit) { $actionName = __('Edit %s', true); } - $modelName = Inflector::humanize(Inflector::underscore($this->model())); + $modelName = Inflector::humanize(Inflector::underscore($model)); $legend = sprintf($actionName, __($modelName, true)); } @@ -675,6 +675,10 @@ function inputs($fields = null, $blacklist = null) { * - `before` - Content to place before the label + input. * - `after` - Content to place after the label + input. * - `between` - Content to place between the label + input. + * - `format` - format template for element order. Any element that is not in the array, will not be in the output. + * Default input format order: array('before', 'label', 'between', 'input', 'after', 'error') + * Default checkbox format order: array('before', 'input', 'between', 'label', 'after', 'error') + * Hidden input will not be formatted * * @param string $fieldName This should be "Modelname.fieldname" * @param array $options Each type of input takes different options. @@ -685,7 +689,7 @@ function input($fieldName, $options = array()) { $this->setEntity($fieldName); $options = array_merge( - array('before' => null, 'between' => null, 'after' => null), + array('before' => null, 'between' => null, 'after' => null, 'format' => null), $this->_inputDefaults, $options ); @@ -758,7 +762,6 @@ function input($fieldName, $options = array()) { $options['maxlength'] = array_sum(explode(',', $fieldDef['length']))+1; } - $out = ''; $div = true; $divOptions = array(); @@ -830,7 +833,7 @@ function input($fieldName, $options = array()) { if (isset($options['id'])) { $labelAttributes = array_merge($labelAttributes, array('for' => $options['id'])); } - $out = $this->label($fieldName, $labelText, $labelAttributes); + $label = $this->label($fieldName, $labelText, $labelAttributes); } $error = null; @@ -865,76 +868,77 @@ function input($fieldName, $options = array()) { } $type = $options['type']; - $before = $options['before']; - $between = $options['between']; - $after = $options['after']; - unset($options['type'], $options['before'], $options['between'], $options['after']); + $out = array_merge( + array('before' => null, 'label' => null, 'between' => null, 'input' => null, 'after' => null, 'error' => null), + array('before' => $options['before'], 'label' => $label, 'between' => $options['between'], 'after' => $options['after']) + ); + $format = null; + if (is_array($options['format']) && in_array('input', $options['format'])) { + $format = $options['format']; + } + unset($options['type'], $options['before'], $options['between'], $options['after'], $options['format']); switch ($type) { case 'hidden': - $out = $this->hidden($fieldName, $options); + $input = $this->hidden($fieldName, $options); + $format = array('input'); unset($divOptions); break; case 'checkbox': - $out = $before . $this->checkbox($fieldName, $options) . $between . $out; + $input = $this->checkbox($fieldName, $options); + $format = $format ?: array('before', 'input', 'between', 'label', 'after', 'error'); break; case 'radio': - $out = $before . $out . $this->radio($fieldName, $radioOptions, $options) . $between; + $input = $this->radio($fieldName, $radioOptions, $options); break; case 'text': case 'password': - $out = $before . $out . $between . $this->{$type}($fieldName, $options); - break; case 'file': - $out = $before . $out . $between . $this->file($fieldName, $options); + $input = $this->{$type}($fieldName, $options); break; case 'select': - $options = array_merge(array('options' => array()), $options); + $options += array('options' => array()); $list = $options['options']; unset($options['options']); - $out = $before . $out . $between . $this->select( - $fieldName, $list, $selected, $options - ); + $input = $this->select($fieldName, $list, $selected, $options); break; case 'time': - $out = $before . $out . $between . $this->dateTime( - $fieldName, null, $timeFormat, $selected, $options - ); + $input = $this->dateTime($fieldName, null, $timeFormat, $selected, $options); break; case 'date': - $out = $before . $out . $between . $this->dateTime( - $fieldName, $dateFormat, null, $selected, $options - ); + $input = $this->dateTime($fieldName, $dateFormat, null, $selected, $options); break; case 'datetime': - $out = $before . $out . $between . $this->dateTime( - $fieldName, $dateFormat, $timeFormat, $selected, $options - ); + $input = $this->dateTime($fieldName, $dateFormat, $timeFormat, $selected, $options); break; case 'textarea': default: - $out = $before . $out . $between . $this->textarea($fieldName, array_merge( - array('cols' => '30', 'rows' => '6'), $options - )); + $input = $this->textarea($fieldName, $options + array('cols' => '30', 'rows' => '6')); break; } - if ($type != 'hidden') { - $out .= $after; - if ($error !== false) { - $errMsg = $this->error($fieldName, $error); - if ($errMsg) { - $out .= $errMsg; - $divOptions = $this->addClass($divOptions, 'error'); - } + if ($type != 'hidden' && $error !== false) { + $errMsg = $this->error($fieldName, $error); + if ($errMsg) { + $divOptions = $this->addClass($divOptions, 'error'); + $out['error'] = $errMsg; } } - if (isset($divOptions) && isset($divOptions['tag'])) { + + $out['input'] = $input; + $format = $format ?: array('before', 'label', 'between', 'input', 'after', 'error'); + $output = ''; + foreach ($format as $element) { + $output .= $out[$element]; + unset($out[$element]); + } + + if (!empty($divOptions['tag'])) { $tag = $divOptions['tag']; unset($divOptions['tag']); - $out = $this->Html->tag($tag, $out, $divOptions); + $output = $this->Html->tag($tag, $output, $divOptions); } - return $out; + return $output; } /** From 3192e130af816319941c7194c8410541de2bb0a4 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 20 Feb 2010 12:49:24 -0500 Subject: [PATCH 1686/2083] Fixing magic select creation for fields that have plural variables added to the view. --- cake/libs/view/helpers/form.php | 9 ++++++++- cake/tests/cases/libs/view/helpers/form.test.php | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index c6b5c4906..5b427b600 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -674,6 +674,7 @@ function input($fieldName, $options = array()) { } if (!isset($options['type'])) { + $magicType = true; $options['type'] = 'text'; $fieldDef = array(); if (isset($options['options'])) { @@ -716,13 +717,19 @@ function input($fieldName, $options = array()) { } $types = array('checkbox', 'radio', 'select'); - if (!isset($options['options']) && in_array($options['type'], $types)) { + if ( + (!isset($options['options']) && in_array($options['type'], $types)) || + (isset($magicType) && $options['type'] == 'text') + ) { $view =& ClassRegistry::getObject('view'); $varName = Inflector::variable( Inflector::pluralize(preg_replace('/_id$/', '', $fieldKey)) ); $varOptions = $view->getVar($varName); if (is_array($varOptions)) { + if ($options['type'] !== 'radio') { + $options['type'] = 'select'; + } $options['options'] = $varOptions; } } diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 1469ef939..45876419b 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -2061,6 +2061,21 @@ function testInputOverridingMagicSelectType() { '/div' ); $this->assertTags($result, $expected); + + //Check that magic types still work for plural/singular vars + $view =& ClassRegistry::getObject('view'); + $view->viewVars['types'] = array('value' => 'good', 'other' => 'bad'); + $result = $this->Form->input('Model.type'); + $expected = array( + 'div' => array('class' => 'input select'), + 'label' => array('for' => 'ModelType'), 'Type', '/label', + 'select' => array('name' => 'data[Model][type]', 'id' => 'ModelType'), + array('option' => array('value' => 'value')), 'good', '/option', + array('option' => array('value' => 'other')), 'bad', '/option', + '/select', + '/div' + ); + $this->assertTags($result, $expected); } /** From 1f25bb31c03fbc9ceee0ddc788902e1bf19f1b4e Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 20 Feb 2010 13:04:15 -0500 Subject: [PATCH 1687/2083] Refactoring option extraction into a separate method. --- cake/libs/view/helpers/form.php | 64 ++++++++++++++++----------------- 1 file changed, 30 insertions(+), 34 deletions(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 5b427b600..f055129ee 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -676,7 +676,6 @@ function input($fieldName, $options = array()) { if (!isset($options['type'])) { $magicType = true; $options['type'] = 'text'; - $fieldDef = array(); if (isset($options['options'])) { $options['type'] = 'select'; } elseif (in_array($fieldKey, array('psword', 'passwd', 'password'))) { @@ -743,13 +742,10 @@ function input($fieldName, $options = array()) { } $out = ''; - $div = true; $divOptions = array(); - if (array_key_exists('div', $options)) { - $div = $options['div']; - unset($options['div']); - } + $div = $this->_extractOption('div', $options, true); + unset($options['div']); if (!empty($div)) { $divOptions['class'] = 'input'; @@ -762,7 +758,7 @@ function input($fieldName, $options = array()) { if ( isset($this->fieldset[$modelKey]) && in_array($fieldKey, $this->fieldset[$modelKey]['validates']) - ) { + ) { $divOptions = $this->addClass($divOptions, 'required'); } if (!isset($divOptions['tag'])) { @@ -779,11 +775,7 @@ function input($fieldName, $options = array()) { if ($options['type'] === 'radio') { $label = false; if (isset($options['options'])) { - if (is_array($options['options'])) { - $radioOptions = $options['options']; - } else { - $radioOptions = array($options['options']); - } + $radioOptions = (array)$options['options']; unset($options['options']); } } @@ -817,36 +809,24 @@ function input($fieldName, $options = array()) { $out = $this->label($fieldName, $labelText, $labelAttributes); } - $error = null; - if (isset($options['error'])) { - $error = $options['error']; - unset($options['error']); - } + $error = $this->_extractOption('error', $options, null); + unset($options['error']); + + $selected = $this->_extractOption('selected', $options, null); + unset($options['selected']); - $selected = null; - if (array_key_exists('selected', $options)) { - $selected = $options['selected']; - unset($options['selected']); - } if (isset($options['rows']) || isset($options['cols'])) { $options['type'] = 'textarea'; } - $timeFormat = 12; - if (isset($options['timeFormat'])) { - $timeFormat = $options['timeFormat']; - unset($options['timeFormat']); - } - - $dateFormat = 'MDY'; - if (isset($options['dateFormat'])) { - $dateFormat = $options['dateFormat']; - unset($options['dateFormat']); - } - if ($options['type'] === 'datetime' || $options['type'] === 'date' || $options['type'] === 'time' || $options['type'] === 'select') { $options += array('empty' => false); } + if ($options['type'] === 'datetime' || $options['type'] === 'date' || $options['type'] === 'time') { + $dateFormat = $this->_extractOption('dateFormat', $options, 'MDY'); + $timeFormat = $this->_extractOption('timeFormat', $options, 12); + unset($options['dateFormat'], $options['timeFormat']); + } $type = $options['type']; $before = $options['before']; @@ -921,6 +901,22 @@ function input($fieldName, $options = array()) { return $out; } +/** + * Extracts a single option from an options array. + * + * @param string $name The name of the option to pull out. + * @param array $options The array of options you want to extract. + * @param mixed $default The default option value + * @return the contents of the option or default + * @access protected + */ + function _extractOption($name, $options, $default = null) { + if (array_key_exists($name, $options)) { + return $options[$name]; + } + return $default; + } + /** * Creates a checkbox input widget. * From 0960abcfb9b99cb51a9f3d04f50693d0d5747eb9 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 27 Feb 2010 11:26:16 -0500 Subject: [PATCH 1688/2083] Removing workaround code for PHP 5.3.0. Error is no longer being generated in PHP 5.3.1 --- cake/tests/cases/libs/model/model_read.test.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/cake/tests/cases/libs/model/model_read.test.php b/cake/tests/cases/libs/model/model_read.test.php index 040ecab19..05bdc7a8a 100755 --- a/cake/tests/cases/libs/model/model_read.test.php +++ b/cake/tests/cases/libs/model/model_read.test.php @@ -4865,9 +4865,6 @@ function testCallbackSourceChange() { $this->assertEqual(3, count($TestModel->find('all'))); $this->expectError(new PatternExpectation('/Non-existent data source foo/i')); - if (defined('PHP_VERSION_ID') && PHP_VERSION_ID >= 50300) { - $this->expectError(new PatternExpectation('/Only variable references/i')); - } $this->assertFalse($TestModel->find('all', array('connection' => 'foo'))); } From ec5d9729b0b1126226e1b7ab9c93c271b4828feb Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 27 Feb 2010 11:32:29 -0500 Subject: [PATCH 1689/2083] Model::find(first) no longer uses the id set in a model as the default conditions. Fixes #266 --- cake/libs/model/model.php | 3 --- cake/tests/cases/libs/model/model_read.test.php | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index e41208325..e4d086aa4 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -2105,9 +2105,6 @@ function find($conditions = null, $fields = array(), $order = null, $recursive = function _findFirst($state, $query, $results = array()) { if ($state == 'before') { $query['limit'] = 1; - if (empty($query['conditions']) && !empty($this->id)) { - $query['conditions'] = array($this->escapeField() => $this->id); - } return $query; } elseif ($state == 'after') { if (empty($results[0])) { diff --git a/cake/tests/cases/libs/model/model_read.test.php b/cake/tests/cases/libs/model/model_read.test.php index 05bdc7a8a..3efd9f479 100755 --- a/cake/tests/cases/libs/model/model_read.test.php +++ b/cake/tests/cases/libs/model/model_read.test.php @@ -4857,6 +4857,7 @@ function testCallbackDisabling() { * Tests that the database configuration assigned to the model can be changed using * (before|after)Find callbacks * + * @access public * @return void */ function testCallbackSourceChange() { @@ -6377,6 +6378,21 @@ function testFindCount() { $this->assertNoPattern('/ORDER\s+BY/', $this->db->_queriesLog[0]['query']); } +/** + * Test that find('first') does not use the id set to the object. + * + * @return void + */ + function testFindFirstNoIdUsed() { + $this->loadFixtures('Project'); + + $Project =& new Project(); + $Project->id = 3; + $result = $Project->find('first'); + + $this->assertEqual($result['Project']['name'], 'Project 1', 'Wrong record retrieved'); + } + /** * test find with COUNT(DISTINCT field) * From 748ec4ee78ff3bc0e4c7bfa5fa94e3ffb927d3a9 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 27 Feb 2010 20:28:04 -0500 Subject: [PATCH 1690/2083] Fixing baking views for models in plugins. Making sure that the temporary controller object gets its plugin property set so the correct models are loaded and used. Fixes #381 --- cake/console/libs/tasks/view.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 62047a3b9..dfbcc5bb7 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -289,9 +289,10 @@ function __loadController() { } $controllerClassName = $this->controllerName . 'Controller'; $controllerObj =& new $controllerClassName(); + $controllerObj->plugin = $this->plugin; $controllerObj->constructClasses(); $modelClass = $controllerObj->modelClass; - $modelObj =& ClassRegistry::getObject($controllerObj->modelKey); + $modelObj =& $controllerObj->{$controllerObj->modelClass}; if ($modelObj) { $primaryKey = $modelObj->primaryKey; @@ -302,13 +303,10 @@ function __loadController() { $fields = array_keys($schema); $associations = $this->__associations($modelObj); } else { - $primaryKey = null; - $displayField = null; + $primaryKey = $displayField = null; $singularVar = Inflector::variable(Inflector::singularize($this->controllerName)); $singularHumanName = $this->_singularHumanName($this->controllerName); - $fields = array(); - $schema = array(); - $associations = array(); + $fields = $schema = $associations = array(); } $pluralVar = Inflector::variable($this->controllerName); $pluralHumanName = $this->_pluralHumanName($this->controllerName); From e75f6fe2b47e5b56e7394ea10306fd24a5883b62 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 27 Feb 2010 21:47:32 -0500 Subject: [PATCH 1691/2083] Refactoring existing callbacks into triggerCallback(). --- cake/libs/controller/component.php | 32 +++++++++++++++++------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php index 56efb6fff..e9fe47e23 100644 --- a/cake/libs/controller/component.php +++ b/cake/libs/controller/component.php @@ -109,12 +109,7 @@ function initialize(&$controller) { * @link http://book.cakephp.org/view/65/MVC-Class-Access-Within-Components */ function startup(&$controller) { - foreach ($this->_primary as $name) { - $component =& $this->_loaded[$name]; - if ($component->enabled === true && method_exists($component, 'startup')) { - $component->startup($controller); - } - } + $this->triggerCallback($controller, 'startup'); } /** @@ -126,12 +121,7 @@ function startup(&$controller) { * @access public */ function beforeRender(&$controller) { - foreach ($this->_primary as $name) { - $component =& $this->_loaded[$name]; - if ($component->enabled === true && method_exists($component,'beforeRender')) { - $component->beforeRender($controller); - } - } + $this->triggerCallback($controller, 'beforeRender'); } /** @@ -166,10 +156,24 @@ function beforeRedirect(&$controller, $url, $status = null, $exit = true) { * @access public */ function shutdown(&$controller) { + $this->triggerCallback($controller, 'shutdown'); + } + +/** + * Trigger a callback on all primary components. Will fire $callback on all components + * that have such a method. You can implement and fire custom callbacks in addition to the + * standard ones. + * + * @param Controller $controller Controller instance + * @param string $callback Callback to trigger. + * @return void + * @access public + */ + function triggerCallback(&$controller, $callback) { foreach ($this->_primary as $name) { $component =& $this->_loaded[$name]; - if (method_exists($component,'shutdown') && $component->enabled === true) { - $component->shutdown($controller); + if (method_exists($component, $callback) && $component->enabled === true) { + $component->{$callback}($controller); } } } From cec6692123ce6e2af4381ed72f73de7971ce74e9 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 27 Feb 2010 22:01:08 -0500 Subject: [PATCH 1692/2083] Re-arrange the arguments of triggerCallback. Modifying Dispatcher so its not calling methods on Component directly. Additional methods added to Controller. --- cake/dispatcher.php | 7 ++----- cake/libs/controller/component.php | 8 ++++---- cake/libs/controller/controller.php | 27 ++++++++++++++++++++++++++- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/cake/dispatcher.php b/cake/dispatcher.php index c54d87954..49551694b 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -182,9 +182,7 @@ function dispatch($url = null, $additionalParams = array()) { */ function _invoke(&$controller, $params) { $controller->constructClasses(); - $controller->Component->initialize($controller); - $controller->beforeFilter(); - $controller->Component->startup($controller); + $controller->startupProcess(); $methods = array_flip($controller->methods); @@ -208,8 +206,7 @@ function _invoke(&$controller, $params) { } elseif (empty($controller->output)) { $controller->output = $output; } - $controller->Component->shutdown($controller); - $controller->afterFilter(); + $controller->shutdownProcess(); if (isset($params['return'])) { return $controller->output; diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php index e9fe47e23..f640d5432 100644 --- a/cake/libs/controller/component.php +++ b/cake/libs/controller/component.php @@ -109,7 +109,7 @@ function initialize(&$controller) { * @link http://book.cakephp.org/view/65/MVC-Class-Access-Within-Components */ function startup(&$controller) { - $this->triggerCallback($controller, 'startup'); + $this->triggerCallback('startup', $controller); } /** @@ -121,7 +121,7 @@ function startup(&$controller) { * @access public */ function beforeRender(&$controller) { - $this->triggerCallback($controller, 'beforeRender'); + $this->triggerCallback('beforeRender', $controller); } /** @@ -156,7 +156,7 @@ function beforeRedirect(&$controller, $url, $status = null, $exit = true) { * @access public */ function shutdown(&$controller) { - $this->triggerCallback($controller, 'shutdown'); + $this->triggerCallback('shutdown', $controller); } /** @@ -169,7 +169,7 @@ function shutdown(&$controller) { * @return void * @access public */ - function triggerCallback(&$controller, $callback) { + function triggerCallback($callback, &$controller) { foreach ($this->_primary as $name) { $component =& $this->_loaded[$name]; if (method_exists($component, $callback) && $component->enabled === true) { diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 1f57ae218..8b8e7dcc9 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -514,6 +514,31 @@ function constructClasses() { return true; } +/** + * Perform the startup process for this controller. + * Fire the Component and Controller callbacks in the correct order. + * + * @return void + * @access public + */ + function startupProcess() { + $this->Component->initialize($this); + $this->beforeFilter(); + $this->Component->triggerCallback('startup', $this); + } + +/** + * Perform the various shutdown processes for this controller. + * Fire the Component and Controller callbacks in the correct order. + * + * @return void + * @access public + */ + function shutdownProcess() { + $this->Component->triggerCallback('shutdown', $controller); + $this->afterFilter(); + } + /** * Queries & sets valid HTTP response codes & messages. * @@ -835,7 +860,7 @@ function render($action = null, $layout = null, $file = null) { App::import('View', $this->view); } - $this->Component->beforeRender($this); + $this->Component->triggerCallback('beforeRender', $this); $this->params['models'] = $this->modelNames; From 0ca5c11e6ca2dd356ca9416f570ba38ae27ee337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Sat, 27 Feb 2010 22:58:27 -0430 Subject: [PATCH 1693/2083] Making the form helper put the "required" class on all imputs that have a validation rule and does not explicitly sets allowEmpty => true in validation array --- cake/libs/view/helpers/form.php | 11 ++++------- cake/tests/cases/libs/view/helpers/form.test.php | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index b7fd98873..4ec6961cd 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -152,14 +152,11 @@ function _isRequiredField($validateProperties) { } foreach ($validateProperties as $rule => $validateProp) { - $rule = isset($validateProp['rule']) ? $validateProp['rule'] : false; - if ($rule) { - $rule = is_array($rule) ? array_shift($rule) : $rule; - $rule = is_string($rule) ? strtolower($rule) : $rule; + if (isset($validateProp['allowEmpty']) && $validateProp['allowEmpty'] === true) { + return false; } - $required = empty($validateProp); - $required = $required || (!empty($rule) && $rule === 'notempty'); - $required = $required || (isset($validateProp['allowEmpty']) && $validateProp['allowEmpty'] !== true); + $rule = isset($validateProp['rule']) ? $validateProp['rule'] : false; + $required = $rule || empty($validateProp); if ($required) { break; } diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 61e3cd9c9..0a826d261 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -108,7 +108,7 @@ class Contact extends CakeTestModel { 'imalsorequired' => array('rule' => 'alphaNumeric', 'allowEmpty' => false), 'imrequiredtoo' => array('rule' => 'notEmpty'), 'required_one' => array('required' => array('rule' => array('notEmpty'))), - 'imnotrequired' => array('required' => false, 'rule' => 'alphaNumeric'), + 'imnotrequired' => array('required' => false, 'rule' => 'alphaNumeric', 'allowEmpty' => true), 'imalsonotrequired' => array('alpha' => array('rule' => 'alphaNumeric','allowEmpty' => true), 'between' => array('rule' => array('between', 5, 30)))); From b782563daf50c6c9a26e580e592be3972f4583ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Sat, 27 Feb 2010 23:18:21 -0430 Subject: [PATCH 1694/2083] Adding test for form input templates --- app/tmp/cache/persistent/empty | 0 cake/libs/view/helpers/form.php | 2 +- .../cases/libs/view/helpers/form.test.php | 64 ++++++++++++++++++- 3 files changed, 64 insertions(+), 2 deletions(-) delete mode 100755 app/tmp/cache/persistent/empty diff --git a/app/tmp/cache/persistent/empty b/app/tmp/cache/persistent/empty deleted file mode 100755 index e69de29bb..000000000 diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 4ec6961cd..167d9232e 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -883,7 +883,7 @@ function input($fieldName, $options = array()) { break; case 'checkbox': $input = $this->checkbox($fieldName, $options); - $format = $format ?: array('before', 'input', 'between', 'label', 'after', 'error'); + $format = $format ? $format : array('before', 'input', 'between', 'label', 'after', 'error'); break; case 'radio': $input = $this->radio($fieldName, $radioOptions, $options); diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 0a826d261..189d30406 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -6019,7 +6019,7 @@ function testMultiRecordForm() { '/div', '/div' ); - $this->assertTags($result, $expected,true); + $this->assertTags($result, $expected); } /** @@ -6041,5 +6041,67 @@ function testMultiRecordFormValidationErrors() { $this->assertTags($result, array('div' => array('class' => 'error-message'), 'Error in field city', '/div')); } +/** + * tests the ability to change the order of the form input placeholder "input", "label", "before", "between", "after", "error" + * + * @return void + */ + function testInputTemplate() { + $result = $this->Form->input('Contact.email', array( + 'type' => 'text', 'format' => array('input') + )); + $expected = array( + 'div' => array('class' => 'input text'), + 'input' => array( + 'type' => 'text', 'name' => 'data[Contact][email]', + 'id' => 'ContactEmail' + ), + '/div' + ); + $this->assertTags($result, $expected); + + $result = $this->Form->input('Contact.email', array( + 'type' => 'text', 'format' => array('input', 'label'), + 'label' => '<em>Email (required)</em>' + )); + $expected = array( + 'div' => array('class' => 'input text'), + array('input' => array( + 'type' => 'text', 'name' => 'data[Contact][email]', + 'id' => 'ContactEmail' + )), + 'label' => array('for' => 'ContactEmail'), + 'em' => array(), + 'Email (required)', + '/em', + '/label', + '/div' + ); + $this->assertTags($result, $expected); + + $result = $this->Form->input('Contact.email', array( + 'type' => 'text', 'format' => array('input', 'between', 'label', 'after'), + 'between' => '<div>Something in the middle</div>', + 'after' => '<span>Some text at the end</span>' + )); + $expected = array( + 'div' => array('class' => 'input text'), + array('input' => array( + 'type' => 'text', 'name' => 'data[Contact][email]', + 'id' => 'ContactEmail' + )), + array('div' => array()), + 'Something in the middle', + '/div', + 'label' => array('for' => 'ContactEmail'), + 'Email', + '/label', + 'span' => array(), + 'Some text at the end', + '/span', + '/div' + ); + $this->assertTags($result, $expected); + } } ?> \ No newline at end of file From c8f6a8edd3eadcb7da6215f0398df0789051aeeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Sat, 27 Feb 2010 23:38:46 -0430 Subject: [PATCH 1695/2083] Re-adding file delete by error --- app/tmp/cache/persistent/empty | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 app/tmp/cache/persistent/empty diff --git a/app/tmp/cache/persistent/empty b/app/tmp/cache/persistent/empty new file mode 100644 index 000000000..e69de29bb From 37cf55470f6abbb9b88847ac6e03bcef1009c801 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Feb 2010 01:49:19 -0500 Subject: [PATCH 1696/2083] Adding tests for Component::triggerCallback(). Deprecating other Component methods, as they are just wrappers for triggerCallback(). --- cake/libs/controller/component.php | 3 +++ .../cases/libs/controller/component.test.php | 20 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php index f640d5432..e72fb3086 100644 --- a/cake/libs/controller/component.php +++ b/cake/libs/controller/component.php @@ -107,6 +107,7 @@ function initialize(&$controller) { * @return void * @access public * @link http://book.cakephp.org/view/65/MVC-Class-Access-Within-Components + * @deprecated See Component::triggerCallback() */ function startup(&$controller) { $this->triggerCallback('startup', $controller); @@ -119,6 +120,7 @@ function startup(&$controller) { * @param object $controller Controller with components to beforeRender * @return void * @access public + * @deprecated See Component::triggerCallback() */ function beforeRender(&$controller) { $this->triggerCallback('beforeRender', $controller); @@ -154,6 +156,7 @@ function beforeRedirect(&$controller, $url, $status = null, $exit = true) { * @param object $controller Controller with components to shutdown * @return void * @access public + * @deprecated See Component::triggerCallback() */ function shutdown(&$controller) { $this->triggerCallback('shutdown', $controller); diff --git a/cake/tests/cases/libs/controller/component.test.php b/cake/tests/cases/libs/controller/component.test.php index ee5640647..749f400ea 100644 --- a/cake/tests/cases/libs/controller/component.test.php +++ b/cake/tests/cases/libs/controller/component.test.php @@ -290,6 +290,8 @@ class SomethingWithEmailComponent extends Object { var $components = array('Email'); } +Mock::generate('Object', 'ComponentMockComponent', array('startup', 'beforeFilter', 'beforeRender', 'other')); + /** * ComponentTest class * @@ -416,6 +418,24 @@ function testComponentStartup() { $this->assertFalse(isset($Controller->bar)); } +/** + * test that triggerCallbacks fires methods on all the components, and can trigger any method. + * + * @return void + */ + function testTriggerCallback() { + $Controller =& new ComponentTestController(); + $Controller->components = array('ComponentMock'); + $Controller->constructClasses(); + + $Controller->ComponentMock->expectOnce('beforeRender'); + $Controller->Component->triggerCallback('beforeRender', $Controller); + + $Controller->ComponentMock->expectNever('beforeFilter'); + $Controller->ComponentMock->enabled = false; + $Controller->Component->triggerCallback('beforeFilter', $Controller); + } + /** * test a component being used more than once. * From 3f0c0d88482b0dddf30f600c47f61cf51a849063 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Feb 2010 01:55:23 -0500 Subject: [PATCH 1697/2083] Adding doc blocks for new methods. --- cake/libs/controller/component.php | 7 +++++++ cake/libs/controller/controller.php | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php index e72fb3086..15e41eb76 100644 --- a/cake/libs/controller/component.php +++ b/cake/libs/controller/component.php @@ -167,6 +167,13 @@ function shutdown(&$controller) { * that have such a method. You can implement and fire custom callbacks in addition to the * standard ones. * + * example use, from inside a controller: + * + * `$this->Component->triggerCallback('beforeFilter', $this);` + * + * will trigger the beforeFilter callback on all components that have implemented one. You + * can trigger any method in this fashion. + * * @param Controller $controller Controller instance * @param string $callback Callback to trigger. * @return void diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 8b8e7dcc9..bde4969fc 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -518,6 +518,10 @@ function constructClasses() { * Perform the startup process for this controller. * Fire the Component and Controller callbacks in the correct order. * + * - Initializes components, which fires their `initialize` callback + * - Calls the controller `beforeFilter`. + * - triggers Component `startup` methods. + * * @return void * @access public */ @@ -531,6 +535,9 @@ function startupProcess() { * Perform the various shutdown processes for this controller. * Fire the Component and Controller callbacks in the correct order. * + * - triggers the component `shutdown` callback. + * - calls the Controller's `afterFilter` method. + * * @return void * @access public */ From 8dfadafc88ee6670ac2f220f564b6c3376dc936a Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Sun, 28 Feb 2010 13:05:00 +0530 Subject: [PATCH 1698/2083] Changing ternary operator usage syntax to be compliant with php 5.2 and below --- cake/libs/view/helpers/form.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 7800170b4..9731b88ec 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -909,7 +909,7 @@ function input($fieldName, $options = array()) { } $out['input'] = $input; - $format = $format ?: array('before', 'label', 'between', 'input', 'after', 'error'); + $format = $format ? $format : array('before', 'label', 'between', 'input', 'after', 'error'); $output = ''; foreach ($format as $element) { $output .= $out[$element]; @@ -1227,12 +1227,12 @@ function button($title, $options = array()) { /** * Creates a submit button element. This method will generate `<input />` elements that - * can be used to submit, and reset forms by using $options. image submits can be created by supplying an + * can be used to submit, and reset forms by using $options. image submits can be created by supplying an * image path for $caption. * * ### Options * - * - `div` - Include a wrapping div? Defaults to true. Accepts sub options similar to + * - `div` - Include a wrapping div? Defaults to true. Accepts sub options similar to * FormHelper::input(). * - `before` - Content to include before the input. * - `after` - Content to include after the input. @@ -1241,7 +1241,7 @@ function button($title, $options = array()) { * * ### Options * - * - `div` - Include a wrapping div? Defaults to true. Accepts sub options similar to + * - `div` - Include a wrapping div? Defaults to true. Accepts sub options similar to * FormHelper::input(). * - Other attributes will be assigned to the input element. * From a38846b6114877e1e9b7ed8c592e7ff58a8ecf80 Mon Sep 17 00:00:00 2001 From: AD7six <andydawson76@yahoo.co.uk> Date: Tue, 23 Feb 2010 11:05:38 +0100 Subject: [PATCH 1699/2083] prevent creating tmp dirs all over the file system if running 'anonymous' shells --- cake/console/cake.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cake/console/cake.php b/cake/console/cake.php index 7d65b8346..0f90dbd44 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -244,6 +244,9 @@ function __bootstrap() { define('APP_DIR', $this->params['app']); define('APP_PATH', $this->params['working'] . DS); define('WWW_ROOT', APP_PATH . $this->params['webroot'] . DS); + if (!is_dir(ROOT . DS . APP_DIR . DS . 'tmp')) { + define('TMP', CORE_PATH . 'cake' . DS . 'console' . DS . 'templates' . DS . 'skel' . DS . 'tmp' . DS); + } $includes = array( CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php', From a1124e36aa3b161c4605313292ff76bd65ca5cb8 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Feb 2010 11:35:56 -0500 Subject: [PATCH 1700/2083] Fixing formatting. --- cake/console/cake.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cake/console/cake.php b/cake/console/cake.php index 0f90dbd44..5d8669f9e 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -625,14 +625,14 @@ function help() { $columns = max(1, floor($width / 30)); $rows = ceil(count($shellList) / $columns); - foreach($shellList as $shell => $types) { + foreach ($shellList as $shell => $types) { sort($types); $shellList[$shell] = str_pad($shell . ' [' . implode ($types, ', ') . ']', $width / $columns); } $out = array_chunk($shellList, $rows); - for($i = 0; $i < $rows; $i++) { + for ($i = 0; $i < $rows; $i++) { $row = ''; - for($j = 0; $j < $columns; $j++) { + for ($j = 0; $j < $columns; $j++) { if (!isset($out[$j][$i])) { continue; } From 75e98387e7518086f499a259a81b817df5dd47b3 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Feb 2010 11:39:09 -0500 Subject: [PATCH 1701/2083] Removing debug() from test case. --- cake/tests/cases/console/libs/tasks/controller.test.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 3f713f585..887414648 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -333,8 +333,6 @@ function testBakeActionsUsingSessions() { $this->assertTrue(strpos($result, 'if ($this->Article->delete($id))') !== false); $this->assertTrue(strpos($result, "\$this->Session->setFlash(sprintf(__('%s deleted', true), 'Article'));") !== false); -debug($result, true); - $result = $this->Task->bakeActions('Articles', 'admin_', true); $this->assertTrue(strpos($result, 'function admin_index() {') !== false); From e0eb48d25077275bb50a91979966336c1bc48ff7 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Feb 2010 12:15:25 -0500 Subject: [PATCH 1702/2083] Adding expectError to catch errors coming from FileEngine. Fixing incorrect tests in ApcTest. --- cake/tests/cases/libs/cache.test.php | 1 + cake/tests/cases/libs/cache/apc.test.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cake/tests/cases/libs/cache.test.php b/cake/tests/cases/libs/cache.test.php index e741b2116..d66d3a7a0 100644 --- a/cake/tests/cases/libs/cache.test.php +++ b/cake/tests/cases/libs/cache.test.php @@ -119,6 +119,7 @@ function testConfigWithLibAndPluginEngines() { * @return void */ function testInvaidConfig() { + $this->expectError(); Cache::config('Invalid', array( 'engine' => 'File', 'duration' => '+1 year', diff --git a/cake/tests/cases/libs/cache/apc.test.php b/cake/tests/cases/libs/cache/apc.test.php index 4454b80ba..b15ff2f10 100644 --- a/cake/tests/cases/libs/cache/apc.test.php +++ b/cake/tests/cases/libs/cache/apc.test.php @@ -182,16 +182,16 @@ function testIncrement() { $this->assertTrue($result); $result = Cache::increment('test_increment'); - $this->assertEqual(5, $result); + $this->assertEqual(6, $result); $result = Cache::read('test_increment'); - $this->assertEqual(5, $result); + $this->assertEqual(6, $result); $result = Cache::increment('test_increment', 2); - $this->assertEqual(7, $result); + $this->assertEqual(8, $result); $result = Cache::read('test_increment'); - $this->assertEqual(7, $result); + $this->assertEqual(8, $result); } } ?> \ No newline at end of file From d5fa897681667d70e03bc25f2d318c6f85e071fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Sun, 28 Feb 2010 12:55:35 -0430 Subject: [PATCH 1703/2083] Adding tests for startupProcess and shutDownProcess in controller Fixing variable reference --- cake/libs/controller/controller.php | 2 +- .../console/libs/tasks/controller.test.php | 2 - .../cases/libs/controller/controller.test.php | 64 ++++++++++++++++++- 3 files changed, 64 insertions(+), 4 deletions(-) diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index bde4969fc..973064337 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -542,7 +542,7 @@ function startupProcess() { * @access public */ function shutdownProcess() { - $this->Component->triggerCallback('shutdown', $controller); + $this->Component->triggerCallback('shutdown', $this); $this->afterFilter(); } diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 3f713f585..887414648 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -333,8 +333,6 @@ function testBakeActionsUsingSessions() { $this->assertTrue(strpos($result, 'if ($this->Article->delete($id))') !== false); $this->assertTrue(strpos($result, "\$this->Session->setFlash(sprintf(__('%s deleted', true), 'Article'));") !== false); -debug($result, true); - $result = $this->Task->bakeActions('Articles', 'admin_', true); $this->assertTrue(strpos($result, 'function admin_index() {') !== false); diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index fb422b5cf..35597af1e 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -366,6 +366,31 @@ class TestComponent extends Object { */ function beforeRedirect() { } +/** + * initialize method + * + * @access public + * @return void + */ + function initialize(&$controller) { + } + +/** + * startup method + * + * @access public + * @return void + */ + function startup(&$controller) { + } +/** + * shutdown method + * + * @access public + * @return void + */ + function shutdown(&$controller) { + } } /** @@ -382,7 +407,6 @@ class AnotherTestController extends AppController { * @access public */ var $name = 'AnotherTest'; - /** * uses property * @@ -1307,5 +1331,43 @@ function testControllerHttpCodes() { $expected = array(404 => 'Sorry Bro'); $this->assertEqual($result, $expected); } + +/** + * Tests that the startup process calls the correct functions + * + * @access public + * @return void + */ + function testStartupProcess() { + Mock::generatePartial('AnotherTestController','MockedController', array('beforeFilter')); + Mock::generate('TestComponent', 'MockTestComponent', array('startup', 'initialize')); + $MockedController =& new MockedController(); + $MockedController->components = array('MockTest'); + $MockedController->Component =& new Component(); + $MockedController->Component->init($MockedController); + $MockedController->startupProcess(); + + $MockedController->expectCallCount('beforeFilter', 1); + $MockedController->MockTest->expectOnce('initialize', array($MockedController)); + $MockedController->MockTest->expectOnce('startup', array($MockedController)); + } +/** + * Tests that the shutdown process calls the correct functions + * + * @access public + * @return void + */ + function testShutdownProcess() { + Mock::generatePartial('AnotherTestController','MockedController2', array('afterFilter')); + Mock::generate('TestComponent', 'MockTestComponent', array('shutdown')); + $MockedController =& new MockedController2(); + $MockedController->components = array('MockTest'); + $MockedController->Component =& new Component(); + $MockedController->Component->init($MockedController); + $MockedController->shutdownProcess(); + + $MockedController->expectCallCount('afterFilter', 1); + $MockedController->MockTest->expectOnce('shutdown', array($MockedController)); + } } ?> \ No newline at end of file From 322d8e667c20c2ae438c191c905dd7c1c1f82896 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Feb 2010 12:26:15 -0500 Subject: [PATCH 1704/2083] Removing duplicate method. --- .../components/request_handler.test.php | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/cake/tests/cases/libs/controller/components/request_handler.test.php b/cake/tests/cases/libs/controller/components/request_handler.test.php index db5becd25..79894d79a 100644 --- a/cake/tests/cases/libs/controller/components/request_handler.test.php +++ b/cake/tests/cases/libs/controller/components/request_handler.test.php @@ -616,34 +616,5 @@ function testBeforeRedirectCallbackWithArrayUrl() { App::build(); } -/** - * test that the beforeRedirect callback properly converts - * array urls into their correct string ones, and adds base => false so - * the correct urls are generated. - * - * @link http://cakephp.lighthouseapp.com/projects/42648-cakephp-1x/tickets/276 - * @return void - */ - function testBeforeRedirectCallbackWithArrayUrl() { - $_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'; - App::build(array( - 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS) - ), true); - Router::setRequestInfo(array( - array('plugin' => null, 'controller' => 'accounts', 'action' => 'index', 'pass' => array(), 'named' => array(), 'form' => array(), 'url' => array('url' => 'accounts/'), 'bare' => 0), - array('base' => '/officespace', 'here' => '/officespace/accounts/', 'webroot' => '/officespace/') - )); - - $RequestHandler =& new NoStopRequestHandler(); - - ob_start(); - $RequestHandler->beforeRedirect( - $this->Controller, - array('controller' => 'request_handler_test', 'action' => 'param_method', 'first', 'second') - ); - $result = ob_get_clean(); - $this->assertEqual($result, 'one: first two: second'); - App::build(); - } } ?> \ No newline at end of file From 4256cbc6f88741c0c9c7795bdb203b9124762655 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Feb 2010 12:28:31 -0500 Subject: [PATCH 1705/2083] Fixing fails in apishell test. --- cake/tests/cases/console/libs/api.test.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cake/tests/cases/console/libs/api.test.php b/cake/tests/cases/console/libs/api.test.php index c21ac1dca..7433245e7 100644 --- a/cake/tests/cases/console/libs/api.test.php +++ b/cake/tests/cases/console/libs/api.test.php @@ -101,8 +101,10 @@ function testMethodNameDetection () { '15. render($action = null, $layout = null, $file = null)', '16. set($one, $two = null)', '17. setAction($action)', - '18. validate()', - '19. validateErrors()' + '18. shutdownProcess()', + '19. startupProcess()', + '20. validate()', + '21. validateErrors()' ) ); $this->Shell->expectAt(1, 'out', $expected); From f0e73e11582899e34d3b91a1aae00fdc3fc8ebfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Sun, 28 Feb 2010 13:08:36 -0430 Subject: [PATCH 1706/2083] Changing order of expectations to get more correct results --- .../cases/libs/controller/controller.test.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index 35597af1e..4f9c5e6ed 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -1339,17 +1339,16 @@ function testControllerHttpCodes() { * @return void */ function testStartupProcess() { - Mock::generatePartial('AnotherTestController','MockedController', array('beforeFilter')); + Mock::generatePartial('AnotherTestController','MockedController', array('beforeFilter', 'afterFilter')); Mock::generate('TestComponent', 'MockTestComponent', array('startup', 'initialize')); $MockedController =& new MockedController(); $MockedController->components = array('MockTest'); $MockedController->Component =& new Component(); $MockedController->Component->init($MockedController); - $MockedController->startupProcess(); - $MockedController->expectCallCount('beforeFilter', 1); - $MockedController->MockTest->expectOnce('initialize', array($MockedController)); - $MockedController->MockTest->expectOnce('startup', array($MockedController)); + $MockedController->MockTest->expectCallCount('initialize', 1); + $MockedController->MockTest->expectCallCount('startup', 1); + $MockedController->startupProcess(); } /** * Tests that the shutdown process calls the correct functions @@ -1358,16 +1357,14 @@ function testStartupProcess() { * @return void */ function testShutdownProcess() { - Mock::generatePartial('AnotherTestController','MockedController2', array('afterFilter')); Mock::generate('TestComponent', 'MockTestComponent', array('shutdown')); - $MockedController =& new MockedController2(); + $MockedController =& new MockedController(); $MockedController->components = array('MockTest'); $MockedController->Component =& new Component(); $MockedController->Component->init($MockedController); - $MockedController->shutdownProcess(); - $MockedController->expectCallCount('afterFilter', 1); - $MockedController->MockTest->expectOnce('shutdown', array($MockedController)); + $MockedController->MockTest->expectCallCount('shutdown', 1); + $MockedController->shutdownProcess(); } } ?> \ No newline at end of file From a6efda66b81b2db75e4bbe0793ab41b2b3ee5533 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Feb 2010 12:38:49 -0500 Subject: [PATCH 1707/2083] Adding fixtures to fix errors in schema shell test case. --- cake/tests/cases/console/libs/schema.test.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cake/tests/cases/console/libs/schema.test.php b/cake/tests/cases/console/libs/schema.test.php index cbb8e982c..2c0c2d750 100644 --- a/cake/tests/cases/console/libs/schema.test.php +++ b/cake/tests/cases/console/libs/schema.test.php @@ -121,7 +121,7 @@ class SchemaShellTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.article', 'core.user', 'core.post', 'core.auth_user'); + var $fixtures = array('core.article', 'core.user', 'core.post', 'core.auth_user', 'core.author', 'core.comment'); /** * startTest method @@ -368,6 +368,8 @@ function testGenerateWithPlugins() { $this->assertPattern('/var \$posts/', $contents); $this->assertPattern('/var \$auth_users/', $contents); + $this->assertPattern('/var \$authors/', $contents); + $this->assertPattern('/var \$comments/', $contents); $this->assertNoPattern('/var \$users/', $contents); $this->assertNoPattern('/var \$articles/', $contents); From 27ffd432144c492e0b26a2a688d5a884979a874b Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Feb 2010 12:48:34 -0500 Subject: [PATCH 1708/2083] Fixing issue in component test where AppController will cause failing tests due to bleed through. --- cake/tests/cases/libs/controller/component.test.php | 1 + 1 file changed, 1 insertion(+) diff --git a/cake/tests/cases/libs/controller/component.test.php b/cake/tests/cases/libs/controller/component.test.php index 749f400ea..c739475cd 100644 --- a/cake/tests/cases/libs/controller/component.test.php +++ b/cake/tests/cases/libs/controller/component.test.php @@ -426,6 +426,7 @@ function testComponentStartup() { function testTriggerCallback() { $Controller =& new ComponentTestController(); $Controller->components = array('ComponentMock'); + $Controller->uses = null; $Controller->constructClasses(); $Controller->ComponentMock->expectOnce('beforeRender'); From 2a19a8d5e4de5d448e8b79ab4893790c3b6dbf1c Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Feb 2010 13:31:23 -0500 Subject: [PATCH 1709/2083] Updating CakeSchema test so it runs in both solo and group contexts. Changing table used on TestPluginComment to match its name. --- cake/tests/cases/libs/model/cake_schema.test.php | 9 ++++++--- .../plugins/test_plugin/models/test_plugin_comment.php | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cake/tests/cases/libs/model/cake_schema.test.php b/cake/tests/cases/libs/model/cake_schema.test.php index ac1f42b6a..cb6e2cb1a 100644 --- a/cake/tests/cases/libs/model/cake_schema.test.php +++ b/cake/tests/cases/libs/model/cake_schema.test.php @@ -463,7 +463,9 @@ class CakeSchemaTest extends CakeTestCase { * @access public */ var $fixtures = array( - 'core.post', 'core.tag', 'core.posts_tag', 'core.comment', 'core.datatype', 'core.auth_user', 'core.author' + 'core.post', 'core.tag', 'core.posts_tag', 'core.test_plugin_comment', + 'core.datatype', 'core.auth_user', 'core.author', + 'core.test_plugin_article', 'core.user', 'core.comment' ); /** @@ -559,6 +561,7 @@ function testSchemaReadWithPlugins() { App::build(array( 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) )); + $Schema =& new CakeSchema(); $Schema->plugin = 'TestPlugin'; $read = $Schema->read(array( @@ -569,10 +572,10 @@ function testSchemaReadWithPlugins() { unset($read['tables']['missing']); $this->assertTrue(isset($read['tables']['auth_users'])); $this->assertTrue(isset($read['tables']['authors'])); - $this->assertTrue(isset($read['tables']['comments'])); + $this->assertTrue(isset($read['tables']['test_plugin_comments'])); $this->assertTrue(isset($read['tables']['posts'])); $this->assertEqual(count($read['tables']), 4); - + App::build(); } diff --git a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php index 5330ba97c..84fbf0c98 100644 --- a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php +++ b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php @@ -24,7 +24,7 @@ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ class TestPluginComment extends TestPluginAppModel { - var $useTable = 'comments'; + var $useTable = 'test_plugin_comments'; var $name = 'TestPluginComment'; } ?> \ No newline at end of file From dbe35a495ce9bf58a958d80758c5e0c98fa5648a Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Feb 2010 13:34:37 -0500 Subject: [PATCH 1710/2083] Updating Object test to include fixtures for both comment fixtures. --- cake/tests/cases/libs/object.test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/object.test.php b/cake/tests/cases/libs/object.test.php index 72de8a1a3..384bf2bc9 100644 --- a/cake/tests/cases/libs/object.test.php +++ b/cake/tests/cases/libs/object.test.php @@ -323,7 +323,7 @@ class ObjectTest extends CakeTestCase { * * @var string */ - var $fixtures = array('core.post', 'core.comment'); + var $fixtures = array('core.post', 'core.test_plugin_comment', 'core.comment'); /** * setUp method From 428ee1998a6ba45f7ec9f9e752528bcdaadaf26b Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Feb 2010 13:44:04 -0500 Subject: [PATCH 1711/2083] Updating paths so app layout doesn't break tests. --- cake/tests/cases/libs/error.test.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cake/tests/cases/libs/error.test.php b/cake/tests/cases/libs/error.test.php index 915313b82..8f53f26b4 100644 --- a/cake/tests/cases/libs/error.test.php +++ b/cake/tests/cases/libs/error.test.php @@ -328,6 +328,10 @@ function testError() { * @return void */ function testError404() { + App::build(array( + 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS) + ), true); + ob_start(); $TestErrorHandler = new TestErrorHandler('error404', array('message' => 'Page not found', 'url' => '/test_error')); $result = ob_get_clean(); @@ -345,6 +349,8 @@ function testError404() { $result = ob_get_clean(); $this->assertNoPattern('#<script>#', $result); $this->assertNoPattern('#</script>#', $result); + + App::build(); } /** From 65169971d498c0d85eb1d897ccfc392baf478d96 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Feb 2010 13:51:47 -0500 Subject: [PATCH 1712/2083] Making memory leak test work with margins present in php5.3.1 --- cake/tests/cases/libs/view/theme.test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/tests/cases/libs/view/theme.test.php b/cake/tests/cases/libs/view/theme.test.php index 6d1cfae3e..8146c6561 100644 --- a/cake/tests/cases/libs/view/theme.test.php +++ b/cake/tests/cases/libs/view/theme.test.php @@ -321,7 +321,7 @@ function testMissingLayout() { * @return void */ function testMemoryLeakInPaths() { - if ($this->skipIf(!function_exists('memory_get_usage'), 'No memory measurement function, fail. %s')) { + if ($this->skipIf(!function_exists('memory_get_usage'), 'No memory measurement function, cannot test for possible memory leak. %s')) { return; } $this->Controller->plugin = null; @@ -338,7 +338,7 @@ function testMemoryLeakInPaths() { $View->element('test_element'); } $end = memory_get_usage(); - $this->assertWithinMargin($start, $end, 2000); + $this->assertWithinMargin($start, $end, 3500); } } ?> \ No newline at end of file From ee3c2efec7a4ce681e2e3dd4399618c3b819e4cd Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Feb 2010 20:48:26 -0500 Subject: [PATCH 1713/2083] Updating version number to 1.3.0-RC1 --- cake/VERSION.txt | 2 +- cake/config/config.php | 2 +- cake/libs/view/pages/home.ctp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cake/VERSION.txt b/cake/VERSION.txt index ab0db2cda..06f84be6a 100644 --- a/cake/VERSION.txt +++ b/cake/VERSION.txt @@ -18,4 +18,4 @@ // @license MIT License (http://www.opensource.org/licenses/mit-license.php) // +--------------------------------------------------------------------------------------------+ // //////////////////////////////////////////////////////////////////////////////////////////////////// -1.3.0-beta \ No newline at end of file +1.3.0-RC1 \ No newline at end of file diff --git a/cake/config/config.php b/cake/config/config.php index af1ee41fb..c79f7a9a0 100644 --- a/cake/config/config.php +++ b/cake/config/config.php @@ -17,5 +17,5 @@ * @since CakePHP(tm) v 1.1.11.4062 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -return $config['Cake.version'] = '1.3.0-beta'; +return $config['Cake.version'] = '1.3.0-RC1'; ?> \ No newline at end of file diff --git a/cake/libs/view/pages/home.ctp b/cake/libs/view/pages/home.ctp index e18d5bd66..509d45863 100644 --- a/cake/libs/view/pages/home.ctp +++ b/cake/libs/view/pages/home.ctp @@ -21,7 +21,7 @@ if (Configure::read() == 0): endif; ?> <h2><?php echo sprintf(__('Release Notes for CakePHP %s.', true), Configure::version()); ?></h2> -<a href="http://cakephp.lighthouseapp.com/projects/42648/changelog-1-2-6"><?php __('Read the changelog'); ?> </a> +<a href="http://cakephp.lighthouseapp.com/projects/42648/changelog-1-3-0-RC1"><?php __('Read the changelog'); ?> </a> <?php if (Configure::read() > 0): Debugger::checkSecurityKeys(); From 256ce41b1f5ae43374944e2f55e017aa6619e581 Mon Sep 17 00:00:00 2001 From: hiromi2424 <tanaka2424@gmail.com> Date: Wed, 3 Mar 2010 11:42:53 +0900 Subject: [PATCH 1714/2083] LC_TIME support multi-byte value. --- cake/libs/i18n.php | 3 ++ cake/tests/cases/libs/i18n.test.php | 17 +++++++++ cake/tests/test_app/locale/ja_jp/LC_TIME | 48 ++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 cake/tests/test_app/locale/ja_jp/LC_TIME diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index a9122f49f..9feb8704a 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -540,6 +540,9 @@ function __parseLiteralValue($string) { $delimiter = 'U00'; return join('', array_map('chr', array_map('hexdec', array_filter(explode($delimiter, $string))))); } + if (preg_match('/U([0-9a-fA-F]{4})/',$string,$match)){ + return Multibyte::ascii(array(hexdec($match[1]))); + } return $string; } diff --git a/cake/tests/cases/libs/i18n.test.php b/cake/tests/cases/libs/i18n.test.php index 5b05915ed..1821391f2 100644 --- a/cake/tests/cases/libs/i18n.test.php +++ b/cake/tests/cases/libs/i18n.test.php @@ -2604,6 +2604,23 @@ function testTimeDefinition() { $this->assertEqual($result, $expected); } + function testTimeDefinitionJapanese(){ + Configure::write('Config.language', 'ja_jp'); + $result = __c('d_fmt', 5, true); + + $expected = "%Yå¹´%m月%dæ—¥"; + + $this->assertEqual($result, $expected); + + $result = __c('am_pm', 5, true); + $expected = array("åˆå‰", "åˆå¾Œ"); + $this->assertEqual($result, $expected); + + $result = __c('abmon', 5, true); + $expected = array(" 1月", " 2月", " 3月", " 4月", " 5月", " 6月", " 7月", " 8月", " 9月", "10月", "11月", "12月"); + $this->assertEqual($result, $expected); + } + /** * Singular method * diff --git a/cake/tests/test_app/locale/ja_jp/LC_TIME b/cake/tests/test_app/locale/ja_jp/LC_TIME new file mode 100644 index 000000000..2f1efb868 --- /dev/null +++ b/cake/tests/test_app/locale/ja_jp/LC_TIME @@ -0,0 +1,48 @@ +escape_char / +comment_char % +abday "<U65E5>";"<U6708>";"<U706B>";"<U6C34>";"<U6728>";"<U91D1>";"<U571F>" + +day "<U65E5><U66DC><U65E5>";"<U6708><U66DC><U65E5>";/ + "<U706B><U66DC><U65E5>";"<U6C34><U66DC><U65E5>";/ + "<U6728><U66DC><U65E5>";"<U91D1><U66DC><U65E5>";/ + "<U571F><U66DC><U65E5>" + +week 7;19971130;7 +first_weekday 1 +first_workday 2 +abmon "<U0020><U0031><U6708>";"<U0020><U0032><U6708>";/ + "<U0020><U0033><U6708>";"<U0020><U0034><U6708>";/ + "<U0020><U0035><U6708>";"<U0020><U0036><U6708>";/ + "<U0020><U0037><U6708>";"<U0020><U0038><U6708>";/ + "<U0020><U0039><U6708>";"<U0031><U0030><U6708>";/ + "<U0031><U0031><U6708>";"<U0031><U0032><U6708>" +mon "<U0031><U6708>";"<U0032><U6708>";/ + "<U0033><U6708>";"<U0034><U6708>";/ + "<U0035><U6708>";"<U0036><U6708>";/ + "<U0037><U6708>";"<U0038><U6708>";/ + "<U0039><U6708>";"<U0031><U0030><U6708>";/ + "<U0031><U0031><U6708>";"<U0031><U0032><U6708>" +% Appropriate date and time representation (%c) +% +d_t_fmt "<U0025><U0059><U5E74><U0025><U006D><U6708><U0025><U0064><U65E5><U0020><U0025><U0048><U6642><U0025><U004D><U5206><U0025><U0053><U79D2>" +% +% Appropriate date representation (%x) +% "%Yå¹´%m月%dæ—¥" +d_fmt "<U0025><U0059><U5E74><U0025><U006D><U6708><U0025><U0064><U65E5>" +% +% Appropriate time representation (%X) +% +t_fmt "<U0025><U0048><U6642><U0025><U004D><U5206><U0025><U0053><U79D2>" +% +% Appropriate AM/PM time representation (%r) +% +t_fmt_ampm "<U0025><U0070><U0025><U0049><U6642><U0025><U004D><U5206><U0025><U0053><U79D2>" +% +% Strings for AM/PM +% +am_pm "<U5348><U524D>";"<U5348><U5F8C>" +% +% Appropriate date representation (date(1)) +date_fmt "<U0025><U0059><U5E74><U0020><U0025><U0062><U0020><U0025>/ +<U0065><U65E5><U0020><U0025><U0041><U0020><U0025><U0048><U003A><U0025>/ +<U004D><U003A><U0025><U0053><U0020><U0025><U005A>" From 174108df198f6222cd9f957ce8a9952bc20a175a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Wed, 3 Mar 2010 00:11:10 -0430 Subject: [PATCH 1715/2083] Code cleanup, closes #416 --- cake/libs/i18n.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index 9feb8704a..3a00b8441 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -461,7 +461,6 @@ function __loadPo($file, $domain) { * @access private */ function __loadLocaleDefinition($file, $domain = null) { - $_this =& I18N::getInstance(); $comment = '#'; $escape = '\\'; $currentToken = false; @@ -492,7 +491,7 @@ function __loadLocaleDefinition($file, $domain = null) { $len = strlen($value) - 1; if ($value[$len] === $escape) { - $value = substr($value,0,$len); + $value = substr($value, 0, $len); continue; } @@ -500,7 +499,7 @@ function __loadLocaleDefinition($file, $domain = null) { $replacements = array_map('crc32', $mustEscape); $value = str_replace($mustEscape, $replacements, $value); $value = explode(';', $value); - $_this->__escape = $escape; + $this->__escape = $escape; foreach ($value as $i => $val) { $val = trim($val, '"'); $val = preg_replace_callback('/(?:<)?(.[^>]*)(?:>)?/', array(&$this, '__parseLiteralValue'), $val); @@ -540,7 +539,7 @@ function __parseLiteralValue($string) { $delimiter = 'U00'; return join('', array_map('chr', array_map('hexdec', array_filter(explode($delimiter, $string))))); } - if (preg_match('/U([0-9a-fA-F]{4})/',$string,$match)){ + if (preg_match('/U([0-9a-fA-F]{4})/', $string, $match)) { return Multibyte::ascii(array(hexdec($match[1]))); } return $string; From 382e11ccde9d37b002728d5c3f5247c063fd2218 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Thu, 4 Mar 2010 10:20:15 +1100 Subject: [PATCH 1716/2083] Changed Configure::write to return true on success. Maked testing result simpler. --- cake/libs/configure.php | 3 ++- cake/tests/cases/libs/configure.test.php | 15 +++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 8629eb1e4..40f9b0041 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -75,7 +75,7 @@ function &getInstance($boot = true) { * @link http://book.cakephp.org/view/412/write * @param array $config Name of var to write * @param mixed $value Value to set for var - * @return void + * @return boolean True if write was successful * @access public */ function write($config, $value = null) { @@ -133,6 +133,7 @@ function write($config, $value = null) { } error_reporting($reporting); } + return true; } /** diff --git a/cake/tests/cases/libs/configure.test.php b/cake/tests/cases/libs/configure.test.php index 457d38773..67104dcf6 100644 --- a/cake/tests/cases/libs/configure.test.php +++ b/cake/tests/cases/libs/configure.test.php @@ -108,16 +108,19 @@ function testRead() { * @return void */ function testWrite() { - Configure::write('SomeName.someKey', 'myvalue'); + $writeResult = Configure::write('SomeName.someKey', 'myvalue'); + $this->assertTrue($writeResult); $result = Configure::read('SomeName.someKey'); $this->assertEqual($result, 'myvalue'); - Configure::write('SomeName.someKey', null); + $writeResult = Configure::write('SomeName.someKey', null); + $this->assertTrue($writeResult); $result = Configure::read('SomeName.someKey'); $this->assertEqual($result, null); $expected = array('One' => array('Two' => array('Three' => array('Four' => array('Five' => 'cool'))))); - Configure::write('Key', $expected); + $writeResult = Configure::write('Key', $expected); + $this->assertTrue($writeResult); $result = Configure::read('Key'); $this->assertEqual($expected, $result); @@ -226,7 +229,7 @@ function testLoad() { $this->assertFalse($result); $result = Configure::load('config'); - $this->assertTrue($result === null); + $this->assertTrue($result); $result = Configure::load('../../index'); $this->assertFalse($result); @@ -241,13 +244,13 @@ function testLoad() { function testLoadPlugin() { App::build(array('plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)), true); $result = Configure::load('test_plugin.load'); - $this->assertTrue($result === null); + $this->assertTrue($result); $expected = '/test_app/plugins/test_plugin/config/load.php'; $config = Configure::read('plugin_load'); $this->assertEqual($config, $expected); $result = Configure::load('test_plugin.more.load'); - $this->assertTrue($result === null); + $this->assertTrue($result); $expected = '/test_app/plugins/test_plugin/config/more.load.php'; $config = Configure::read('plugin_more_load'); $this->assertEqual($config, $expected); From 3e275494e1eb180c6e13b352cf765acc4ee4a313 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 3 Mar 2010 20:07:23 -0500 Subject: [PATCH 1717/2083] Removing duplicated condition from merge. --- cake/libs/model/datasources/dbo_source.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 2dc87e90b..73243b8f6 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -475,9 +475,6 @@ function name($data) { if ($data === '*') { return '*'; } - if (is_object($data) && isset($data->type)) { - return $data->value; - } if (is_array($data)) { foreach ($data as $i => $dataItem) { $data[$i] = $this->name($dataItem); From 0c6722b1918edd6ed5ce810a5a4cf95901f1f560 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 4 Mar 2010 20:44:45 -0500 Subject: [PATCH 1718/2083] Removing directory checks. Console operations will simply create directories as needed. --- cake/console/libs/bake.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index f9f5b3d37..c8810781b 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -48,10 +48,6 @@ function loadTasks() { parent::loadTasks(); $task = Inflector::classify($this->command); if (isset($this->{$task}) && !in_array($task, array('Project', 'DbConfig'))) { - if (empty($this->{$task}->path)) { - $path = Inflector::underscore(Inflector::pluralize($this->command)); - $this->{$task}->path = $this->params['working'] . DS . $path . DS; - } if (isset($this->params['connection'])) { $this->{$task}->connection = $this->params['connection']; } @@ -64,10 +60,6 @@ function loadTasks() { if (isset($this->params['plugin'])) { $this->{$task}->plugin = $this->params['plugin']; } - if (!is_dir($this->{$task}->path)) { - $this->err(sprintf(__("%s directory could not be found.\nBe sure you have created %s", true), $task, $this->{$task}->path)); - $this->_stop(); - } } } From 1af49c87807981d68ea9a4e3b2f91eca36391f22 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 4 Mar 2010 20:50:52 -0500 Subject: [PATCH 1719/2083] Adding BakeTask. Will be a base class for tasks used in Bake. --- cake/console/libs/tasks/bake.php | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 cake/console/libs/tasks/bake.php diff --git a/cake/console/libs/tasks/bake.php b/cake/console/libs/tasks/bake.php new file mode 100644 index 000000000..408114b6b --- /dev/null +++ b/cake/console/libs/tasks/bake.php @@ -0,0 +1,42 @@ +<?php +/** + * Base class for Bake Tasks. + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console.libs.tasks + * @since CakePHP(tm) v 1.3 + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + */ +class BakeTask extends Shell { +/** + * Name attribute, used in path generation. + * + * @var string + */ + var $name = null; + +/** + * Gets the path for output. Checks the plugin property + * and returns the correct path. + * + * @return string Path to output. + * @access public + */ + function getPath() { + $path = $this->path; + if (isset($this->plugin)) { + $path = $this->_pluginPath($this->plugin) . Inflector::pluralize(Inflector::underscore($this->name)) . DS; + } + return $path; + } +} \ No newline at end of file From 4a6ab01134c8ab70a789a58c32fdbd94e28f8075 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 4 Mar 2010 20:52:25 -0500 Subject: [PATCH 1720/2083] Making model, view, and controller task use BakeTask. --- cake/console/libs/tasks/controller.php | 10 +++++----- cake/console/libs/tasks/model.php | 10 +++++----- cake/console/libs/tasks/view.php | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 1aa1ecfd1..ebfab47dc 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -18,14 +18,17 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +include_once dirname(__FILE__) . DS . 'bake.php'; + /** * Task class for creating and updating controller files. * * @package cake * @subpackage cake.cake.console.libs.tasks */ -class ControllerTask extends Shell { +class ControllerTask extends BakeTask { + var $name = 'Controller'; /** * Name of plugin * @@ -318,10 +321,7 @@ function bake($controllerName, $actions = '', $helpers = null, $components = nul $this->Template->set(compact('controllerName', 'actions', 'helpers', 'components', 'isScaffold')); $contents = $this->Template->generate('classes', 'controller'); - $path = $this->path; - if (isset($this->plugin)) { - $path = $this->_pluginPath($this->plugin) . 'controllers' . DS; - } + $path = $this->getPath(); $filename = $path . $this->_controllerPath($controllerName) . '_controller.php'; if ($this->createFile($filename, $contents)) { return $contents; diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 461740f75..96cff5c62 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -18,14 +18,17 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +include_once dirname(__FILE__) . DS . 'bake.php'; + /** * Task class for creating and updating model files. * * @package cake * @subpackage cake.cake.console.libs.tasks */ -class ModelTask extends Shell { +class ModelTask extends BakeTask { + var $name = 'Model'; /** * Name of plugin * @@ -751,10 +754,7 @@ function bake($name, $data = array()) { $this->Template->set('plugin', Inflector::camelize($this->plugin)); $out = $this->Template->generate('classes', 'model'); - $path = $this->path; - if (isset($this->plugin)) { - $path = $this->_pluginPath($this->plugin) . 'models' . DS; - } + $path = $this->getPath(); $filename = $path . Inflector::underscore($name) . '.php'; $this->out("\nBaking model class for $name..."); $this->createFile($filename, $out); diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index dfbcc5bb7..07955ec65 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -18,6 +18,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ App::import('Controller', 'Controller', false); +include_once dirname(__FILE__) . DS . 'bake.php'; /** * Task class for creating and updating view files. @@ -25,7 +26,9 @@ * @package cake * @subpackage cake.cake.console.libs.tasks */ -class ViewTask extends Shell { +class ViewTask extends BakeTask { + + var $name = 'View'; /** * Name of plugin @@ -370,10 +373,7 @@ function bake($action, $content = '') { if ($content === true) { $content = $this->getContent($action); } - $path = $this->path; - if (isset($this->plugin)) { - $path = $this->_pluginPath($this->plugin) . 'views' . DS; - } + $path = $this->getPath(); $filename = $path . $this->controllerPath . DS . Inflector::underscore($action) . '.ctp'; return $this->createFile($filename, $content); } From 01ea34f45240d3beef02d999c8a5efd6b102615f Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 4 Mar 2010 21:30:26 -0500 Subject: [PATCH 1721/2083] Moving features up to BakeTask. --- cake/console/libs/tasks/bake.php | 16 ++++++++++++++++ cake/console/libs/tasks/controller.php | 7 ------- cake/console/libs/tasks/fixture.php | 20 ++------------------ cake/console/libs/tasks/model.php | 15 --------------- cake/console/libs/tasks/view.php | 8 -------- 5 files changed, 18 insertions(+), 48 deletions(-) diff --git a/cake/console/libs/tasks/bake.php b/cake/console/libs/tasks/bake.php index 408114b6b..34298ef8f 100644 --- a/cake/console/libs/tasks/bake.php +++ b/cake/console/libs/tasks/bake.php @@ -25,6 +25,22 @@ class BakeTask extends Shell { */ var $name = null; +/** + * Name of plugin + * + * @var string + * @access public + */ + var $plugin = null; + +/** + * The db connection being used for baking + * + * @var string + * @access public + */ + var $connection = null; + /** * Gets the path for output. Checks the plugin property * and returns the correct path. diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index ebfab47dc..08d23ae6e 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -29,13 +29,6 @@ class ControllerTask extends BakeTask { var $name = 'Controller'; -/** - * Name of plugin - * - * @var string - * @access public - */ - var $plugin = null; /** * Tasks to be loaded by this Task diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 195392d1c..86ea8e31b 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -17,22 +17,14 @@ * @since CakePHP(tm) v 1.3 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ - +include_once dirname(__FILE__) . DS . 'bake.php'; /** * Task class for creating and updating fixtures files. * * @package cake * @subpackage cake.cake.console.libs.tasks */ -class FixtureTask extends Shell { - -/** - * Name of plugin - * - * @var string - * @access public - */ - var $plugin = null; +class FixtureTask extends BakeTask { /** * Tasks to be loaded by this Task @@ -50,14 +42,6 @@ class FixtureTask extends Shell { */ var $path = null; -/** - * The db connection being used for baking - * - * @var string - * @access public - */ - var $connection = null; - /** * Schema instance * diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 96cff5c62..15449a3b9 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -29,21 +29,6 @@ class ModelTask extends BakeTask { var $name = 'Model'; -/** - * Name of plugin - * - * @var string - * @access public - */ - var $plugin = null; - -/** - * Name of the db connection used. - * - * @var string - * @access public - */ - var $connection = null; /** * path to MODELS directory diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 07955ec65..b403b295c 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -30,14 +30,6 @@ class ViewTask extends BakeTask { var $name = 'View'; -/** - * Name of plugin - * - * @var string - * @access public - */ - var $plugin = null; - /** * Tasks to be loaded by this Task * From d4393e90580280972baae18a5f9722cdb12fd47a Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 4 Mar 2010 21:57:48 -0500 Subject: [PATCH 1722/2083] Fixing path generation in BakeTask. Removing name properties as they were causing troubles. All BakeTasks are now interactive = false by default. This makes interfaces more consistent when working with bake. Refs #423 Tests updated. --- cake/console/libs/tasks/bake.php | 16 +++++++------ cake/console/libs/tasks/controller.php | 2 -- cake/console/libs/tasks/fixture.php | 18 +++++++++++---- cake/console/libs/tasks/model.php | 2 -- cake/console/libs/tasks/test.php | 23 ++++--------------- cake/console/libs/tasks/view.php | 2 -- .../console/libs/tasks/controller.test.php | 2 ++ .../cases/console/libs/tasks/fixture.test.php | 1 + .../cases/console/libs/tasks/model.test.php | 2 ++ .../cases/console/libs/tasks/test.test.php | 1 + .../cases/console/libs/tasks/view.test.php | 1 + 11 files changed, 34 insertions(+), 36 deletions(-) diff --git a/cake/console/libs/tasks/bake.php b/cake/console/libs/tasks/bake.php index 34298ef8f..db0aa0aca 100644 --- a/cake/console/libs/tasks/bake.php +++ b/cake/console/libs/tasks/bake.php @@ -18,12 +18,6 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ class BakeTask extends Shell { -/** - * Name attribute, used in path generation. - * - * @var string - */ - var $name = null; /** * Name of plugin @@ -41,6 +35,13 @@ class BakeTask extends Shell { */ var $connection = null; +/** + * Flag for interactive mode + * + * @var boolean + */ + var $interactive = false; + /** * Gets the path for output. Checks the plugin property * and returns the correct path. @@ -51,7 +52,8 @@ class BakeTask extends Shell { function getPath() { $path = $this->path; if (isset($this->plugin)) { - $path = $this->_pluginPath($this->plugin) . Inflector::pluralize(Inflector::underscore($this->name)) . DS; + $name = substr($this->name, 0, strlen($this->name) - 4); + $path = $this->_pluginPath($this->plugin) . Inflector::pluralize(Inflector::underscore($name)) . DS; } return $path; } diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 08d23ae6e..c51e19193 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -28,8 +28,6 @@ */ class ControllerTask extends BakeTask { - var $name = 'Controller'; - /** * Tasks to be loaded by this Task * diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 86ea8e31b..07621c52d 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -222,10 +222,7 @@ function generateFixtureFile($model, $otherVars) { $defaults = array('table' => null, 'schema' => null, 'records' => null, 'import' => null, 'fields' => null); $vars = array_merge($defaults, $otherVars); - $path = $this->path; - if (isset($this->plugin)) { - $path = $this->_pluginPath($this->plugin) . 'tests' . DS . 'fixtures' . DS; - } + $path = $this->getPath(); $filename = Inflector::underscore($model) . '_fixture.php'; $this->Template->set('model', $model); @@ -237,6 +234,19 @@ function generateFixtureFile($model, $otherVars) { return $content; } +/** + * Get the path to the fixtures. + * + * @return void + */ + function getPath() { + $path = $this->path; + if (isset($this->plugin)) { + $path = $this->_pluginPath($this->plugin) . 'tests' . DS . 'fixtures' . DS; + } + return $path; + } + /** * Generates a string representation of a schema. * diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 15449a3b9..3827625e1 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -28,8 +28,6 @@ */ class ModelTask extends BakeTask { - var $name = 'Model'; - /** * path to MODELS directory * diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 843599db9..ff7996cde 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -18,21 +18,15 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +include_once dirname(__FILE__) . DS . 'bake.php'; + /** * Task class for creating and updating test files. * * @package cake * @subpackage cake.cake.console.libs.tasks */ -class TestTask extends Shell { - -/** - * Name of plugin - * - * @var string - * @access public - */ - var $plugin = null; +class TestTask extends BakeTask { /** * path to TESTS directory @@ -66,12 +60,6 @@ class TestTask extends Shell { */ var $_fixtures = array(); -/** - * Flag for interactive mode - * - * @var boolean - */ - var $interactive = false; /** * Execution method always used for tasks @@ -434,10 +422,7 @@ function generateConstructor($type, $fullClassName) { * @access public */ function testCaseFileName($type, $className) { - $path = $this->path; - if (isset($this->plugin)) { - $path = $this->_pluginPath($this->plugin) . 'tests' . DS; - } + $path = $this->getPath();; $path .= 'cases' . DS . Inflector::tableize($type) . DS; if (strtolower($type) == 'controller') { $className = $this->getRealClassName($type, $className); diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index b403b295c..81590ad72 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -28,8 +28,6 @@ */ class ViewTask extends BakeTask { - var $name = 'View'; - /** * Tasks to be loaded by this Task * diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 887414648..0083b14bf 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -101,6 +101,7 @@ class ControllerTaskTest extends CakeTestCase { function startTest() { $this->Dispatcher =& new TestControllerTaskMockShellDispatcher(); $this->Task =& new MockControllerTask($this->Dispatcher); + $this->Task->name = 'ControllerTask'; $this->Task->Dispatch =& $this->Dispatcher; $this->Task->Dispatch->shellPaths = App::path('shells'); $this->Task->Template =& new TemplateTask($this->Task->Dispatch); @@ -158,6 +159,7 @@ function testListAll() { * @access public */ function testGetName() { + $this->Task->interactive = true; $this->Task->setReturnValue('in', 1); $this->Task->setReturnValueAt(0, 'in', 'q'); diff --git a/cake/tests/cases/console/libs/tasks/fixture.test.php b/cake/tests/cases/console/libs/tasks/fixture.test.php index ba6642ea2..679388497 100644 --- a/cake/tests/cases/console/libs/tasks/fixture.test.php +++ b/cake/tests/cases/console/libs/tasks/fixture.test.php @@ -142,6 +142,7 @@ function testImportOptions() { * @access public */ function testImportRecordsFromDatabaseWithConditions() { + $this->Task->interactive = true; $this->Task->setReturnValueAt(0, 'in', 'WHERE 1=1 LIMIT 10'); $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index 949c54628..bfe30c368 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -78,6 +78,8 @@ class ModelTaskTest extends CakeTestCase { function startTest() { $this->Dispatcher =& new TestModelTaskMockShellDispatcher(); $this->Task =& new MockModelTask($this->Dispatcher); + $this->Task->name = 'ModelTask'; + $this->Task->interactive = true; $this->Task->Dispatch =& $this->Dispatcher; $this->Task->Dispatch->shellPaths = App::path('shells'); $this->Task->Template =& new TemplateTask($this->Task->Dispatch); diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index 1b3d6f92c..d25de3fbc 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -265,6 +265,7 @@ function startTest() { $this->Dispatcher =& new TestTestTaskMockShellDispatcher(); $this->Dispatcher->shellPaths = App::path('shells'); $this->Task =& new MockTestTask($this->Dispatcher); + $this->Task->name = 'TestTask'; $this->Task->Dispatch =& $this->Dispatcher; $this->Task->Template =& new TemplateTask($this->Dispatcher); } diff --git a/cake/tests/cases/console/libs/tasks/view.test.php b/cake/tests/cases/console/libs/tasks/view.test.php index 66fb6b73c..a3632c3e1 100644 --- a/cake/tests/cases/console/libs/tasks/view.test.php +++ b/cake/tests/cases/console/libs/tasks/view.test.php @@ -255,6 +255,7 @@ function startTest() { $this->Dispatcher =& new TestViewTaskMockShellDispatcher(); $this->Dispatcher->shellPaths = App::path('shells'); $this->Task =& new MockViewTask($this->Dispatcher); + $this->Task->name = 'ViewTask'; $this->Task->Dispatch =& $this->Dispatcher; $this->Task->Template =& new TemplateTask($this->Dispatcher); $this->Task->Controller =& new ViewTaskMockControllerTask(); From f8cb20e994b0d8d1b648026908a4f65e9dc07a41 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 4 Mar 2010 22:02:49 -0500 Subject: [PATCH 1723/2083] Passing interactive property to inner tasks. Inner tasks now share the parent interactive setting making things more consistent. Fixes #423 --- cake/console/libs/tasks/controller.php | 1 + cake/console/libs/tasks/model.php | 2 ++ cake/tests/cases/console/libs/tasks/controller.test.php | 2 ++ cake/tests/cases/console/libs/tasks/model.test.php | 6 ++++++ 4 files changed, 11 insertions(+) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index c51e19193..fa77d523e 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -330,6 +330,7 @@ function bake($controllerName, $actions = '', $helpers = null, $components = nul function bakeTest($className) { $this->Test->plugin = $this->plugin; $this->Test->connection = $this->connection; + $this->Test->interactive = $this->interactive; return $this->Test->bake('Controller', $className); } diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 3827625e1..f848fc3c4 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -752,6 +752,7 @@ function bake($name, $data = array()) { * @access private */ function bakeTest($className) { + $this->Test->interactive = $this->interactive; $this->Test->plugin = $this->plugin; $this->Test->connection = $this->connection; return $this->Test->bake('Model', $className); @@ -911,6 +912,7 @@ function help() { * @see FixtureTask::bake */ function bakeFixture($className, $useTable = null) { + $this->Fixture->interactive = $this->interactive; $this->Fixture->connection = $this->connection; $this->Fixture->plugin = $this->plugin; $this->Fixture->bake($className, $useTable); diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 0083b14bf..d94ebe5c8 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -389,12 +389,14 @@ function testBakeActionsWithNoSessions() { function testBakeTest() { $this->Task->plugin = 'ControllerTest'; $this->Task->connection = 'test_suite'; + $this->Task->interactive = false; $this->Task->Test->expectOnce('bake', array('Controller', 'Articles')); $this->Task->bakeTest('Articles'); $this->assertEqual($this->Task->plugin, $this->Task->Test->plugin); $this->assertEqual($this->Task->connection, $this->Task->Test->connection); + $this->assertEqual($this->Task->interactive, $this->Task->Test->interactive); } /** diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index bfe30c368..f4fef7882 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -487,11 +487,14 @@ function testDoAssociationsNonInteractive() { * @access public */ function testBakeFixture() { + $this->Task->plugin = 'test_plugin'; + $this->Task->interactive = true; $this->Task->Fixture->expectAt(0, 'bake', array('Article', 'articles')); $this->Task->bakeFixture('Article', 'articles'); $this->assertEqual($this->Task->plugin, $this->Task->Fixture->plugin); $this->assertEqual($this->Task->connection, $this->Task->Fixture->connection); + $this->assertEqual($this->Task->interactive, $this->Task->Fixture->interactive); } /** @@ -501,11 +504,14 @@ function testBakeFixture() { * @access public */ function testBakeTest() { + $this->Task->plugin = 'test_plugin'; + $this->Task->interactive = true; $this->Task->Test->expectAt(0, 'bake', array('Model', 'Article')); $this->Task->bakeTest('Article'); $this->assertEqual($this->Task->plugin, $this->Task->Test->plugin); $this->assertEqual($this->Task->connection, $this->Task->Test->connection); + $this->assertEqual($this->Task->interactive, $this->Task->Test->interactive); } /** From 38d53b9359473998b99971011b3800ad15f49dbd Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 4 Mar 2010 22:04:50 -0500 Subject: [PATCH 1724/2083] Fixing typo in dispatcher. Fixes #420 --- cake/dispatcher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 49551694b..f3edc7050 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -603,7 +603,7 @@ function asset($url) { header('HTTP/1.1 404 Not Found'); return $this->_stop(); } elseif ($isCss) { - include WWW_ROOT . DS . $filter['css']; + include WWW_ROOT . DS . $filters['css']; $this->_stop(); } elseif ($isJs) { include WWW_ROOT . DS . $filters['js']; From 1d449e38479bee2f5f497ef013e5dd78c10f997f Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 4 Mar 2010 22:46:43 -0500 Subject: [PATCH 1725/2083] Refactoring label generation into a method. Fixing issues with labels having a for attribute = Array when an array of id's is provided. Fixing issues where a date input would require you to provide id keys for hour, minute, and meridian even if you were not using them. Fixes #411 --- cake/libs/view/helpers/form.php | 77 ++++++++++++------- .../cases/libs/view/helpers/form.test.php | 7 ++ 2 files changed, 57 insertions(+), 27 deletions(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 9731b88ec..11d74f6cc 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -803,32 +803,7 @@ function input($fieldName, $options = array()) { } if ($label !== false) { - $labelAttributes = $this->domId(array(), 'for'); - if ($options['type'] === 'date' || $options['type'] === 'datetime') { - if (isset($options['dateFormat']) && $options['dateFormat'] === 'NONE') { - $labelAttributes['for'] .= 'Hour'; - } else { - $labelAttributes['for'] .= 'Month'; - } - } elseif ($options['type'] === 'time') { - $labelAttributes['for'] .= 'Hour'; - } - - if (is_array($label)) { - $labelText = null; - if (isset($label['text'])) { - $labelText = $label['text']; - unset($label['text']); - } - $labelAttributes = array_merge($labelAttributes, $label); - } else { - $labelText = $label; - } - - if (isset($options['id'])) { - $labelAttributes = array_merge($labelAttributes, array('for' => $options['id'])); - } - $label = $this->label($fieldName, $labelText, $labelAttributes); + $label = $this->_inputLabel($fieldName, $label, $options); } $error = $this->_extractOption('error', $options, null); @@ -940,6 +915,50 @@ function _extractOption($name, $options, $default = null) { return $default; } +/** + * Generate a label for an input() call. + * + * @param array $options Options for the label element. + * @return string Generated label element + * @access protected + */ + function _inputLabel($fieldName, $label, $options) { + $labelAttributes = $this->domId(array(), 'for'); + if ($options['type'] === 'date' || $options['type'] === 'datetime') { + if (isset($options['dateFormat']) && $options['dateFormat'] === 'NONE') { + $labelAttributes['for'] .= 'Hour'; + $idKey = 'hour'; + } else { + $labelAttributes['for'] .= 'Month'; + $idKey = 'month'; + } + if (isset($options['id']) && isset($options['id'][$idKey])) { + $labelAttributes['for'] = $options['id'][$idKey]; + } + } elseif ($options['type'] === 'time') { + $labelAttributes['for'] .= 'Hour'; + if (isset($options['id']) && isset($options['id']['hour'])) { + $labelAttributes['for'] = $options['id']['hour']; + } + } + + if (is_array($label)) { + $labelText = null; + if (isset($label['text'])) { + $labelText = $label['text']; + unset($label['text']); + } + $labelAttributes = array_merge($labelAttributes, $label); + } else { + $labelText = $label; + } + + if (isset($options['id']) && is_string($options['id'])) { + $labelAttributes = array_merge($labelAttributes, array('for' => $options['id'])); + } + return $this->label($fieldName, $labelText, $labelAttributes); + } + /** * Creates a checkbox input widget. * @@ -1752,7 +1771,7 @@ function dateTime($fieldName, $dateFormat = 'DMY', $timeFormat = '12', $selected } } - $elements = array('Day','Month','Year','Hour','Minute','Meridian'); + $elements = array('Day', 'Month', 'Year', 'Hour', 'Minute', 'Meridian'); $defaults = array( 'minYear' => null, 'maxYear' => null, 'separator' => '-', 'interval' => 1, 'monthNames' => true @@ -1779,6 +1798,10 @@ function dateTime($fieldName, $dateFormat = 'DMY', $timeFormat = '12', $selected } } elseif (is_array($attributes['id'])) { // check for missing ones and build selectAttr for each element + $attributes['id'] += array( + 'month' => '', 'year' => '', 'day' => '', + 'hour' => '', 'minute' => '', 'meridian' => '' + ); foreach ($elements as $element) { $selectAttrName = 'select' . $element . 'Attr'; ${$selectAttrName} = $attributes; diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 166ca641b..3a552dea5 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -1880,6 +1880,13 @@ function testInputDatetime() { $this->Form->data = array('Contact' => array('created' => null)); $result = $this->Form->input('Contact.created', array('type' => 'datetime', 'timeFormat' => 'NONE')); $this->assertPattern('/for\="ContactCreatedMonth"/', $result); + + $result = $this->Form->input('Contact.created', array( + 'type' => 'date', + 'id' => array('day' => 'created-day', 'month' => 'created-month', 'year' => 'created-year'), + 'timeFormat' => 'NONE' + )); + $this->assertPattern('/for\="created-month"/', $result); } /** * Test generating checkboxes in a loop. From e4a5ca528ccc44276bb8bf02ddf6f9269c8f03c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Fri, 5 Mar 2010 16:07:59 -0430 Subject: [PATCH 1726/2083] Fixing virutal fields fetching for postgresql, closes #417 --- cake/libs/model/datasources/dbo_source.php | 10 ++++--- .../datasources/dbo/dbo_postgres.test.php | 27 ++++++++++++++++--- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 73243b8f6..4f4de80e1 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -1873,9 +1873,6 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) { } $fields = array_values(array_filter($fields)); - if (!$quote) { - return $fields; - } $virtual = array(); $virtualFields = $model->getVirtualField(); if (!empty($virtualFields)) { @@ -1892,6 +1889,13 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) { } $fields = array_values($fields); } + + if (!$quote) { + if (!empty($virtual)) { + $fields = array_merge($fields, $this->_constructVirtualFields($model, $alias, $virtual)); + } + return $fields; + } $count = count($fields); if ($count >= 1 && !in_array($fields[0], array('*', 'COUNT(*)'))) { diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php index 4dfa2bb8d..ab84540a2 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php @@ -427,19 +427,19 @@ function testBinaryDataIntegrity() { 4 0 obj << /Length 5 0 R /Filter /FlateDecode >> stream - xµYMì€∆Ω„WÃ%)nï0¯îâ-«é]Q"Ï€Xµáÿ•Ip - P�V,]Ú#c˚ˇ‰ut¥†âˆTi9�Ü=â€â€ºÃ˜_Ëœ4>à∑‚Épcé¢Pxæ®2q\' - 1UªbU ᡒ+ö«√[ıµâ„ão"R∑"HiGæä€(å≠≈^Ãøsm?YlƒÃõªï¬â€¹Ã¢EÚB&‚Î◊7bÃ’^¸m°÷˛?2±Øs“ï¬u#®U√ˇú÷g¥C;ä")n})JºIÔ3ËSnÑÎ¥≤ıD∆¢∂Msx1üèG˚±Œ™â„>¶ySïufؠ˸?UπÃã√6flÌÚC=øK?Ë…s  + xµYMì€∆Ω„WÃ%)nï0¯îâ-«é]Q"Ï€Xµáÿ•Ip - P V,]Ú#c˚ˇ‰ut¥†âˆTi9 Ü=â€â€ºÃ˜_Ëœ4>à∑‚Épcé¢Pxæ®2q\' + 1UªbU ᡒ+ö«√[ıµâ„ão"R∑"HiGæä€(å≠≈^Ãøsm?YlƒÃõªï¬â€¹Ã¢EÚB&‚Î◊7bÃ’^¸m°÷˛?2±Øs“ï¬u#®U√ˇú÷g¥C;ä")n})JºIÔ3ËSnÑÎ¥≤ıD∆¢∂Msx1üèG˚±Œ™â„>¶ySïufؠ˸?UπÃã√6flÌÚC=øK?Ë…s ˛§¯ˇ:-˜ò7€ÓFæ∂∑Õ˛∆“V’>ılflëÅd«ÜQdI ›ÎB%W¿ΩıÉn~h vêCS>«éË›(ØôK!€¡zB!√ [φ"ûß ·iH¸[Àºæ∑¯¡L,ÀÚAlS∫ˆ=∫Œ≤cÄr&ˆÈ:√ÿ£˚È«4fl•À]vc›bÅôÿî=siXe4/¡p]ã]ôÆIϪʽflà_ƒ‚G?«7 ùÿ ı¯K4ïIpV◊÷·\'éµóªÚæ>î ;›sú!2fl¬F•/f∑j£ dw"IÊÜπ<ôÿˆ%IG1ytÛDflXg|Éòa§˜}C˛¿ÿe°G´Ú±jÃm~¿/∂hã<#-¥•ıùe87€tËœõ6w}´{æ m‹ê– ∆¡ 6â„\ - rAÀBùZ3aË‚r$G·$ó0Ñ üâUY4È™¡%C∑Ÿ2rc<Iõ-cï.  + rAÀBùZ3aË‚r$G·$ó0Ñ üâUY4È™¡%C∑Ÿ2rc<Iõ-cï. [ŒöâFA†É‡+QglMÉîÉÄúÌ|¸»#x7Â¥«MgVÃŽ-GGÚ• I?Ñâ€Lzw∞pHů◊nefqCî.nÕeè∆ÿÛy¡Ë™fb≤üŒHÜAëÕNq=´@ ’cQdÖúAÉIqñŸ˘+2&∠Àù.gÅ‚ƒœ3EPÆ’Oi—‰:>ÃCäı =Õec=ëRËâ€eñ=<V$ì˙+x+¢ïÒÕ<àeWå»–˚∫Õ d§&£àf ]fPA´âtënöåâˆâ—ŠÃ³ „Ë@∆≠K´÷˘}a_CIËš©yòHg,ôSSVìBÆ’l4 L.ÈY…á,2∂íäÙ.$ó¸CäŸ*€óy Ï€?G,_√·ÆÎç=^Vkvo±ó{§Æ’2»±¨ÃüoȑD-ãé ï¬Ã³Â¥cVÙ\'â„¢G~\'p¢%* ã˚÷ ªºnh˚ºO^âˆâ€¦Â®[Ó“‚ÅfıÌ≥∫F!EÅ“(π∑T6`¬tΩÆ0ì»rTÃŽ`»Ñ« - ]ŌpË)=¿Ô0∆öVÂmˇˆ„ø~¯ÃÔâˆb*fc»‡Îı„Ú}∆tÅ“s∂Y∫ÜaÆË™Xâˆ~<ÿ·Ù vé1‹p¿TD∆ÔîÄ“úhˆ*Ú€îe)K –p¨ÚJ3Ÿ∞ã>ÊuNê°“√Ü ‹Ê9iÙ0Ë™AAEà ˙`∂£\'ûce•åƒX›ŸÃ´1SK{qdá"tÃ[wQ#SµBe∞∑µó…ÃŒV`B"Ñ≥„!è_ÓÆ-º*ºú¿Ë0ˆeê∂´ë+HFj…‡zvHÓN|ÔL÷ûñ3õÜ$z%sá…pÎóV38âs Çoµ•ß3†<9B·¨û~¢3)ÂxóÿÃCÕòÆ ∫Ã=»ÿSÏ€S;∆~±êÆTEp∑óÈ÷ÀuìDHÈ $ÉõæÜjû§"≤ÃONM®RËíRr{õS âˆÃŠâ„¢op±W;ÂUÔ�P∫kÔˇflTæ∑óflˆÆC©Ô[≥◊HÃ˚¨hê"ÆbF?ú%hË™ˇ4xèÕ(ó2ÙáíM])Ñd|=fë-cI0ñL¢kÖêk‰Rƒ«ıÄWñ8mO3âˆ&√æËX¯Hó—ì]yF2»–˜ádàà‡‹Çο„≥7mªHAS∑¶.;Å’x(1}�_kd©.ï¬dç48M\'àáªCp^Krí<ɉXÓıïl!ÃŒ$N<ı∞B»G]…∂Ó¯>˛ÔbõÒπÀ•:ôO<j∂™œ%â×>@È$pÖu‹Ê´-QqV ?V≥JÆÃqÛX8(lπï@zgÖ}Fe<ˇ‡Sñ“ÿ˜ê?6‡L∫Oß~µ�–?ËeäÚ®YîÕ =Ü=¢DÃu*GvBk;)L¬N«î:flö∂≠ÇΩq„Ñm하Ë∂‚"û≥§:±≤i^ΩÑ!)Wıyŧô�á„RÄ÷Òôc’≠—sâ„¢rı‚Pdêãh˘ßHVç5ï¬ï¬ÃˆF€çÌÛuçÖ/M=gëµ±ÿGû1coÔuñæ‘z®.�õ∑7ÉÃÜÆ,°’H†ÃÉÌ∂7e º® íˆâ„◊øNWKâ€Ã‚Yµ‚ñé;µ¶gV-fl>µtË¥áßN2 ¯¶BaP-)eW.àôt^âˆ1›C∑Ö?L„&â€5’4jvã–ªZ ÷+4% ´0l…»ú^°´© ûiÏ€∑é®óܱÒÿ‰ïˆÌ–dˆ◊Æ19rQ=Ã|ı•rMæ¬;ò‰Y‰é9.†‹ËV«ã¯âˆ,+ë®j*¡·/'; + ]ŌpË)=¿Ô0∆öVÂmˇˆ„ø~¯ÃÔâˆb*fc»‡Îı„Ú}∆tÅ“s∂Y∫ÜaÆË™Xâˆ~<ÿ·Ù vé1‹p¿TD∆ÔîÄ“úhˆ*Ú€îe)K –p¨ÚJ3Ÿ∞ã>ÊuNê°“√Ü ‹Ê9iÙ0Ë™AAEà ˙`∂£\'ûce•åƒX›ŸÃ´1SK{qdá"tÃ[wQ#SµBe∞∑µó…ÃŒV`B"Ñ≥„!è_ÓÆ-º*ºú¿Ë0ˆeê∂´ë+HFj…‡zvHÓN|ÔL÷ûñ3õÜ$z%sá…pÎóV38âs Çoµ•ß3†<9B·¨û~¢3)ÂxóÿÃCÕòÆ ∫Ã=»ÿSÏ€S;∆~±êÆTEp∑óÈ÷ÀuìDHÈ $ÉõæÜjû§"≤ÃONM®RËíRr{õS âˆÃŠâ„¢op±W;ÂUÔ P∫kÔˇflTæ∑óflˆÆC©Ô[≥◊HÃ˚¨hê"ÆbF?ú%hË™ˇ4xèÕ(ó2ÙáíM])Ñd|=fë-cI0ñL¢kÖêk‰Rƒ«ıÄWñ8mO3âˆ&√æËX¯Hó—ì]yF2»–˜ádàà‡‹Çο„≥7mªHAS∑¶.;Å’x(1} _kd©.ï¬dç48M\'àáªCp^Krí<ɉXÓıïl!ÃŒ$N<ı∞B»G]…∂Ó¯>˛ÔbõÒπÀ•:ôO<j∂™œ%â×>@È$pÖu‹Ê´-QqV ?V≥JÆÃqÛX8(lπï@zgÖ}Fe<ˇ‡Sñ“ÿ˜ê?6‡L∫Oß~µ –?ËeäÚ®YîÕ =Ü=¢DÃu*GvBk;)L¬N«î:flö∂≠ÇΩq„Ñm하Ë∂‚"û≥§:±≤i^ΩÑ!)Wıyŧô á„RÄ÷Òôc’≠—sâ„¢rı‚Pdêãh˘ßHVç5ï¬ï¬ÃˆF€çÌÛuçÖ/M=gëµ±ÿGû1coÔuñæ‘z®. õ∑7ÉÃÜÆ,°’H†ÃÉÌ∂7e º® íˆâ„◊øNWKâ€Ã‚Yµ‚ñé;µ¶gV-fl>µtË¥áßN2 ¯¶BaP-)eW.àôt^âˆ1›C∑Ö?L„&â€5’4jvã–ªZ ÷+4% ´0l…»ú^°´© ûiÏ€∑é®óܱÒÿ‰ïˆÌ–dˆ◊Æ19rQ=Ã|ı•rMæ¬;ò‰Y‰é9.†‹ËV«ã¯âˆ,+ë®j*¡·/'; $model =& new AppModel(array('name' => 'BinaryTest', 'ds' => 'test_suite')); $model->save(compact('data')); @@ -671,5 +671,24 @@ function testAlterIndexes() { $this->db->query($this->db->dropSchema($schema1)); } + + /** + * Test it is possible to use virtual field with postgresql + */ + function testVirtualFields() { + $this->loadFixtures('Article', 'Comment'); + $Article =& ClassRegistry::init('Article'); + $Article->virtualFields = array( + 'next_id' => 'Article.id + 1', + 'complex' => 'Article.title || Article.body', + 'functional' => 'COALESCE(User.user, Article.title)', + 'subquery' => 'SELECT count(*) FROM ' . $Article->Comment->table + ); + $result = $Article->find('first'); + $this->assertEqual($result['Article']['next_id'], 2); + $this->assertEqual($result['Article']['complex'], $result['Article']['title'] . $result['Article']['body']); + $this->assertEqual($result['Article']['functional'], $result['Article']['title']); + $this->assertEqual($result['Article']['subquery'], 6); + } } ?> \ No newline at end of file From 220fba9bbabff998bb63c7b7c1bd09e91dcfd507 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 5 Mar 2010 21:30:58 -0500 Subject: [PATCH 1727/2083] Fixing inflection of parameters when using bake. Model, View, Controller, and Fixture tasks all accept either singular or plural forms of the table name. Fixes #425 --- cake/console/libs/tasks/controller.php | 2 +- cake/console/libs/tasks/fixture.php | 2 +- cake/console/libs/tasks/model.php | 2 +- cake/console/libs/tasks/view.php | 4 +- .../console/libs/tasks/controller.test.php | 54 ++++++++++++++++++- .../cases/console/libs/tasks/fixture.test.php | 31 +++++++++++ .../cases/console/libs/tasks/model.test.php | 26 +++++++++ .../cases/console/libs/tasks/view.test.php | 20 +++++++ 8 files changed, 135 insertions(+), 6 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index fa77d523e..a32f60bc3 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -70,7 +70,7 @@ function execute() { return $this->all(); } - $controller = Inflector::camelize($this->args[0]); + $controller = $this->_controllerName($this->args[0]); $actions = 'scaffold'; if (!empty($this->args[1]) && ($this->args[1] == 'public' || $this->args[1] == 'scaffold')) { diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 07621c52d..1d76f1a48 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -79,7 +79,7 @@ function execute() { if (strtolower($this->args[0]) == 'all') { return $this->all(); } - $model = Inflector::camelize($this->args[0]); + $model = $this->_modelName($this->args[0]); $this->bake($model); } } diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index f848fc3c4..cd0cf2821 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -88,7 +88,7 @@ function execute() { if (strtolower($this->args[0]) == 'all') { return $this->all(); } - $model = Inflector::camelize($this->args[0]); + $model = $this->_modelName($this->args[0]); $object = $this->_getModelObject($model); if ($this->bake($object, false)) { if ($this->_checkUnitTest()) { diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 81590ad72..6af3e7c5b 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -109,8 +109,8 @@ function execute() { $this->connection = 'default'; } $controller = $action = $alias = null; - $this->controllerName = Inflector::camelize($this->args[0]); - $this->controllerPath = Inflector::underscore($this->controllerName); + $this->controllerName = $this->_controllerName($this->args[0]); + $this->controllerPath = $this->_controllerPath($this->controllerName); $this->Project->interactive = false; if (strtolower($this->args[0]) == 'all') { diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index d94ebe5c8..13b45d7cb 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -326,7 +326,7 @@ function testBakeActionsUsingSessions() { $this->assertTrue(strpos($result, 'function add()') !== false); $this->assertTrue(strpos($result, 'if (!empty($this->data))') !== false); $this->assertTrue(strpos($result, 'if ($this->Article->save($this->data))') !== false); - $this->assertTrue(strpos($result, "\$this->Session->setFlash(sprintf(__('The %s has been saved', true), 'article'));") !== false); + $this->assertTrue(strpos($result, "\$this->Session->setFlash(sprintf(__('The %s has been saved', true), 'article'));") !== false); $this->assertTrue(strpos($result, 'function edit($id = null)') !== false); $this->assertTrue(strpos($result, "\$this->Session->setFlash(sprintf(__('The %s could not be saved. Please, try again.', true), 'article'));") !== false); @@ -474,6 +474,58 @@ function testExecuteWithController() { $this->Task->execute(); } +/** + * test that both plural and singular forms work for controller baking. + * + * @return void + * @access public + */ + function testExecuteWithControllerNameVariations() { + $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), + 'Execute with scaffold param requires no Article, Tag or Comment model to be defined. %s'); + if ($skip) { + return; + } + $this->Task->connection = 'test_suite'; + $this->Task->path = '/my/path/'; + $this->Task->args = array('Articles'); + + $filename = '/my/path/articles_controller.php'; + $this->Task->expectAt(0, 'createFile', array( + $filename, new PatternExpectation('/\$scaffold/') + )); + + $this->Task->execute(); + + $this->Task->args = array('Article'); + $filename = '/my/path/articles_controller.php'; + $this->Task->expectAt(1, 'createFile', array( + $filename, new PatternExpectation('/class ArticlesController/') + )); + $this->Task->execute(); + + $this->Task->args = array('article'); + $filename = '/my/path/articles_controller.php'; + $this->Task->expectAt(2, 'createFile', array( + $filename, new PatternExpectation('/class ArticlesController/') + )); + + $this->Task->args = array('articles'); + $filename = '/my/path/articles_controller.php'; + $this->Task->expectAt(3, 'createFile', array( + $filename, new PatternExpectation('/class ArticlesController/') + )); + $this->Task->execute(); + + $this->Task->args = array('Articles'); + $filename = '/my/path/articles_controller.php'; + $this->Task->expectAt(4, 'createFile', array( + $filename, new PatternExpectation('/class ArticlesController/') + )); + $this->Task->execute(); + $this->Task->execute(); + } + /** * test that `cake bake controller foo scaffold` works. * diff --git a/cake/tests/cases/console/libs/tasks/fixture.test.php b/cake/tests/cases/console/libs/tasks/fixture.test.php index 679388497..06698ab80 100644 --- a/cake/tests/cases/console/libs/tasks/fixture.test.php +++ b/cake/tests/cases/console/libs/tasks/fixture.test.php @@ -171,6 +171,37 @@ function testExecuteWithNamedModel() { $this->Task->execute(); } +/** + * test that execute passes runs bake depending with named model. + * + * @return void + * @access public + */ + function testExecuteWithNamedModelVariations() { + $this->Task->connection = 'test_suite'; + $this->Task->path = '/my/path/'; + + $this->Task->args = array('article'); + $filename = '/my/path/article_fixture.php'; + $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticleFixture/'))); + $this->Task->execute(); + + $this->Task->args = array('articles'); + $filename = '/my/path/article_fixture.php'; + $this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/class ArticleFixture/'))); + $this->Task->execute(); + + $this->Task->args = array('Articles'); + $filename = '/my/path/article_fixture.php'; + $this->Task->expectAt(2, 'createFile', array($filename, new PatternExpectation('/class ArticleFixture/'))); + $this->Task->execute(); + + $this->Task->args = array('Article'); + $filename = '/my/path/article_fixture.php'; + $this->Task->expectAt(3, 'createFile', array($filename, new PatternExpectation('/class ArticleFixture/'))); + $this->Task->execute(); + } + /** * test that execute runs all() when args[0] = all * diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index f4fef7882..40d96935f 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -715,6 +715,32 @@ function testExecuteWithNamedModel() { $this->assertEqual(count(ClassRegistry::mapKeys()), 0); } +/** + * test that execute passes with different inflections of the same name. + * + * @return void + * @access public + */ + function testExecuteWithNamedModelVariations() { + $this->Task->connection = 'test_suite'; + $this->Task->path = '/my/path/'; + $this->Task->setReturnValue('_checkUnitTest', 1); + + $this->Task->args = array('article'); + $filename = '/my/path/article.php'; + + $this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class Article extends AppModel/'))); + $this->Task->execute(); + + $this->Task->args = array('Articles'); + $this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/class Article extends AppModel/'))); + $this->Task->execute(); + + $this->Task->args = array('articles'); + $this->Task->expectAt(2, 'createFile', array($filename, new PatternExpectation('/class Article extends AppModel/'))); + $this->Task->execute(); + } + /** * test that execute with a model name picks up hasMany associations. * diff --git a/cake/tests/cases/console/libs/tasks/view.test.php b/cake/tests/cases/console/libs/tasks/view.test.php index a3632c3e1..7426805ed 100644 --- a/cake/tests/cases/console/libs/tasks/view.test.php +++ b/cake/tests/cases/console/libs/tasks/view.test.php @@ -504,6 +504,26 @@ function testExecuteWithController() { $this->Task->execute(); } +/** + * test that both plural and singular forms can be used for baking views. + * + * @return void + * @access public + */ + function testExecuteWithControllerVariations() { + $this->Task->args = array('ViewTaskComments'); + + $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'index.ctp', '*')); + $this->Task->expectAt(1, 'createFile', array(TMP . 'view_task_comments' . DS . 'add.ctp', '*')); + $this->Task->execute(); + + $this->Task->args = array('ViewTaskComment'); + + $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'index.ctp', '*')); + $this->Task->expectAt(1, 'createFile', array(TMP . 'view_task_comments' . DS . 'add.ctp', '*')); + $this->Task->execute(); + } + /** * test `cake bake view $controller -admin` * Which only bakes admin methods, not non-admin methods. From ba06b5b456b8b2d30c462f1e80cd54912d95a0f4 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 5 Mar 2010 21:37:28 -0500 Subject: [PATCH 1728/2083] Moving call to _getConnectionObjects() inside class_exists check. Removes errors when creating a connection with no DATABASE_CONFIG class. --- cake/libs/model/connection_manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/model/connection_manager.php b/cake/libs/model/connection_manager.php index a0c9174d3..50cfd24da 100644 --- a/cake/libs/model/connection_manager.php +++ b/cake/libs/model/connection_manager.php @@ -61,8 +61,8 @@ class ConnectionManager extends Object { function __construct() { if (class_exists('DATABASE_CONFIG')) { $this->config =& new DATABASE_CONFIG(); + $this->_getConnectionObjects(); } - $this->_getConnectionObjects(); } /** From af92276ba98ab06602b74fb6ec79d7220aefe922 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 5 Mar 2010 21:41:48 -0500 Subject: [PATCH 1729/2083] Adding missing reference operators to getInstance methods. --- cake/libs/cache.php | 4 ++-- cake/libs/controller/controller.php | 2 +- cake/tests/cases/dispatcher.test.php | 2 +- cake/tests/cases/libs/debugger.test.php | 8 ++++---- cake/tests/lib/code_coverage_manager.php | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cake/libs/cache.php b/cake/libs/cache.php index 972c93f0e..b8d26c4eb 100644 --- a/cake/libs/cache.php +++ b/cake/libs/cache.php @@ -163,7 +163,7 @@ function _buildEngine($name) { * @return array Array of configured Cache config names. */ function configured() { - $self = Cache::getInstance(); + $self =& Cache::getInstance(); return array_keys($self->__config); } @@ -176,7 +176,7 @@ function configured() { * @return boolen success of the removal, returns false when the config does not exist. */ function drop($name) { - $self = Cache::getInstance(); + $self =& Cache::getInstance(); if (!isset($self->__config[$name])) { return false; } diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 973064337..529eacf0c 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -653,7 +653,7 @@ function loadModel($modelClass = null, $id = null) { if ($this->persistModel === true) { $this->_persist($modelClass, true, $this->{$modelClass}); - $registry = ClassRegistry::getInstance(); + $registry =& ClassRegistry::getInstance(); $this->_persist($modelClass . 'registry', true, $registry->__objects, 'registry'); } } else { diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index 98e59a9ec..c737d0e53 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -1843,7 +1843,7 @@ function testChangingParamsFromBeforeFilter() { */ function testAssets() { Router::reload(); - $Configure = Configure::getInstance(); + $Configure =& Configure::getInstance(); $Configure->__objects = null; App::build(array( diff --git a/cake/tests/cases/libs/debugger.test.php b/cake/tests/cases/libs/debugger.test.php index c9628ed62..2b6ce2e4f 100644 --- a/cake/tests/cases/libs/debugger.test.php +++ b/cake/tests/cases/libs/debugger.test.php @@ -321,16 +321,16 @@ function testDump() { * @return void */ function testGetInstance() { - $result = Debugger::getInstance(); + $result =& Debugger::getInstance(); $this->assertIsA($result, 'Debugger'); - $result = Debugger::getInstance('DebuggerTestCaseDebugger'); + $result =& Debugger::getInstance('DebuggerTestCaseDebugger'); $this->assertIsA($result, 'DebuggerTestCaseDebugger'); - $result = Debugger::getInstance(); + $result =& Debugger::getInstance(); $this->assertIsA($result, 'DebuggerTestCaseDebugger'); - $result = Debugger::getInstance('Debugger'); + $result =& Debugger::getInstance('Debugger'); $this->assertIsA($result, 'Debugger'); } } diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index 8f4d69311..3b2827ae7 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -588,7 +588,7 @@ function __testObjectFilesFromGroupFile($groupFile, $isApp = true) { */ function __getExecutableLines($content) { if (is_array($content)) { - $manager = CodeCoverageManager::getInstance(); + $manager =& CodeCoverageManager::getInstance(); $result = array(); foreach ($content as $file) { $result[$file] = $manager->__getExecutableLines(file_get_contents($file)); From 3affec58c6fa40e40a40cfe3b515d2b9deaa85f5 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck <dieter@kangaroot.net> Date: Tue, 23 Feb 2010 16:05:30 +0100 Subject: [PATCH 1730/2083] move information about return value to the correct place in the doc block of Model::saveAll() Signed-off-by: Mark Story <mark@mark-story.com> --- cake/libs/model/model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index e4d086aa4..b23bcddd7 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1557,14 +1557,14 @@ function _prepareUpdateFields($data) { * validate the records, but not save them. * - atomic: If true (default), will attempt to save all records in a single transaction. * Should be set to false if database/table does not support transactions. - * If false, we return an array similar to the $data array passed, but values are set to true/false - * depending on whether each record saved successfully. * - fieldList: Equivalent to the $fieldList parameter in Model::save() * * @param array $data Record data to save. This can be either a numerically-indexed array (for saving multiple * records of the same type), or an array indexed by association name. * @param array $options Options to use when saving record data, See $options above. - * @return mixed True on success, or false on failure + * @return mixed If atomic: True on success, or false on failure. + * Otherwise: array similar to the $data array passed, but values are set to true/false + * depending on whether each record saved successfully. * @access public * @link http://book.cakephp.org/view/84/Saving-Related-Model-Data-hasOne-hasMany-belongsTo * @link http://book.cakephp.org/view/75/Saving-Your-Data From 1ae922cea1406a6c1a790621d3b86b98cbac1e1a Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 5 Mar 2010 22:06:20 -0500 Subject: [PATCH 1731/2083] Fixing missing reference operators in test cases. --- cake/tests/cases/libs/model/connection_manager.test.php | 2 +- cake/tests/cases/libs/router.test.php | 2 +- cake/tests/cases/libs/security.test.php | 2 +- cake/tests/cases/libs/xml.test.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cake/tests/cases/libs/model/connection_manager.test.php b/cake/tests/cases/libs/model/connection_manager.test.php index a4336a28a..c13b58f50 100644 --- a/cake/tests/cases/libs/model/connection_manager.test.php +++ b/cake/tests/cases/libs/model/connection_manager.test.php @@ -34,7 +34,7 @@ class ConnectionManagerTest extends CakeTestCase { * @return void */ function setUp() { - $this->ConnectionManager = ConnectionManager::getInstance(); + $this->ConnectionManager =& ConnectionManager::getInstance(); } /** diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 274ce242c..99b549cfc 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -1159,7 +1159,7 @@ function testPrefixRoutingAndPlugins() { * @return void */ function testExtensionParsingSetting() { - $router = Router::getInstance(); + $router =& Router::getInstance(); $this->assertFalse($this->router->__parseExtensions); $router->parseExtensions(); diff --git a/cake/tests/cases/libs/security.test.php b/cake/tests/cases/libs/security.test.php index 96e9517d0..fb8d30478 100644 --- a/cake/tests/cases/libs/security.test.php +++ b/cake/tests/cases/libs/security.test.php @@ -90,7 +90,7 @@ function testValidateAuthKey() { * @return void */ function testHash() { - $Security = Security::getInstance(); + $Security =& Security::getInstance(); $_hashType = $Security->hashType; $key = 'someKey'; diff --git a/cake/tests/cases/libs/xml.test.php b/cake/tests/cases/libs/xml.test.php index 43ccf17a9..435d5b341 100644 --- a/cake/tests/cases/libs/xml.test.php +++ b/cake/tests/cases/libs/xml.test.php @@ -932,7 +932,7 @@ function testNamespaces() { $expects = '<a:container xmlns:a="http://example.com/a" xmlns:b="http://example.com/b" xmlns:c="http://example.com/c" xmlns:d="http://example.com/d" xmlns:e="http://example.com/e" xmlns:f="http://example.com/f"><b:rule test=""><c:result>value</c:result></b:rule><d:rule test=""><e:result>value</e:result></d:rule></a:container>'; - $_xml = XmlManager::getInstance(); + $_xml =& XmlManager::getInstance(); $xml->addNamespace('f', 'http://example.com/f'); $result = $xml->toString(array('cdata' => false)); $this->assertEqual($expects, $result); From 63fcd225acc30db5db7369cf69dcbf2fd64e32e3 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 5 Mar 2010 22:07:39 -0500 Subject: [PATCH 1732/2083] Fixing doc block @link tags in Model class. --- cake/libs/model/model.php | 99 ++++++++++++++++++++------------------- 1 file changed, 51 insertions(+), 48 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index b23bcddd7..f38cf39b0 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -50,7 +50,7 @@ class Model extends Overloadable { * * @var string * @access public - * @link http://book.cakephp.org/view/435/useDbConfig + * @link http://book.cakephp.org/view/1057/Model-Attributes#useDbConfig-1058 */ var $useDbConfig = 'default'; @@ -59,7 +59,7 @@ class Model extends Overloadable { * * @var string * @access public - * @link http://book.cakephp.org/view/436/useTable + * @link http://book.cakephp.org/view/1057/Model-Attributes#useTable-1059 */ var $useTable = null; @@ -68,7 +68,7 @@ class Model extends Overloadable { * * @var string * @access public - * @link http://book.cakephp.org/view/438/displayField + * @link http://book.cakephp.org/view/1057/Model-Attributes#displayField-1062 */ var $displayField = null; @@ -86,7 +86,7 @@ class Model extends Overloadable { * * @var array * @access public - * @link http://book.cakephp.org/view/441/data + * @link http://book.cakephp.org/view/1057/Model-Attributes#data-1065 */ var $data = array(); @@ -103,7 +103,7 @@ class Model extends Overloadable { * * @var string * @access public - * @link http://book.cakephp.org/view/437/primaryKey + * @link http://book.cakephp.org/view/1057/Model-Attributes#primaryKey-1061 */ var $primaryKey = null; @@ -112,7 +112,7 @@ class Model extends Overloadable { * * @var array * @access protected - * @link http://book.cakephp.org/view/442/_schema + * @link http://book.cakephp.org/view/1057/Model-Attributes#_schema-1066 */ var $_schema = null; @@ -122,8 +122,8 @@ class Model extends Overloadable { * * @var array * @access public - * @link http://book.cakephp.org/view/443/validate - * @link http://book.cakephp.org/view/125/Data-Validation + * @link http://book.cakephp.org/view/1057/Model-Attributes#validate-1067 + * @link http://book.cakephp.org/view/1143/Data-Validation */ var $validate = array(); @@ -132,7 +132,7 @@ class Model extends Overloadable { * * @var array * @access public - * @link http://book.cakephp.org/view/410/Validating-Data-from-the-Controller + * @link http://book.cakephp.org/view/1182/Validating-Data-from-the-Controller */ var $validationErrors = array(); @@ -141,7 +141,7 @@ class Model extends Overloadable { * * @var string * @access public - * @link http://book.cakephp.org/view/475/tablePrefix + * @link http://book.cakephp.org/view/1057/Model-Attributes#tablePrefix-1060 */ var $tablePrefix = null; @@ -150,7 +150,7 @@ class Model extends Overloadable { * * @var string * @access public - * @link http://book.cakephp.org/view/444/name + * @link http://book.cakephp.org/view/1057/Model-Attributes#name-1068 */ var $name = null; @@ -192,7 +192,7 @@ class Model extends Overloadable { * * @var boolean * @access public - * @link http://book.cakephp.org/view/445/cacheQueries + * @link http://book.cakephp.org/view/1057/Model-Attributes#cacheQueries-1069 */ var $cacheQueries = false; @@ -201,7 +201,7 @@ class Model extends Overloadable { * * @var array * @access public - * @link http://book.cakephp.org/view/81/belongsTo + * @link http://book.cakephp.org/view/1042/belongsTo */ var $belongsTo = array(); @@ -210,7 +210,7 @@ class Model extends Overloadable { * * @var array * @access public - * @link http://book.cakephp.org/view/80/hasOne + * @link http://book.cakephp.org/view/1041/hasOne */ var $hasOne = array(); @@ -219,7 +219,7 @@ class Model extends Overloadable { * * @var array * @access public - * @link http://book.cakephp.org/view/82/hasMany + * @link http://book.cakephp.org/view/1043/hasMany */ var $hasMany = array(); @@ -228,7 +228,7 @@ class Model extends Overloadable { * * @var array * @access public - * @link http://book.cakephp.org/view/83/hasAndBelongsToMany-HABTM + * @link http://book.cakephp.org/view/1044/hasAndBelongsToMany-HABTM */ var $hasAndBelongsToMany = array(); @@ -240,7 +240,7 @@ class Model extends Overloadable { * * @var array * @access public - * @link http://book.cakephp.org/view/90/Using-Behaviors + * @link http://book.cakephp.org/view/1072/Using-Behaviors */ var $actsAs = null; @@ -282,7 +282,7 @@ class Model extends Overloadable { * * @var integer * @access public - * @link http://book.cakephp.org/view/439/recursive + * @link http://book.cakephp.org/view/1057/Model-Attributes#recursive-1063 */ var $recursive = 1; @@ -294,7 +294,7 @@ class Model extends Overloadable { * * @var string * @access public - * @link http://book.cakephp.org/view/440/order + * @link http://book.cakephp.org/view/1057/Model-Attributes#order-1064 */ var $order = null; @@ -531,7 +531,7 @@ function call__($method, $params) { * @param boolean $reset Set to false to make the binding permanent * @return boolean Success * @access public - * @link http://book.cakephp.org/view/86/Creating-and-Destroying-Associations-on-the-Fly + * @link http://book.cakephp.org/view/1045/Creating-and-Destroying-Associations-on-the-Fly */ function bindModel($params, $reset = true) { foreach ($params as $assoc => $model) { @@ -570,7 +570,7 @@ function bindModel($params, $reset = true) { * @param boolean $reset Set to false to make the unbinding permanent * @return boolean Success * @access public - * @link http://book.cakephp.org/view/86/Creating-and-Destroying-Associations-on-the-Fly + * @link http://book.cakephp.org/view/1045/Creating-and-Destroying-Associations-on-the-Fly */ function unbindModel($params, $reset = true) { foreach ($params as $assoc => $models) { @@ -795,6 +795,7 @@ function setSource($tableName) { * @param string $two Value string for the alternative indata method * @return array Data with all of $one's keys and values * @access public + * @link http://book.cakephp.org/view/1031/Saving-Your-Data */ function set($one, $two = null) { if (!$one) { @@ -1076,7 +1077,7 @@ function getVirtualField($field = null) { * @param boolean $filterKey If true, overwrites any primary key input with an empty value * @return array The current Model::data; after merging $data and/or defaults from database * @access public - * @link http://book.cakephp.org/view/75/Saving-Your-Data + * @link http://book.cakephp.org/view/1031/Saving-Your-Data */ function create($data = array(), $filterKey = false) { $defaults = array(); @@ -1107,6 +1108,7 @@ function create($data = array(), $filterKey = false) { * @param mixed $id The ID of the record to read * @return array Array of database fields, or false if not found * @access public + * @link http://book.cakephp.org/view/1017/Retrieving-Your-Data#read-1029 */ function read($fields = null, $id = null) { $this->validationErrors = array(); @@ -1141,7 +1143,7 @@ function read($fields = null, $id = null) { * @param string $order SQL ORDER BY fragment * @return string field contents, or false if not found * @access public - * @link http://book.cakephp.org/view/453/field + * @link http://book.cakephp.org/view/1017/Retrieving-Your-Data#field-1028 */ function field($name, $conditions = null, $order = null) { if ($conditions === null && $this->id !== false) { @@ -1182,7 +1184,7 @@ function field($name, $conditions = null, $order = null) { * @return boolean See Model::save() * @access public * @see Model::save() - * @link http://book.cakephp.org/view/75/Saving-Your-Data + * @link http://book.cakephp.org/view/1031/Saving-Your-Data */ function saveField($name, $value, $validate = false) { $id = $this->id; @@ -1207,7 +1209,7 @@ function saveField($name, $value, $validate = false) { * @param array $fieldList List of fields to allow to be written * @return mixed On success Model::$data if its not empty or true, false on failure * @access public - * @link http://book.cakephp.org/view/75/Saving-Your-Data + * @link http://book.cakephp.org/view/1031/Saving-Your-Data */ function save($data = null, $validate = true, $fieldList = array()) { $defaults = array('validate' => true, 'fieldList' => array(), 'callbacks' => true); @@ -1523,7 +1525,7 @@ function updateCounterCache($keys = array(), $created = false) { * * @param array $data The fields of the record that will be updated * @return array Returns updated foreign key values, along with an 'old' key containing the old - * values, or empty if no foreign keys are updated. + * values, or empty if no foreign keys are updated. * @access protected */ function _prepareUpdateFields($data) { @@ -1563,11 +1565,11 @@ function _prepareUpdateFields($data) { * records of the same type), or an array indexed by association name. * @param array $options Options to use when saving record data, See $options above. * @return mixed If atomic: True on success, or false on failure. - * Otherwise: array similar to the $data array passed, but values are set to true/false - * depending on whether each record saved successfully. + * Otherwise: array similar to the $data array passed, but values are set to true/false + * depending on whether each record saved successfully. * @access public - * @link http://book.cakephp.org/view/84/Saving-Related-Model-Data-hasOne-hasMany-belongsTo - * @link http://book.cakephp.org/view/75/Saving-Your-Data + * @link http://book.cakephp.org/view/1032/Saving-Related-Model-Data-hasOne-hasMany-belongsTo + * @link http://book.cakephp.org/view/1031/Saving-Your-Data */ function saveAll($data = null, $options = array()) { if (empty($data)) { @@ -1764,7 +1766,7 @@ function __save($data, $options) { * @param mixed $conditions Conditions to match, true for all records * @return boolean True on success, false on failure * @access public - * @link http://book.cakephp.org/view/75/Saving-Your-Data + * @link http://book.cakephp.org/view/1031/Saving-Your-Data */ function updateAll($fields, $conditions = true) { $db =& ConnectionManager::getDataSource($this->useDbConfig); @@ -1778,7 +1780,7 @@ function updateAll($fields, $conditions = true) { * @param boolean $cascade Set to true to delete records that depend on this record * @return boolean True on success * @access public - * @link http://book.cakephp.org/view/690/del + * @link http://book.cakephp.org/view/1036/delete */ function delete($id = null, $cascade = true) { if (!empty($id)) { @@ -1890,7 +1892,7 @@ function _deleteLinks($id) { * @param boolean $callbacks Run callbacks (not being used) * @return boolean True on success, false on failure * @access public - * @link http://book.cakephp.org/view/692/deleteAll + * @link http://book.cakephp.org/view/1038/deleteAll */ function deleteAll($conditions, $cascade = true, $callbacks = false) { if (empty($conditions)) { @@ -2014,7 +2016,7 @@ function hasAny($conditions = null) { * @param integer $recursive The number of levels deep to fetch associated records * @return array Array of records * @access public - * @link http://book.cakephp.org/view/449/find + * @link http://book.cakephp.org/view/1018/find */ function find($conditions = null, $fields = array(), $order = null, $recursive = null) { if (!is_string($conditions) || (is_string($conditions) && !array_key_exists($conditions, $this->_findMethods))) { @@ -2405,7 +2407,7 @@ function isUnique($fields, $or = true) { * @param string $sql SQL statement * @return array Resultset * @access public - * @link http://book.cakephp.org/view/456/query + * @link http://book.cakephp.org/view/1027/query */ function query() { $params = func_get_args(); @@ -2422,7 +2424,7 @@ function query() { * @param string $options An optional array of custom options to be made available in the beforeValidate callback * @return boolean True if there are no errors * @access public - * @link http://book.cakephp.org/view/410/Validating-Data-from-the-Controller + * @link http://book.cakephp.org/view/1182/Validating-Data-from-the-Controller */ function validates($options = array()) { $errors = $this->invalidFields($options); @@ -2442,7 +2444,7 @@ function validates($options = array()) { * @return array Array of invalid fields * @see Model::validates() * @access public - * @link http://book.cakephp.org/view/410/Validating-Data-from-the-Controller + * @link http://book.cakephp.org/view/1182/Validating-Data-from-the-Controller */ function invalidFields($options = array()) { if ( @@ -2632,7 +2634,7 @@ function __validateWithModels($options) { * * @param string $field The name of the field to invalidate * @param mixed $value Name of validation rule that was not failed, or validation message to - * be returned. If no validation key is provided, defaults to true. + * be returned. If no validation key is provided, defaults to true. * @access public */ function invalidate($field, $value = true) { @@ -2660,7 +2662,8 @@ function isForeignKey($field) { } /** - * Escapes the field name and prepends the model name. Escaping is done according to the current database driver's rules. + * Escapes the field name and prepends the model name. Escaping is done according to the + * current database driver's rules. * * @param string $field Field to escape (e.g: id) * @param string $alias Alias for the model (e.g: Post) @@ -2882,7 +2885,7 @@ function joinModel($assoc, $keys = array()) { * @return mixed true if the operation should continue, false if it should abort; or, modified * $queryData to continue with new $queryData * @access public - * @link http://book.cakephp.org/view/680/beforeFind + * @link http://book.cakephp.org/view/1048/Callback-Methods#beforeFind-1049 */ function beforeFind($queryData) { return true; @@ -2896,7 +2899,7 @@ function beforeFind($queryData) { * @param boolean $primary Whether this model is being queried directly (vs. being queried as an association) * @return mixed Result of the find operation * @access public - * @link http://book.cakephp.org/view/681/afterFind + * @link http://book.cakephp.org/view/1048/Callback-Methods#afterFind-1050 */ function afterFind($results, $primary = false) { return $results; @@ -2908,7 +2911,7 @@ function afterFind($results, $primary = false) { * * @return boolean True if the operation should continue, false if it should abort * @access public - * @link http://book.cakephp.org/view/683/beforeSave + * @link http://book.cakephp.org/view/1048/Callback-Methods#beforeSave-1052 */ function beforeSave($options = array()) { return true; @@ -2919,7 +2922,7 @@ function beforeSave($options = array()) { * * @param boolean $created True if this save created a new record * @access public - * @link http://book.cakephp.org/view/684/afterSave + * @link http://book.cakephp.org/view/1048/Callback-Methods#afterSave-1053 */ function afterSave($created) { } @@ -2930,7 +2933,7 @@ function afterSave($created) { * @param boolean $cascade If true records that depend on this record will also be deleted * @return boolean True if the operation should continue, false if it should abort * @access public - * @link http://book.cakephp.org/view/685/beforeDelete + * @link http://book.cakephp.org/view/1048/Callback-Methods#beforeDelete-1054 */ function beforeDelete($cascade = true) { return true; @@ -2940,7 +2943,7 @@ function beforeDelete($cascade = true) { * Called after every deletion operation. * * @access public - * @link http://book.cakephp.org/view/686/afterDelete + * @link http://book.cakephp.org/view/1048/Callback-Methods#afterDelete-1055 */ function afterDelete() { } @@ -2952,7 +2955,7 @@ function afterDelete() { * @return boolean True if validate operation should continue, false to abort * @param $options array Options passed from model::save(), see $options of model::save(). * @access public - * @link http://book.cakephp.org/view/682/beforeValidate + * @link http://book.cakephp.org/view/1048/Callback-Methods#beforeValidate-1051 */ function beforeValidate($options = array()) { return true; @@ -2962,7 +2965,7 @@ function beforeValidate($options = array()) { * Called when a DataSource-level error occurs. * * @access public - * @link http://book.cakephp.org/view/687/onError + * @link http://book.cakephp.org/view/1048/Callback-Methods#onError-1056 */ function onError() { } @@ -2971,7 +2974,7 @@ function onError() { * Private method. Clears cache for this model. * * @param string $type If null this deletes cached views if Cache.check is true - * Will be used to allow deleting query cache also + * Will be used to allow deleting query cache also * @return boolean true on delete * @access protected * @todo From 8216f5010ce338e251c77e70eeecd1cf707f2531 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 6 Mar 2010 10:46:26 -0500 Subject: [PATCH 1733/2083] Fixing @see tags in JsEngines --- cake/libs/view/helpers/jquery_engine.php | 11 ++++++----- cake/libs/view/helpers/mootools_engine.php | 8 ++++---- cake/libs/view/helpers/prototype_engine.php | 10 +++++----- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/cake/libs/view/helpers/jquery_engine.php b/cake/libs/view/helpers/jquery_engine.php index c16c08745..ea14fb8f1 100644 --- a/cake/libs/view/helpers/jquery_engine.php +++ b/cake/libs/view/helpers/jquery_engine.php @@ -245,6 +245,7 @@ function effect($name, $options = array()) { * @param array $options See JsHelper::request() for options. * @return string The completed ajax call. * @access public + * @see JsBaseEngineHelper::request() for options list. */ function request($url, $options = array()) { $url = $this->url($url); @@ -282,7 +283,7 @@ function request($url, $options = array()) { * @param array $options Array of options for the sortable. * @return string Completed sortable script. * @access public - * @see JsHelper::sortable() for options list. + * @see JsBaseEngineHelper::sortable() for options list. */ function sortable($options = array()) { $template = '%s.sortable({%s});'; @@ -297,7 +298,7 @@ function sortable($options = array()) { * @param array $options Array of options for the draggable element. * @return string Completed Draggable script. * @access public - * @see JsHelper::drag() for options list. + * @see JsBaseEngineHelper::drag() for options list. */ function drag($options = array()) { $template = '%s.draggable({%s});'; @@ -312,7 +313,7 @@ function drag($options = array()) { * @param array $options Array of options for the droppable element. * @return string Completed Droppable script. * @access public - * @see JsHelper::drop() for options list. + * @see JsBaseEngineHelper::drop() for options list. */ function drop($options = array()) { $template = '%s.droppable({%s});'; @@ -327,7 +328,7 @@ function drop($options = array()) { * @param array $options Array of options for the droppable element. * @return string Completed Slider script. * @access public - * @see JsHelper::slider() for options list. + * @see JsBaseEngineHelper::slider() for options list. */ function slider($options = array()) { $callbacks = array('start', 'change', 'slide', 'stop'); @@ -342,7 +343,7 @@ function slider($options = array()) { * @param array $options Options for the serialization * @return string completed form serialization script. * @access public - * @see JsHelper::serializeForm() for option list. + * @see JsBaseEngineHelper::serializeForm() for option list. */ function serializeForm($options = array()) { $options = array_merge(array('isForm' => false, 'inline' => false), $options); diff --git a/cake/libs/view/helpers/mootools_engine.php b/cake/libs/view/helpers/mootools_engine.php index 7fe26e33b..4a67cc98b 100644 --- a/cake/libs/view/helpers/mootools_engine.php +++ b/cake/libs/view/helpers/mootools_engine.php @@ -269,7 +269,7 @@ function request($url, $options = array()) { * * @param array $options Array of options for the sortable. * @return string Completed sortable script. - * @see JsHelper::sortable() for options list. + * @see JsBaseEngineHelper::sortable() for options list. */ function sortable($options = array()) { $options = $this->_processOptions('sortable', $options); @@ -302,7 +302,7 @@ function drag($options = array()) { * * @param array $options Array of options for the droppable. * @return string Completed droppable script. - * @see JsHelper::drop() for options list. + * @see JsBaseEngineHelper::drop() for options list. */ function drop($options = array()) { if (empty($options['drag'])) { @@ -332,7 +332,7 @@ function drop($options = array()) { * * @param array $options Array of options for the slider. * @return string Completed slider script. - * @see JsHelper::slider() for options list. + * @see JsBaseEngineHelper::slider() for options list. */ function slider($options = array()) { $slider = $this->selection; @@ -357,7 +357,7 @@ function slider($options = array()) { * * @param array $options Array of options. * @return string Completed serializeForm() snippet - * @see JsHelper::serializeForm() + * @see JsBaseEngineHelper::serializeForm() */ function serializeForm($options = array()) { $options = array_merge(array('isForm' => false, 'inline' => false), $options); diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php index 3f6ffb409..b838afaca 100644 --- a/cake/libs/view/helpers/prototype_engine.php +++ b/cake/libs/view/helpers/prototype_engine.php @@ -265,7 +265,7 @@ function request($url, $options = array()) { * @param array $options Array of options for the sortable. * @return string Completed sortable script. * @access public - * @see JsHelper::sortable() for options list. + * @see JsBaseEngineHelper::sortable() for options list. */ function sortable($options = array()) { $options = $this->_processOptions('sortable', $options); @@ -283,7 +283,7 @@ function sortable($options = array()) { * @param array $options Array of options for the draggable. * @return string Completed draggable script. * @access public - * @see JsHelper::draggable() for options list. + * @see JsBaseEngineHelper::draggable() for options list. */ function drag($options = array()) { $options = $this->_processOptions('drag', $options); @@ -304,7 +304,7 @@ function drag($options = array()) { * @param array $options Array of options for the droppable. * @return string Completed droppable script. * @access public - * @see JsHelper::droppable() for options list. + * @see JsBaseEngineHelper::droppable() for options list. */ function drop($options = array()) { $options = $this->_processOptions('drop', $options); @@ -322,7 +322,7 @@ function drop($options = array()) { * @param array $options Array of options for the slider. * @return string Completed slider script. * @access public - * @see JsHelper::slider() for options list. + * @see JsBaseEngineHelper::slider() for options list. */ function slider($options = array()) { $slider = $this->selection; @@ -348,7 +348,7 @@ function slider($options = array()) { * @param array $options Array of options. * @return string Completed serializeForm() snippet * @access public - * @see JsHelper::serializeForm() + * @see JsBaseEngineHelper::serializeForm() */ function serializeForm($options = array()) { $options = array_merge(array('isForm' => false, 'inline' => false), $options); From 12edc75a4f9b8487764ce622a20926c7d79c334c Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 7 Mar 2010 17:14:13 -0500 Subject: [PATCH 1734/2083] Moving output below check for a single prefix. --- cake/console/libs/tasks/project.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php index b894716f5..2c6e701d2 100644 --- a/cake/console/libs/tasks/project.php +++ b/cake/console/libs/tasks/project.php @@ -314,13 +314,13 @@ function getPrefix() { $admin = ''; $prefixes = Configure::read('Routing.prefixes'); if (!empty($prefixes)) { + if (count($prefixes) == 1) { + return $prefixes[0] . '_'; + } if ($this->interactive) { $this->out(); $this->out(__('You have more than one routing prefix configured', true)); } - if (count($prefixes) == 1) { - return $prefixes[0] . '_'; - } $options = array(); foreach ($prefixes as $i => $prefix) { $options[] = $i + 1; From bfbf31e234ffc09725773fb8f235599c42d81766 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 7 Mar 2010 17:14:40 -0500 Subject: [PATCH 1735/2083] Making check for 'add' prefix insensitive. Fixes #434 --- cake/console/templates/default/views/form.ctp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cake/console/templates/default/views/form.ctp b/cake/console/templates/default/views/form.ctp index 1f445f2a3..218290ecf 100644 --- a/cake/console/templates/default/views/form.ctp +++ b/cake/console/templates/default/views/form.ctp @@ -45,7 +45,8 @@ <div class="actions"> <h3><?php echo "<?php __('Actions'); ?>"; ?></h3> <ul> -<?php if ($action != 'add'):?> + +<?php if (strpos($action, 'add') === false): ?> <li><?php echo "<?php echo \$this->Html->link(__('Delete', true), array('action' => 'delete', \$this->Form->value('{$modelClass}.{$primaryKey}')), null, sprintf(__('Are you sure you want to delete # %s?', true), \$this->Form->value('{$modelClass}.{$primaryKey}'))); ?>";?></li> <?php endif;?> <li><?php echo "<?php echo \$this->Html->link(sprintf(__('List %s', true), __('{$pluralHumanName}', true)), array('action' => 'index'));?>";?></li> From e6664f0ea415ec67f5c4e869fec3fc1b6eddd493 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 7 Mar 2010 19:02:19 -0500 Subject: [PATCH 1736/2083] Fixing SQL errors when running model_behavior tests with postgresql. Fixes #406 --- cake/tests/cases/libs/model/model_behavior.test.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cake/tests/cases/libs/model/model_behavior.test.php b/cake/tests/cases/libs/model/model_behavior.test.php index bbfa6215e..95daf2ddb 100644 --- a/cake/tests/cases/libs/model/model_behavior.test.php +++ b/cake/tests/cases/libs/model/model_behavior.test.php @@ -786,16 +786,16 @@ function testBehaviorBelongsToFindCallbacks() { 'Apple' => array('id' => 3), 'Parent' => array('id' => 2,'name' => 'Bright Red Apple', 'mytime' => '22:57:17')) ); - $result = $Apple->find('all', array('fields' => array('Apple.id', 'Parent.*'), 'conditions' => array('Apple.id <' => '4'))); - //$this->assertEqual($result, $expected2); + $result = $Apple->find('all', array( + 'fields' => array('Apple.id', 'Parent.id', 'Parent.name', 'Parent.mytime'), + 'conditions' => array('Apple.id <' => '4') + )); + $this->assertEqual($result, $expected2); $Apple->Parent->Behaviors->disable('Test'); $result = $Apple->find('all'); $this->assertEqual($result, $expected); - $Apple->Parent->Behaviors->attach('Test', array('before' => 'off', 'after' => 'on')); - //$this->assertIdentical($Apple->find('all'), array()); - $Apple->Parent->Behaviors->attach('Test', array('after' => 'off')); $this->assertEqual($Apple->find('all'), $expected); From 7334fdfbdfd4d7978c3eeaea583bf8266a16e443 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Tue, 9 Mar 2010 12:26:25 +1100 Subject: [PATCH 1737/2083] Fixing escaping of forward slash for JS Engines. --- cake/libs/view/helpers/js.php | 15 +++++++-------- .../libs/view/helpers/jquery_engine.test.php | 12 ++++++------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 6f47374f9..016d90d0e 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -676,24 +676,23 @@ function _utf8ToHex($string) { for ($i = 0; $i < $length; ++$i) { $ord = ord($string{$i}); switch (true) { - case $ord == 0x08: + case $ord == 0x08: // Backspace $return .= '\b'; break; - case $ord == 0x09: + case $ord == 0x09: // Tab $return .= '\t'; break; - case $ord == 0x0A: + case $ord == 0x0A: // New Line $return .= '\n'; break; - case $ord == 0x0C: + case $ord == 0x0C: // New Page $return .= '\f'; break; - case $ord == 0x0D: + case $ord == 0x0D: // Carriage Return $return .= '\r'; break; - case $ord == 0x22: - case $ord == 0x2F: - case $ord == 0x5C: + case $ord == 0x22: // Character: " + case $ord == 0x5C: // Character: \ $return .= '\\' . $string{$i}; break; case (($ord >= 0x20) && ($ord <= 0x7F)): diff --git a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php index 1a2ba66c6..bb89f541d 100644 --- a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php @@ -156,13 +156,13 @@ function testEffect() { */ function testRequest() { $result = $this->Jquery->request(array('controller' => 'posts', 'action' => 'view', 1)); - $expected = '$.ajax({url:"\\/posts\\/view\\/1"});'; + $expected = '$.ajax({url:"/posts/view/1"});'; $this->assertEqual($result, $expected); $result = $this->Jquery->request(array('controller' => 'posts', 'action' => 'view', 1), array( 'update' => '#content' )); - $expected = '$.ajax({dataType:"html", success:function (data, textStatus) {$("#content").html(data);}, url:"\/posts\/view\/1"});'; + $expected = '$.ajax({dataType:"html", success:function (data, textStatus) {$("#content").html(data);}, url:"/posts/view/1"});'; $this->assertEqual($result, $expected); $result = $this->Jquery->request('/people/edit/1', array( @@ -175,7 +175,7 @@ function testRequest() { 'data' => array('name' => 'jim', 'height' => '185cm'), 'wrapCallbacks' => false )); - $expected = '$.ajax({beforeSend:doBefore, complete:doComplete, data:"name=jim&height=185cm", dataType:"json", error:handleError, success:doSuccess, type:"post", url:"\\/people\\/edit\\/1"});'; + $expected = '$.ajax({beforeSend:doBefore, complete:doComplete, data:"name=jim&height=185cm", dataType:"json", error:handleError, success:doSuccess, type:"post", url:"/people/edit/1"});'; $this->assertEqual($result, $expected); $result = $this->Jquery->request('/people/edit/1', array( @@ -184,7 +184,7 @@ function testRequest() { 'method' => 'post', 'wrapCallbacks' => false )); - $expected = '$.ajax({dataType:"html", success:function (data, textStatus) {$("#updated").html(data);}, type:"post", url:"\\/people\\/edit\\/1"});'; + $expected = '$.ajax({dataType:"html", success:function (data, textStatus) {$("#updated").html(data);}, type:"post", url:"/people/edit/1"});'; $this->assertEqual($result, $expected); $result = $this->Jquery->request('/people/edit/1', array( @@ -195,7 +195,7 @@ function testRequest() { 'data' => '$("#someId").serialize()', 'wrapCallbacks' => false )); - $expected = '$.ajax({data:$("#someId").serialize(), dataType:"html", success:function (data, textStatus) {$("#updated").html(data);}, type:"post", url:"\\/people\\/edit\\/1"});'; + $expected = '$.ajax({data:$("#someId").serialize(), dataType:"html", success:function (data, textStatus) {$("#updated").html(data);}, type:"post", url:"/people/edit/1"});'; $this->assertEqual($result, $expected); $result = $this->Jquery->request('/people/edit/1', array( @@ -205,7 +205,7 @@ function testRequest() { 'dataExpression' => true, 'data' => '$("#someId").serialize()', )); - $expected = '$.ajax({beforeSend:function (XMLHttpRequest) {doBefore}, data:$("#someId").serialize(), success:function (data, textStatus) {doFoo}, type:"post", url:"\\/people\\/edit\\/1"});'; + $expected = '$.ajax({beforeSend:function (XMLHttpRequest) {doBefore}, data:$("#someId").serialize(), success:function (data, textStatus) {doFoo}, type:"post", url:"/people/edit/1"});'; $this->assertEqual($result, $expected); } From f8bc6de4ae0e30ff222a1100fe5f169772af17ff Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 8 Mar 2010 21:18:53 -0500 Subject: [PATCH 1738/2083] Fixing ViewTask and FixtureTask. $interactive was set to false, and methods were auto quitting. Fixes #437 --- cake/console/libs/tasks/fixture.php | 2 +- cake/console/libs/tasks/view.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 1d76f1a48..95c2fdb4a 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -106,7 +106,7 @@ function all() { * @access private */ function __interactive() { - $this->interactive = true; + $this->DbConfig->interactive = $this->Model->interactive = $this->interactive = true; $this->hr(); $this->out(sprintf("Bake Fixture\nPath: %s", $this->path)); $this->hr(); diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 6af3e7c5b..bdb5a72bc 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -211,6 +211,8 @@ function __interactive() { $this->out(sprintf("Bake View\nPath: %s", $this->path)); $this->hr(); + $this->DbConfig->interactive = $this->Controller->interactive = $this->interactive = true; + if (empty($this->connection)) { $this->connection = $this->DbConfig->getConfig(); } From 2218d186c83c8e20a3c6cdf79e49141c597b5a3d Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Tue, 9 Mar 2010 14:30:28 +1100 Subject: [PATCH 1739/2083] Revert "Fixing escaping of forward slash for JS Engines." This reverts commit 7334fdfbdfd4d7978c3eeaea583bf8266a16e443. --- cake/libs/view/helpers/js.php | 15 ++++++++------- .../libs/view/helpers/jquery_engine.test.php | 12 ++++++------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 016d90d0e..6f47374f9 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -676,23 +676,24 @@ function _utf8ToHex($string) { for ($i = 0; $i < $length; ++$i) { $ord = ord($string{$i}); switch (true) { - case $ord == 0x08: // Backspace + case $ord == 0x08: $return .= '\b'; break; - case $ord == 0x09: // Tab + case $ord == 0x09: $return .= '\t'; break; - case $ord == 0x0A: // New Line + case $ord == 0x0A: $return .= '\n'; break; - case $ord == 0x0C: // New Page + case $ord == 0x0C: $return .= '\f'; break; - case $ord == 0x0D: // Carriage Return + case $ord == 0x0D: $return .= '\r'; break; - case $ord == 0x22: // Character: " - case $ord == 0x5C: // Character: \ + case $ord == 0x22: + case $ord == 0x2F: + case $ord == 0x5C: $return .= '\\' . $string{$i}; break; case (($ord >= 0x20) && ($ord <= 0x7F)): diff --git a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php index bb89f541d..1a2ba66c6 100644 --- a/cake/tests/cases/libs/view/helpers/jquery_engine.test.php +++ b/cake/tests/cases/libs/view/helpers/jquery_engine.test.php @@ -156,13 +156,13 @@ function testEffect() { */ function testRequest() { $result = $this->Jquery->request(array('controller' => 'posts', 'action' => 'view', 1)); - $expected = '$.ajax({url:"/posts/view/1"});'; + $expected = '$.ajax({url:"\\/posts\\/view\\/1"});'; $this->assertEqual($result, $expected); $result = $this->Jquery->request(array('controller' => 'posts', 'action' => 'view', 1), array( 'update' => '#content' )); - $expected = '$.ajax({dataType:"html", success:function (data, textStatus) {$("#content").html(data);}, url:"/posts/view/1"});'; + $expected = '$.ajax({dataType:"html", success:function (data, textStatus) {$("#content").html(data);}, url:"\/posts\/view\/1"});'; $this->assertEqual($result, $expected); $result = $this->Jquery->request('/people/edit/1', array( @@ -175,7 +175,7 @@ function testRequest() { 'data' => array('name' => 'jim', 'height' => '185cm'), 'wrapCallbacks' => false )); - $expected = '$.ajax({beforeSend:doBefore, complete:doComplete, data:"name=jim&height=185cm", dataType:"json", error:handleError, success:doSuccess, type:"post", url:"/people/edit/1"});'; + $expected = '$.ajax({beforeSend:doBefore, complete:doComplete, data:"name=jim&height=185cm", dataType:"json", error:handleError, success:doSuccess, type:"post", url:"\\/people\\/edit\\/1"});'; $this->assertEqual($result, $expected); $result = $this->Jquery->request('/people/edit/1', array( @@ -184,7 +184,7 @@ function testRequest() { 'method' => 'post', 'wrapCallbacks' => false )); - $expected = '$.ajax({dataType:"html", success:function (data, textStatus) {$("#updated").html(data);}, type:"post", url:"/people/edit/1"});'; + $expected = '$.ajax({dataType:"html", success:function (data, textStatus) {$("#updated").html(data);}, type:"post", url:"\\/people\\/edit\\/1"});'; $this->assertEqual($result, $expected); $result = $this->Jquery->request('/people/edit/1', array( @@ -195,7 +195,7 @@ function testRequest() { 'data' => '$("#someId").serialize()', 'wrapCallbacks' => false )); - $expected = '$.ajax({data:$("#someId").serialize(), dataType:"html", success:function (data, textStatus) {$("#updated").html(data);}, type:"post", url:"/people/edit/1"});'; + $expected = '$.ajax({data:$("#someId").serialize(), dataType:"html", success:function (data, textStatus) {$("#updated").html(data);}, type:"post", url:"\\/people\\/edit\\/1"});'; $this->assertEqual($result, $expected); $result = $this->Jquery->request('/people/edit/1', array( @@ -205,7 +205,7 @@ function testRequest() { 'dataExpression' => true, 'data' => '$("#someId").serialize()', )); - $expected = '$.ajax({beforeSend:function (XMLHttpRequest) {doBefore}, data:$("#someId").serialize(), success:function (data, textStatus) {doFoo}, type:"post", url:"/people/edit/1"});'; + $expected = '$.ajax({beforeSend:function (XMLHttpRequest) {doBefore}, data:$("#someId").serialize(), success:function (data, textStatus) {doFoo}, type:"post", url:"\\/people\\/edit\\/1"});'; $this->assertEqual($result, $expected); } From c874d98195d5b79a3032047c068a07af5bf435e9 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 8 Mar 2010 22:48:39 -0500 Subject: [PATCH 1740/2083] Minor refactor to use local variable. --- cake/libs/cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/cache.php b/cake/libs/cache.php index b8d26c4eb..a0c448d4d 100644 --- a/cake/libs/cache.php +++ b/cake/libs/cache.php @@ -234,7 +234,7 @@ function set($settings = array(), $value = null) { if (is_string($settings) && $value !== null) { $settings = array($settings => $value); } - $settings = array_merge($self->__config[$self->__name], $settings); + $settings = array_merge($self->__config[$name], $settings); if (isset($settings['duration']) && !is_numeric($settings['duration'])) { $settings['duration'] = strtotime($settings['duration']) - time(); } From 41bdc48fd373eb90b85fdfaff3a4752c2182e443 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 8 Mar 2010 22:49:09 -0500 Subject: [PATCH 1741/2083] Fixing whitespacing. --- cake/libs/view/helpers/time.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/time.php b/cake/libs/view/helpers/time.php index 728d5543b..7e1584a75 100644 --- a/cake/libs/view/helpers/time.php +++ b/cake/libs/view/helpers/time.php @@ -450,7 +450,7 @@ function timeAgoInWords($dateTime, $options = array()) { } $now = time(); if (!is_null($userOffset)) { - $now = $this->convert(time(), $userOffset); + $now = $this->convert(time(), $userOffset); } $inSeconds = $this->fromString($dateTime, $userOffset); $backwards = ($inSeconds > $now); From bed4027d37b717dcc9d4dad0c5c11b18d9b26358 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 8 Mar 2010 22:51:46 -0500 Subject: [PATCH 1742/2083] Making JsHelper::writeBuffer() use the isAjax param to hint the domReady() event. Disabling domready events when the request isAjax fixes issues in prototype and makes output code simpler. Fixes #429 --- cake/libs/view/helpers/js.php | 9 +++++++-- cake/tests/cases/libs/view/helpers/js.test.php | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 6f47374f9..5ad10191d 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -185,7 +185,8 @@ function value($val, $quoteString = true) { /** * Writes all Javascript generated so far to a code block or * caches them to a file and returns a linked script. If no scripts have been - * buffered this method will return null + * buffered this method will return null. If the request is an XHR(ajax) request + * onDomReady will be set to false. As the dom is already 'ready'. * * ### Options * @@ -202,7 +203,11 @@ function value($val, $quoteString = true) { * @access public */ function writeBuffer($options = array()) { - $defaults = array('onDomReady' => true, 'inline' => true, 'cache' => false, 'clear' => true, 'safe' => true); + $domReady = isset($this->params['isAjax']) ? !$this->params['isAjax'] : true; + $defaults = array( + 'onDomReady' => $domReady, 'inline' => true, + 'cache' => false, 'clear' => true, 'safe' => true + ); $options = array_merge($defaults, $options); $script = implode("\n", $this->getBuffer($options['clear'])); diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index 3138e73d3..292bbb19e 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -255,6 +255,20 @@ function testWriteBufferNotInline() { $result = $this->Js->writeBuffer(array('onDomReady' => false, 'inline' => false, 'safe' => false)); } +/** + * test that writeBuffer() sets domReady = false when the request is done by XHR. + * Including a domReady() when in XHR can cause issues as events aren't triggered by some libraries + * + * @return void + */ + function testWriteBufferAndXhr() { + $this->_useMock(); + $this->Js->params['isAjax'] = true; + $this->Js->buffer('alert("test");'); + $this->Js->TestJsEngine->expectCallCount('dispatchMethod', 0); + $result = $this->Js->writeBuffer(); + } + /** * test that writeScripts makes files, and puts the events into them. * From af317a107bdb179bce31323d0d28af2c333ebc12 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 8 Mar 2010 23:07:36 -0500 Subject: [PATCH 1743/2083] Fixing issues in Set::combine() when data or paths used result in empty datasets. Tests added. Fixes #414 --- cake/libs/set.php | 7 ++++++- cake/tests/cases/libs/set.test.php | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cake/libs/set.php b/cake/libs/set.php index fc921b26a..ed8e19c91 100644 --- a/cake/libs/set.php +++ b/cake/libs/set.php @@ -947,6 +947,9 @@ function combine($data, $path1 = null, $path2 = null, $groupPath = null) { } else { $keys = Set::extract($data, $path1); } + if (empty($keys)) { + return array(); + } if (!empty($path2) && is_array($path2)) { $format = array_shift($path2); @@ -978,7 +981,9 @@ function combine($data, $path1 = null, $path2 = null, $groupPath = null) { return $out; } } - + if (empty($vals)) { + return array(); + } return array_combine($keys, $vals); } /** diff --git a/cake/tests/cases/libs/set.test.php b/cake/tests/cases/libs/set.test.php index a42d0cc9e..6867ae4f1 100644 --- a/cake/tests/cases/libs/set.test.php +++ b/cake/tests/cases/libs/set.test.php @@ -1621,6 +1621,9 @@ function testCombine() { $result = Set::combine($b, 'users.{n}.User.id', 'users.{n}.User.non-existant'); $expected = array(2 => null, 14 => null, 25 => null); $this->assertIdentical($result, $expected); + + $result = Set::combine($a, 'fail', 'fail'); + $this->assertEqual($result, array()); } /** * testMapReverse method From a79ff508a63082905853dd134649a9b3526855b6 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck <dieter@kangaroot.net> Date: Wed, 24 Feb 2010 10:48:36 +0100 Subject: [PATCH 1744/2083] fix compliancy with more elaborate ORDER syntax, such as "DESC NULLS FIRST" in postgresql, in DboSource::order() --- cake/libs/model/datasources/dbo_source.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 4f4de80e1..bb4f96bc4 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -2333,9 +2333,9 @@ function order($keys, $direction = 'ASC', $model = null) { continue; } - if (preg_match('/\\x20ASC|\\x20DESC/i', $key, $_dir)) { + if (preg_match('/\\x20(ASC|DESC).*/i', $key, $_dir)) { $dir = $_dir[0]; - $key = preg_replace('/\\x20ASC|\\x20DESC/i', '', $key); + $key = preg_replace('/\\x20(ASC|DESC).*/i', '', $key); } if (strpos($key, '.')) { From acccf964a50a4779f2fe8db3d6825b254bfce0e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Tue, 9 Mar 2010 15:24:03 -0430 Subject: [PATCH 1745/2083] Fixing some tests for Postgres Dbo and adding test cverage for extra params in order function, closes #353 --- .../libs/model/datasources/dbo/dbo_postgres.test.php | 11 ++++++++++- cake/tests/cases/libs/model/model_read.test.php | 8 +++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php index ab84540a2..e789bae4a 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php @@ -677,7 +677,7 @@ function testAlterIndexes() { */ function testVirtualFields() { $this->loadFixtures('Article', 'Comment'); - $Article =& ClassRegistry::init('Article'); + $Article = new Article; $Article->virtualFields = array( 'next_id' => 'Article.id + 1', 'complex' => 'Article.title || Article.body', @@ -690,5 +690,14 @@ function testVirtualFields() { $this->assertEqual($result['Article']['functional'], $result['Article']['title']); $this->assertEqual($result['Article']['subquery'], 6); } + + /** + * Tests additional order options for postgres + */ + function testOrderAdditionalParams() { + $result = $this->db->order(array('title' => 'DESC NULLS FIRSTS', 'body' => 'DESC')); + $expected = ' ORDER BY "title" DESC NULLS FIRSTS, "body" DESC'; + $this->assertEqual($result, $expected); + } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/model/model_read.test.php b/cake/tests/cases/libs/model/model_read.test.php index 3efd9f479..bdcb4db2a 100755 --- a/cake/tests/cases/libs/model/model_read.test.php +++ b/cake/tests/cases/libs/model/model_read.test.php @@ -76,7 +76,7 @@ function testFetchingNonUniqueFKJoinTableRecords() { function testGroupBy() { $db = ConnectionManager::getDataSource('test_suite'); $isStrictGroupBy = in_array($db->config['driver'], array('postgres', 'oracle')); - $message = '%s Postgresql and Oracle have strict GROUP BY and are incompatible with this test.'; + $message = '%s Postgres and Oracle have strict GROUP BY and are incompatible with this test.'; if ($this->skipIf($isStrictGroupBy, $message )) { return; @@ -4030,6 +4030,9 @@ function testFindAllWithConditionsHavingMixedDataTypes() { $result = $TestModel->find('all', compact('conditions', 'recursive', 'order')); $this->assertEqual($result, $expected); + if ($this->skipIf($this->db->config['driver'] == 'postgres', 'The rest of testFindAllWithConditionsHavingMixedDataTypes test is not compatible with Postgres')) { + return; + } $conditions = array('id' => array('1', 2, '3.0')); $order = 'Article.id ASC'; $result = $TestModel->find('all', compact('recursive', 'conditions', 'order')); @@ -7240,6 +7243,9 @@ function testVirtualFields() { $result = $Post->field('other_field'); $this->assertEqual($result, 4); + if ($this->skipIf($this->db->config['driver'] == 'postgres', 'The rest of virtualFieds test is not compatible with Postgres')) { + return; + } ClassRegistry::flush(); $Post =& ClassRegistry::init('Post'); From cbcd394d0baa63b8c62e19005772dcafb715aaff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Tue, 9 Mar 2010 16:09:16 -0430 Subject: [PATCH 1746/2083] Fixing alter schema queries generated for Postgres, which dos not support altering column type, nullable and default value at the same time --- cake/libs/model/datasources/dbo/dbo_postgres.php | 16 ++++++++++++++++ .../model/datasources/dbo/dbo_postgres.test.php | 9 ++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index 194fed549..25f3cb03a 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -546,7 +546,23 @@ function alterSchema($compare, $table = null) { $col['name'] = $field; } $fieldName = $this->name($field); + + $default = isset($col['default']) ? $col['default'] : null; + $nullable = isset($col['null']) ? $col['null'] : null; + unset($col['default'], $col['null']); $colList[] = 'ALTER COLUMN '. $fieldName .' TYPE ' . str_replace($fieldName, '', $this->buildColumn($col)); + + if (isset($nullable)) { + $nullable = ($nullable) ? 'DROP NOT NULL' : 'SET NOT NULL'; + $colList[] = 'ALTER COLUMN '. $fieldName .' ' . $nullable; + } + + if (isset($default)) { + $colList[] = 'ALTER COLUMN '. $fieldName .' SET DEFAULT ' . $default; + } else { + $colList[] = 'ALTER COLUMN '. $fieldName .' DROP DEFAULT'; + } + } break; } diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php index e789bae4a..5f408b117 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php @@ -564,7 +564,7 @@ function testAlterSchema() { 'alter_posts' => array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'author_id' => array('type' => 'integer', 'null' => false), - 'title' => array('type' => 'string', 'null' => false), + 'title' => array('type' => 'string', 'null' => true), 'body' => array('type' => 'text'), 'published' => array('type' => 'string', 'length' => 1, 'default' => 'N'), 'created' => array('type' => 'datetime'), @@ -578,10 +578,10 @@ function testAlterSchema() { 'name' => 'AlterPosts', 'alter_posts' => array( 'id' => array('type' => 'integer', 'key' => 'primary'), - 'author_id' => array('type' => 'integer', 'null' => false), + 'author_id' => array('type' => 'integer', 'null' => true), 'title' => array('type' => 'string', 'null' => false), 'body' => array('type' => 'string', 'length' => 500), - 'status' => array('type' => 'integer', 'length' => 3), + 'status' => array('type' => 'integer', 'length' => 3, 'default' => 1), 'created' => array('type' => 'datetime'), 'updated' => array('type' => 'datetime'), ) @@ -593,6 +593,9 @@ function testAlterSchema() { $this->assertTrue(isset($result['status'])); $this->assertFalse(isset($result['published'])); $this->assertEqual($result['body']['type'], 'string'); + $this->assertEqual($result['status']['default'], 1); + $this->assertEqual($result['author_id']['null'], true); + $this->assertEqual($result['title']['null'], false); $this->db->query($this->db->dropSchema($New)); } From 9a9bc3643b64d8209b88be09f5da018381bd5c42 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck <dieter@kangaroot.net> Date: Wed, 10 Mar 2010 10:42:49 +0100 Subject: [PATCH 1747/2083] fix typo in DboPostgresTestDb::testOrderAdditionalParams() --- .../cases/libs/model/datasources/dbo/dbo_postgres.test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php index 5f408b117..4c1bb7ded 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php @@ -698,8 +698,8 @@ function testVirtualFields() { * Tests additional order options for postgres */ function testOrderAdditionalParams() { - $result = $this->db->order(array('title' => 'DESC NULLS FIRSTS', 'body' => 'DESC')); - $expected = ' ORDER BY "title" DESC NULLS FIRSTS, "body" DESC'; + $result = $this->db->order(array('title' => 'DESC NULLS FIRST', 'body' => 'DESC')); + $expected = ' ORDER BY "title" DESC NULLS FIRST, "body" DESC'; $this->assertEqual($result, $expected); } } From d8a757ce759983320343d84567a9b820b0932ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Wed, 10 Mar 2010 15:16:02 -0430 Subject: [PATCH 1748/2083] Fixing empty value check to avoid a mistaken default value selection in Helper::value. closes #290 --- cake/libs/view/helper.php | 2 +- cake/tests/cases/libs/view/helper.test.php | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index 43ef30f8f..20e1f0335 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -700,7 +700,7 @@ function value($options = array(), $field = null, $key = 'value') { } if (is_array($options)) { - if (empty($result) && isset($options['default'])) { + if ($result === null && isset($options['default'])) { $result = $options['default']; } unset($options['default']); diff --git a/cake/tests/cases/libs/view/helper.test.php b/cake/tests/cases/libs/view/helper.test.php index d546a6877..804f325c5 100644 --- a/cake/tests/cases/libs/view/helper.test.php +++ b/cake/tests/cases/libs/view/helper.test.php @@ -385,6 +385,19 @@ function testValue() { $this->Helper->setEntity('HelperTestTag.HelperTestTag'); $result = $this->Helper->value('HelperTestTag.HelperTestTag'); $this->assertEqual($result, array(3 => 3, 5 => 5)); + + $this->Helper->data = array('zero' => 0); + $this->Helper->setEntity('zero'); + $result = $this->Helper->value(array('default' => 'something'), 'zero'); + $this->assertEqual($result, array('value' => 0)); + + $this->Helper->data = array('zero' => '0'); + $result = $this->Helper->value(array('default' => 'something'), 'zero'); + $this->assertEqual($result, array('value' => '0')); + + $this->Helper->setEntity('inexistent'); + $result = $this->Helper->value(array('default' => 'something'), 'inexistent'); + $this->assertEqual($result, array('value' => 'something')); } /** From 4c668c036c1fb6e77c41fa0e18e4c421044929f5 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 10 Mar 2010 21:46:28 -0500 Subject: [PATCH 1749/2083] Adding checks to force limit to always be a positive integer. Fixes potential out of bounds type queries with paginate(). Fixes #418 --- cake/libs/controller/controller.php | 7 ++++++- cake/tests/cases/libs/controller/controller.test.php | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 529eacf0c..b76b9f050 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -1168,8 +1168,13 @@ function paginate($object = null, $scope = array(), $whitelist = array()) { $type = $defaults[0]; unset($defaults[0]); } + $options = array_merge(array('page' => 1, 'limit' => 20), $defaults, $options); - $options['limit'] = (empty($options['limit']) || !is_numeric($options['limit'])) ? 1 : $options['limit']; + $options['limit'] = (int) $options['limit']; + if (empty($options['limit']) || $options['limit'] < 1) { + $options['limit'] = 1; + } + extract($options); if (is_array($scope) && !empty($scope)) { diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index 4f9c5e6ed..db98280d8 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -595,6 +595,14 @@ function testPaginate() { $this->assertIdentical($Controller->params['paging']['ControllerPost']['pageCount'], 3); $this->assertIdentical($Controller->params['paging']['ControllerPost']['prevPage'], false); $this->assertIdentical($Controller->params['paging']['ControllerPost']['nextPage'], true); + + $Controller->passedArgs = array(); + $Controller->paginate = array('limit' => '-1'); + $Controller->paginate('ControllerPost'); + $this->assertIdentical($Controller->params['paging']['ControllerPost']['page'], 1); + $this->assertIdentical($Controller->params['paging']['ControllerPost']['pageCount'], 3); + $this->assertIdentical($Controller->params['paging']['ControllerPost']['prevPage'], false); + $this->assertIdentical($Controller->params['paging']['ControllerPost']['nextPage'], true); } /** From 64c627a35241cf9766a035fc02cdd78a908755ef Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 10 Mar 2010 21:46:28 -0500 Subject: [PATCH 1750/2083] Adding checks to force limit to always be a positive integer. Fixes potential out of bounds type queries with paginate(). Fixes #418 --- cake/libs/controller/controller.php | 7 ++++++- cake/tests/cases/libs/controller/controller.test.php | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 16524a986..a7e5a9722 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -1046,8 +1046,13 @@ function paginate($object = null, $scope = array(), $whitelist = array()) { $type = $defaults[0]; unset($defaults[0]); } + $options = array_merge(array('page' => 1, 'limit' => 20), $defaults, $options); - $options['limit'] = (empty($options['limit']) || !is_numeric($options['limit'])) ? 1 : $options['limit']; + $options['limit'] = (int) $options['limit']; + if (empty($options['limit']) || $options['limit'] < 1) { + $options['limit'] = 1; + } + extract($options); if (is_array($scope) && !empty($scope)) { diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index 1b06f487a..e65a639fa 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -526,6 +526,14 @@ function testPaginate() { $this->assertIdentical($Controller->params['paging']['ControllerPost']['pageCount'], 3); $this->assertIdentical($Controller->params['paging']['ControllerPost']['prevPage'], false); $this->assertIdentical($Controller->params['paging']['ControllerPost']['nextPage'], true); + + $Controller->passedArgs = array(); + $Controller->paginate = array('limit' => '-1'); + $Controller->paginate('ControllerPost'); + $this->assertIdentical($Controller->params['paging']['ControllerPost']['page'], 1); + $this->assertIdentical($Controller->params['paging']['ControllerPost']['pageCount'], 3); + $this->assertIdentical($Controller->params['paging']['ControllerPost']['prevPage'], false); + $this->assertIdentical($Controller->params['paging']['ControllerPost']['nextPage'], true); } /** * testPaginateExtraParams method From 8e8acfaccdd12c3bc0cd8601e82005ccb1ae5b2d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 12 Mar 2010 22:58:14 -0500 Subject: [PATCH 1751/2083] Fixing notice errors when bogus validation options are selected. Refs #453 --- cake/console/libs/tasks/model.php | 4 ++++ .../cases/console/libs/tasks/model.test.php | 20 ++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index cd0cf2821..57fbcc26c 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -410,6 +410,10 @@ function fieldValidation($fieldName, $metaData, $primaryKey = 'id') { $this->out(__("You have already chosen that validation rule,\nplease choose again", true)); continue; } + if (!isset($this->_validations[$choice])) { + $this->out(__('Please make a valid selection.', true)); + continue; + } $alreadyChosen[] = $choice; } else { $choice = $guess; diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index 40d96935f..e2252a0d8 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -42,7 +42,7 @@ ); Mock::generatePartial( 'ModelTask', 'MockModelTask', - array('in', 'out', 'err', 'createFile', '_stop', '_checkUnitTest') + array('in', 'out', 'hr', 'err', 'createFile', '_stop', '_checkUnitTest') ); Mock::generate( @@ -233,6 +233,24 @@ function testInteractiveFieldValidation() { $this->assertEqual($result, $expected); } +/** + * test that a bogus response doesn't cause errors to bubble up. + * + * @return void + */ + function testInteractiveFieldValidationWithBogusResponse() { + $this->Task->initValidations(); + $this->Task->interactive = true; + $this->Task->setReturnValueAt(0, 'in', '--bogus--'); + $this->Task->setReturnValueAt(1, 'in', '19'); + $this->Task->setReturnValueAt(2, 'in', 'n'); + $this->Task->expectAt(4, 'out', array(new PatternExpectation('/make a valid/'))); + + $result = $this->Task->fieldValidation('text', array('type' => 'string', 'length' => 10, 'null' => false)); + $expected = array('notempty' => 'notempty'); + $this->assertEqual($result, $expected); + } + /** * test the validation Generation routine * From 677ff2d8b793bc032dca25d449e768c9e212306f Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 12 Mar 2010 23:03:06 -0500 Subject: [PATCH 1752/2083] Removing outcommented code. --- cake/tests/cases/libs/validation.test.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/cake/tests/cases/libs/validation.test.php b/cake/tests/cases/libs/validation.test.php index d3db2e7df..7f51544e3 100644 --- a/cake/tests/cases/libs/validation.test.php +++ b/cake/tests/cases/libs/validation.test.php @@ -2201,12 +2201,5 @@ function testUserDefined() { $this->assertTrue(Validation::userDefined('333', $validator, 'customValidate')); } - // function testFile() { - // $this->assertTrue(Validation::file(WWW_ROOT . 'img' . DS . 'cake.icon.gif')); - // $this->assertTrue(Validation::file(WWW_ROOT. 'favicon.ico')); - // $this->assertTrue(Validation::file(WWW_ROOT. 'index.php')); - // $this->assertTrue(Validation::file(WWW_ROOT. 'css' . DS . 'cake.generic.css')); - // $this->assertTrue(Validation::file(TEST_CAKE_CORE_INCLUDE_PATH. 'VERSION.txt')); - // } } ?> \ No newline at end of file From e304c48ec4f3569c1d1b17cefed3bdd94a7c415d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 12 Mar 2010 23:17:11 -0500 Subject: [PATCH 1753/2083] Adding test to show that select() doesn't always auto select options named 'Array'. Disproves #412 --- .../cases/libs/view/helpers/form.test.php | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 3a552dea5..0761be82d 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -3237,6 +3237,36 @@ function testSelectMultipleCheckboxes() { '/div' ); $this->assertTags($result, $expected); + + $this->Form->data = array('Model' => array('tags' => array(1))); + $result = $this->Form->select( + 'Model.tags', array('1' => 'first', 'Array' => 'Array'), null, array('multiple' => 'checkbox') + ); + $expected = array( + 'input' => array( + 'type' => 'hidden', 'name' => 'data[Model][tags]', 'value' => '', 'id' => 'ModelTags' + ), + array('div' => array('class' => 'checkbox')), + array('input' => array( + 'type' => 'checkbox', 'name' => 'data[Model][tags][]', + 'value' => '1', 'id' => 'ModelTags1', 'checked' => 'checked' + )), + array('label' => array('for' => 'ModelTags1', 'class' => 'selected')), + 'first', + '/label', + '/div', + + array('div' => array('class' => 'checkbox')), + array('input' => array( + 'type' => 'checkbox', 'name' => 'data[Model][tags][]', + 'value' => 'Array', 'id' => 'ModelTagsArray' + )), + array('label' => array('for' => 'ModelTagsArray')), + 'Array', + '/label', + '/div' + ); + $this->assertTags($result, $expected); } /** From 028668b7a63f464caff5b851dd489c5c0bc14fcc Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 13 Mar 2010 00:18:51 -0500 Subject: [PATCH 1754/2083] Adding condition for counterCache update keys. Fixes issues where counter cache wouldn't be updated. Fixes #450 --- cake/libs/model/model.php | 5 ++++- .../cases/libs/model/model_delete.test.php | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index f38cf39b0..0950afdeb 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1801,7 +1801,10 @@ function delete($id = null, $cascade = true) { $this->id = $id; if (!empty($this->belongsTo)) { - $keys = $this->find('first', array('fields' => $this->__collectForeignKeys())); + $keys = $this->find('first', array( + 'fields' => $this->__collectForeignKeys(), + 'conditions' => array($this->alias . '.' . $this->primaryKey => $id) + )); } if ($db->delete($this)) { diff --git a/cake/tests/cases/libs/model/model_delete.test.php b/cake/tests/cases/libs/model/model_delete.test.php index e6c448548..fe69d9c95 100644 --- a/cake/tests/cases/libs/model/model_delete.test.php +++ b/cake/tests/cases/libs/model/model_delete.test.php @@ -255,6 +255,23 @@ function testDelete() { $this->assertEqual($result, $expected); } +/** + * test that delete() updates the correct records counterCache() records. + * + * @return void + */ + function testDeleteUpdatingCounterCacheCorrectly() { + $this->loadFixtures('CounterCacheUser', 'CounterCachePost'); + $User =& new CounterCacheUser(); + + $User->Post->delete(3); + $result = $User->read(null, 301); + $this->assertEqual($result['User']['post_count'], 0); + + $result = $User->read(null, 66); + $this->assertEqual($result['User']['post_count'], 2); + } + /** * testDeleteAll method * From 178099d15bf7af31d586e372c01354cbd5cd3460 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 13 Mar 2010 00:26:23 -0500 Subject: [PATCH 1755/2083] Adding test that closes #455 --- cake/tests/cases/libs/inflector.test.php | 1 + 1 file changed, 1 insertion(+) diff --git a/cake/tests/cases/libs/inflector.test.php b/cake/tests/cases/libs/inflector.test.php index aa0dea20b..d8a555a3d 100644 --- a/cake/tests/cases/libs/inflector.test.php +++ b/cake/tests/cases/libs/inflector.test.php @@ -110,6 +110,7 @@ function testInflectingSingulars() { $this->assertEqual(Inflector::singularize('taxis'), 'taxi'); $this->assertEqual(Inflector::singularize('taxes'), 'tax'); $this->assertEqual(Inflector::singularize('Taxes'), 'Tax'); + $this->assertEqual(Inflector::singularize('AwesomeTaxes'), 'AwesomeTax'); $this->assertEqual(Inflector::singularize('faxes'), 'fax'); $this->assertEqual(Inflector::singularize('waxes'), 'wax'); $this->assertEqual(Inflector::singularize('niches'), 'niche'); From 688daf2c35168d731b4fc8ff59018e40d33d78d6 Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Sun, 14 Mar 2010 01:50:13 +0530 Subject: [PATCH 1756/2083] Allowing the default transliteration map used in Inflector::slug to be customized using Inflector::rules. Closes #321, #334, #439. --- cake/libs/inflector.php | 78 ++++++++++++++++-------- cake/tests/cases/libs/inflector.test.php | 18 ++++++ 2 files changed, 69 insertions(+), 27 deletions(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index 9c5bd2deb..4d56efa7f 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -172,6 +172,29 @@ class Inflector { 'Yengeese' ); +/** + * Default map of accented and special characters to ASCII characters + * + * @var array + * @access protected + */ + var $_transliteration = array( + '/à|á|Ã¥|â/' => 'a', + '/è|é|ê|ẽ|ë/' => 'e', + '/ì|í|î/' => 'i', + '/ò|ó|ô|ø/' => 'o', + '/ù|ú|ů|û/' => 'u', + '/ç/' => 'c', + '/ñ/' => 'n', + '/ä|æ/' => 'ae', + '/ö/' => 'oe', + '/ü/' => 'ue', + '/Ä/' => 'Ae', + '/Ü/' => 'Ue', + '/Ö/' => 'Oe', + '/ß/' => 'ss' + ); + /** * Cached array identity map of pluralized words. * @@ -267,7 +290,7 @@ function _cache($type, $key, $value = false) { } /** - * Adds custom inflection $rules, of either 'plural' or 'singular' $type. + * Adds custom inflection $rules, of either 'plural', 'singular' or 'transliteration' $type. * * ### Usage: * @@ -278,9 +301,10 @@ function _cache($type, $key, $value = false) { * 'uninflected' => array('dontinflectme'), * 'irregular' => array('red' => 'redlings') * )); + * Inflector::rules('transliteration', array('/Ã¥/' => 'aa')); * }}} * - * @param string $type The type of inflection, either 'singular' or 'plural' + * @param string $type The type of inflection, either 'singular', 'singular' or 'transliteration' * @param array $rules Array of rules to be added. * @param boolean $reset If true, will unset default inflections for all * new rules that are being defined in $rules. @@ -290,20 +314,31 @@ function _cache($type, $key, $value = false) { */ function rules($type, $rules, $reset = false) { $_this =& Inflector::getInstance(); - $type = '_'.$type; + $var = '_'.$type; - foreach ($rules as $rule => $pattern) { - if (is_array($pattern)) { + switch ($type) { + case 'transliteration': if ($reset) { - $_this->{$type}[$rule] = $pattern; + $_this->_transliteration = $rules; } else { - $_this->{$type}[$rule] = array_merge($pattern, $_this->{$type}[$rule]); + $_this->_transliteration = array_merge($rules, $_this->_transliteration, $rules); } - unset($rules[$rule], $_this->{$type}['cache' . ucfirst($rule)], $_this->{$type}['merged'][$rule]); - } + break; + + default: + foreach ($rules as $rule => $pattern) { + if (is_array($pattern)) { + if ($reset) { + $_this->{$var}[$rule] = $pattern; + } else { + $_this->{$var}[$rule] = array_merge($pattern, $_this->{$var}[$rule]); + } + unset($rules[$rule], $_this->{$var}['cache' . ucfirst($rule)], $_this->{$var}['merged'][$rule]); + } + } + $_this->{$var}['rules'] = array_merge($rules, $_this->{$var}['rules']); + break; } - $_this->{$type}['rules'] = array_merge($rules, $_this->{$type}['rules']); - } /** @@ -520,39 +555,28 @@ function variable($string) { * @param string $string the string you want to slug * @param string $replacement will replace keys in map * @param array $map extra elements to map to the replacement + * @deprecated $map param will be removed in future versions. Use Inflector::rules() instead * @return string * @access public * @static * @link http://book.cakephp.org/view/572/Class-methods */ function slug($string, $replacement = '_', $map = array()) { + $_this =& Inflector::getInstance(); + if (is_array($replacement)) { $map = $replacement; $replacement = '_'; } $quotedReplacement = preg_quote($replacement, '/'); - $default = array( - '/à|á|Ã¥|â/' => 'a', - '/è|é|ê|ẽ|ë/' => 'e', - '/ì|í|î/' => 'i', - '/ò|ó|ô|ø/' => 'o', - '/ù|ú|ů|û/' => 'u', - '/ç/' => 'c', - '/ñ/' => 'n', - '/ä|æ/' => 'ae', - '/ö/' => 'oe', - '/ü/' => 'ue', - '/Ä/' => 'Ae', - '/Ü/' => 'Ue', - '/Ö/' => 'Oe', - '/ß/' => 'ss', + $merge = array( '/[^\s\p{Ll}\p{Lm}\p{Lo}\p{Lt}\p{Lu}\p{Nd}]/mu' => ' ', '/\\s+/' => $replacement, sprintf('/^[%s]+|[%s]+$/', $quotedReplacement, $quotedReplacement) => '', ); - $map = array_merge($map, $default); + $map = $map + $_this->_transliteration + $merge; return preg_replace(array_keys($map), array_values($map), $string); } } diff --git a/cake/tests/cases/libs/inflector.test.php b/cake/tests/cases/libs/inflector.test.php index d8a555a3d..7e38fea77 100644 --- a/cake/tests/cases/libs/inflector.test.php +++ b/cake/tests/cases/libs/inflector.test.php @@ -382,6 +382,24 @@ function testCustomSingularRule() { $this->assertEqual(Inflector::singularize('singulars'), 'singulars'); } +/** + * testCustomTransliterationRule method + * + * @access public + * @return void + */ + function testCustomTransliterationRule() { + $this->assertEqual(Inflector::slug('Testing æ ø Ã¥'), 'Testing_ae_o_a'); + + Inflector::rules('transliteration', array('/Ã¥/' => 'aa', '/ø/' => 'oe')); + $this->assertEqual(Inflector::slug('Testing æ ø Ã¥'), 'Testing_ae_oe_aa'); + + Inflector::rules('transliteration', array('/ä|æ/' => 'ae', '/Ã¥/' => 'aa'), true); + $this->assertEqual(Inflector::slug('Testing æ ø Ã¥'), 'Testing_ae_ø_aa'); + + $this->assertEqual(Inflector::slug('Testing æ ø Ã¥', '-', array('/ø/' => 'oe')), 'Testing-ae-oe-aa'); + } + /** * Test resetting inflection rules. * From 49c60658b965da4193d653547535b37746a35f2e Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 13 Mar 2010 19:44:20 -0500 Subject: [PATCH 1757/2083] Fixing the ability to use regular expressions for validation rules. Fixes #453 --- cake/console/libs/tasks/model.php | 10 ++++++++-- .../cases/console/libs/tasks/model.test.php | 18 +++++++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 57fbcc26c..7a8115831 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -410,7 +410,7 @@ function fieldValidation($fieldName, $metaData, $primaryKey = 'id') { $this->out(__("You have already chosen that validation rule,\nplease choose again", true)); continue; } - if (!isset($this->_validations[$choice])) { + if (!isset($this->_validations[$choice]) && is_numeric($choice)) { $this->out(__('Please make a valid selection.', true)); continue; } @@ -418,7 +418,13 @@ function fieldValidation($fieldName, $metaData, $primaryKey = 'id') { } else { $choice = $guess; } - $validatorName = $this->_validations[$choice]; + + if (isset($this->_validations[$choice])) { + $validatorName = $this->_validations[$choice]; + } else { + $validatorName = Inflector::slug($choice); + } + if ($choice != $defaultChoice) { if (is_numeric($choice) && isset($this->_validations[$choice])) { $validate[$validatorName] = $this->_validations[$choice]; diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index e2252a0d8..e8d7acf64 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -241,7 +241,7 @@ function testInteractiveFieldValidation() { function testInteractiveFieldValidationWithBogusResponse() { $this->Task->initValidations(); $this->Task->interactive = true; - $this->Task->setReturnValueAt(0, 'in', '--bogus--'); + $this->Task->setReturnValueAt(0, 'in', '999999'); $this->Task->setReturnValueAt(1, 'in', '19'); $this->Task->setReturnValueAt(2, 'in', 'n'); $this->Task->expectAt(4, 'out', array(new PatternExpectation('/make a valid/'))); @@ -251,6 +251,22 @@ function testInteractiveFieldValidationWithBogusResponse() { $this->assertEqual($result, $expected); } +/** + * test that a regular expression can be used for validation. + * + * @return void + */ + function testInteractiveFieldValidationWithRegexp() { + $this->Task->initValidations(); + $this->Task->interactive = true; + $this->Task->setReturnValueAt(0, 'in', '/^[a-z]{0,9}$/'); + $this->Task->setReturnValueAt(1, 'in', 'n'); + + $result = $this->Task->fieldValidation('text', array('type' => 'string', 'length' => 10, 'null' => false)); + $expected = array('a_z_0_9' => '/^[a-z]{0,9}$/'); + $this->assertEqual($result, $expected); + } + /** * test the validation Generation routine * From c059cf5175677d3984db663348bdf272a29a568f Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 13 Mar 2010 22:55:18 -0500 Subject: [PATCH 1758/2083] Implementing cacheMethod(). Helps to solve #458, as it provides features to control and clear method caches. --- cake/libs/model/datasources/dbo_source.php | 75 ++++++++++++++++--- .../model/datasources/dbo_source.test.php | 27 +++++++ 2 files changed, 93 insertions(+), 9 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index bb4f96bc4..ff3871347 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -60,6 +60,15 @@ class DboSource extends DataSource { */ var $methodCache = array(); +/** + * Whether or not to cache the results of DboSource::name() and DboSource::conditions() + * into the memory cache. Set to false to disable the use of the memory cache. + * + * @var boolean. + * @access public + */ + var $cacheMethods = true ; + /** * Bypass automatic adding of joined fields/associations. * @@ -460,6 +469,41 @@ function field($name, $sql) { } } +/** + * Empties the method caches. + * These caches are used by DboSource::name() and DboSource::conditions() + * + * @return void + */ + function flushMethodCache() { + $this->methodCache = array(); + } + +/** + * Cache a value into the methodCaches. Will respect the value of DboSource::$cacheMethods. + * Will retrieve a value from the cache if $value is null. + * + * If caching is disabled and a write is attempted, the $value will be returned. + * A read will either return the value or null. + * + * @param string $method Name of the method being cached. + * @param string $key The keyname for the cache operation. + * @param mixed $value The value to cache into memory. + * @return mixed Either null on failure, or the value if its set. + */ + function cacheMethod($method, $key, $value = null) { + if ($this->cacheMethods === false) { + if ($value !== null) { + return $value; + } + return null; + } + if ($value === null) { + return (isset($this->methodCache[$method][$key])) ? $this->methodCache[$method][$key] : null; + } + return $this->methodCache[$method][$key] = $value; + } + /** * Returns a quoted name of $data for use in an SQL statement. * Strips fields out of SQL functions before quoting. @@ -482,27 +526,40 @@ function name($data) { return $data; } $cacheKey = crc32($this->startQuote.$data.$this->endQuote); - if (isset($this->methodCache[__FUNCTION__][$cacheKey])) { - return $this->methodCache[__FUNCTION__][$cacheKey]; + if ($return = $this->cacheMethod(__FUNCTION__, $cacheKey)) { + return $return; } $data = trim($data); if (preg_match('/^[\w-]+(\.[\w-]+)*$/', $data)) { // string, string.string if (strpos($data, '.') === false) { // string - return $this->methodCache[__FUNCTION__][$cacheKey] = $this->startQuote . $data . $this->endQuote; + return $this->cacheMethod(__FUNCTION__, $cacheKey, $this->startQuote . $data . $this->endQuote); } $items = explode('.', $data); - return $this->methodCache[__FUNCTION__][$cacheKey] = $this->startQuote . implode($this->endQuote . '.' . $this->startQuote, $items) . $this->endQuote; + return $this->cacheMethod(__FUNCTION__, $cacheKey, + $this->startQuote . implode($this->endQuote . '.' . $this->startQuote, $items) . $this->endQuote + ); } if (preg_match('/^[\w-]+\.\*$/', $data)) { // string.* - return $this->methodCache[__FUNCTION__][$cacheKey] = $this->startQuote . str_replace('.*', $this->endQuote . '.*', $data); + return $this->cacheMethod(__FUNCTION__, $cacheKey, + $this->startQuote . str_replace('.*', $this->endQuote . '.*', $data) + ); } if (preg_match('/^([\w-]+)\((.*)\)$/', $data, $matches)) { // Functions - return $this->methodCache[__FUNCTION__][$cacheKey] = $matches[1] . '(' . $this->name($matches[2]) . ')'; + return $this->cacheMethod(__FUNCTION__, $cacheKey, + $matches[1] . '(' . $this->name($matches[2]) . ')' + ); } - if (preg_match('/^([\w-]+(\.[\w-]+|\(.*\))*)\s+' . preg_quote($this->alias) . '\s*([\w-]+)$/', $data, $matches)) { - return $this->methodCache[__FUNCTION__][$cacheKey] = preg_replace('/\s{2,}/', ' ', $this->name($matches[1]) . ' ' . $this->alias . ' ' . $this->name($matches[3])); + if ( + preg_match('/^([\w-]+(\.[\w-]+|\(.*\))*)\s+' . preg_quote($this->alias) . '\s*([\w-]+)$/', $data, $matches + )) { + return $this->cacheMethod( + __FUNCTION__, $cacheKey, + preg_replace( + '/\s{2,}/', ' ', $this->name($matches[1]) . ' ' . $this->alias . ' ' . $this->name($matches[3]) + ) + ); } - return $this->methodCache[__FUNCTION__][$cacheKey] = $data; + return $this->cacheMethod(__FUNCTION__, $cacheKey, $data); } /** diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index f143820ce..096f2eeca 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -4043,6 +4043,33 @@ function testName() { $this->assertEqual($result, $expected); } +/** + * test that cacheMethod works as exepected + * + * @return void + */ + function testCacheMethod() { + $this->testDb->cacheMethods = true; + $result = $this->testDb->cacheMethod('name', 'some-key', 'stuff'); + $this->assertEqual($result, 'stuff'); + + $result = $this->testDb->cacheMethod('name', 'some-key'); + $this->assertEqual($result, 'stuff'); + + $result = $this->testDb->cacheMethod('conditions', 'some-key'); + $this->assertNull($result); + + $result = $this->testDb->cacheMethod('name', 'other-key'); + $this->assertNull($result); + + $this->testDb->cacheMethods = false; + $result = $this->testDb->cacheMethod('name', 'some-key', 'stuff'); + $this->assertEqual($result, 'stuff'); + + $result = $this->testDb->cacheMethod('name', 'some-key'); + $this->assertNull($result); + } + /** * testLog method * From 32432e8de6e9b78e45cd002dd9b53db56519b832 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 13 Mar 2010 23:00:08 -0500 Subject: [PATCH 1759/2083] Updating DboSource::conditions() to use cacheMethod(). Refs #458 --- cake/libs/model/datasources/dbo_source.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index ff3871347..37caca82f 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -2050,8 +2050,8 @@ function conditions($conditions, $quoteValues = true, $where = true, $model = nu $cacheKey = array($conditions, $quoteValues, $where); } $cacheKey = crc32(serialize($cacheKey)); - if (isset($this->methodCache[__FUNCTION__][$cacheKey])) { - return $this->methodCache[__FUNCTION__][$cacheKey]; + if ($return = $this->cacheMethod(__FUNCTION__, $cacheKey)) { + return $return; } $clause = $out = ''; @@ -2064,16 +2064,16 @@ function conditions($conditions, $quoteValues = true, $where = true, $model = nu $out = $this->conditionKeysToString($conditions, $quoteValues, $model); if (empty($out)) { - return $this->methodCache[__FUNCTION__][$cacheKey] = $clause . ' 1 = 1'; + return $this->cacheMethod(__FUNCTION__, $cacheKey, $clause . ' 1 = 1'); } - return $this->methodCache[__FUNCTION__][$cacheKey] = $clause . implode(' AND ', $out); + return $this->cacheMethod(__FUNCTION__, $cacheKey, $clause . implode(' AND ', $out)); } if ($conditions === false || $conditions === true) { - return $this->methodCache[__FUNCTION__][$cacheKey] = $clause . (int)$conditions . ' = 1'; + return $this->cacheMethod(__FUNCTION__, $cacheKey, $clause . (int)$conditions . ' = 1'); } if (empty($conditions) || trim($conditions) == '') { - return $this->methodCache[__FUNCTION__][$cacheKey] = $clause . '1 = 1'; + return $this->cacheMethod(__FUNCTION__, $cacheKey, $clause . '1 = 1'); } $clauses = '/^WHERE\\x20|^GROUP\\x20BY\\x20|^HAVING\\x20|^ORDER\\x20BY\\x20/i'; @@ -2085,7 +2085,7 @@ function conditions($conditions, $quoteValues = true, $where = true, $model = nu } else { $conditions = $this->__quoteFields($conditions); } - return $this->methodCache[__FUNCTION__][$cacheKey] = $clause . $conditions; + return $this->cacheMethod(__FUNCTION__, $cacheKey, $clause . $conditions); } /** From 78f347afd781c4474d1351316d6f0325a58db941 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 14 Mar 2010 13:06:22 -0400 Subject: [PATCH 1760/2083] Fixing SchemaShell test, was failing due to a model in the test_app changing. --- cake/tests/cases/console/libs/schema.test.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cake/tests/cases/console/libs/schema.test.php b/cake/tests/cases/console/libs/schema.test.php index 2c0c2d750..78ed58839 100644 --- a/cake/tests/cases/console/libs/schema.test.php +++ b/cake/tests/cases/console/libs/schema.test.php @@ -121,7 +121,9 @@ class SchemaShellTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.article', 'core.user', 'core.post', 'core.auth_user', 'core.author', 'core.comment'); + var $fixtures = array('core.article', 'core.user', 'core.post', 'core.auth_user', 'core.author', + 'core.comment', 'core.test_plugin_comment' + ); /** * startTest method @@ -369,7 +371,7 @@ function testGenerateWithPlugins() { $this->assertPattern('/var \$posts/', $contents); $this->assertPattern('/var \$auth_users/', $contents); $this->assertPattern('/var \$authors/', $contents); - $this->assertPattern('/var \$comments/', $contents); + $this->assertPattern('/var \$test_plugin_comments/', $contents); $this->assertNoPattern('/var \$users/', $contents); $this->assertNoPattern('/var \$articles/', $contents); From 5ec965830c6932edb096c7027622256f73848dfe Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 14 Mar 2010 13:20:52 -0400 Subject: [PATCH 1761/2083] Fixing issues caused by daylight savings time switch. --- cake/tests/cases/libs/view/helpers/time.test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/view/helpers/time.test.php b/cake/tests/cases/libs/view/helpers/time.test.php index fb8f78841..e865bf296 100644 --- a/cake/tests/cases/libs/view/helpers/time.test.php +++ b/cake/tests/cases/libs/view/helpers/time.test.php @@ -758,7 +758,7 @@ function testI18nFormat() { $this->assertEqual($result, $expected); $result = $this->Time->i18nFormat($time, '%c'); - $expected = 'jue 14 ene 2010 13:59:28 ' . strftime('%Z'); + $expected = 'jue 14 ene 2010 13:59:28 ' . strftime('%Z', $time); $this->assertEqual($result, $expected); $result = $this->Time->i18nFormat($time, 'Time is %r, and date is %x'); From 8d58b40642c182afe307d00debf44a1dbd8a3c62 Mon Sep 17 00:00:00 2001 From: Mariano Iglesias <mariano@cricava.com> Date: Sun, 14 Mar 2010 16:34:57 -0300 Subject: [PATCH 1762/2083] Fixing issue in Containable where if bindModel was used to add / change a binding not permanently, Containable was making the change permanent --- cake/libs/model/behaviors/containable.php | 6 ++++- .../libs/model/behaviors/containable.test.php | 25 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/cake/libs/model/behaviors/containable.php b/cake/libs/model/behaviors/containable.php index 7aa02f55e..8ace8760f 100644 --- a/cake/libs/model/behaviors/containable.php +++ b/cake/libs/model/behaviors/containable.php @@ -129,7 +129,11 @@ function beforeFind(&$Model, $query) { if ($contain) { $backupBindings = array(); foreach ($this->types as $relation) { - $backupBindings[$relation] = $instance->{$relation}; + if (!empty($instance->__backAssociation[$relation])) { + $backupBindings[$relation] = $instance->__backAssociation[$relation]; + } else { + $backupBindings[$relation] = $instance->{$relation}; + } } foreach ($this->types as $type) { $unbind = array(); diff --git a/cake/tests/cases/libs/model/behaviors/containable.test.php b/cake/tests/cases/libs/model/behaviors/containable.test.php index ebfa57a54..a2a6fdc71 100644 --- a/cake/tests/cases/libs/model/behaviors/containable.test.php +++ b/cake/tests/cases/libs/model/behaviors/containable.test.php @@ -3311,6 +3311,31 @@ function testOriginalAssociations() { $this->assertTrue(Set::matches('/Comment[article_id=1]', $result)); $this->Article->resetBindings(); } +/** + * testResetAddedAssociation method + * + * @access public + */ + function testResetAddedAssociation() { + $this->assertTrue(empty($this->Article->hasMany['ArticlesTag'])); + + $this->Article->bindModel(array( + 'hasMany' => array('ArticlesTag') + )); + $this->assertTrue(!empty($this->Article->hasMany['ArticlesTag'])); + + $result = $this->Article->find('first', array( + 'conditions' => array('Article.id' => 1), + 'contain' => array('ArticlesTag') + )); + $expected = array('Article', 'ArticlesTag'); + $this->assertTrue(!empty($result)); + $this->assertEqual('First Article', $result['Article']['title']); + $this->assertTrue(!empty($result['ArticlesTag'])); + $this->assertEqual($expected, array_keys($result)); + + $this->assertTrue(empty($this->Article->hasMany['ArticlesTag'])); + } /** * testResetAssociation method * From 1120d0daffb20c2a5f1d9906c7cefec03748aff4 Mon Sep 17 00:00:00 2001 From: Mariano Iglesias <mariano@cricava.com> Date: Sun, 14 Mar 2010 16:34:57 -0300 Subject: [PATCH 1763/2083] Fixing issue in Containable where if bindModel was used to add / change a binding not permanently, Containable was making the change permanent --- cake/libs/model/behaviors/containable.php | 6 ++++- .../libs/model/behaviors/containable.test.php | 25 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/cake/libs/model/behaviors/containable.php b/cake/libs/model/behaviors/containable.php index 30fe1e7dc..be0890940 100644 --- a/cake/libs/model/behaviors/containable.php +++ b/cake/libs/model/behaviors/containable.php @@ -130,7 +130,11 @@ function beforeFind(&$Model, $query) { if ($contain) { $backupBindings = array(); foreach ($this->types as $relation) { - $backupBindings[$relation] = $instance->{$relation}; + if (!empty($instance->__backAssociation[$relation])) { + $backupBindings[$relation] = $instance->__backAssociation[$relation]; + } else { + $backupBindings[$relation] = $instance->{$relation}; + } } foreach ($this->types as $type) { $unbind = array(); diff --git a/cake/tests/cases/libs/model/behaviors/containable.test.php b/cake/tests/cases/libs/model/behaviors/containable.test.php index 1b833e77d..9305a2060 100644 --- a/cake/tests/cases/libs/model/behaviors/containable.test.php +++ b/cake/tests/cases/libs/model/behaviors/containable.test.php @@ -3327,6 +3327,31 @@ function testOriginalAssociations() { $this->Article->resetBindings(); } +/** + * testResetAddedAssociation method + * + * @access public + */ + function testResetAddedAssociation() { + $this->assertTrue(empty($this->Article->hasMany['ArticlesTag'])); + + $this->Article->bindModel(array( + 'hasMany' => array('ArticlesTag') + )); + $this->assertTrue(!empty($this->Article->hasMany['ArticlesTag'])); + + $result = $this->Article->find('first', array( + 'conditions' => array('Article.id' => 1), + 'contain' => array('ArticlesTag') + )); + $expected = array('Article', 'ArticlesTag'); + $this->assertTrue(!empty($result)); + $this->assertEqual('First Article', $result['Article']['title']); + $this->assertTrue(!empty($result['ArticlesTag'])); + $this->assertEqual($expected, array_keys($result)); + + $this->assertTrue(empty($this->Article->hasMany['ArticlesTag'])); + } /** * testResetAssociation method * From 3d4b1e365dccaeaae40683fd472977dc6d651e27 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 14 Mar 2010 16:06:31 -0400 Subject: [PATCH 1764/2083] Removing deprecated method missed in last release candidate. --- cake/libs/view/helpers/text.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/cake/libs/view/helpers/text.php b/cake/libs/view/helpers/text.php index 2afcc64b9..e4feb4013 100644 --- a/cake/libs/view/helpers/text.php +++ b/cake/libs/view/helpers/text.php @@ -267,18 +267,6 @@ function truncate($text, $length = 100, $options = array()) { return $truncate; } -/** - * Alias for truncate(). - * - * @see TextHelper::truncate() - * @access public - */ - function trim() { - trigger_error(__('TextHelper::trim() is deprecated. Use TextHelper::truncate() instead', true), E_USER_WARNING); - $args = func_get_args(); - return call_user_func_array(array(&$this, 'truncate'), $args); - } - /** * Extracts an excerpt from the text surrounding the phrase with a number of characters on each side * determined by radius. From 4c7b62bf641719d0117d1b9f71638713df8c66da Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 14 Mar 2010 16:07:29 -0400 Subject: [PATCH 1765/2083] Removing pre-beta deprecated method that was missed in last Release candidate --- cake/libs/set.php | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/cake/libs/set.php b/cake/libs/set.php index 1e667ae86..516570bab 100644 --- a/cake/libs/set.php +++ b/cake/libs/set.php @@ -801,22 +801,6 @@ function diff($val1, $val2 = null) { return $val1 + $val2; } -/** - * Determines if two Sets or arrays are equal - * This method is deprecated, and will be removed in a future release. - * - * @param array $val1 First value - * @param array $val2 Second value - * @return boolean true if they are equal, false otherwise - * @access public - * @static - * @deprecated - */ - function isEqual($val1, $val2 = null) { - trigger_error(__('Set::isEqual() is deprecated. Please use standard comparison operators instead.', true), E_USER_WARNING); - return ($val1 == $val2); - } - /** * Determines if one Set or array contains the exact keys and values of another. * From 70d0c642836504949a7ac07ad267a621b2399a73 Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Mon, 15 Mar 2010 01:58:38 +0530 Subject: [PATCH 1766/2083] Removing constant REQUEST_MOBILE_UA, and added variable $mobileUA instead for mobile browser detection. Also added new user agent string 'webOS', closes #457 --- .../controller/components/request_handler.php | 45 ++++++++++++++++--- .../components/request_handler.test.php | 6 +++ 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php index bc18cdf55..ef166baac 100644 --- a/cake/libs/controller/components/request_handler.php +++ b/cake/libs/controller/components/request_handler.php @@ -20,10 +20,6 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -if (!defined('REQUEST_MOBILE_UA')) { - define('REQUEST_MOBILE_UA', '(Android|iPod|iPhone|MIDP|AvantGo|BlackBerry|J2ME|Opera Mini|DoCoMo|NetFront|Nokia|PalmOS|PalmSource|portalmmm|Plucker|ReqwirelessWeb|SonyEricsson|Symbian|UP\.Browser|Windows CE|Xiino)'); -} - /** * Request object for handling HTTP requests * @@ -105,6 +101,37 @@ class RequestHandlerComponent extends Object { 'tar' => 'application/x-tar' ); +/** + * List of regular expressions for matching mobile device's user agent string + * + * @var array + * @access public + */ + var $mobileUA = array( + 'Android', + 'AvantGo', + 'BlackBerry', + 'DoCoMo', + 'iPod', + 'iPhone', + 'J2ME', + 'MIDP', + 'NetFront', + 'Nokia', + 'Opera Mini', + 'PalmOS', + 'PalmSource', + 'portalmmm', + 'Plucker', + 'ReqwirelessWeb', + 'SonyEricsson', + 'Symbian', + 'UP\.Browser', + 'webOS', + 'Windows CE', + 'Xiino' + ); + /** * Content-types accepted by the client. If extension parsing is enabled in the * Router, and an extension is detected, the corresponding content-type will be @@ -314,10 +341,16 @@ function isAtom() { * * @return boolean True if user agent is a mobile web browser * @access public + * @deprecated Use of constant REQUEST_MOBILE_UA is deprecated and will be removed in future versions */ function isMobile() { - preg_match('/' . REQUEST_MOBILE_UA . '/i', env('HTTP_USER_AGENT'), $match); - if (!empty($match) || $this->accepts('wap')) { + if (defined('REQUEST_MOBILE_UA')) { + $regex = '/' . REQUEST_MOBILE_UA . '/i'; + } else { + $regex = '/' . implode('|', $this->mobileUA) . '/i'; + } + + if (preg_match($regex, env('HTTP_USER_AGENT')) || $this->accepts('wap')) { return true; } return false; diff --git a/cake/tests/cases/libs/controller/components/request_handler.test.php b/cake/tests/cases/libs/controller/components/request_handler.test.php index 79894d79a..955a99d5b 100644 --- a/cake/tests/cases/libs/controller/components/request_handler.test.php +++ b/cake/tests/cases/libs/controller/components/request_handler.test.php @@ -427,8 +427,14 @@ function testResponseContentType() { */ function testMobileDeviceDetection() { $this->assertFalse($this->RequestHandler->isMobile()); + $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3'; $this->assertTrue($this->RequestHandler->isMobile()); + + $_SERVER['HTTP_USER_AGENT'] = 'Some imaginary UA'; + $this->RequestHandler->mobileUA []= 'imaginary'; + $this->assertTrue($this->RequestHandler->isMobile()); + array_pop($this->RequestHandler->mobileUA); } /** From edf2ea1e741a554a8de069fd17122f850b46f85e Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 14 Mar 2010 16:44:54 -0400 Subject: [PATCH 1767/2083] Updating version numbers to 1.3.0-RC2 --- cake/VERSION.txt | 2 +- cake/config/config.php | 2 +- cake/libs/view/pages/home.ctp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cake/VERSION.txt b/cake/VERSION.txt index 06f84be6a..b115bfc6b 100644 --- a/cake/VERSION.txt +++ b/cake/VERSION.txt @@ -18,4 +18,4 @@ // @license MIT License (http://www.opensource.org/licenses/mit-license.php) // +--------------------------------------------------------------------------------------------+ // //////////////////////////////////////////////////////////////////////////////////////////////////// -1.3.0-RC1 \ No newline at end of file +1.3.0-RC2 \ No newline at end of file diff --git a/cake/config/config.php b/cake/config/config.php index c79f7a9a0..ce1d4114d 100644 --- a/cake/config/config.php +++ b/cake/config/config.php @@ -17,5 +17,5 @@ * @since CakePHP(tm) v 1.1.11.4062 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -return $config['Cake.version'] = '1.3.0-RC1'; +return $config['Cake.version'] = '1.3.0-RC2'; ?> \ No newline at end of file diff --git a/cake/libs/view/pages/home.ctp b/cake/libs/view/pages/home.ctp index 509d45863..1ec7cd917 100644 --- a/cake/libs/view/pages/home.ctp +++ b/cake/libs/view/pages/home.ctp @@ -21,7 +21,7 @@ if (Configure::read() == 0): endif; ?> <h2><?php echo sprintf(__('Release Notes for CakePHP %s.', true), Configure::version()); ?></h2> -<a href="http://cakephp.lighthouseapp.com/projects/42648/changelog-1-3-0-RC1"><?php __('Read the changelog'); ?> </a> +<a href="http://cakephp.lighthouseapp.com/projects/42648/changelog-1-3-0-RC2"><?php __('Read the changelog'); ?> </a> <?php if (Configure::read() > 0): Debugger::checkSecurityKeys(); From 3ab687043e57130cbee76ead4ad7865478da718b Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 14 Mar 2010 19:27:36 -0400 Subject: [PATCH 1768/2083] Updating DboPostgres test to reflect changes in test suite. --- .../datasources/dbo/dbo_postgres.test.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php index e7d2de630..bfd375d77 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php @@ -157,7 +157,8 @@ class DboPostgresTest extends CakeTestCase { * @access public */ var $fixtures = array('core.user', 'core.binary_test', 'core.comment', 'core.article', - 'core.tag', 'core.articles_tag', 'core.attachment', 'core.person', 'core.post', 'core.author'); + 'core.tag', 'core.articles_tag', 'core.attachment', 'core.person', 'core.post', 'core.author', + ); /** * Actual DB connection used in testing * @@ -477,16 +478,23 @@ function testCakeSchema() { )'); $model =& ClassRegistry::init('datatypes'); $schema = new CakeSchema(array('connection' => 'test_suite')); - $result = $schema->read(array('connection' => 'test_suite')); - $schema->tables = $result['tables']['missing']; + $result = $schema->read(array( + 'connection' => 'test_suite', + 'models' => array('Datatype') + )); + $schema->tables = array('datatypes' => $result['tables']['datatypes']); $result = $db1->createSchema($schema, 'datatypes'); $this->assertNoPattern('/timestamp DEFAULT/', $result); $this->assertPattern('/timestamp\s*,/', $result); $db1->query('DROP TABLE ' . $db1->fullTableName('datatypes')); + $db1->query($result); - $result2 = $schema->read(array('connection' => 'test_suite')); - $schema->tables = $result2['tables']['missing']; + $result2 = $schema->read(array( + 'connection' => 'test_suite', + 'models' => array('Datatype') + )); + $schema->tables = array('datatypes' => $result2['tables']['datatypes']); $result2 = $db1->createSchema($schema, 'datatypes'); $this->assertEqual($result, $result2); From daf02cad61a0979fe6cf85b0aa4e5f2d68a03c2b Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 14 Mar 2010 23:31:52 -0400 Subject: [PATCH 1769/2083] Fixing CakeSchema index comparison that was causing failures in postgres tests. --- cake/libs/model/schema.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cake/libs/model/schema.php b/cake/libs/model/schema.php index 30c1a37da..db68169b1 100644 --- a/cake/libs/model/schema.php +++ b/cake/libs/model/schema.php @@ -372,7 +372,7 @@ function write($object, $options = array()) { */ function compare($old, $new = null) { if (empty($new)) { - $new = $this; + $new =& $this; } if (is_array($new)) { if (isset($new['tables'])) { @@ -406,6 +406,7 @@ function compare($old, $new = null) { $tables[$table]['drop'] = $diff; } } + foreach ($fields as $field => $value) { if (isset($old[$table][$field])) { $diff = array_diff_assoc($value, $old[$table][$field]); @@ -427,10 +428,13 @@ function compare($old, $new = null) { if (isset($old[$table]['indexes']) && isset($new[$table]['indexes'])) { $diff = $this->_compareIndexes($new[$table]['indexes'], $old[$table]['indexes']); if ($diff) { - if (isset($tables[$table]['drop']['indexes']) && isset($diff['drop'])) { + if (!isset($tables[$table])) { + $tables[$table] = array(); + } + if (isset($diff['drop'])) { $tables[$table]['drop']['indexes'] = $diff['drop']; } - if (isset($tables[$table]['add']['indexes']) && isset($diff['add'])) { + if ($diff && isset($diff['add'])) { $tables[$table]['add']['indexes'] = $diff['add']; } } From 5e665b32f2bdd67b718c79de406758d7e683a010 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 15 Mar 2010 00:41:44 -0400 Subject: [PATCH 1770/2083] Removing useless condition in DboSource::cacheMethod() --- cake/libs/model/datasources/dbo_source.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 37caca82f..dc41588b4 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -493,10 +493,7 @@ function flushMethodCache() { */ function cacheMethod($method, $key, $value = null) { if ($this->cacheMethods === false) { - if ($value !== null) { - return $value; - } - return null; + return $value; } if ($value === null) { return (isset($this->methodCache[$method][$key])) ? $this->methodCache[$method][$key] : null; From cadac9c24215e546c40cdd8addd3e13480157779 Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Tue, 16 Mar 2010 00:35:05 +0530 Subject: [PATCH 1771/2083] Minor optimization in Inflector::rules, using 'plus'(+) operator instead of 'array_merge' to merge transliteration map arrays --- cake/libs/inflector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index 4d56efa7f..269da7f8b 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -321,7 +321,7 @@ function rules($type, $rules, $reset = false) { if ($reset) { $_this->_transliteration = $rules; } else { - $_this->_transliteration = array_merge($rules, $_this->_transliteration, $rules); + $_this->_transliteration = $rules + $_this->_transliteration; } break; From 190066fd51c222de91989aec97b0042d7bcda7c9 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 15 Mar 2010 22:15:03 -0400 Subject: [PATCH 1772/2083] Adding array_filter() to remove empty conditions that can be caused by array casting an empty string. --- cake/libs/model/model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index d76510fc8..c0ad6aaa1 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1370,10 +1370,10 @@ function __saveMulti($joined, $id) { } if ($this->hasAndBelongsToMany[$assoc]['unique']) { - $conditions = array_merge( + $conditions = array_filter(array_merge( array($join . '.' . $this->hasAndBelongsToMany[$assoc]['foreignKey'] => $id), (array)$this->hasAndBelongsToMany[$assoc]['conditions'] - ); + )); $links = $this->{$join}->find('all', array( 'conditions' => $conditions, 'recursive' => empty($this->hasAndBelongsToMany[$assoc]['conditions']) ? -1 : 0, @@ -1397,7 +1397,7 @@ function __saveMulti($joined, $id) { } if (!empty($newValues)) { - $fields = implode(',', $fields); + $fields = implode(',', $fields); $db->insertMulti($this->{$join}, $fields, $newValues); } } From ea64588a814b09565b82c428845f7a096814c327 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 15 Mar 2010 22:55:14 -0400 Subject: [PATCH 1773/2083] Adding tests from 'Stephen Cuppert' to test incorrectly generate DELETE queries for habtm join tables that do not have a primary key when using PostgreSQL. Updating DboSource::_matchRecords() to only query the table if the supplied conditions are actually multi-table conditions. Fixes #459 --- cake/libs/model/datasources/dbo_source.php | 16 ++++++ .../cases/libs/model/model_delete.test.php | 55 +++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 9f087946d..5982e137d 100644 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -1477,6 +1477,22 @@ function _matchRecords(&$model, $conditions = null) { } elseif ($conditions === null) { $conditions = $this->conditions($this->defaultConditions($model, $conditions, false), true, true, $model); } else { + $noJoin = true; + foreach ($conditions as $field => $value) { + $originalField = $field; + if (strpos($field, '.') !== false) { + list($alias, $field) = explode('.', $field); + } + if (!$model->hasField($field)) { + $noJoin = false; + break; + } + $conditions[$field] = $value; + unset($conditions[$originalField]); + } + if ($noJoin === true) { + return $this->conditions($conditions); + } $idList = $model->find('all', array( 'fields' => "{$model->alias}.{$model->primaryKey}", 'conditions' => $conditions diff --git a/cake/tests/cases/libs/model/model_delete.test.php b/cake/tests/cases/libs/model/model_delete.test.php index e2d4874f8..d299cc905 100644 --- a/cake/tests/cases/libs/model/model_delete.test.php +++ b/cake/tests/cases/libs/model/model_delete.test.php @@ -580,6 +580,61 @@ function testBeforeDeleteDeleteAbortion() { $exists = $Model->findById(1); $this->assertTrue(is_array($exists)); } +/** + * test for a habtm deletion error that occurs in postgres but should not. + * And should not occur in any dbo. + * + * @return void + */ + function testDeleteHabtmPostgresFailure() { + $this->loadFixtures('Article', 'Tag', 'ArticlesTag'); + + $Article =& ClassRegistry::init('Article'); + $Article->hasAndBelongsToMany['Tag']['unique'] = true; + + $Tag =& ClassRegistry::init('Tag'); + $Tag->bindModel(array('hasAndBelongsToMany' => array( + 'Article' => array( + 'className' => 'Article', + 'unique' => true + ) + )), true); + + // Article 1 should have Tag.1 and Tag.2 + $before = $Article->find("all", array( + "conditions" => array("Article.id" => 1), + )); + $this->assertEqual(count($before[0]['Tag']), 2, 'Tag count for Article.id = 1 is incorrect, should be 2 %s'); + + // From now on, Tag #1 is only associated with Post #1 + $submitted_data = array( + "Tag" => array("id" => 1, 'tag' => 'tag1'), + "Article" => array( + "Article" => array(1) + ) + ); + $Tag->save($submitted_data); + + // One more submission (The other way around) to make sure the reverse save looks good. + $submitted_data = array( + "Article" => array("id" => 2, 'title' => 'second article'), + "Tag" => array( + "Tag" => array(2, 3) + ) + ); + // ERROR: + // Postgresql: DELETE FROM "articles_tags" WHERE tag_id IN ('1', '3') + // MySQL: DELETE `ArticlesTag` FROM `articles_tags` AS `ArticlesTag` WHERE `ArticlesTag`.`article_id` = 2 AND `ArticlesTag`.`tag_id` IN (1, 3) + $Article->save($submitted_data); + + // Want to make sure Article #1 has Tag #1 and Tag #2 still. + $after = $Article->find("all", array( + "conditions" => array("Article.id" => 1), + )); + + // Removing Article #2 from Tag #1 is all that should have happened. + $this->assertEqual(count($before[0]["Tag"]), count($after[0]["Tag"])); + } } ?> \ No newline at end of file From 661fcd32ab56b3c288c922c570ea141461d794ba Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 15 Mar 2010 23:07:18 -0400 Subject: [PATCH 1774/2083] Fixing failing tests in PostgreSQL cause by invalid datatype comparisons and missing id fields. --- cake/tests/cases/libs/model/model_write.test.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/model/model_write.test.php b/cake/tests/cases/libs/model/model_write.test.php index f57dc0eb4..b43b0facf 100644 --- a/cake/tests/cases/libs/model/model_write.test.php +++ b/cake/tests/cases/libs/model/model_write.test.php @@ -322,6 +322,7 @@ function testCacheClearOnSave() { $data = array( 'OverallFavorite' => array( + 'id' => 22, 'model_type' => '8-track', 'model_id' => '3', 'priority' => '1' @@ -383,6 +384,7 @@ function testCounterCacheIncrease() { $User = new CounterCacheUser(); $Post = new CounterCachePost(); $data = array('Post' => array( + 'id' => 22, 'title' => 'New Post', 'user_id' => 66 )); @@ -2007,7 +2009,7 @@ function testHabtmSaveWithConditionsInAssociation() { 'DoomedSomethingElse' => array( 'className' => 'SomethingElse', 'joinTable' => 'join_things', - 'conditions' => 'JoinThing.doomed = 1', + 'conditions' => 'JoinThing.doomed = true', 'unique' => true ), 'NotDoomedSomethingElse' => array( From 01a5738f3c7f8553d8203eb565c08beba6e79ca0 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 15 Mar 2010 23:14:23 -0400 Subject: [PATCH 1775/2083] Effectively reverting changes made in [190066fd51c222de91989aec97b0042d7bcda7c9] which caused conditions using a falsey values to be removed. --- cake/libs/model/model.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index c0ad6aaa1..184a75fee 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1370,10 +1370,12 @@ function __saveMulti($joined, $id) { } if ($this->hasAndBelongsToMany[$assoc]['unique']) { - $conditions = array_filter(array_merge( - array($join . '.' . $this->hasAndBelongsToMany[$assoc]['foreignKey'] => $id), - (array)$this->hasAndBelongsToMany[$assoc]['conditions'] - )); + $conditions = array( + $join . '.' . $this->hasAndBelongsToMany[$assoc]['foreignKey'] => $id + ); + if (!empty($this->hasAndBelongsToMany[$assoc]['conditions'])) { + $conditions = array_merge($conditions, (array)$this->hasAndBelongsToMany[$assoc]['conditions']); + } $links = $this->{$join}->find('all', array( 'conditions' => $conditions, 'recursive' => empty($this->hasAndBelongsToMany[$assoc]['conditions']) ? -1 : 0, From 0c951b724822f432e03530fc3f625904788e5225 Mon Sep 17 00:00:00 2001 From: AD7six <andydawson76@yahoo.co.uk> Date: Mon, 15 Mar 2010 11:55:47 +0100 Subject: [PATCH 1776/2083] Prevent sql error for uuids if id is specified as null if the primary key is present in the data to be saved as null - prevent passing the same key (id) twice and therefore triggering an sql error. Signed-off-by: Mark Story <mark@mark-story.com> --- cake/libs/model/model.php | 9 ++++++-- .../cases/libs/model/model_write.test.php | 23 +++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index c1de0d85b..9f2a91df9 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1334,7 +1334,12 @@ function save($data = null, $validate = true, $fieldList = array()) { ($fInfo['type'] === 'string' || $fInfo['type'] === 'binary') ); if (empty($this->data[$this->alias][$this->primaryKey]) && $isUUID) { - list($fields[], $values[]) = array($this->primaryKey, String::uuid()); + if (array_key_exists($this->primaryKey, $this->data[$this->alias])) { + $j = array_search($this->primaryKey, $fields); + $values[$j] = String::uuid(); + } else { + list($fields[], $values[]) = array($this->primaryKey, String::uuid()); + } } break; } @@ -2667,7 +2672,7 @@ function isForeignKey($field) { } /** - * Escapes the field name and prepends the model name. Escaping is done according to the + * Escapes the field name and prepends the model name. Escaping is done according to the * current database driver's rules. * * @param string $field Field to escape (e.g: id) diff --git a/cake/tests/cases/libs/model/model_write.test.php b/cake/tests/cases/libs/model/model_write.test.php index dc757d576..22f878443 100644 --- a/cake/tests/cases/libs/model/model_write.test.php +++ b/cake/tests/cases/libs/model/model_write.test.php @@ -162,6 +162,29 @@ function testAutoSaveUuid() { $this->assertEqual(strlen($result['Uuid']['id']), 36); } +/** + * Ensure that if the id key is null but present the save doesn't fail (with an + * x sql error: "Column id specified twice") + * + * @return void + * @access public + */ + function testSaveUuidNull() { + // SQLite does not support non-integer primary keys + $this->skipIf($this->db->config['driver'] == 'sqlite'); + + $this->loadFixtures('Uuid'); + $TestModel =& new Uuid(); + + $TestModel->save(array('title' => 'Test record', 'id' => null)); + $result = $TestModel->findByTitle('Test record'); + $this->assertEqual( + array_keys($result['Uuid']), + array('id', 'title', 'count', 'created', 'updated') + ); + $this->assertEqual(strlen($result['Uuid']['id']), 36); + } + /** * testZeroDefaultFieldValue method * From 8375570f8aee3dbd7cea85762bebfcfe30ae2cec Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 15 Mar 2010 23:36:20 -0400 Subject: [PATCH 1777/2083] Removing useless loop in Model::save() --- cake/libs/model/model.php | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 9f2a91df9..f8ccaf81d 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1327,21 +1327,16 @@ function save($data = null, $validate = true, $fieldList = array()) { if (!empty($this->id)) { $success = (bool)$db->update($this, $fields, $values); } else { - foreach ($this->_schema as $field => $properties) { - if ($this->primaryKey === $field) { - $fInfo = $this->_schema[$field]; - $isUUID = ($fInfo['length'] == 36 && - ($fInfo['type'] === 'string' || $fInfo['type'] === 'binary') - ); - if (empty($this->data[$this->alias][$this->primaryKey]) && $isUUID) { - if (array_key_exists($this->primaryKey, $this->data[$this->alias])) { - $j = array_search($this->primaryKey, $fields); - $values[$j] = String::uuid(); - } else { - list($fields[], $values[]) = array($this->primaryKey, String::uuid()); - } - } - break; + $fInfo = $this->_schema[$this->primaryKey]; + $isUUID = ($fInfo['length'] == 36 && + ($fInfo['type'] === 'string' || $fInfo['type'] === 'binary') + ); + if (empty($this->data[$this->alias][$this->primaryKey]) && $isUUID) { + if (array_key_exists($this->primaryKey, $this->data[$this->alias])) { + $j = array_search($this->primaryKey, $fields); + $values[$j] = String::uuid(); + } else { + list($fields[], $values[]) = array($this->primaryKey, String::uuid()); } } From 201a952218e7e83ebc08f80decd4be13739ed773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Tue, 16 Mar 2010 15:12:27 -0430 Subject: [PATCH 1778/2083] Fixing test for postgresql, it is no safe to asume the order of the returned results of a joined table --- cake/tests/cases/libs/model/model_read.test.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cake/tests/cases/libs/model/model_read.test.php b/cake/tests/cases/libs/model/model_read.test.php index bdcb4db2a..49e1f39fe 100755 --- a/cake/tests/cases/libs/model/model_read.test.php +++ b/cake/tests/cases/libs/model/model_read.test.php @@ -51,17 +51,20 @@ function testFetchingNonUniqueFKJoinTableRecords() { 'updated' => '2007-03-18 10:41:31' ) ); + $Something->JoinThing->create($joinThingData); $Something->JoinThing->save(); $result = $Something->JoinThing->find('all', array('conditions' => array('something_else_id' => 2))); - $this->assertEqual($result[0]['JoinThing']['doomed'], 1); - $this->assertEqual($result[1]['JoinThing']['doomed'], 0); + $this->assertEqual($result[0]['JoinThing']['doomed'], true); + $this->assertEqual($result[1]['JoinThing']['doomed'], false); $result = $Something->find('first'); $this->assertEqual(count($result['SomethingElse']), 2); - $this->assertEqual($result['SomethingElse'][0]['JoinThing']['doomed'], 1); - $this->assertEqual($result['SomethingElse'][1]['JoinThing']['doomed'], 0); + + $doomed = Set::extract('/JoinThing/doomed', $result['SomethingElse']); + $this->assertTrue(in_array(true, $doomed)); + $this->assertTrue(in_array(false, $doomed)); } /** From c1f74c28aeb12f6f603c772e74d8e752173a33bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Tue, 16 Mar 2010 16:49:57 -0430 Subject: [PATCH 1779/2083] Fixing postgres self join error --- cake/libs/model/datasources/dbo_source.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index a0135e5d3..de1396de1 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -1663,6 +1663,8 @@ function _matchRecords(&$model, $conditions = null) { $originalField = $field; if (strpos($field, '.') !== false) { list($alias, $field) = explode('.', $field); + $field = ltrim($field, $this->startQuote); + $field = rtrim($field, $this->endQuote); } if (!$model->hasField($field)) { $noJoin = false; From c51f4076f708ef5c93ea0ce6b2704eb712e70717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Tue, 16 Mar 2010 17:00:20 -0430 Subject: [PATCH 1780/2083] Forcing order on find('all') in test. It is not safe to asume returned row order in postgres --- cake/tests/cases/libs/model/model_write.test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/model/model_write.test.php b/cake/tests/cases/libs/model/model_write.test.php index 22f878443..5861a3f75 100644 --- a/cake/tests/cases/libs/model/model_write.test.php +++ b/cake/tests/cases/libs/model/model_write.test.php @@ -1590,7 +1590,7 @@ function testSaveHabtmCustomKeys() { $result = $Story->save(); $this->assertTrue($result); - $result = $Story->find('all'); + $result = $Story->find('all', array('order' => array('Story.story'))); $expected = array( array( 'Story' => array( From 85f5750c81447ea6fcc0b74b21b79f4f6059ea20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Tue, 16 Mar 2010 18:09:27 -0430 Subject: [PATCH 1781/2083] Changing fixture data to avoid postgres error. Manually inserted id does not increment sequence --- .../uuiditems_uuidportfolio_numericid_fixture.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php b/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php index 01c0d64e0..93e5cedcd 100644 --- a/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php +++ b/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php @@ -53,10 +53,10 @@ class UuiditemsUuidportfolioNumericidFixture extends CakeTestFixture { * @access public */ var $records = array( - array('id' => 1, 'uuiditem_id' => '481fc6d0-b920-43e0-a40d-6d1740cf8569', 'uuidportfolio_id' => '4806e091-6940-4d2b-b227-303740cf8569'), - array('id' => 2, 'uuiditem_id' => '48298a29-81c0-4c26-a7fb-413140cf8569', 'uuidportfolio_id' => '480af662-eb8c-47d3-886b-230540cf8569'), - array('id' => 3, 'uuiditem_id' => '482b7756-8da0-419a-b21f-27da40cf8569', 'uuidportfolio_id' => '4806e091-6940-4d2b-b227-303740cf8569'), - array('id' => 4, 'uuiditem_id' => '482cfd4b-0e7c-4ea3-9582-4cec40cf8569', 'uuidportfolio_id' => '4806e091-6940-4d2b-b227-303740cf8569') + array('uuiditem_id' => '481fc6d0-b920-43e0-a40d-6d1740cf8569', 'uuidportfolio_id' => '4806e091-6940-4d2b-b227-303740cf8569'), + array('uuiditem_id' => '48298a29-81c0-4c26-a7fb-413140cf8569', 'uuidportfolio_id' => '480af662-eb8c-47d3-886b-230540cf8569'), + array('uuiditem_id' => '482b7756-8da0-419a-b21f-27da40cf8569', 'uuidportfolio_id' => '4806e091-6940-4d2b-b227-303740cf8569'), + array('uuiditem_id' => '482cfd4b-0e7c-4ea3-9582-4cec40cf8569', 'uuidportfolio_id' => '4806e091-6940-4d2b-b227-303740cf8569') ); } ?> \ No newline at end of file From cceb568520ab1401f3891f041d9b7884c544f486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Tue, 16 Mar 2010 18:46:04 -0430 Subject: [PATCH 1782/2083] Skiping some test in model_write test when using postgres as there is no way yet to do joins inside an update statement. Possible enhancement would be transforming the join conditions into subquerys --- cake/tests/cases/libs/model/model_write.test.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cake/tests/cases/libs/model/model_write.test.php b/cake/tests/cases/libs/model/model_write.test.php index 5861a3f75..2bc0fc64d 100644 --- a/cake/tests/cases/libs/model/model_write.test.php +++ b/cake/tests/cases/libs/model/model_write.test.php @@ -3708,6 +3708,10 @@ function testFindAllForeignKey() { * @return void */ function testProductUpdateAll() { + $this->skipIf( + $this->db->config['driver'] == 'postgres', + '%s Currently, there is no way of doing joins in an update statement in postgresql' + ); $this->loadFixtures('ProductUpdateAll', 'GroupUpdateAll'); $ProductUpdateAll =& new ProductUpdateAll(); @@ -3746,6 +3750,7 @@ function testProductUpdateAll() { $this->assertEqual($results, $expected); } + /** * testProductUpdateAllWithoutForeignKey * @@ -3754,6 +3759,10 @@ function testProductUpdateAll() { * @return void */ function testProductUpdateAllWithoutForeignKey() { + $this->skipIf( + $this->db->config['driver'] == 'postgres', + '%s Currently, there is no way of doing joins in an update statement in postgresql' + ); $this->loadFixtures('ProductUpdateAll', 'GroupUpdateAll'); $ProductUpdateAll =& new ProductUpdateAll(); From bc990f41e3d29db70cf5c181a11668c8e63f4bdf Mon Sep 17 00:00:00 2001 From: AD7six <andydawson76@yahoo.co.uk> Date: Mon, 15 Mar 2010 11:55:47 +0100 Subject: [PATCH 1783/2083] Prevent sql error for uuids if id is specified as null if the primary key is present in the data to be saved as null - prevent passing the same key (id) twice and therefore triggering an sql error. Signed-off-by: Mark Story <mark@mark-story.com> --- cake/libs/model/model.php | 7 +++++- .../cases/libs/model/model_write.test.php | 23 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 184a75fee..f3c26e01a 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1273,7 +1273,12 @@ function save($data = null, $validate = true, $fieldList = array()) { ($fInfo['type'] === 'string' || $fInfo['type'] === 'binary') ); if (empty($this->data[$this->alias][$this->primaryKey]) && $isUUID) { - list($fields[], $values[]) = array($this->primaryKey, String::uuid()); + if (array_key_exists($this->primaryKey, $this->data[$this->alias])) { + $j = array_search($this->primaryKey, $fields); + $values[$j] = String::uuid(); + } else { + list($fields[], $values[]) = array($this->primaryKey, String::uuid()); + } } break; } diff --git a/cake/tests/cases/libs/model/model_write.test.php b/cake/tests/cases/libs/model/model_write.test.php index b43b0facf..2cc0326f3 100644 --- a/cake/tests/cases/libs/model/model_write.test.php +++ b/cake/tests/cases/libs/model/model_write.test.php @@ -161,6 +161,29 @@ function testAutoSaveUuid() { ); $this->assertEqual(strlen($result['Uuid']['id']), 36); } +/** + * Ensure that if the id key is null but present the save doesn't fail (with an + * x sql error: "Column id specified twice") + * + * @return void + * @access public + */ + function testSaveUuidNull() { + // SQLite does not support non-integer primary keys + $this->skipIf($this->db->config['driver'] == 'sqlite'); + + $this->loadFixtures('Uuid'); + $TestModel =& new Uuid(); + + $TestModel->save(array('title' => 'Test record', 'id' => null)); + $result = $TestModel->findByTitle('Test record'); + $this->assertEqual( + array_keys($result['Uuid']), + array('id', 'title', 'count', 'created', 'updated') + ); + $this->assertEqual(strlen($result['Uuid']['id']), 36); + } + /** * testZeroDefaultFieldValue method * From 28cb57a92c54a223fed4aacc738db5ccc8bc71c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Wed, 17 Mar 2010 10:32:36 -0430 Subject: [PATCH 1784/2083] Fixing bug in Model::escapeField() where it would return the wrong string id the datasource's name method returs the unmodified string. Tests added. Closes #473 --- cake/libs/model/model.php | 2 +- .../libs/model/model_integration.test.php | 52 +++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index f3c26e01a..12de7f31f 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -2631,7 +2631,7 @@ function escapeField($field = null, $alias = null) { $field = $this->primaryKey; } $db =& ConnectionManager::getDataSource($this->useDbConfig); - if (strpos($field, $db->name($alias)) === 0) { + if (strpos($field, $db->name($alias) . '.') === 0) { return $field; } return $db->name($alias . '.' . $field); diff --git a/cake/tests/cases/libs/model/model_integration.test.php b/cake/tests/cases/libs/model/model_integration.test.php index 3da333592..85de2ed96 100644 --- a/cake/tests/cases/libs/model/model_integration.test.php +++ b/cake/tests/cases/libs/model/model_integration.test.php @@ -24,6 +24,27 @@ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ require_once dirname(__FILE__) . DS . 'model.test.php'; +App::import('Core', 'DboSource'); + +/** + * DboMock class + * A Dbo Source driver to mock a connection and a identity name() method + */ +class DboMock extends DboSource { + +/** +* Returns the $field without modifications +*/ + function name($field) { + return $field; + } +/** +* Returns true to fake a database connection +*/ + function connect() { + return true; + } +} /** * ModelIntegrationTest @@ -1831,5 +1852,36 @@ function testCreation() { $this->assertEqual($FeaturedModel->create($data), $expected); } +/** + * testEscapeField to prove it escapes the field well even when it has part of the alias on it + * @see ttp://cakephp.lighthouseapp.com/projects/42648-cakephp-1x/tickets/473-escapefield-doesnt-consistently-prepend-modelname + * + * @access public + * @return void + */ + function testEscapeField() { + $TestModel =& new Test(); + $db =& $TestModel->getDataSource(); + + $result = $TestModel->escapeField('test_field'); + $expected = $db->name('Test.test_field'); + $this->assertEqual($result, $expected); + + $result = $TestModel->escapeField('TestField'); + $expected = $db->name('Test.TestField'); + $this->assertEqual($result, $expected); + + $result = $TestModel->escapeField('DomainHandle', 'Domain'); + $expected = $db->name('Domain.DomainHandle'); + $this->assertEqual($result, $expected); + + ConnectionManager::create('mock', array('driver' => 'mock')); + $TestModel->setDataSource('mock'); + $db =& $TestModel->getDataSource(); + + $result = $TestModel->escapeField('DomainHandle', 'Domain'); + $expected = $db->name('Domain.DomainHandle'); + $this->assertEqual($result, $expected); + } } ?> \ No newline at end of file From c3aec39d75a944c2105adbaba286049e03311f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Wed, 17 Mar 2010 10:47:03 -0430 Subject: [PATCH 1785/2083] Chaging array_push call for array_merge, as the first one would produce worng nested arrays in MediaView. closes #391 --- cake/libs/view/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/view/media.php b/cake/libs/view/media.php index 71c4e43a2..f50217d8f 100644 --- a/cake/libs/view/media.php +++ b/cake/libs/view/media.php @@ -148,7 +148,7 @@ function render() { $contentTypes[0] = 'application/octetstream'; } else if (preg_match('/MSIE ([0-9].[0-9]{1,2})/', $agent)) { $contentTypes[0] = 'application/force-download'; - array_push($contentTypes, array( + array_merge($contentTypes, array( 'application/octet-stream', 'application/download' )); From 5c186d4430941e68a610718a51a41c1f15574424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Wed, 17 Mar 2010 15:19:30 -0430 Subject: [PATCH 1786/2083] Making saveAll() behave like plain save() when suplied empty data array, closes #277 --- cake/libs/model/model.php | 5 +++++ .../cases/libs/model/model_write.test.php | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index f8ccaf81d..3c900e3a6 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1584,6 +1584,11 @@ function saveAll($data = null, $options = array()) { $validates = true; $return = array(); + if (empty($data) && $options['validate'] !== false) { + $result = $this->save($data, $options); + return !empty($result); + } + if ($options['atomic'] && $options['validate'] !== 'only') { $db->begin($this); } diff --git a/cake/tests/cases/libs/model/model_write.test.php b/cake/tests/cases/libs/model/model_write.test.php index 22f878443..3b27a079b 100644 --- a/cake/tests/cases/libs/model/model_write.test.php +++ b/cake/tests/cases/libs/model/model_write.test.php @@ -3798,6 +3798,24 @@ function testProductUpdateAllWithoutForeignKey() { $this->assertEqual($resultsFkFalse, $expected); } +/** + * test that saveAll behaves like plain save() when suplied empty data + * + * @link http://cakephp.lighthouseapp.com/projects/42648/tickets/277-test-saveall-with-validation-returns-incorrect-boolean-when-saving-empty-data + * @access public + * @return void + */ + function testSaveAllEmptyData() { + $this->loadFixtures('Article', 'ProductUpdateAll'); + $model =& new Article(); + $result = $model->saveAll(array(), array('validate' => 'first')); + $this->assertTrue($result); + + $model =& new ProductUpdateAll(); + $result = $model->saveAll(array()); + $this->assertFalse($result); + } + } ?> \ No newline at end of file From 93ac79d4fbeb014286ff797889e76766d3aa1023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Wed, 17 Mar 2010 10:47:03 -0430 Subject: [PATCH 1787/2083] Chaging array_push call for array_merge, as the first one would produce worng nested arrays in MediaView. closes #391 --- cake/libs/view/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/view/media.php b/cake/libs/view/media.php index c057ac1fc..8e88fb321 100644 --- a/cake/libs/view/media.php +++ b/cake/libs/view/media.php @@ -154,7 +154,7 @@ function render() { $contentTypes[0] = 'application/octetstream'; } else if (preg_match('/MSIE ([0-9].[0-9]{1,2})/', $agent)) { $contentTypes[0] = 'application/force-download'; - array_push($contentTypes, array( + array_merge($contentTypes, array( 'application/octet-stream', 'application/download' )); From 6a723bb515e8a53578f6c24f21fcbbaf1790c7ba Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Thu, 18 Mar 2010 02:51:20 +0530 Subject: [PATCH 1788/2083] Type casting conditions array to avoid warning during array merge in Model::_deleteDependent(). Fixes #477 --- cake/libs/model/model.php | 2 +- cake/tests/cases/libs/model/model_delete.test.php | 11 +++++++++++ cake/tests/cases/libs/model/models.php | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 3c900e3a6..d6d30e892 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1847,7 +1847,7 @@ function _deleteDependent($id, $cascade) { $model =& $this->{$assoc}; $conditions = array($model->escapeField($data['foreignKey']) => $id); if ($data['conditions']) { - $conditions = array_merge($data['conditions'], $conditions); + $conditions = array_merge((array)$data['conditions'], $conditions); } $model->recursive = -1; diff --git a/cake/tests/cases/libs/model/model_delete.test.php b/cake/tests/cases/libs/model/model_delete.test.php index 6a3b75797..68088b42c 100644 --- a/cake/tests/cases/libs/model/model_delete.test.php +++ b/cake/tests/cases/libs/model/model_delete.test.php @@ -157,6 +157,7 @@ function testDeleteDependentWithConditions() { $this->loadFixtures('Cd','Book','OverallFavorite'); $Cd =& new Cd(); + $Book =& new Book(); $OverallFavorite =& new OverallFavorite(); $Cd->delete(1); @@ -174,6 +175,16 @@ function testDeleteDependentWithConditions() { $this->assertTrue(is_array($result)); $this->assertEqual($result, $expected); + + $Book->delete(1); + + $result = $OverallFavorite->find('all', array( + 'fields' => array('model_type', 'model_id', 'priority') + )); + $expected = array(); + + $this->assertTrue(is_array($result)); + $this->assertEqual($result, $expected); } /** diff --git a/cake/tests/cases/libs/model/models.php b/cake/tests/cases/libs/model/models.php index 6395db434..33b2a6720 100644 --- a/cake/tests/cases/libs/model/models.php +++ b/cake/tests/cases/libs/model/models.php @@ -2025,7 +2025,7 @@ class AssociationTest2 extends CakeTestModel { * @subpackage cake.tests.cases.libs.model */ class Callback extends CakeTestModel { - + } /** * CallbackPostTestModel class @@ -2445,7 +2445,7 @@ class Book extends CakeTestModel { * @var array * @access public */ - var $hasOne = array('OverallFavorite' => array('foreignKey' => 'model_id', 'dependent' => true, 'conditions' => array('model_type' => 'Book'))); + var $hasOne = array('OverallFavorite' => array('foreignKey' => 'model_id', 'dependent' => true, 'conditions' => 'OverallFavorite.model_type = \'Book\'')); } /** From e2113e4aa280719ec3611b475fe35f26702933ba Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Thu, 18 Mar 2010 03:02:58 +0530 Subject: [PATCH 1789/2083] Minor optimization in DboSource::__scrubQueryData(), removing unneded isset() check. --- cake/libs/model/datasources/dbo_source.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index de1396de1..5acc931e1 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -532,12 +532,12 @@ function name($data) { return $this->cacheMethod(__FUNCTION__, $cacheKey, $this->startQuote . $data . $this->endQuote); } $items = explode('.', $data); - return $this->cacheMethod(__FUNCTION__, $cacheKey, + return $this->cacheMethod(__FUNCTION__, $cacheKey, $this->startQuote . implode($this->endQuote . '.' . $this->startQuote, $items) . $this->endQuote ); } if (preg_match('/^[\w-]+\.\*$/', $data)) { // string.* - return $this->cacheMethod(__FUNCTION__, $cacheKey, + return $this->cacheMethod(__FUNCTION__, $cacheKey, $this->startQuote . str_replace('.*', $this->endQuote . '.*', $data) ); } @@ -1884,7 +1884,7 @@ function resolveKey($model, $key, $assoc = null) { */ function __scrubQueryData($data) { foreach (array('conditions', 'fields', 'joins', 'order', 'limit', 'offset', 'group') as $key) { - if (!isset($data[$key]) || empty($data[$key])) { + if (empty($data[$key])) { $data[$key] = array(); } } From 4012925a26059ff926781aaee0d3fe503fc35daf Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Thu, 18 Mar 2010 03:50:14 +0530 Subject: [PATCH 1790/2083] Fixing docblock for pr() --- cake/basics.php | 1 - 1 file changed, 1 deletion(-) diff --git a/cake/basics.php b/cake/basics.php index 4b4904ced..48988cf4f 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -345,7 +345,6 @@ function r($search, $replace, $subject) { * * @see debug() * @param array $var Variable to print out - * @param boolean $showFrom If set to true, the method prints from where the function was called * @link http://book.cakephp.org/view/707/pr */ function pr($var) { From 7337c12f4f3975cc72285790dad72b12f593a815 Mon Sep 17 00:00:00 2001 From: Ceeram <c33ram@gmail.com> Date: Fri, 19 Mar 2010 01:48:28 +0100 Subject: [PATCH 1791/2083] test for ticket #467 --- cake/tests/cases/libs/controller/components/auth.test.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php index df19f67b6..122db1b76 100644 --- a/cake/tests/cases/libs/controller/components/auth.test.php +++ b/cake/tests/cases/libs/controller/components/auth.test.php @@ -625,7 +625,7 @@ function testLogin() { } /** - * test that being redirected to the login page, with no post data does + * test that being redirected to the login page, with no post data does * not set the session value. Saving the session value in this circumstance * can cause the user to be redirected to an already public page. * @@ -1429,6 +1429,8 @@ function testPluginModel() { 'id' => 1, 'username' => 'gwoo', 'created' => '2007-03-17 01:16:23', 'updated' => date('Y-m-d H:i:s') )); $this->assertEqual($user, $expected); + $sessionKey = $this->Controller->Auth->sessionKey; + $this->assertEqual('Auth.TestPluginAuthUser', $sessionKey); // Reverting changes Cache::delete('object_map', '_cake_core_'); From 71e2fb533d51577382a1f2090599c1dd5316bfaf Mon Sep 17 00:00:00 2001 From: Ceeram <c33ram@gmail.com> Date: Fri, 19 Mar 2010 01:49:41 +0100 Subject: [PATCH 1792/2083] fix for ticket #467 setting correct defaults when userModel is a plugin model --- cake/libs/controller/components/auth.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index 5a3c086c1..4236f614d 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -448,12 +448,14 @@ function __setDefaults() { trigger_error(__("Could not find \$userModel. Please set AuthComponent::\$userModel in beforeFilter().", true), E_USER_WARNING); return false; } + list($plugin, $model) = pluginSplit($this->userModel); $defaults = array( 'loginAction' => array( - 'controller' => Inflector::underscore(Inflector::pluralize($this->userModel)), - 'action' => 'login' + 'controller' => Inflector::underscore(Inflector::pluralize($model)), + 'action' => 'login', + 'plugin' => $plugin, ), - 'sessionKey' => 'Auth.' . $this->userModel, + 'sessionKey' => 'Auth.' . $model, 'logoutRedirect' => $this->loginAction, 'loginError' => __('Login failed. Invalid username or password.', true), 'authError' => __('You are not authorized to access that location.', true) From e595d81102ce285ab66c70d9e0b0cd46edb3d8fe Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 19 Mar 2010 14:10:10 +1100 Subject: [PATCH 1793/2083] Removing returns from File::__construct --- cake/libs/file.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/cake/libs/file.php b/cake/libs/file.php index e0fe9ba57..1ff463fd2 100644 --- a/cake/libs/file.php +++ b/cake/libs/file.php @@ -102,16 +102,7 @@ function __construct($path, $create = false, $mode = 0755) { $this->name = basename($path); } $this->pwd(); - - if (!$this->exists()) { - if ($create === true) { - if ($this->safe($path) && $this->create() === false) { - return false; - } - } else { - return false; - } - } + !$this->exists() && $create && $this->safe($path) && $this->create(); } /** From f65cb31cbea30b551369689990a1f0d78af0cc84 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 19 Mar 2010 20:44:18 -0400 Subject: [PATCH 1794/2083] Updating documentation for Router::normalize(). Refs #486 --- cake/libs/router.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index 51d452cec..1569ba359 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -1180,9 +1180,11 @@ function queryString($q, $extra = array(), $escape = false) { return $out; } /** - * Normalizes a URL for purposes of comparison + * Normalizes a URL for purposes of comparison. Will strip the base path off + * and replace any double /'s. It will not unify the casing and underscoring + * of the input value. * - * @param mixed $url URL to normalize + * @param mixed $url URL to normalize Either an array or a string url. * @return string Normalized URL * @access public */ From d75e4b0d5f0e6d0e9102f0a6910ec968bc98b68f Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 19 Mar 2010 20:44:18 -0400 Subject: [PATCH 1795/2083] Updating documentation for Router::normalize(). Refs #486 --- cake/libs/router.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index 36ad1b21c..9d311607e 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -1047,9 +1047,11 @@ function reverse($params) { } /** - * Normalizes a URL for purposes of comparison + * Normalizes a URL for purposes of comparison. Will strip the base path off + * and replace any double /'s. It will not unify the casing and underscoring + * of the input value. * - * @param mixed $url URL to normalize + * @param mixed $url URL to normalize Either an array or a string url. * @return string Normalized URL * @access public * @static From 76af3b9e8136e51da85fc470c31be4e58cf4540c Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Sat, 20 Mar 2010 23:03:51 +0530 Subject: [PATCH 1796/2083] Fixing docblock for Inflector:rules() --- cake/libs/inflector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index 269da7f8b..fc610b55d 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -304,7 +304,7 @@ function _cache($type, $key, $value = false) { * Inflector::rules('transliteration', array('/Ã¥/' => 'aa')); * }}} * - * @param string $type The type of inflection, either 'singular', 'singular' or 'transliteration' + * @param string $type The type of inflection, either 'plural', 'singular' or 'transliteration' * @param array $rules Array of rules to be added. * @param boolean $reset If true, will unset default inflections for all * new rules that are being defined in $rules. From 7f7315e6d25b38e4e4a450fe3d62ff864c7b3f29 Mon Sep 17 00:00:00 2001 From: Phally <info@frankdegraaf.net> Date: Sat, 20 Mar 2010 12:31:20 +0100 Subject: [PATCH 1797/2083] Added alphabetic sorting to the plugin list in the test suite. Signed-off-by: Mark Story <mark@mark-story.com> --- cake/tests/lib/reporter/cake_html_reporter.php | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 cake/tests/lib/reporter/cake_html_reporter.php diff --git a/cake/tests/lib/reporter/cake_html_reporter.php b/cake/tests/lib/reporter/cake_html_reporter.php old mode 100644 new mode 100755 index c6148c218..1144a3f00 --- a/cake/tests/lib/reporter/cake_html_reporter.php +++ b/cake/tests/lib/reporter/cake_html_reporter.php @@ -65,6 +65,7 @@ function paintTestMenu() { $groups = $this->baseUrl() . '?show=groups'; $cases = $this->baseUrl() . '?show=cases'; $plugins = App::objects('plugin'); + sort($plugins); include CAKE_TESTS_LIB . 'templates' . DS . 'menu.php'; } From 6c8ce984aad2fa830da219cd2665c378cecec340 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 20 Mar 2010 18:15:52 -0400 Subject: [PATCH 1798/2083] Adding import for String to ensure that String has been loaded when Security component is used without making any database connections. Fixes #482 --- cake/libs/controller/components/security.php | 1 + 1 file changed, 1 insertion(+) diff --git a/cake/libs/controller/components/security.php b/cake/libs/controller/components/security.php index f702c194a..e49f69966 100644 --- a/cake/libs/controller/components/security.php +++ b/cake/libs/controller/components/security.php @@ -23,6 +23,7 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ +App::import('Core', 'String'); /** * Short description for file. * From 0cc1e4c56e8d492e97e009f0385ad6e66b9e81da Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 20 Mar 2010 18:15:52 -0400 Subject: [PATCH 1799/2083] Adding import for String to ensure that String has been loaded when Security component is used without making any database connections. Fixes #482 --- cake/libs/controller/components/security.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/controller/components/security.php b/cake/libs/controller/components/security.php index 05955a4ec..908ea1179 100644 --- a/cake/libs/controller/components/security.php +++ b/cake/libs/controller/components/security.php @@ -17,7 +17,7 @@ * @since CakePHP(tm) v 0.10.8.2156 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ - +App::import('Core', 'String'); /** * Short description for file. * From 6d13f0d3d1006f91ffd7d8ea09dea03483af3d7d Mon Sep 17 00:00:00 2001 From: Ceeram <c33ram@gmail.com> Date: Fri, 19 Mar 2010 00:31:03 +0100 Subject: [PATCH 1800/2083] added test for ticket #469 Signed-off-by: Mark Story <mark@mark-story.com> --- cake/tests/cases/basics.test.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cake/tests/cases/basics.test.php b/cake/tests/cases/basics.test.php index 2c4dc41ed..1afbe8ae6 100644 --- a/cake/tests/cases/basics.test.php +++ b/cake/tests/cases/basics.test.php @@ -332,6 +332,23 @@ function testClearCache() { $this->assertFalse(file_exists(CACHE . 'models' . DS . 'basics_test.cache')); $this->assertFalse(file_exists(CACHE . 'models' . DS . 'basics_test_2.cache')); $this->assertFalse(file_exists(CACHE . 'models' . DS . 'basics_test_3.cache')); + + // checking if empty files were not removed + $emptyExists = file_exists(CACHE . 'views' . DS . 'empty'); + if (!$emptyExists) { + cache('views' . DS . 'empty', ''); + } + cache('views' . DS . 'basics_test.php', 'simple cache write'); + $this->assertTrue(file_exists(CACHE . 'views' . DS . 'basics_test.php')); + $this->assertTrue(file_exists(CACHE . 'views' . DS . 'empty')); + + $result = clearCache(); + $this->assertTrue($result); + $this->assertTrue(file_exists(CACHE . 'views' . DS . 'empty')); + $this->assertFalse(file_exists(CACHE . 'views' . DS . 'basics_test.php')); + if (!$emptyExists) { + unlink(CACHE . 'views' . DS . 'empty'); + } } /** From 8a4ad9f51a93f188547571c93e5dcae0d444a329 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 20 Mar 2010 18:54:35 -0400 Subject: [PATCH 1801/2083] Fixing clearCache() so it doesn't delete files named 'empty'. Applies Ceeram's changes without modifying the entire file. Fixes #469 --- cake/basics.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/basics.php b/cake/basics.php index 48988cf4f..0df4069e4 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -578,7 +578,7 @@ function clearCache($params = null, $type = 'views', $ext = '.php') { } foreach ($files as $file) { - if (is_file($file)) { + if (is_file($file) && strrpos($file, DS . 'empty') !== strlen($file) - 6) { @unlink($file); } } @@ -599,7 +599,7 @@ function clearCache($params = null, $type = 'views', $ext = '.php') { return false; } foreach ($files as $file) { - if (is_file($file)) { + if (is_file($file) && strrpos($file, DS . 'empty') !== strlen($file) - 6) { @unlink($file); } } From cc59b04ad3d5f075c1e3601ea5149b4c109416ed Mon Sep 17 00:00:00 2001 From: Matt Curry <matt@pseudocoder.com> Date: Fri, 19 Mar 2010 17:20:51 -0400 Subject: [PATCH 1802/2083] fixed bad path for css on windows Signed-off-by: Mark Story <mark@mark-story.com> --- cake/tests/lib/cake_test_suite_dispatcher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/lib/cake_test_suite_dispatcher.php b/cake/tests/lib/cake_test_suite_dispatcher.php index d6bef5cd2..531448d7c 100644 --- a/cake/tests/lib/cake_test_suite_dispatcher.php +++ b/cake/tests/lib/cake_test_suite_dispatcher.php @@ -76,7 +76,7 @@ class CakeTestSuiteDispatcher { */ function CakeTestSuiteDispatcher() { $this->_baseUrl = $_SERVER['PHP_SELF']; - $dir = dirname($this->_baseUrl); + $dir = rtrim(dirname($this->_baseUrl), '\\'); $this->_baseDir = ($dir === '/') ? $dir : $dir . '/'; } From 5e8665cd8db05b4dc2804baa36d878c70724bbe9 Mon Sep 17 00:00:00 2001 From: Juan Basso <jrbasso@gmail.com> Date: Sat, 20 Mar 2010 17:57:01 -0300 Subject: [PATCH 1803/2083] Allowing routes to set an extension when Router::parseExtension() is being used. Fixes #492 Signed-off-by: Mark Story <mark@mark-story.com> --- cake/libs/router.php | 2 +- cake/tests/cases/libs/router.test.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index 9d311607e..0c988ac35 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -497,7 +497,7 @@ function parse($url) { } } - if (!empty($ext)) { + if (!empty($ext) && !isset($out['url']['ext'])) { $out['url']['ext'] = $ext; } return $out; diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 99b549cfc..82b4604ec 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -1212,6 +1212,13 @@ function testExtensionParsing() { $result = Router::parse('/controller/action'); $expected = array('controller' => 'controller', 'action' => 'action', 'plugin' => null, 'url' => array('ext' => 'rss'), 'named' => array(), 'pass' => array()); $this->assertEqual($result, $expected); + + Router::reload(); + Router::parseExtensions('rss'); + Router::connect('/controller/action', array('controller' => 'controller', 'action' => 'action', 'url' => array('ext' => 'rss'))); + $result = Router::parse('/controller/action'); + $expected = array('controller' => 'controller', 'action' => 'action', 'plugin' => null, 'url' => array('ext' => 'rss'), 'named' => array(), 'pass' => array()); + $this->assertEqual($result, $expected); } /** From 8f20b12c5838f9989869b25a00fe0f204fc6aa53 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 20 Mar 2010 19:43:52 -0400 Subject: [PATCH 1804/2083] Expanding the documentation related to showParents and options. Fixes #479. --- cake/libs/view/helpers/form.php | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 11d74f6cc..e06cbc349 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -1342,13 +1342,38 @@ function submit($caption = null, $options = array()) { * ### Attributes: * * - `showParents` - If included in the array and set to true, an additional option element - * will be added for the parent of each option group. + * will be added for the parent of each option group. You can set an option with the same name + * and it's key will be used for the value of the option. * - `multiple` - show a multiple select box. If set to 'checkbox' multiple checkboxes will be * created instead. * - `empty` - If true, the empty select option is shown. If a string, * that string is displayed as the empty element. * - `escape` - If true contents of options will be HTML entity encoded. Defaults to true. * + * ### Using options + * + * A simple array will create normal options: + * + * {{{ + * $options = array(1 => 'one', 2 => 'two); + * $this->Form->select('Model.field', $options)); + * }}} + * + * While a nested options array will create optgroups with options inside them. + * {{{ + * $options = array( + * 1 => 'bill', + * 'fred' => array( + * 2 => 'fred', + * 3 => 'fred jr.' + * ) + * ); + * $this->Form->select('Model.field', $options); + * }}} + * + * In the above `2 => 'fred'` will not generate an option element. You should enable the `showParents` + * attribute to show the fred option. + * * @param string $fieldName Name attribute of the SELECT * @param array $options Array of the OPTION elements (as 'value'=>'Text' pairs) to be used in the * SELECT element From 209af202ecb614330b50ffd477a3c66b32cd59ce Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Tue, 23 Mar 2010 00:39:24 +0530 Subject: [PATCH 1805/2083] Optimizing Sanitize::html() by caching default charset. Closes #496. Also charset passed in $options parameter now takes precedence over the default value obtained from app's config value 'App.encoding' --- cake/libs/sanitize.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/cake/libs/sanitize.php b/cake/libs/sanitize.php index 132d3795d..4c2da5e4f 100644 --- a/cake/libs/sanitize.php +++ b/cake/libs/sanitize.php @@ -80,7 +80,7 @@ function escape($string, $connection = 'default') { /** * Returns given string safe for display as HTML. Renders entities. - * + * * strip_tags() does not validating HTML syntax or structure, so it might strip whole passages * with broken HTML. * @@ -97,9 +97,16 @@ function escape($string, $connection = 'default') { * @static */ function html($string, $options = array()) { + static $defaultCharset = false; + if ($defaultCharset === false) { + $defaultCharset = Configure::read('App.encoding'); + if ($defaultCharset === null) { + $defaultCharset = 'UTF-8'; + } + } $default = array( 'remove' => false, - 'charset' => 'UTF-8', + 'charset' => $defaultCharset, 'quotes' => ENT_QUOTES ); @@ -108,11 +115,8 @@ function html($string, $options = array()) { if ($options['remove']) { $string = strip_tags($string); } - $encoding = Configure::read('App.encoding'); - if (empty($encoding)) { - $encoding = $options['charset']; - } - return htmlentities($string, $options['quotes'], $encoding); + + return htmlentities($string, $options['quotes'], $options['charset']); } /** @@ -197,15 +201,15 @@ function stripTags() { /** * Sanitizes given array or value for safe input. Use the options to specify * the connection to use, and what filters should be applied (with a boolean - * value). Valid filters: + * value). Valid filters: * * - odd_spaces - removes any non space whitespace characters * - encode - Encode any html entities. Encode must be true for the `remove_html` to work. * - dollar - Escape `$` with `\$` * - carriage - Remove `\r` - * - unicode - + * - unicode - * - escape - Should the string be SQL escaped. - * - backslash - + * - backslash - * - remove_html - Strip HTML with strip_tags. `encode` must be true for this option to work. * * @param mixed $data Data to sanitize From 1230b83438c7354a4f43292cb2296abff3ab6ae3 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 22 Mar 2010 22:26:32 -0400 Subject: [PATCH 1806/2083] Fixing incorrect string concatenation resulting in invalid conditions. Fixes failing tests. --- cake/console/libs/tasks/fixture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 95c2fdb4a..8073cdfd9 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -370,7 +370,7 @@ function _getRecordsFromTable($modelName, $useTable = null) { $condition = $this->in($prompt, null, 'WHERE 1=1 LIMIT 10'); } } else { - $condition = 'WHERE 1=1 ' . isset($this->params['count']) ? $this->params['count'] : 10; + $condition = 'WHERE 1=1 LIMIT ' . (isset($this->params['count']) ? $this->params['count'] : 10); } App::import('Model', 'Model', false); $modelObject =& new Model(array('name' => $modelName, 'table' => $useTable, 'ds' => $this->connection)); From 3883f728fbab5b14e51a8adf5dca66e32fc69198 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 22 Mar 2010 23:28:58 -0400 Subject: [PATCH 1807/2083] Adding tests for Fixture importing. Fixing importing fixtures for databases that require custom fields handling like postgresql. Fixes #481 --- .../cases/libs/cake_test_fixture.test.php | 37 +++++++++++++++++++ cake/tests/lib/cake_test_fixture.php | 11 +++--- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/cake/tests/cases/libs/cake_test_fixture.test.php b/cake/tests/cases/libs/cake_test_fixture.test.php index 30b518a34..6d33f4ce7 100644 --- a/cake/tests/cases/libs/cake_test_fixture.test.php +++ b/cake/tests/cases/libs/cake_test_fixture.test.php @@ -230,6 +230,43 @@ function testImport() { $Source->drop($newTestSuiteDb); } +/** + * test that importing with records works. Make sure to try with postgres as its + * handling of aliases is a workaround at best. + * + * @return void + */ + function testImportWithRecords() { + $this->_initDb(); + + $defaultDb =& ConnectionManager::getDataSource('default'); + $testSuiteDb =& ConnectionManager::getDataSource('test_suite'); + $defaultConfig = $defaultDb->config; + $testSuiteConfig = $testSuiteDb->config; + ConnectionManager::create('new_test_suite', array_merge($testSuiteConfig, array('prefix' => 'new_' . $testSuiteConfig['prefix']))); + $newTestSuiteDb =& ConnectionManager::getDataSource('new_test_suite'); + + $Source =& new CakeTestFixtureTestFixture(); + $Source->create($newTestSuiteDb); + $Source->insert($newTestSuiteDb); + + $defaultDb->config = $newTestSuiteDb->config; + + $Fixture =& new CakeTestFixtureDefaultImportFixture(); + $Fixture->fields = $Fixture->records = null; + $Fixture->import = array( + 'model' => 'FixtureImportTestModel', 'connection' => 'new_test_suite', 'records' => true + ); + $Fixture->init(); + $this->assertEqual(array_keys($Fixture->fields), array('id', 'name', 'created')); + $this->assertFalse(empty($Fixture->records[0]), 'No records loaded on importing fixture.'); + $this->assertTrue(isset($Fixture->records[0]['name']), 'No name loaded for first record'); + + $defaultDb->config = $defaultConfig; + + $Source->drop($newTestSuiteDb); + } + /** * test create method * diff --git a/cake/tests/lib/cake_test_fixture.php b/cake/tests/lib/cake_test_fixture.php index 8d945795c..f460fadd3 100644 --- a/cake/tests/lib/cake_test_fixture.php +++ b/cake/tests/lib/cake_test_fixture.php @@ -68,7 +68,10 @@ function __construct() { */ function init() { if (isset($this->import) && (is_string($this->import) || is_array($this->import))) { - $import = array_merge(array('connection' => 'default', 'records' => false), is_array($this->import) ? $this->import : array('model' => $this->import)); + $import = array_merge( + array('connection' => 'default', 'records' => false), + is_array($this->import) ? $this->import : array('model' => $this->import) + ); if (isset($import['model']) && App::import('Model', $import['model'])) { ClassRegistry::config(array('ds' => $import['connection'])); @@ -93,7 +96,7 @@ function init() { if (isset($import['records']) && $import['records'] !== false && isset($model) && isset($db)) { $this->records = array(); $query = array( - 'fields' => array_keys($this->fields), + 'fields' => $db->fields($model, null, array_keys($this->fields)), 'table' => $db->fullTableName($model->table), 'alias' => $model->alias, 'conditions' => array(), @@ -101,10 +104,6 @@ function init() { 'limit' => null, 'group' => null ); - - foreach ($query['fields'] as $index => $field) { - $query['fields'][$index] = $db->name($query['alias']) . '.' . $db->name($field); - } $records = $db->fetchAll($db->buildStatement($query, $model), false, $model->alias); if ($records !== false && !empty($records)) { From 9334aeabc2a0e2a7ef3190525afb981cde725c28 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 24 Mar 2010 22:11:53 -0400 Subject: [PATCH 1808/2083] Adding tests for loading helpers off of additional paths. Closes #410 --- cake/tests/cases/libs/configure.test.php | 21 +++++++++++++++++++- cake/tests/test_app/views/helpers/banana.php | 21 ++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 cake/tests/test_app/views/helpers/banana.php diff --git a/cake/tests/cases/libs/configure.test.php b/cake/tests/cases/libs/configure.test.php index 67104dcf6..dc153c3f3 100644 --- a/cake/tests/cases/libs/configure.test.php +++ b/cake/tests/cases/libs/configure.test.php @@ -301,7 +301,7 @@ function testVersion() { * @package cake * @subpackage cake.tests.cases.libs */ -class AppImportTest extends UnitTestCase { +class AppImportTest extends CakeTestCase { /** * testBuild method @@ -581,8 +581,27 @@ function testClassLoading() { $result = App::import('Datasource', 'TestPlugin.TestSource'); $this->assertTrue($result); $this->assertTrue(class_exists('TestSource')); + App::build(); + } +/** + * test that building helper paths actually works. + * + * @return void + * @link http://cakephp.lighthouseapp.com/projects/42648/tickets/410 + */ + function testImportingHelpersFromAlternatePaths() { App::build(); + $this->assertFalse(class_exists('BananaHelper'), 'BananaHelper exists, cannot test importing it.'); + App::import('Helper', 'Banana'); + $this->assertFalse(class_exists('BananaHelper'), 'BananaHelper was not found because the path does not exist.'); + + App::build(array( + 'helpers' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'helpers' . DS) + )); + $this->assertFalse(class_exists('BananaHelper'), 'BananaHelper exists, cannot test importing it.'); + App::import('Helper', 'Banana'); + $this->assertTrue(class_exists('BananaHelper'), 'BananaHelper was not loaded.'); } /** diff --git a/cake/tests/test_app/views/helpers/banana.php b/cake/tests/test_app/views/helpers/banana.php new file mode 100644 index 000000000..514bd3d74 --- /dev/null +++ b/cake/tests/test_app/views/helpers/banana.php @@ -0,0 +1,21 @@ +<?php +/** + * + * PHP versions 4 and 5 + * + * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link http://cakephp.org CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.libs.view.templates.layouts + * @since CakePHP(tm) v 1.3 + * @license MIT License (http://www.opensource.org/licenses/mit-license.php) + */ +class BananaHelper extends Helper { + +} \ No newline at end of file From 9d3f2fb4a757e0cccbb590a5062dc4a29dff13e4 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 24 Mar 2010 22:33:51 -0400 Subject: [PATCH 1809/2083] Moving Non-Zero tests for Set::extract() into a separate method. --- cake/tests/cases/libs/set.test.php | 114 ++++++++++++++++------------- 1 file changed, 62 insertions(+), 52 deletions(-) diff --git a/cake/tests/cases/libs/set.test.php b/cake/tests/cases/libs/set.test.php index 6867ae4f1..19dbc9968 100644 --- a/cake/tests/cases/libs/set.test.php +++ b/cake/tests/cases/libs/set.test.php @@ -417,43 +417,15 @@ function testExtract() { array('a' => array('II' => array('a' => 3, 'III' => array('a' => array('foo' => 4))))), ); - $nonSequential = array( - 'User' => array( - 0 => array('id' => 1), - 2 => array('id' => 2), - 6 => array('id' => 3), - 9 => array('id' => 4), - 3 => array('id' => 5), - ), - ); - - $nonZero = array( - 'User' => array( - 2 => array('id' => 1), - 4 => array('id' => 2), - 6 => array('id' => 3), - 9 => array('id' => 4), - 3 => array('id' => 5), - ), - ); - $expected = array(array('a' => $c[2]['a'])); $r = Set::extract('/a/II[a=3]/..', $c); $this->assertEqual($r, $expected); $expected = array(1, 2, 3, 4, 5); $this->assertEqual(Set::extract('/User/id', $a), $expected); - $this->assertEqual(Set::extract('/User/id', $nonSequential), $expected); - - $result = Set::extract('/User/id', $nonZero); - $this->assertEqual($result, $expected, 'Failed non zero array key extract'); $expected = array(1, 2, 3, 4, 5); $this->assertEqual(Set::extract('/User/id', $a), $expected); - $this->assertEqual(Set::extract('/User/id', $nonSequential), $expected); - - $result = Set::extract('/User/id', $nonZero); - $this->assertEqual($result, $expected, 'Failed non zero array key extract'); $expected = array( array('id' => 1), array('id' => 2), array('id' => 3), array('id' => 4), array('id' => 5) @@ -549,30 +521,6 @@ function testExtract() { $r = Set::extract('/User/@*', $tricky); $this->assertEqual($r, $expected); - $nonZero = array( - 1 => array( - 'User' => array( - 'id' => 1, - 'name' => 'John', - ) - ), - 2 => array( - 'User' => array( - 'id' => 2, - 'name' => 'Bob', - ) - ), - 3 => array( - 'User' => array( - 'id' => 3, - 'name' => 'Tony', - ) - ) - ); - $expected = array(1, 2, 3); - $r = Set::extract('/User/id', $nonZero); - $this->assertEqual($r, $expected); - $common = array( array( 'Article' => array( @@ -1026,6 +974,68 @@ function testExtract() { $expected = array('Second'); $this->assertEqual($result, $expected); } +/** + * test that extract() still works when arrays don't contain a 0 index. + * + * @return void + */ + function testExtractWithNonZeroArrays() { + $nonZero = array( + 1 => array( + 'User' => array( + 'id' => 1, + 'name' => 'John', + ) + ), + 2 => array( + 'User' => array( + 'id' => 2, + 'name' => 'Bob', + ) + ), + 3 => array( + 'User' => array( + 'id' => 3, + 'name' => 'Tony', + ) + ) + ); + $expected = array(1, 2, 3); + $r = Set::extract('/User/id', $nonZero); + $this->assertEqual($r, $expected); + + $nonSequential = array( + 'User' => array( + 0 => array('id' => 1), + 2 => array('id' => 2), + 6 => array('id' => 3), + 9 => array('id' => 4), + 3 => array('id' => 5), + ), + ); + + $nonZero = array( + 'User' => array( + 2 => array('id' => 1), + 4 => array('id' => 2), + 6 => array('id' => 3), + 9 => array('id' => 4), + 3 => array('id' => 5), + ), + ); + + $expected = array(1, 2, 3, 4, 5); + $this->assertEqual(Set::extract('/User/id', $nonSequential), $expected); + + $result = Set::extract('/User/id', $nonZero); + $this->assertEqual($result, $expected, 'Failed non zero array key extract'); + + $expected = array(1, 2, 3, 4, 5); + $this->assertEqual(Set::extract('/User/id', $nonSequential), $expected); + + $result = Set::extract('/User/id', $nonZero); + $this->assertEqual($result, $expected, 'Failed non zero array key extract'); + } /** * testExtractWithArrays method * From e8e520d6f2114b2e954299ca95e7360f4d191535 Mon Sep 17 00:00:00 2001 From: Jimmy Bourassa <jbourassa@jbourassamb.local> Date: Wed, 17 Mar 2010 00:09:27 -0400 Subject: [PATCH 1810/2083] Added test case for a bug in Set::extract Signed-off-by: Mark Story <mark@mark-story.com> --- cake/tests/cases/libs/set.test.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cake/tests/cases/libs/set.test.php b/cake/tests/cases/libs/set.test.php index 19dbc9968..06632a796 100644 --- a/cake/tests/cases/libs/set.test.php +++ b/cake/tests/cases/libs/set.test.php @@ -973,6 +973,20 @@ function testExtract() { $result = Set::extract('/ParentNode/name', $hasMany); $expected = array('Second'); $this->assertEqual($result, $expected); + + $startingAtOne = array( + 'Article' => array( + 1=> array( + 'id' => 1, + 'approved' => 1, + ), + ) + ); + + $expected = array(0 => array('Article' => array('id' => 1, 'approved' => 1))); + $result = Set::extract('/Article[approved=1]', $startingAtOne); + $this->assertEqual($result, $expected); + } /** * test that extract() still works when arrays don't contain a 0 index. From cbb65ca85f514df59486b4ac02517d78b9c7e5a5 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 24 Mar 2010 22:36:38 -0400 Subject: [PATCH 1811/2083] Moving failing test into new method for non-zero array extraction. --- cake/tests/cases/libs/set.test.php | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/cake/tests/cases/libs/set.test.php b/cake/tests/cases/libs/set.test.php index 06632a796..46c2dd597 100644 --- a/cake/tests/cases/libs/set.test.php +++ b/cake/tests/cases/libs/set.test.php @@ -973,20 +973,6 @@ function testExtract() { $result = Set::extract('/ParentNode/name', $hasMany); $expected = array('Second'); $this->assertEqual($result, $expected); - - $startingAtOne = array( - 'Article' => array( - 1=> array( - 'id' => 1, - 'approved' => 1, - ), - ) - ); - - $expected = array(0 => array('Article' => array('id' => 1, 'approved' => 1))); - $result = Set::extract('/Article[approved=1]', $startingAtOne); - $this->assertEqual($result, $expected); - } /** * test that extract() still works when arrays don't contain a 0 index. @@ -1049,6 +1035,19 @@ function testExtractWithNonZeroArrays() { $result = Set::extract('/User/id', $nonZero); $this->assertEqual($result, $expected, 'Failed non zero array key extract'); + + $startingAtOne = array( + 'Article' => array( + 1=> array( + 'id' => 1, + 'approved' => 1, + ), + ) + ); + + $expected = array(0 => array('Article' => array('id' => 1, 'approved' => 1))); + $result = Set::extract('/Article[approved=1]', $startingAtOne); + $this->assertEqual($result, $expected); } /** * testExtractWithArrays method From 4f4d3f9ffe186ed5fde8c1b800903630e66b6113 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 24 Mar 2010 23:25:02 -0400 Subject: [PATCH 1812/2083] Fixing extraction of non-zero arrays with only one element and attribute selectors. Fixes #475 --- cake/libs/set.php | 3 ++- cake/tests/cases/libs/set.test.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cake/libs/set.php b/cake/libs/set.php index ed8e19c91..b6179de1c 100644 --- a/cake/libs/set.php +++ b/cake/libs/set.php @@ -438,7 +438,8 @@ function extract($path, $data = null, $options = array()) { $items = array($items); } elseif (!isset($items[0])) { $current = current($items); - if ((is_array($current) && count($items) <= 1) || !is_array($current)) { + $currentKey = key($items); + if (!is_array($current) || (is_array($current) && count($items) <= 1 && !is_numeric($currentKey))) { $items = array($items); } } diff --git a/cake/tests/cases/libs/set.test.php b/cake/tests/cases/libs/set.test.php index 46c2dd597..349522ece 100644 --- a/cake/tests/cases/libs/set.test.php +++ b/cake/tests/cases/libs/set.test.php @@ -1035,10 +1035,10 @@ function testExtractWithNonZeroArrays() { $result = Set::extract('/User/id', $nonZero); $this->assertEqual($result, $expected, 'Failed non zero array key extract'); - + $startingAtOne = array( 'Article' => array( - 1=> array( + 1 => array( 'id' => 1, 'approved' => 1, ), From 12e608c671a403a3481f1f82a78ed1af2cd5a36b Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Fri, 26 Mar 2010 01:03:48 +0530 Subject: [PATCH 1813/2083] Changing variable $title to $title_for_layout. Closes #511 --- cake/libs/controller/pages_controller.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cake/libs/controller/pages_controller.php b/cake/libs/controller/pages_controller.php index ecaf125db..b26f71a74 100644 --- a/cake/libs/controller/pages_controller.php +++ b/cake/libs/controller/pages_controller.php @@ -67,7 +67,7 @@ function display() { if (!$count) { $this->redirect('/'); } - $page = $subpage = $title = null; + $page = $subpage = $title_for_layout = null; if (!empty($path[0])) { $page = $path[0]; @@ -76,9 +76,9 @@ function display() { $subpage = $path[1]; } if (!empty($path[$count - 1])) { - $title = Inflector::humanize($path[$count - 1]); + $title_for_layout = Inflector::humanize($path[$count - 1]); } - $this->set(compact('page', 'subpage', 'title')); + $this->set(compact('page', 'subpage', 'title_for_layout')); $this->render(implode('/', $path)); } } From dd4ad2f83d17431fa31b0c8e1c2539c80d692e44 Mon Sep 17 00:00:00 2001 From: "renan.saddam" <renan.saddam@gmail.com> Date: Thu, 25 Mar 2010 17:33:34 -0300 Subject: [PATCH 1814/2083] Supporting Model.* syntax on postgres. --- .../model/datasources/dbo/dbo_postgres.php | 18 ++- .../datasources/dbo/dbo_postgres.test.php | 107 +++++++++++++++--- 2 files changed, 108 insertions(+), 17 deletions(-) diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index 25f3cb03a..f1d4195ec 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -440,9 +440,23 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) { } $count = count($fields); - if ($count >= 1 && $fields[0] != '*' && strpos($fields[0], 'COUNT(*)') === false) { + if ($count >= 1 && strpos($fields[0], 'COUNT(*)') === false) { + $result = array(); for ($i = 0; $i < $count; $i++) { if (!preg_match('/^.+\\(.*\\)/', $fields[$i]) && !preg_match('/\s+AS\s+/', $fields[$i])) { + if (substr($fields[$i], -1) == '*') { + if (strpos($fields[$i], '.') !== false && $fields[$i] != $alias . '.*') { + $build = explode('.', $fields[$i]); + $AssociatedModel = $model->{$build[0]}; + } else { + $AssociatedModel = $model; + } + + $_fields = $this->fields($AssociatedModel, $AssociatedModel->alias, array_keys($AssociatedModel->schema())); + $result = array_merge($result, $_fields); + continue; + } + $prepend = ''; if (strpos($fields[$i], 'DISTINCT') !== false) { $prepend = 'DISTINCT '; @@ -456,7 +470,9 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) { $fields[$i] = $prepend . $this->name($build[0]) . '.' . $this->name($build[1]) . ' AS ' . $this->name($build[0] . '__' . $build[1]); } } + $result[] = $fields[$i]; } + return $result; } return $fields; } diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php index 28f9d7338..0fc86ad78 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php @@ -84,6 +84,18 @@ class PostgresTestModel extends Model { */ var $useTable = false; +/** + * belongsTo property + * + * @var array + * @access public + */ + var $belongsTo = array( + 'PostgresClientTestModel' => array( + 'foreignKey' => 'client_id' + ) + ); + /** * find method * @@ -142,6 +154,47 @@ function schema() { } } +/** + * PostgresClientTestModel class + * + * @package cake + * @subpackage cake.tests.cases.libs.model.datasources + */ +class PostgresClientTestModel extends Model { + +/** + * name property + * + * @var string 'PostgresClientTestModel' + * @access public + */ + var $name = 'PostgresClientTestModel'; + +/** + * useTable property + * + * @var bool false + * @access public + */ + var $useTable = false; + +/** + * schema method + * + * @access public + * @return void + */ + function schema() { + return array( + 'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8', 'key' => 'primary'), + 'name' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), + 'email' => array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'), + 'created' => array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => ''), + 'updated' => array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null) + ); + } +} + /** * DboPostgresTest class * @@ -227,13 +280,12 @@ function tearDown() { } /** - * Test field and value quoting method + * Test field quoting method * * @access public */ - function testQuoting() { - $result = $this->db2->fields($this->model); - $expected = array( + function testFieldQuoting() { + $fields = array( '"PostgresTestModel"."id" AS "PostgresTestModel__id"', '"PostgresTestModel"."client_id" AS "PostgresTestModel__client_id"', '"PostgresTestModel"."name" AS "PostgresTestModel__name"', @@ -253,15 +305,29 @@ function testQuoting() { '"PostgresTestModel"."created" AS "PostgresTestModel__created"', '"PostgresTestModel"."updated" AS "PostgresTestModel__updated"' ); + + $result = $this->db->fields($this->model); + $expected = $fields; $this->assertEqual($result, $expected); - $expected = "'1.2'"; - $result = $this->db2->value(1.2, 'float'); - $this->assertIdentical($expected, $result); + $result = $this->db->fields($this->model, null, 'PostgresTestModel.*'); + $expected = $fields; + $this->assertEqual($result, $expected); - $expected = "'1,2'"; - $result = $this->db2->value('1,2', 'float'); - $this->assertIdentical($expected, $result); + $result = $this->db->fields($this->model, null, array('*', 'AnotherModel.id', 'AnotherModel.name')); + $expected = array_merge($fields, array( + '"AnotherModel"."id" AS "AnotherModel__id"', + '"AnotherModel"."name" AS "AnotherModel__name"')); + $this->assertEqual($result, $expected); + + $result = $this->db->fields($this->model, null, array('*', 'PostgresClientTestModel.*')); + $expected = array_merge($fields, array( + '"PostgresClientTestModel"."id" AS "PostgresClientTestModel__id"', + '"PostgresClientTestModel"."name" AS "PostgresClientTestModel__name"', + '"PostgresClientTestModel"."email" AS "PostgresClientTestModel__email"', + '"PostgresClientTestModel"."created" AS "PostgresClientTestModel__created"', + '"PostgresClientTestModel"."updated" AS "PostgresClientTestModel__updated"')); + $this->assertEqual($result, $expected); } /** @@ -286,6 +352,9 @@ function testColumnParsing() { * @return void */ function testValueQuoting() { + $this->assertIdentical($this->db2->value(1.2, 'float'), "'1.2'"); + $this->assertEqual($this->db2->value('1,2', 'float'), "'1,2'"); + $this->assertEqual($this->db2->value('0', 'integer'), "'0'"); $this->assertEqual($this->db2->value('', 'integer'), 'NULL'); $this->assertEqual($this->db2->value('', 'float'), 'NULL'); @@ -682,9 +751,12 @@ function testAlterIndexes() { $this->db->query($this->db->dropSchema($schema1)); } - /** - * Test it is possible to use virtual field with postgresql - */ +/** + * Test it is possible to use virtual field with postgresql + * + * @access public + * @return void + */ function testVirtualFields() { $this->loadFixtures('Article', 'Comment'); $Article = new Article; @@ -701,9 +773,12 @@ function testVirtualFields() { $this->assertEqual($result['Article']['subquery'], 6); } - /** - * Tests additional order options for postgres - */ +/** + * Tests additional order options for postgres + * + * @access public + * @return void + */ function testOrderAdditionalParams() { $result = $this->db->order(array('title' => 'DESC NULLS FIRST', 'body' => 'DESC')); $expected = ' ORDER BY "title" DESC NULLS FIRST, "body" DESC'; From 1f1324f500f1dbe4c94c82d0bc38dd2c826e8cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Thu, 25 Mar 2010 16:05:45 -0430 Subject: [PATCH 1815/2083] Qouting fields inside postgres functions when prepended a DISTINCT, closes #512 --- .../model/datasources/dbo/dbo_postgres.php | 26 +++++++++++++++++++ cake/libs/model/datasources/dbo_source.php | 2 +- .../datasources/dbo/dbo_postgres.test.php | 23 +++++++++++----- 3 files changed, 44 insertions(+), 7 deletions(-) diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index 25f3cb03a..d99b989aa 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -455,12 +455,38 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) { $build = explode('.', $fields[$i]); $fields[$i] = $prepend . $this->name($build[0]) . '.' . $this->name($build[1]) . ' AS ' . $this->name($build[0] . '__' . $build[1]); } + } else { + $fields[$i] = preg_replace_callback('/\(([\s\.\w]+)\)/', array(&$this, '__quoteFunctionField'), $fields[$i]); } } } return $fields; } +/** + * Auxiliary function to quote matched `(Model.fields)` from a preg_replace_callback call + * + * @param string matched string + * @return string quoted strig + * @access private + */ + function __quoteFunctionField($match) { + $prepend = ''; + if (strpos($match[1], 'DISTINCT') !== false) { + $prepend = 'DISTINCT '; + $match[1] = trim(str_replace('DISTINCT', '', $match[1])); + } + if (strpos($match[1], '.') === false) { + $match[1] = $this->name($alias . '.' . $match[1]); + } else { + $parts = explode('.', $match[1]); + if (!Set::numeric($parts)) { + $match[1] = $this->name($match[1]); + } + } + return '(' . $prepend .$match[1] . ')'; + } + /** * Returns an array of the indexes in given datasource name. * diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 5acc931e1..8c3da9226 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -2327,7 +2327,7 @@ function __quoteFields($conditions) { } /** - * Auxiliary function to qoute matches `Model.fields` from a preg_replace_callback call + * Auxiliary function to quote matches `Model.fields` from a preg_replace_callback call * * @param string matched string * @return string quoted strig diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php index 28f9d7338..fac7f19ee 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php @@ -682,9 +682,9 @@ function testAlterIndexes() { $this->db->query($this->db->dropSchema($schema1)); } - /** - * Test it is possible to use virtual field with postgresql - */ +/** +* Test it is possible to use virtual field with postgresql +*/ function testVirtualFields() { $this->loadFixtures('Article', 'Comment'); $Article = new Article; @@ -701,13 +701,24 @@ function testVirtualFields() { $this->assertEqual($result['Article']['subquery'], 6); } - /** - * Tests additional order options for postgres - */ +/** +* Tests additional order options for postgres +*/ function testOrderAdditionalParams() { $result = $this->db->order(array('title' => 'DESC NULLS FIRST', 'body' => 'DESC')); $expected = ' ORDER BY "title" DESC NULLS FIRST, "body" DESC'; $this->assertEqual($result, $expected); } + +/** +* Test it is possible to do a SELECT COUNT(DISTINCT Model.field) query in postgres and it gets correctly quoted +*/ + function testQuoteDistinctInFunction() { + $this->loadFixtures('Article'); + $Article = new Article; + $result = $this->db->fields($Article, null, array('COUNT(DISTINCT Article.id)')); + $expected = array('COUNT(DISTINCT "Article"."id")'); + $this->assertEqual($result, $expected); + } } ?> \ No newline at end of file From d95e482894927f8f9dbb80959d36a87d57467ed3 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 26 Mar 2010 10:46:48 +1100 Subject: [PATCH 1816/2083] Refs #332. Beginning fix for multiple session starts. --- cake/libs/session.php | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/cake/libs/session.php b/cake/libs/session.php index 8dbbdb78a..f44740648 100644 --- a/cake/libs/session.php +++ b/cake/libs/session.php @@ -116,6 +116,13 @@ class CakeSession extends Object { * @access public */ var $id = null; +/** + * Session Started + * + * @var boolean + * @access public + */ + var $started = false; /** * Constructor. * @@ -163,16 +170,19 @@ function __construct($base = null, $start = true) { /** * Starts the Session. * - * @param string $name Variable name to check for - * @return boolean True if variable is there + * @return boolean True if session was started * @access public */ function start() { + if ($this->started) { + return true; + } if (function_exists('session_write_close')) { session_write_close(); } $this->__initSession(); - return $this->__startSession(); + $this->started = $this->__startSession(); + return $this->started; } /** * Determine if Session has been started. @@ -475,12 +485,13 @@ function __initSession() { ini_set('session.auto_start', 0); } } - session_set_save_handler(array('CakeSession','__open'), - array('CakeSession', '__close'), - array('CakeSession', '__read'), - array('CakeSession', '__write'), - array('CakeSession', '__destroy'), - array('CakeSession', '__gc')); + session_set_save_handler( + array('CakeSession','__open'), + array('CakeSession', '__close'), + array('CakeSession', '__read'), + array('CakeSession', '__write'), + array('CakeSession', '__destroy'), + array('CakeSession', '__gc')); break; case 'php': if (empty($_SESSION)) { @@ -507,12 +518,13 @@ function __initSession() { ini_set('session.cookie_path', $this->path); } } - session_set_save_handler(array('CakeSession','__open'), - array('CakeSession', '__close'), - array('Cache', 'read'), - array('Cache', 'write'), - array('Cache', 'delete'), - array('Cache', 'gc')); + session_set_save_handler( + array('CakeSession','__open'), + array('CakeSession', '__close'), + array('Cache', 'read'), + array('Cache', 'write'), + array('Cache', 'delete'), + array('Cache', 'gc')); break; default: if (empty($_SESSION)) { From a72dabe2576cd0c987d1822acb36a95f1ec698db Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 25 Mar 2010 23:01:50 -0400 Subject: [PATCH 1817/2083] Removing unnecessary variable assignment. Removing unnecessary parenthesis. --- cake/libs/i18n.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index 3a00b8441..37abc0061 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -189,16 +189,15 @@ function translate($singular, $plural = null, $domain = null, $category = 6, $co } } if (strlen($trans)) { - $singular = $trans; - return $singular; + return $trans; } } } if (!empty($plurals)) { - return($plural); + return $plural; } - return($singular); + return $singular; } /** @@ -317,7 +316,7 @@ function __bindTextDomain($domain) { if (empty($this->__domains[$this->category][$this->__lang][$domain])) { $this->__domains[$this->category][$this->__lang][$domain] = array(); - return($domain); + return $domain; } if ($head = $this->__domains[$this->category][$this->__lang][$domain][""]) { @@ -338,7 +337,7 @@ function __bindTextDomain($domain) { unset($this->__domains[$this->category][$this->__lang][$domain][null]); } } - return($domain); + return $domain; } /** From 9740029e9e2db239c54f8db53d69046e04ef0dbe Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 26 Mar 2010 14:21:08 +1100 Subject: [PATCH 1818/2083] Fixes #332. --- cake/libs/session.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cake/libs/session.php b/cake/libs/session.php index f44740648..d6a856392 100644 --- a/cake/libs/session.php +++ b/cake/libs/session.php @@ -120,9 +120,9 @@ class CakeSession extends Object { * Session Started * * @var boolean - * @access public + * @access protected */ - var $started = false; + var $_started = false; /** * Constructor. * @@ -174,15 +174,15 @@ function __construct($base = null, $start = true) { * @access public */ function start() { - if ($this->started) { + if ($this->started()) { return true; } if (function_exists('session_write_close')) { session_write_close(); } $this->__initSession(); - $this->started = $this->__startSession(); - return $this->started; + $this->_started = $this->__startSession(); + return $this->started(); } /** * Determine if Session has been started. @@ -191,7 +191,7 @@ function start() { * @return boolean True if session has been started. */ function started() { - if (isset($_SESSION)) { + if (isset($_SESSION) && $this->_started) { return true; } return false; @@ -223,7 +223,7 @@ function id($id = null) { $this->id = $id; session_id($this->id); } - if (isset($_SESSION)) { + if ($this->started()) { return session_id(); } else { return $this->id; From 9f5949ab5273048c76bf411d7c0057ba217d6132 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 26 Mar 2010 14:29:27 +1100 Subject: [PATCH 1819/2083] Fix for Session Component to use CakeSession started() checks. Refs #332. --- cake/libs/controller/components/session.php | 16 ++++------------ .../libs/controller/components/session.test.php | 4 ++-- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/cake/libs/controller/components/session.php b/cake/libs/controller/components/session.php index 5300ab6f4..7f8c2df55 100644 --- a/cake/libs/controller/components/session.php +++ b/cake/libs/controller/components/session.php @@ -43,13 +43,6 @@ class SessionComponent extends CakeSession { * @access private */ var $__active = true; -/** - * Used to determine if Session has been started - * - * @var boolean - * @access private - */ - var $__started = false; /** * Used to determine if request are from an Ajax request * @@ -89,7 +82,7 @@ function initialize(&$controller) { * @access public */ function startup(&$controller) { - if ($this->__started === false && $this->__active === true) { + if ($this->started() === false && $this->__active === true) { $this->__start(); } } @@ -299,15 +292,14 @@ function id($id = null) { * @access private */ function __start() { - if ($this->__started === false) { + if ($this->started() === false) { if (!$this->id() && parent::start()) { - $this->__started = true; parent::_checkValid(); } else { - $this->__started = parent::start(); + parent::start(); } } - return $this->__started; + return $this->started(); } } diff --git a/cake/tests/cases/libs/controller/components/session.test.php b/cake/tests/cases/libs/controller/components/session.test.php index c87c9f6f0..b6115fe29 100644 --- a/cake/tests/cases/libs/controller/components/session.test.php +++ b/cake/tests/cases/libs/controller/components/session.test.php @@ -108,13 +108,13 @@ function testSessionAutoStart() { Configure::write('Session.start', false); $Session =& new SessionComponent(); $this->assertFalse($Session->__active); - $this->assertFalse($Session->__started); + $this->assertFalse($Session->started()); $Session->startup(new SessionTestController()); Configure::write('Session.start', true); $Session =& new SessionComponent(); $this->assertTrue($Session->__active); - $this->assertFalse($Session->__started); + $this->assertFalse($Session->started()); $Session->startup(new SessionTestController()); $this->assertTrue(isset($_SESSION)); From 7b17374cad338013f2fc4e91359820deac2ce4b3 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 26 Mar 2010 10:46:48 +1100 Subject: [PATCH 1820/2083] Refs #332. Beginning fix for multiple session starts. --- cake/libs/cake_session.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index 4d55cd9a6..83905c382 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -114,6 +114,13 @@ class CakeSession extends Object { */ var $id = null; +/** + * Session Started + * + * @var boolean + * @access public + */ + var $started = false; /** * Constructor. * @@ -181,16 +188,19 @@ function __construct($base = null, $start = true) { /** * Starts the Session. * - * @param string $name Variable name to check for - * @return boolean True if variable is there + * @return boolean True if session was started * @access public */ function start() { + if ($this->started) { + return true; + } if (function_exists('session_write_close')) { session_write_close(); } $this->__initSession(); - return $this->__startSession(); + $this->started = $this->__startSession(); + return $this->started; } /** From 13a55b6cd862f567069148372ebf0cdf50e8d4c4 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 26 Mar 2010 14:21:08 +1100 Subject: [PATCH 1821/2083] Fixes #332. --- cake/libs/cake_session.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index 83905c382..45fec9c62 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -118,9 +118,9 @@ class CakeSession extends Object { * Session Started * * @var boolean - * @access public + * @access protected */ - var $started = false; + var $_started = false; /** * Constructor. * @@ -192,15 +192,15 @@ function __construct($base = null, $start = true) { * @access public */ function start() { - if ($this->started) { + if ($this->started()) { return true; } if (function_exists('session_write_close')) { session_write_close(); } $this->__initSession(); - $this->started = $this->__startSession(); - return $this->started; + $this->_started = $this->__startSession(); + return $this->started(); } /** @@ -210,7 +210,7 @@ function start() { * @return boolean True if session has been started. */ function started() { - if (isset($_SESSION)) { + if (isset($_SESSION) && $this->_started) { return true; } return false; @@ -243,7 +243,7 @@ function id($id = null) { $this->id = $id; session_id($this->id); } - if (isset($_SESSION)) { + if ($this->started()) { return session_id(); } else { return $this->id; From 5d3f0d7fe0817941a54f831a254de8c683cabafc Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 26 Mar 2010 14:29:27 +1100 Subject: [PATCH 1822/2083] Fix for Session Component to use CakeSession started() checks. Refs #332. --- cake/libs/controller/components/session.php | 13 ++++++------- .../libs/controller/components/session.test.php | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/cake/libs/controller/components/session.php b/cake/libs/controller/components/session.php index 4dc6e8978..fbe572009 100644 --- a/cake/libs/controller/components/session.php +++ b/cake/libs/controller/components/session.php @@ -41,12 +41,12 @@ class SessionComponent extends CakeSession { var $__active = true; /** - * Used to determine if Session has been started + * Used to determine if request are from an Ajax request * * @var boolean * @access private */ - var $__started = false; + var $__bare = 0; /** * Class constructor @@ -69,7 +69,7 @@ function __construct($base = null) { * @access public */ function startup(&$controller) { - if ($this->__started === false && $this->__active === true) { + if ($this->started() === false && $this->__active === true) { $this->__start(); } } @@ -275,15 +275,14 @@ function id($id = null) { * @access private */ function __start() { - if ($this->__started === false) { + if ($this->started() === false) { if (!$this->id() && parent::start()) { - $this->__started = true; parent::_checkValid(); } else { - $this->__started = parent::start(); + parent::start(); } } - return $this->__started; + return $this->started(); } } diff --git a/cake/tests/cases/libs/controller/components/session.test.php b/cake/tests/cases/libs/controller/components/session.test.php index 575aa3020..5eb2e39bc 100644 --- a/cake/tests/cases/libs/controller/components/session.test.php +++ b/cake/tests/cases/libs/controller/components/session.test.php @@ -112,13 +112,13 @@ function testSessionAutoStart() { Configure::write('Session.start', false); $Session =& new SessionComponent(); $this->assertFalse($Session->__active); - $this->assertFalse($Session->__started); + $this->assertFalse($Session->started()); $Session->startup(new SessionTestController()); Configure::write('Session.start', true); $Session =& new SessionComponent(); $this->assertTrue($Session->__active); - $this->assertFalse($Session->__started); + $this->assertFalse($Session->started()); $Session->startup(new SessionTestController()); $this->assertTrue(isset($_SESSION)); From d20aa237116912d3e156079ea7ebff600443aa82 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 25 Mar 2010 23:44:40 -0400 Subject: [PATCH 1823/2083] Fixing issues where paths added to build() would be appended into the search paths after the default paths. Fixed issue where paths added with build() would be lost when calling build() again to change a different path type. Tests updated. Fixes #410 --- cake/libs/configure.php | 6 ++++-- cake/tests/cases/libs/configure.test.php | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 40f9b0041..692002aa7 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -683,11 +683,13 @@ function build($paths = array(), $reset = false) { $merge = array_merge($merge, (array)$core[$type]); } - $_this->{$type} = $default; + if (empty($_this->{$type}) || empty($paths)) { + $_this->{$type} = $default; + } if (!empty($paths[$type])) { $path = array_flip(array_flip(array_merge( - $_this->{$type}, (array)$paths[$type], $merge + (array)$paths[$type], $_this->{$type}, $merge ))); $_this->{$type} = array_values($path); } else { diff --git a/cake/tests/cases/libs/configure.test.php b/cake/tests/cases/libs/configure.test.php index dc153c3f3..46c8ea069 100644 --- a/cake/tests/cases/libs/configure.test.php +++ b/cake/tests/cases/libs/configure.test.php @@ -323,8 +323,8 @@ function testBuild() { $new = App::path('models'); $expected = array( - APP . 'models' . DS, '/path/to/models/', + APP . 'models' . DS, APP, ROOT . DS . LIBS . 'model' . DS ); @@ -599,9 +599,12 @@ function testImportingHelpersFromAlternatePaths() { App::build(array( 'helpers' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'helpers' . DS) )); + App::build(array('vendors' => array(TEST_CAKE_CORE_INCLUDE_PATH))); $this->assertFalse(class_exists('BananaHelper'), 'BananaHelper exists, cannot test importing it.'); App::import('Helper', 'Banana'); $this->assertTrue(class_exists('BananaHelper'), 'BananaHelper was not loaded.'); + + App::build(); } /** From ec3f4b8d34005d533d5d0f6d4003e65971a3e394 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 26 Mar 2010 19:59:09 +1100 Subject: [PATCH 1824/2083] Fixes #53, ordering of XML::toArray() operations. --- cake/libs/xml.php | 3 ++- cake/tests/cases/libs/xml.test.php | 37 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/cake/libs/xml.php b/cake/libs/xml.php index ba37d5d96..4c2e03894 100644 --- a/cake/libs/xml.php +++ b/cake/libs/xml.php @@ -664,6 +664,7 @@ function toArray($camelize = true) { foreach ($this->children as $child) { $key = $camelize ? Inflector::camelize($child->name) : $child->name; + //debug($key); if (is_a($child, 'XmlTextNode')) { $out['value'] = $child->value; @@ -688,7 +689,7 @@ function toArray($camelize = true) { if (isset($out[$key]) || isset($multi[$key])) { if (!isset($multi[$key])) { $multi[$key] = array($out[$key]); - unset($out[$key]); + //unset($out[$key]); } $multi[$key][] = $value; } elseif (!empty($value)) { diff --git a/cake/tests/cases/libs/xml.test.php b/cake/tests/cases/libs/xml.test.php index bb71e1456..abcb7d0f4 100644 --- a/cake/tests/cases/libs/xml.test.php +++ b/cake/tests/cases/libs/xml.test.php @@ -1244,6 +1244,43 @@ function testToArray() { ) ); $this->assertEqual($result, $expected); + + $text = '<main><first label="first type node 1" /><first label="first type node 2" /><second label="second type node" /></main>'; + $xml = new Xml($text); + $result = $xml->toArray(); + $expected = array( + 'Main' => array( + 'First' => array( + array('label' => 'first type node 1'), + array('label' => 'first type node 2') + ), + 'Second' => array('label'=>'second type node') + ) + ); + $this->assertIdentical($result,$expected); + + $text = '<main><first label="first type node 1" /><first label="first type node 2" /><second label="second type node" /><collection><fifth label="fifth type node"/><third label="third type node 1"/><third label="third type node 2"/><third label="third type node 3"/><fourth label="fourth type node"/></collection></main>'; + $xml = new Xml($text); + $result = $xml->toArray(); + $expected = array( + 'Main' => array( + 'First' => array( + array('label' => 'first type node 1'), + array('label' => 'first type node 2') + ), + 'Second' => array('label'=>'second type node'), + 'Collection' => array( + 'Fifth' => array('label' => 'fifth type node'), + 'Third' => array( + array('label' => 'third type node 1'), + array('label' => 'third type node 2'), + array('label' => 'third type node 3'), + ), + 'Fourth' => array('label' => 'fourth type node'), + ) + ) + ); + $this->assertIdentical($result,$expected); } /** * testAppend method From 0dfc07ba0d8c44374f89998eda9c2dd0f995c1db Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 26 Mar 2010 19:59:09 +1100 Subject: [PATCH 1825/2083] Fixes #53, ordering of XML::toArray() operations. --- cake/libs/xml.php | 3 ++- cake/tests/cases/libs/xml.test.php | 37 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/cake/libs/xml.php b/cake/libs/xml.php index 3447141a5..5c8cb40c3 100644 --- a/cake/libs/xml.php +++ b/cake/libs/xml.php @@ -691,6 +691,7 @@ function toArray($camelize = true) { foreach ($this->children as $child) { $key = $camelize ? Inflector::camelize($child->name) : $child->name; + //debug($key); if (is_a($child, 'XmlTextNode')) { $out['value'] = $child->value; @@ -715,7 +716,7 @@ function toArray($camelize = true) { if (isset($out[$key]) || isset($multi[$key])) { if (!isset($multi[$key])) { $multi[$key] = array($out[$key]); - unset($out[$key]); + //unset($out[$key]); } $multi[$key][] = $value; } elseif (!empty($value)) { diff --git a/cake/tests/cases/libs/xml.test.php b/cake/tests/cases/libs/xml.test.php index 435d5b341..aa237fb07 100644 --- a/cake/tests/cases/libs/xml.test.php +++ b/cake/tests/cases/libs/xml.test.php @@ -1266,6 +1266,43 @@ function testToArray() { ) ); $this->assertEqual($result, $expected); + + $text = '<main><first label="first type node 1" /><first label="first type node 2" /><second label="second type node" /></main>'; + $xml = new Xml($text); + $result = $xml->toArray(); + $expected = array( + 'Main' => array( + 'First' => array( + array('label' => 'first type node 1'), + array('label' => 'first type node 2') + ), + 'Second' => array('label'=>'second type node') + ) + ); + $this->assertIdentical($result,$expected); + + $text = '<main><first label="first type node 1" /><first label="first type node 2" /><second label="second type node" /><collection><fifth label="fifth type node"/><third label="third type node 1"/><third label="third type node 2"/><third label="third type node 3"/><fourth label="fourth type node"/></collection></main>'; + $xml = new Xml($text); + $result = $xml->toArray(); + $expected = array( + 'Main' => array( + 'First' => array( + array('label' => 'first type node 1'), + array('label' => 'first type node 2') + ), + 'Second' => array('label'=>'second type node'), + 'Collection' => array( + 'Fifth' => array('label' => 'fifth type node'), + 'Third' => array( + array('label' => 'third type node 1'), + array('label' => 'third type node 2'), + array('label' => 'third type node 3'), + ), + 'Fourth' => array('label' => 'fourth type node'), + ) + ) + ); + $this->assertIdentical($result,$expected); } /** From 9da921d1d723e145e2b9705c8b895e7ebb20b943 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 26 Mar 2010 22:47:20 +1100 Subject: [PATCH 1826/2083] Space comment block away from code. --- cake/libs/cake_session.php | 1 + 1 file changed, 1 insertion(+) diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index 45fec9c62..6cd65e9ec 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -121,6 +121,7 @@ class CakeSession extends Object { * @access protected */ var $_started = false; + /** * Constructor. * From abefca759a0305b2d945b68aff312a067fa6390b Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 26 Mar 2010 22:51:58 +1100 Subject: [PATCH 1827/2083] Fix $host not being defined on SessionHelper. --- cake/libs/session.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cake/libs/session.php b/cake/libs/session.php index d6a856392..a2568d157 100644 --- a/cake/libs/session.php +++ b/cake/libs/session.php @@ -123,6 +123,13 @@ class CakeSession extends Object { * @access protected */ var $_started = false; +/** + * Hostname + * + * @var string + * @access public + */ + var $host = null; /** * Constructor. * From 2decbc7129d8dd5ceae7e7f92ec38af47fd2da82 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 26 Mar 2010 22:51:58 +1100 Subject: [PATCH 1828/2083] Fix $host not being defined on SessionHelper. --- cake/libs/cake_session.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index 6cd65e9ec..54f4ac9cd 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -122,6 +122,13 @@ class CakeSession extends Object { */ var $_started = false; +/** + * Hostname + * + * @var string + * @access public + */ + var $host = null; /** * Constructor. * From 9ef536721937847bac0b87759fae7a9d47acb2c9 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 26 Mar 2010 22:53:30 +1100 Subject: [PATCH 1829/2083] Minor doc block spacing. --- cake/libs/cake_session.php | 1 + 1 file changed, 1 insertion(+) diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index 54f4ac9cd..c63c6a8a3 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -129,6 +129,7 @@ class CakeSession extends Object { * @access public */ var $host = null; + /** * Constructor. * From b559be58221537b220f4bfd1a127e4914e22a349 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 27 Mar 2010 12:48:31 -0400 Subject: [PATCH 1830/2083] Moving xml_parser_free() so parser resources are freed immediately after they are used. Helps reduce memory consumption in Xml class. Refs #505 --- cake/libs/xml.php | 8 +++----- cake/tests/cases/libs/xml.test.php | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/cake/libs/xml.php b/cake/libs/xml.php index 4c2e03894..1151e5880 100644 --- a/cake/libs/xml.php +++ b/cake/libs/xml.php @@ -664,7 +664,6 @@ function toArray($camelize = true) { foreach ($this->children as $child) { $key = $camelize ? Inflector::camelize($child->name) : $child->name; - //debug($key); if (is_a($child, 'XmlTextNode')) { $out['value'] = $child->value; @@ -842,7 +841,7 @@ function __construct($input = null, $options = array()) { parent::__construct('#document'); if ($options['root'] !== '#document') { - $Root = $this->createNode($options['root']); + $Root =& $this->createNode($options['root']); } else { $Root =& $this; } @@ -922,6 +921,8 @@ function parse() { break; } } + xml_parser_free($this->__parser); + $this->__parser = null; return true; } /** @@ -1089,9 +1090,6 @@ function header($attrib = array()) { * @access private */ function __destruct() { - if (is_resource($this->__parser)) { - xml_parser_free($this->__parser); - } $this->_killParent(true); } /** diff --git a/cake/tests/cases/libs/xml.test.php b/cake/tests/cases/libs/xml.test.php index abcb7d0f4..8eca83c8d 100644 --- a/cake/tests/cases/libs/xml.test.php +++ b/cake/tests/cases/libs/xml.test.php @@ -1370,5 +1370,25 @@ function testNumericDataHandling() { $result = $result[0]->first(); $this->assertEqual($result->value, '012345'); } + +/** + * test that creating an xml object does not leak memory + * + * @return void + */ + function testMemoryLeakInConstructor() { + if ($this->skipIf(!function_exists('memory_get_usage'), 'Cannot test memory leaks without memory_get_usage')) { + return; + } + $data = '<?xml version="1.0" encoding="UTF-8"?><content>TEST</content>'; + $start = memory_get_usage(); + for ($i = 0; $i <= 300; $i++) { + $test =& new XML($data); + $test->__destruct(); + unset($test); + } + $end = memory_get_usage(); + $this->assertWithinMargin($start, $end, 3600, 'Memory leaked %s'); + } } ?> \ No newline at end of file From 35446a42a92907e767442a433384472c40480763 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 27 Mar 2010 16:23:46 -0400 Subject: [PATCH 1831/2083] Making filtering of extracted arrays remember their key. This fixes attribute selectors followed by parent selectors returning seemingly random results. Fixes #502 --- cake/libs/set.php | 2 +- cake/tests/cases/libs/set.test.php | 74 ++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a/cake/libs/set.php b/cake/libs/set.php index b6179de1c..64f55b0e6 100644 --- a/cake/libs/set.php +++ b/cake/libs/set.php @@ -486,7 +486,7 @@ function extract($path, $data = null, $options = array()) { $length = count($matches); foreach ($matches as $i => $match) { if (Set::matches(array($condition), $match['item'], $i + 1, $length)) { - $filtered[] = $match; + $filtered[$i] = $match; } } $matches = $filtered; diff --git a/cake/tests/cases/libs/set.test.php b/cake/tests/cases/libs/set.test.php index 349522ece..8f983f4ec 100644 --- a/cake/tests/cases/libs/set.test.php +++ b/cake/tests/cases/libs/set.test.php @@ -974,6 +974,80 @@ function testExtract() { $expected = array('Second'); $this->assertEqual($result, $expected); } +/** + * test parent selectors with extract + * + * @return void + */ + function testExtractParentSelector() { + $a = array( + 'Model' => array( + '0' => array( + 'id' => 18, + 'SubModelsModel' => array( + 'id' => 1, + 'submodel_id' => 66, + 'model_id' => 18, + 'type' => 1 + ), + ), + '1' => array( + 'id' => 0, + 'SubModelsModel' => array( + 'id' => 2, + 'submodel_id' => 66, + 'model_id' => 0, + 'type' => 1 + ), + ), + '2' => array( + 'id' => 17, + 'SubModelsModel' => array( + 'id' => 3, + 'submodel_id' => 66, + 'model_id' => 17, + 'type' => 2 + ), + ), + '3' => array( + 'id' => 0, + 'SubModelsModel' => array( + 'id' => 4, + 'submodel_id' => 66, + 'model_id' => 0, + 'type' => 2 + ) + ) + ) + ); + + $expected = array( + array( + 'Model' => array( + 'id' => 17, + 'SubModelsModel' => array( + 'id' => 3, + 'submodel_id' => 66, + 'model_id' => 17, + 'type' => 2 + ), + ) + ), + array( + 'Model' => array( + 'id' => 0, + 'SubModelsModel' => array( + 'id' => 4, + 'submodel_id' => 66, + 'model_id' => 0, + 'type' => 2 + ) + ) + ) + ); + $r = Set::extract('/Model/SubModelsModel[type=2]/..', $a); + $this->assertEqual($r, $expected); + } /** * test that extract() still works when arrays don't contain a 0 index. * From 3040c6f586436df09231191b33c5ec41ac8cd683 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 27 Mar 2010 16:27:23 -0400 Subject: [PATCH 1832/2083] Moving tests around in set test. --- cake/tests/cases/libs/set.test.php | 158 ++++++++++++++--------------- 1 file changed, 78 insertions(+), 80 deletions(-) diff --git a/cake/tests/cases/libs/set.test.php b/cake/tests/cases/libs/set.test.php index 8f983f4ec..1d4c29d48 100644 --- a/cake/tests/cases/libs/set.test.php +++ b/cake/tests/cases/libs/set.test.php @@ -795,10 +795,87 @@ function testExtract() { $r = Set::extract('/Comment/User[name=/bob|tod/]/..', $habtm); $this->assertEqual($r[0]['Comment']['User']['name'], 'bob'); - // Currently failing, needs fix $this->assertEqual($r[1]['Comment']['User']['name'], 'tod'); $this->assertEqual(count($r), 2); + $mixedKeys = array( + 'User' => array( + 0 => array( + 'id' => 4, + 'name' => 'Neo' + ), + 1 => array( + 'id' => 5, + 'name' => 'Morpheus' + ), + 'stringKey' => array() + ) + ); + $expected = array('Neo', 'Morpheus'); + $r = Set::extract('/User/name', $mixedKeys); + $this->assertEqual($r, $expected); + + $f = array( + array( + 'file' => array( + 'name' => 'zipfile.zip', + 'type' => 'application/zip', + 'tmp_name' => '/tmp/php178.tmp', + 'error' => 0, + 'size' => '564647' + ) + ), + array( + 'file' => array( + 'name' => 'zipfile2.zip', + 'type' => 'application/x-zip-compressed', + 'tmp_name' => '/tmp/php179.tmp', + 'error' => 0, + 'size' => '354784' + ) + ), + array( + 'file' => array( + 'name' => 'picture.jpg', + 'type' => 'image/jpeg', + 'tmp_name' => '/tmp/php180.tmp', + 'error' => 0, + 'size' => '21324' + ) + ) + ); + $expected = array(array('name' => 'zipfile2.zip','type' => 'application/x-zip-compressed','tmp_name' => '/tmp/php179.tmp','error' => 0,'size' => '354784')); + $r = Set::extract('/file/.[type=application/x-zip-compressed]', $f); + $this->assertEqual($r, $expected); + + $expected = array(array('name' => 'zipfile.zip','type' => 'application/zip','tmp_name' => '/tmp/php178.tmp','error' => 0,'size' => '564647')); + $r = Set::extract('/file/.[type=application/zip]', $f); + $this->assertEqual($r, $expected); + + $hasMany = array( + 'Node' => array( + 'id' => 1, + 'name' => 'First', + 'state' => 50 + ), + 'ParentNode' => array( + 0 => array( + 'id' => 2, + 'name' => 'Second', + 'state' => 60, + ) + ) + ); + $result = Set::extract('/ParentNode/name', $hasMany); + $expected = array('Second'); + $this->assertEqual($result, $expected); + } +/** + * test parent selectors with extract + * + * @return void + */ + function testExtractParentSelector() { $tree = array( array( 'Category' => array( @@ -855,24 +932,6 @@ function testExtract() { $r = Set::extract('/Category[name=Category 2]/../children', $tree); $this->assertEqual($r, $expected); - $mixedKeys = array( - 'User' => array( - 0 => array( - 'id' => 4, - 'name' => 'Neo' - ), - 1 => array( - 'id' => 5, - 'name' => 'Morpheus' - ), - 'stringKey' => array() - ) - ); - - $expected = array('Neo', 'Morpheus'); - $r = Set::extract('/User/name', $mixedKeys); - $this->assertEqual($r, $expected); - $single = array( array( 'CallType' => array( @@ -919,67 +978,6 @@ function testExtract() { $r = Set::extract('/CallType[name=Internal Voice]/../x/hour', $multiple); $this->assertEqual($r, $expected); - $f = array( - array( - 'file' => array( - 'name' => 'zipfile.zip', - 'type' => 'application/zip', - 'tmp_name' => '/tmp/php178.tmp', - 'error' => 0, - 'size' => '564647' - ) - ), - array( - 'file' => array( - 'name' => 'zipfile2.zip', - 'type' => 'application/x-zip-compressed', - 'tmp_name' => '/tmp/php179.tmp', - 'error' => 0, - 'size' => '354784' - ) - ), - array( - 'file' => array( - 'name' => 'picture.jpg', - 'type' => 'image/jpeg', - 'tmp_name' => '/tmp/php180.tmp', - 'error' => 0, - 'size' => '21324' - ) - ) - ); - $expected = array(array('name' => 'zipfile2.zip','type' => 'application/x-zip-compressed','tmp_name' => '/tmp/php179.tmp','error' => 0,'size' => '354784')); - $r = Set::extract('/file/.[type=application/x-zip-compressed]', $f); - $this->assertEqual($r, $expected); - - $expected = array(array('name' => 'zipfile.zip','type' => 'application/zip','tmp_name' => '/tmp/php178.tmp','error' => 0,'size' => '564647')); - $r = Set::extract('/file/.[type=application/zip]', $f); - $this->assertEqual($r, $expected); - - $hasMany = array( - 'Node' => array( - 'id' => 1, - 'name' => 'First', - 'state' => 50 - ), - 'ParentNode' => array( - 0 => array( - 'id' => 2, - 'name' => 'Second', - 'state' => 60, - ) - ) - ); - $result = Set::extract('/ParentNode/name', $hasMany); - $expected = array('Second'); - $this->assertEqual($result, $expected); - } -/** - * test parent selectors with extract - * - * @return void - */ - function testExtractParentSelector() { $a = array( 'Model' => array( '0' => array( From 1210a4f598fddd0f7371bb29c14eb99f7da1e25b Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 27 Mar 2010 16:28:59 -0400 Subject: [PATCH 1833/2083] Fixing whitespacing. --- cake/tests/cases/libs/set.test.php | 1 + 1 file changed, 1 insertion(+) diff --git a/cake/tests/cases/libs/set.test.php b/cake/tests/cases/libs/set.test.php index ffba178e3..6d62d9367 100644 --- a/cake/tests/cases/libs/set.test.php +++ b/cake/tests/cases/libs/set.test.php @@ -873,6 +873,7 @@ function testExtract() { $expected = array('Second'); $this->assertEqual($result, $expected); } + /** * test parent selectors with extract * From 7b28fdec859fc4ae710da2c56c4acfb773e930d0 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 27 Mar 2010 17:19:42 -0400 Subject: [PATCH 1834/2083] Fixing Security::cipher() not being able to correctly decrypt numeric values. Fixes #513 --- cake/libs/security.php | 10 ++++------ cake/tests/cases/libs/security.test.php | 10 ++++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/cake/libs/security.php b/cake/libs/security.php index 63ac25f6f..53a5e519b 100644 --- a/cake/libs/security.php +++ b/cake/libs/security.php @@ -176,17 +176,15 @@ function cipher($text, $key) { srand(Configure::read('Security.cipherSeed')); $out = ''; - $keyLength = strlen($key); - for ($i = 0, $j = strlen($text); $i < $j; $i++) { - $k = ord($key[$i % $keyLength]); - while ($k-- > 0) { + for ($i = 0, $textLength = strlen($text); $i < $textLength; $i++) { + $j = ord(substr($key, $i % $keyLength, 1)); + while ($j--) { rand(0, 255); } $mask = rand(0, 255); - $out .= chr(ord($text[$i]) ^ $mask); + $out .= chr(ord(substr($text, $i, 1)) ^ $mask); } - srand(); return $out; } diff --git a/cake/tests/cases/libs/security.test.php b/cake/tests/cases/libs/security.test.php index fb8d30478..34d1569da 100644 --- a/cake/tests/cases/libs/security.test.php +++ b/cake/tests/cases/libs/security.test.php @@ -159,6 +159,16 @@ function testCipher() { $result = Security::cipher($txt, $key); $this->assertError(); $this->assertIdentical($result, ''); + + $txt = 123456; + $key = 'my_key'; + $result = Security::cipher($txt, $key); + $this->assertEqual(Security::cipher($result, $key), $txt); + + $txt = '123456'; + $key = 'my_key'; + $result = Security::cipher($txt, $key); + $this->assertEqual(Security::cipher($result, $key), $txt); } } ?> \ No newline at end of file From d365fafe4d4fe06621c71383ccbf52b00228726c Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Sun, 28 Mar 2010 05:29:42 +0530 Subject: [PATCH 1835/2083] Changed default value for option 'validate' to 'first' in Model::saveAll(). Also fixed issue where the return array contained more keys then number of records in data array itself with options 'validate =>'first' and 'atomic'=>false --- cake/libs/model/model.php | 10 ++++++---- cake/tests/cases/libs/model/model_write.test.php | 9 +++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index c75de73f8..579b21489 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1556,9 +1556,9 @@ function _prepareUpdateFields($data) { * * #### Options * - * - validate: Set to false to disable validation, true to validate each record before - * saving, 'first' to validate *all* records before any are saved, or 'only' to only - * validate the records, but not save them. + * - validate: Set to false to disable validation, true to validate each record before saving, + * 'first' to validate *all* records before any are saved (default), + * or 'only' to only validate the records, but not save them. * - atomic: If true (default), will attempt to save all records in a single transaction. * Should be set to false if database/table does not support transactions. * - fieldList: Equivalent to the $fieldList parameter in Model::save() @@ -1579,7 +1579,7 @@ function saveAll($data = null, $options = array()) { } $db =& ConnectionManager::getDataSource($this->useDbConfig); - $options = array_merge(array('validate' => true, 'atomic' => true), $options); + $options = array_merge(array('validate' => 'first', 'atomic' => true), $options); $this->validationErrors = $validationErrors = array(); $validates = true; $return = array(); @@ -1626,6 +1626,7 @@ function saveAll($data = null, $options = array()) { break; case ($options['validate'] === 'first'): $options['validate'] = true; + $return = array(); continue; break; default: @@ -1731,6 +1732,7 @@ function saveAll($data = null, $options = array()) { break; case ($options['validate'] === 'first'): $options['validate'] = true; + $return = array(); continue; break; default: diff --git a/cake/tests/cases/libs/model/model_write.test.php b/cake/tests/cases/libs/model/model_write.test.php index 8be8cb6da..5a06db1fc 100644 --- a/cake/tests/cases/libs/model/model_write.test.php +++ b/cake/tests/cases/libs/model/model_write.test.php @@ -2871,7 +2871,8 @@ function testSaveAllAtomic() { 'title' => '', 'body' => 'Trying to get away with an empty title' ) - ), array('atomic' => false)); + ), array('validate' => true, 'atomic' => false)); + $this->assertIdentical($result, array(true, false)); $result = $TestModel->saveAll(array( @@ -2887,7 +2888,7 @@ function testSaveAllAtomic() { 'published' => 'Y', 'user_id' => 2 )) - ), array('atomic' => false)); + ), array('validate' => true, 'atomic' => false)); $this->assertIdentical($result, array('Article' => true, 'Comment' => array(true, true))); } @@ -2985,7 +2986,7 @@ function testSaveAllHasManyValidation() { 'Comment' => array( array('comment' => '', 'published' => 'Y', 'user_id' => 1), ) - )); + ), array('validate' => true)); $expected = array('Comment' => array(false)); $this->assertEqual($result, $expected); @@ -3318,7 +3319,7 @@ function testSaveAllValidation() { 'title' => '', 'body' => 'Trying to get away with an empty title' )); - $result = $TestModel->saveAll($data, array('atomic' => false)); + $result = $TestModel->saveAll($data, array('validate' => true, 'atomic' => false)); $this->assertEqual($result, array(true, false)); $result = $TestModel->find('all', array('recursive' => -1, 'order' => 'Post.id ASC')); $errors = array(1 => array('title' => 'This field cannot be left blank')); From 8ff0b536d881711d3260162685e42077ca8ef70f Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Mar 2010 11:28:03 -0400 Subject: [PATCH 1836/2083] Fixing @link tags and updating documentation for basics.php, Controller, and Dispatcher. --- cake/basics.php | 32 ++++----- cake/dispatcher.php | 23 +++--- cake/libs/controller/controller.php | 105 ++++++++++++++-------------- 3 files changed, 83 insertions(+), 77 deletions(-) diff --git a/cake/basics.php b/cake/basics.php index 0df4069e4..e58eec6e6 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -98,7 +98,7 @@ function uses() { * @param boolean $var Variable to show debug information for. * @param boolean $showHtml If set to true, the method prints the debug data in a screen-friendly way. * @param boolean $showFrom If set to true, the method prints from where the function was called. - * @link http://book.cakephp.org/view/458/Basic-Debugging + * @link http://book.cakephp.org/view/1190/Basic-Debugging */ function debug($var = false, $showHtml = false, $showFrom = true) { if (Configure::read() > 0) { @@ -198,7 +198,7 @@ function array_combine($a1, $a2) { * @param string $text Text to wrap through htmlspecialchars * @param string $charset Character set to use when escaping. Defaults to config value in 'App.encoding' or 'UTF-8' * @return string Wrapped text - * @link http://book.cakephp.org/view/703/h + * @link http://book.cakephp.org/view/1132/h */ function h($text, $charset = null) { if (is_array($text)) { @@ -253,7 +253,7 @@ function pluginSplit($name, $dotAppend = false, $plugin = null) { * `array('a', 'b')` * * @return array Array of given parameters - * @link http://book.cakephp.org/view/694/a + * @link http://book.cakephp.org/view/1122/a * @deprecated Will be removed in 2.0 */ function a() { @@ -273,7 +273,7 @@ function a() { * `array('a'=>'b')` * * @return array Associative array - * @link http://book.cakephp.org/view/695/aa + * @link http://book.cakephp.org/view/1123/aa * @deprecated Will be removed in 2.0 */ function aa() { @@ -294,7 +294,7 @@ function aa() { * Convenience method for echo(). * * @param string $text String to echo - * @link http://book.cakephp.org/view/700/e + * @link http://book.cakephp.org/view/1129/e * @deprecated Will be removed in 2.0 */ function e($text) { @@ -306,7 +306,7 @@ function e($text) { * * @param string $str String to lowercase * @return string Lowercased string - * @link http://book.cakephp.org/view/705/low + * @link http://book.cakephp.org/view/1134/low * @deprecated Will be removed in 2.0 */ function low($str) { @@ -318,7 +318,7 @@ function low($str) { * * @param string $str String to uppercase * @return string Uppercased string - * @link http://book.cakephp.org/view/710/up + * @link http://book.cakephp.org/view/1139/up * @deprecated Will be removed in 2.0 */ function up($str) { @@ -332,7 +332,7 @@ function up($str) { * @param string $replace String to insert * @param string $subject String to search * @return string Replaced string - * @link http://book.cakephp.org/view/708/r + * @link http://book.cakephp.org/view/1137/r * @deprecated Will be removed in 2.0 */ function r($search, $replace, $subject) { @@ -345,7 +345,7 @@ function r($search, $replace, $subject) { * * @see debug() * @param array $var Variable to print out - * @link http://book.cakephp.org/view/707/pr + * @link http://book.cakephp.org/view/1136/pr */ function pr($var) { if (Configure::read() > 0) { @@ -380,7 +380,7 @@ function params($p) { * @param array Third array * @param array Etc... * @return array All array parameters merged into one - * @link http://book.cakephp.org/view/696/am + * @link http://book.cakephp.org/view/1124/am */ function am() { $r = array(); @@ -402,7 +402,7 @@ function am() { * * @param string $key Environment variable name. * @return string Environment variable setting. - * @link http://book.cakephp.org/view/701/env + * @link http://book.cakephp.org/view/1130/env */ function env($key) { if ($key == 'HTTPS') { @@ -619,7 +619,7 @@ function clearCache($params = null, $type = 'views', $ext = '.php') { * * @param array $values Array of values to strip slashes * @return mixed What is returned from calling stripslashes - * @link http://book.cakephp.org/view/709/stripslashes_deep + * @link http://book.cakephp.org/view/1138/stripslashes_deep */ function stripslashes_deep($values) { if (is_array($values)) { @@ -638,7 +638,7 @@ function stripslashes_deep($values) { * @param string $singular Text to translate * @param boolean $return Set to true to return translated string, or false to echo * @return mixed translated string if $return is false string will be echoed - * @link http://book.cakephp.org/view/693/__ + * @link http://book.cakephp.org/view/1121/__ */ function __($singular, $return = false) { if (!$singular) { @@ -919,7 +919,7 @@ function LogError($message) { * * @param string $file File to look for * @return Full path to file if exists, otherwise false - * @link http://book.cakephp.org/view/702/fileExistsInPath + * @link http://book.cakephp.org/view/1131/fileExistsInPath */ function fileExistsInPath($file) { $paths = explode(PATH_SEPARATOR, ini_get('include_path')); @@ -940,7 +940,7 @@ function fileExistsInPath($file) { * * @param string String to convert * @return string with underscore remove from start and end of string - * @link http://book.cakephp.org/view/697/convertSlash + * @link http://book.cakephp.org/view/1126/convertSlash */ function convertSlash($string) { $string = trim($string, '/'); @@ -1001,7 +1001,7 @@ function http_build_query($data, $prefix = null, $argSep = null, $baseKey = null * @param mixed $val1 Value to return in case condition matches * @param mixed $val2 Value to return if condition doesn't match * @return mixed $val1 or $val2, depending on whether $condition evaluates to a non-empty expression. - * @link http://book.cakephp.org/view/704/ife + * @link http://book.cakephp.org/view/1133/ife * @deprecated Will be removed in 2.0 */ function ife($condition, $val1 = null, $val2 = null) { diff --git a/cake/dispatcher.php b/cake/dispatcher.php index f3edc7050..d04826593 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -82,7 +82,8 @@ function __construct($url = null, $base = false) { } /** - * Dispatches and invokes given URL, handing over control to the involved controllers, and then renders the results (if autoRender is set). + * Dispatches and invokes given URL, handing over control to the involved controllers, and then renders the + * results (if autoRender is set). * * If no controller of given name can be found, invoke() shows error messages in * the form of Missing Controllers information. It does the same with Actions (methods of Controllers are called @@ -171,8 +172,9 @@ function dispatch($url = null, $additionalParams = array()) { } /** - * Invokes given controller's render action if autoRender option is set. Otherwise the - * contents of the operation are returned as a string. + * Initializes the components and models a controller will be using. + * Triggers the controller action, and invokes the rendering if Controller::$autoRender is true and echo's the output. + * Otherwise the return value of the controller action are returned. * * @param object $controller Controller to invoke * @param array $params Parameters with at least the 'action' to invoke @@ -216,10 +218,11 @@ function _invoke(&$controller, $params) { /** * Sets the params when $url is passed as an array to Object::requestAction(); + * Merges the $url and $additionalParams and creates a string url. * - * @param array $url - * @param array $additionalParams - * @return string $url + * @param array $url Array or request parameters + * @param array $additionalParams Array of additional parameters. + * @return string $url The generated url string. * @access private */ function __extractParams($url, $additionalParams = array()) { @@ -414,7 +417,10 @@ function &__getController() { $name = $ctrlClass; $ctrlClass .= 'Controller'; if (class_exists($ctrlClass)) { - if (empty($params['plugin']) && strtolower(get_parent_class($ctrlClass)) === strtolower($name . 'AppController')) { + if ( + empty($params['plugin']) && + strtolower(get_parent_class($ctrlClass)) === strtolower($name . 'AppController') + ) { $params = $this->_restructureParams($params); } $this->params = $params; @@ -424,7 +430,7 @@ function &__getController() { } /** - * Load controller and return controller class + * Load controller and return controller classname * * @param array $params Array of parameters * @return string|bool Name of controller class name @@ -580,7 +586,6 @@ function cached($url) { return $return; } } - return false; } diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index b76b9f050..f2cfcce9c 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -32,7 +32,7 @@ * * @package cake * @subpackage cake.cake.libs.controller - * @link http://book.cakephp.org/view/49/Controllers + * @link http://book.cakephp.org/view/956/Introduction */ class Controller extends Object { @@ -41,7 +41,7 @@ class Controller extends Object { * * @var string * @access public - * @link http://book.cakephp.org/view/52/name + * @link http://book.cakephp.org/view/959/Controller-Attributes */ var $name = null; @@ -72,14 +72,14 @@ class Controller extends Object { /** * An array containing the class names of models this controller uses. * - * Example: var $uses = array('Product', 'Post', 'Comment'); + * Example: `var $uses = array('Product', 'Post', 'Comment');` * * Can be set to array() to use no models. Can be set to false to * use no models and prevent the merging of $uses with AppController * * @var mixed A single name as a string or a list of names as an array. * @access protected - * @link http://book.cakephp.org/view/53/components-helpers-and-uses + * @link http://book.cakephp.org/view/961/components-helpers-and-uses */ var $uses = false; @@ -87,11 +87,11 @@ class Controller extends Object { * An array containing the names of helpers this controller uses. The array elements should * not contain the "Helper" part of the classname. * - * Example: var $helpers = array('Html', 'Javascript', 'Time', 'Ajax'); + * Example: `var $helpers = array('Html', 'Javascript', 'Time', 'Ajax');` * * @var mixed A single name as a string or a list of names as an array. * @access protected - * @link http://book.cakephp.org/view/53/components-helpers-and-uses + * @link http://book.cakephp.org/view/961/components-helpers-and-uses */ var $helpers = array('Session', 'Html', 'Form'); @@ -101,13 +101,13 @@ class Controller extends Object { * * @var array * @access public - * @link http://book.cakephp.org/view/55/The-Parameters-Attribute-params + * @link http://book.cakephp.org/view/963/The-Parameters-Attribute-params */ var $params = array(); /** * Data POSTed to the controller using the HtmlHelper. Data here is accessible - * using the $this->data['ModelName']['fieldName'] pattern. + * using the `$this->data['ModelName']['fieldName']` pattern. * * @var array * @access public @@ -122,14 +122,16 @@ class Controller extends Object { * Pagination defaults can also be supplied in a model-by-model basis by using * the name of the model as a key for a pagination array: * + * {{{ * var $paginate = array( * 'Post' => array(...), * 'Comment' => array(...) * ); + * }}} * * @var array * @access public - * @link http://book.cakephp.org/view/164/Pagination + * @link http://book.cakephp.org/view/1231/Pagination */ var $paginate = array('limit' => 20, 'page' => 1); @@ -157,16 +159,6 @@ class Controller extends Object { */ var $viewVars = array(); -/** - * Text to be used for the $title_for_layout layout variable (usually - * placed inside <title> tags.) - * - * @var boolean - * @access public - * @link http://book.cakephp.org/view/54/Page-related-Attributes-layout-and-pageTitle - */ - var $pageTitle = false; - /** * An array containing the class names of the models this controller uses. * @@ -190,7 +182,7 @@ class Controller extends Object { * * @var string * @access public - * @link http://book.cakephp.org/view/54/Page-related-Attributes-layout-and-pageTitle + * @link http://book.cakephp.org/view/962/Page-related-Attributes-layout-and-pageTitle */ var $layout = 'default'; @@ -223,11 +215,11 @@ class Controller extends Object { * Array containing the names of components this controller uses. Component names * should not contain the "Component" portion of the classname. * - * Example: var $components = array('Session', 'RequestHandler', 'Acl'); + * Example: `var $components = array('Session', 'RequestHandler', 'Acl');` * * @var array * @access public - * @link http://book.cakephp.org/view/53/components-helpers-and-uses + * @link http://book.cakephp.org/view/961/components-helpers-and-uses */ var $components = array('Session'); @@ -270,17 +262,21 @@ class Controller extends Object { * single action, the value is set to an array containing keys that match * action names and values that denote cache expiration times (in seconds). * - * Example: var $cacheAction = array( + * Example: + * + * {{{ + * var $cacheAction = array( * 'view/23/' => 21600, * 'recalled/' => 86400 * ); + * }}} * * $cacheAction can also be set to a strtotime() compatible string. This * marks all the actions in the controller for view caching. * * @var mixed * @access public - * @link http://book.cakephp.org/view/346/Caching-in-the-Controller + * @link http://book.cakephp.org/view/1380/Caching-in-the-Controller */ var $cacheAction = false; @@ -307,7 +303,7 @@ class Controller extends Object { * * @var mixed * @access public - * @link http://book.cakephp.org/view/105/Scaffolding + * @link http://book.cakephp.org/view/1103/Scaffolding */ var $scaffold = false; @@ -484,7 +480,7 @@ function __mergeVars() { * @return mixed true if models found and instance created, or cakeError if models not found. * @access public * @see Controller::loadModel() - * @link http://book.cakephp.org/view/429/constructClasses + * @link http://book.cakephp.org/view/977/Controller-Methods#constructClasses-986 */ function constructClasses() { $this->__mergeVars(); @@ -562,7 +558,7 @@ function shutdownProcess() { * )); // sets these new values, and returns true * * @return mixed Associative array of the HTTP codes as keys, and the message - * strings as values, or null of the given $code does not exist. + * strings as values, or null of the given $code does not exist. */ function httpCodes($code = null) { if (empty($this->__httpCodes)) { @@ -604,7 +600,7 @@ function httpCodes($code = null) { /** * Loads and instantiates models required by this controller. - * If Controller::persistModel; is true, controller will cache model instances on first request, + * If Controller::$persistModel; is true, controller will cache model instances on first request, * additional request will used cached models. * If the model is non existent, it will throw a missing database table error, as Cake generates * dynamic models for the time being. @@ -668,12 +664,12 @@ function loadModel($modelClass = null, $id = null) { * Script execution is halted after the redirect. * * @param mixed $url A string or array-based URL pointing to another location within the app, - * or an absolute URL + * or an absolute URL * @param integer $status Optional HTTP status code (eg: 404) * @param boolean $exit If true, exit() will be called after the redirect * @return mixed void if $exit = false. Terminates script if $exit = true * @access public - * @link http://book.cakephp.org/view/425/redirect + * @link http://book.cakephp.org/view/982/redirect */ function redirect($url, $status = null, $exit = true) { $this->autoRender = false; @@ -737,9 +733,10 @@ function redirect($url, $status = null, $exit = true) { } /** - * Convenience method for header() + * Convenience and object wrapper method for header(). Useful when doing tests and + * asserting that particular headers have been set. * - * @param string $status + * @param string $status The header message that is being set. * @return void * @access public */ @@ -755,7 +752,7 @@ function header($status) { * Unused if $one is an associative array, otherwise serves as the values to $one's keys. * @return void * @access public - * @link http://book.cakephp.org/view/427/set + * @link http://book.cakephp.org/view/979/set */ function set($one, $two = null) { $data = array(); @@ -773,14 +770,18 @@ function set($one, $two = null) { } /** - * Internally redirects one action to another. Examples: + * Internally redirects one action to another. Does not perform another HTTP request unlike Controller::redirect() + * + * Examples: * + * {{{ * setAction('another_action'); * setAction('action_with_parameters', $parameter1); + * }}} * - * @param string $action The new action to be redirected to + * @param string $action The new action to be 'redirected' to * @param mixed Any other parameters passed to this method will be passed as - * parameters to the new action. + * parameters to the new action. * @return mixed Returns the return value of the called action * @access public */ @@ -793,11 +794,11 @@ function setAction($action) { /** * Controller callback to tie into Auth component. - * Only called when AuthComponent::authorize is set to 'controller'. + * Only called when AuthComponent::$authorize is set to 'controller'. * * @return bool true if authorized, false otherwise * @access public - * @link http://book.cakephp.org/view/396/authorize + * @link http://book.cakephp.org/view/1275/authorize */ function isAuthorized() { trigger_error(sprintf( @@ -825,7 +826,7 @@ function validate() { /** * Validates models passed by parameters. Example: * - * $errors = $this->validateErrors($this->Article, $this->User); + * `$errors = $this->validateErrors($this->Article, $this->User);` * * @param mixed A list of models as a variable argument * @return array Validation errors, or false if none @@ -855,7 +856,7 @@ function validateErrors() { * @param string $file File to use for rendering * @return string Full output string of view contents * @access public - * @link http://book.cakephp.org/view/428/render + * @link http://book.cakephp.org/view/980/render */ function render($action = null, $layout = null, $file = null) { $this->beforeRender(); @@ -917,7 +918,7 @@ function render($action = null, $layout = null, $file = null) { * @param boolean $local If true, restrict referring URLs to local server * @return string Referring URL * @access public - * @link http://book.cakephp.org/view/430/referer + * @link http://book.cakephp.org/view/987/referer */ function referer($default = null, $local = false) { $ref = env('HTTP_REFERER'); @@ -946,7 +947,7 @@ function referer($default = null, $local = false) { * * @return void * @access public - * @link http://book.cakephp.org/view/431/disableCache + * @link http://book.cakephp.org/view/988/disableCache */ function disableCache() { header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); @@ -967,7 +968,7 @@ function disableCache() { * @param string $layout Layout you want to use, defaults to 'flash' * @return void Renders flash layout * @access public - * @link http://book.cakephp.org/view/426/flash + * @link http://book.cakephp.org/view/983/flash */ function flash($message, $url, $pause = 1, $layout = 'flash') { $this->autoRender = false; @@ -989,7 +990,7 @@ function flash($message, $url, $pause = 1, $layout = 'flash') { * included in the returned conditions * @return array An array of model conditions * @access public - * @link http://book.cakephp.org/view/432/postConditions + * @link http://book.cakephp.org/view/989/postConditions */ function postConditions($data = array(), $op = null, $bool = 'AND', $exclusive = false) { if (!is_array($data) || empty($data)) { @@ -1046,7 +1047,7 @@ function postConditions($data = array(), $op = null, $bool = 'AND', $exclusive = * @param array $whitelist List of allowed options for paging * @return array Model query results * @access public - * @link http://book.cakephp.org/view/165/Controller-Setup + * @link http://book.cakephp.org/view/1232/Controller-Setup */ function paginate($object = null, $scope = array(), $whitelist = array()) { if (is_array($object)) { @@ -1244,7 +1245,7 @@ function paginate($object = null, $scope = array(), $whitelist = array()) { * Called before the controller action. * * @access public - * @link http://book.cakephp.org/view/60/Callbacks + * @link http://book.cakephp.org/view/984/Callbacks */ function beforeFilter() { } @@ -1253,7 +1254,7 @@ function beforeFilter() { * Called after the controller action is run, but before the view is rendered. * * @access public - * @link http://book.cakephp.org/view/60/Callbacks + * @link http://book.cakephp.org/view/984/Callbacks */ function beforeRender() { } @@ -1262,7 +1263,7 @@ function beforeRender() { * Called after the controller action is run and rendered. * * @access public - * @link http://book.cakephp.org/view/60/Callbacks + * @link http://book.cakephp.org/view/984/Callbacks */ function afterFilter() { } @@ -1273,7 +1274,7 @@ function afterFilter() { * @param string $method name of method called example index, edit, etc. * @return boolean Success * @access protected - * @link http://book.cakephp.org/view/60/Callbacks + * @link http://book.cakephp.org/view/984/Callbacks */ function _beforeScaffold($method) { return true; @@ -1285,7 +1286,7 @@ function _beforeScaffold($method) { * @param string $method name of method called either edit or update. * @return boolean Success * @access protected - * @link http://book.cakephp.org/view/60/Callbacks + * @link http://book.cakephp.org/view/984/Callbacks */ function _afterScaffoldSave($method) { return true; @@ -1297,7 +1298,7 @@ function _afterScaffoldSave($method) { * @param string $method name of method called either edit or update. * @return boolean Success * @access protected - * @link http://book.cakephp.org/view/60/Callbacks + * @link http://book.cakephp.org/view/984/Callbacks */ function _afterScaffoldSaveError($method) { return true; @@ -1311,7 +1312,7 @@ function _afterScaffoldSaveError($method) { * @param string $method name of method called example index, edit, etc. * @return boolean Success * @access protected - * @link http://book.cakephp.org/view/60/Callbacks + * @link http://book.cakephp.org/view/984/Callbacks */ function _scaffoldError($method) { return false; From 45730d1bcaa867fe997a245c3f2f921c972e1ead Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Mar 2010 11:34:58 -0400 Subject: [PATCH 1837/2083] Updating more @link tags. --- cake/console/libs/bake.php | 2 +- cake/console/libs/schema.php | 2 +- cake/libs/configure.php | 16 ++++++++-------- cake/libs/controller/component.php | 4 ++-- cake/libs/debugger.php | 14 +++++++------- cake/libs/inflector.php | 20 ++++++++++---------- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index c8810781b..05a5e020a 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -27,7 +27,7 @@ * * @package cake * @subpackage cake.cake.console.libs - * @link http://book.cakephp.org/view/113/Code-Generation-with-Bake + * @link http://book.cakephp.org/view/1522/Code-Generation-with-Bake */ class BakeShell extends Shell { diff --git a/cake/console/libs/schema.php b/cake/console/libs/schema.php index 0b2c65dc9..b8efe2a55 100644 --- a/cake/console/libs/schema.php +++ b/cake/console/libs/schema.php @@ -28,7 +28,7 @@ * * @package cake * @subpackage cake.cake.console.libs - * @link http://book.cakephp.org/view/734/Schema-management-and-migrations + * @link http://book.cakephp.org/view/1523s/Schema-management-and-migrations */ class SchemaShell extends Shell { diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 692002aa7..802ed1c3b 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -23,14 +23,14 @@ * * @package cake * @subpackage cake.cake.libs - * @link http://book.cakephp.org/view/42/The-Configuration-Class + * @link http://book.cakephp.org/view/924/The-Configuration-Class */ class Configure extends Object { /** * Current debug level. * - * @link http://book.cakephp.org/view/44/CakePHP-Core-Configuration-Variables + * @link http://book.cakephp.org/view/931/CakePHP-Core-Configuration-Variables * @var integer * @access public */ @@ -72,7 +72,7 @@ function &getInstance($boot = true) { * )); * }}} * - * @link http://book.cakephp.org/view/412/write + * @link http://book.cakephp.org/view/926/write * @param array $config Name of var to write * @param mixed $value Value to set for var * @return boolean True if write was successful @@ -145,7 +145,7 @@ function write($config, $value = null) { * Configure::read('Name.key'); will return only the value of Configure::Name[key] * }}} * - * @link http://book.cakephp.org/view/413/read + * @link http://book.cakephp.org/view/927/read * @param string $var Variable to obtain. Use '.' to access array elements. * @return string value of Configure::$var * @access public @@ -195,7 +195,7 @@ function read($var = 'debug') { * Configure::delete('Name.key'); will delete only the Configure::Name[key] * }}} * - * @link http://book.cakephp.org/view/414/delete + * @link http://book.cakephp.org/view/928/delete * @param string $var the var to be deleted * @return void * @access public @@ -222,7 +222,7 @@ function delete($var = null) { * - To load config files from app/config use `Configure::load('configure_file');`. * - To load config files from a plugin `Configure::load('plugin.configure_file');`. * - * @link http://book.cakephp.org/view/415/load + * @link http://book.cakephp.org/view/929/load * @param string $fileName name of file to load, extension must be .php and only the name * should be used, not the extenstion * @return mixed false if file not found, void if load successful @@ -273,7 +273,7 @@ function load($fileName) { * * Usage `Configure::version();` * - * @link http://book.cakephp.org/view/416/version + * @link http://book.cakephp.org/view/930/version * @return string Current version of CakePHP * @access public */ @@ -825,7 +825,7 @@ function objects($type, $path = null, $cache = true) { /** * Finds classes based on $name or specific file(s) to search. * - * @link http://book.cakephp.org/view/529/Using-App-import + * @link http://book.cakephp.org/view/934/Using-App-import * @param mixed $type The type of Class if passed as a string, or all params can be passed as * an single array to $type, * @param string $name Name of the Class or a unique name for the file diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php index 15e41eb76..4df0b1257 100644 --- a/cake/libs/controller/component.php +++ b/cake/libs/controller/component.php @@ -84,7 +84,7 @@ function init(&$controller) { * @param object $controller Controller with components to initialize * @return void * @access public - * @link http://book.cakephp.org/view/65/MVC-Class-Access-Within-Components + * @link http://book.cakephp.org/view/998/MVC-Class-Access-Within-Components */ function initialize(&$controller) { foreach (array_keys($this->_loaded) as $name) { @@ -106,7 +106,7 @@ function initialize(&$controller) { * @param object $controller Controller with components to startup * @return void * @access public - * @link http://book.cakephp.org/view/65/MVC-Class-Access-Within-Components + * @link http://book.cakephp.org/view/998/MVC-Class-Access-Within-Components * @deprecated See Component::triggerCallback() */ function startup(&$controller) { diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index 980e435bd..6c567d149 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -41,7 +41,7 @@ * * @package cake * @subpackage cake.cake.libs - * @link http://book.cakephp.org/view/460/Using-the-Debugger-Class + * @link http://book.cakephp.org/view/1191/Using-the-Debugger-Class */ class Debugger extends Object { @@ -210,7 +210,7 @@ function &getInstance($class = null) { * @see exportVar * @access public * @static - * @link http://book.cakephp.org/view/460/Using-the-Debugger-Class + * @link http://book.cakephp.org/view/1191/Using-the-Debugger-Class */ function dump($var) { $_this =& Debugger::getInstance(); @@ -225,7 +225,7 @@ function dump($var) { * @param $level int type of log to use. Defaults to LOG_DEBUG * @return void * @static - * @link http://book.cakephp.org/view/460/Using-the-Debugger-Class + * @link http://book.cakephp.org/view/1191/Using-the-Debugger-Class */ function log($var, $level = LOG_DEBUG) { $_this =& Debugger::getInstance(); @@ -324,7 +324,7 @@ function handleError($code, $description, $file = null, $line = null, $context = * @return string Formatted stack trace * @access public * @static - * @link http://book.cakephp.org/view/460/Using-the-Debugger-Class + * @link http://book.cakephp.org/view/1191/Using-the-Debugger-Class */ function trace($options = array()) { $_this =& Debugger::getInstance(); @@ -436,7 +436,7 @@ function trimPath($path) { * @return array Set of lines highlighted * @access public * @static - * @link http://book.cakephp.org/view/460/Using-the-Debugger-Class + * @link http://book.cakephp.org/view/1191/Using-the-Debugger-Class */ function excerpt($file, $line, $context = 2) { $data = $lines = array(); @@ -469,7 +469,7 @@ function excerpt($file, $line, $context = 2) { * @return string Variable as a formatted string * @access public * @static - * @link http://book.cakephp.org/view/460/Using-the-Debugger-Class + * @link http://book.cakephp.org/view/1191/Using-the-Debugger-Class */ function exportVar($var, $recursion = 0) { $_this =& Debugger::getInstance(); @@ -686,7 +686,7 @@ function checkSecurityKeys() { * @param object $debugger A reference to the Debugger object * @access public * @static - * @link http://book.cakephp.org/view/460/Using-the-Debugger-Class + * @link http://book.cakephp.org/view/1191/Using-the-Debugger-Class */ function invoke(&$debugger) { set_error_handler(array(&$debugger, 'handleError')); diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index fc610b55d..a6ba66361 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -28,7 +28,7 @@ * * @package cake * @subpackage cake.cake.libs - * @link http://book.cakephp.org/view/491/Inflector + * @link http://book.cakephp.org/view/1478/Inflector */ class Inflector { @@ -348,7 +348,7 @@ function rules($type, $rules, $reset = false) { * @return string Word in plural * @access public * @static - * @link http://book.cakephp.org/view/572/Class-methods + * @link http://book.cakephp.org/view/1479/Class-methods */ function pluralize($word) { $_this =& Inflector::getInstance(); @@ -395,7 +395,7 @@ function pluralize($word) { * @return string Word in singular * @access public * @static - * @link http://book.cakephp.org/view/572/Class-methods + * @link http://book.cakephp.org/view/1479/Class-methods */ function singularize($word) { $_this =& Inflector::getInstance(); @@ -444,7 +444,7 @@ function singularize($word) { * @return string Camelized word. LikeThis. * @access public * @static - * @link http://book.cakephp.org/view/572/Class-methods + * @link http://book.cakephp.org/view/1479/Class-methods */ function camelize($lowerCaseAndUnderscoredWord) { $_this =& Inflector::getInstance(); @@ -462,7 +462,7 @@ function camelize($lowerCaseAndUnderscoredWord) { * @return string Underscore-syntaxed version of the $camelCasedWord * @access public * @static - * @link http://book.cakephp.org/view/572/Class-methods + * @link http://book.cakephp.org/view/1479/Class-methods */ function underscore($camelCasedWord) { $_this =& Inflector::getInstance(); @@ -481,7 +481,7 @@ function underscore($camelCasedWord) { * @return string Human-readable string * @access public * @static - * @link http://book.cakephp.org/view/572/Class-methods + * @link http://book.cakephp.org/view/1479/Class-methods */ function humanize($lowerCaseAndUnderscoredWord) { $_this =& Inflector::getInstance(); @@ -499,7 +499,7 @@ function humanize($lowerCaseAndUnderscoredWord) { * @return string Name of the database table for given class * @access public * @static - * @link http://book.cakephp.org/view/572/Class-methods + * @link http://book.cakephp.org/view/1479/Class-methods */ function tableize($className) { $_this =& Inflector::getInstance(); @@ -517,7 +517,7 @@ function tableize($className) { * @return string Class name * @access public * @static - * @link http://book.cakephp.org/view/572/Class-methods + * @link http://book.cakephp.org/view/1479/Class-methods */ function classify($tableName) { $_this =& Inflector::getInstance(); @@ -535,7 +535,7 @@ function classify($tableName) { * @return string in variable form * @access public * @static - * @link http://book.cakephp.org/view/572/Class-methods + * @link http://book.cakephp.org/view/1479/Class-methods */ function variable($string) { $_this =& Inflector::getInstance(); @@ -559,7 +559,7 @@ function variable($string) { * @return string * @access public * @static - * @link http://book.cakephp.org/view/572/Class-methods + * @link http://book.cakephp.org/view/1479/Class-methods */ function slug($string, $replacement = '_', $map = array()) { $_this =& Inflector::getInstance(); From 304a5ff64a41bd363fa44bb13315b6404f422bc6 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Mar 2010 12:17:53 -0400 Subject: [PATCH 1838/2083] Expanding documentation for AclComponent and DbAcl. --- cake/libs/controller/components/acl.php | 98 +++++++++++++++---------- 1 file changed, 59 insertions(+), 39 deletions(-) diff --git a/cake/libs/controller/components/acl.php b/cake/libs/controller/components/acl.php index 519a43fdb..dbee341eb 100644 --- a/cake/libs/controller/components/acl.php +++ b/cake/libs/controller/components/acl.php @@ -23,7 +23,9 @@ /** * Access Control List factory class. * - * Looks for ACL implementation class in core config, and returns an instance of that class. + * Uses a strategy pattern to allow custom ACL implementations to be used with the same component interface. + * You can define by changing `Configure::write('Acl.classname', 'DbAcl');` in your core.php. Concrete ACL + * implementations should extend `AclBase` and implement the methods it defines. * * @package cake * @subpackage cake.cake.libs.controller.components @@ -39,7 +41,7 @@ class AclComponent extends Object { var $_Instance = null; /** - * Constructor. Will return an instance of the correct ACL class. + * Constructor. Will return an instance of the correct ACL class as defined in `Configure::read('Acl.classname')` * */ function __construct() { @@ -76,10 +78,11 @@ function _initACL() { } /** - * Pass-thru function for ACL check instance. + * Pass-thru function for ACL check instance. Check methods + * are used to check whether or not an ARO can access an ACO * - * @param string $aro ARO - * @param string $aco ACO + * @param string $aro ARO The requesting object identifier. + * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success * @access public @@ -89,10 +92,11 @@ function check($aro, $aco, $action = "*") { } /** - * Pass-thru function for ACL allow instance. + * Pass-thru function for ACL allow instance. Allow methods + * are used to grant an ARO access to an ACO. * - * @param string $aro ARO - * @param string $aco ACO + * @param string $aro ARO The requesting object identifier. + * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success * @access public @@ -102,10 +106,11 @@ function allow($aro, $aco, $action = "*") { } /** - * Pass-thru function for ACL deny instance. + * Pass-thru function for ACL deny instance. Deny methods + * are used to remove permission from an ARO to access an ACO. * - * @param string $aro ARO - * @param string $aco ACO + * @param string $aro ARO The requesting object identifier. + * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success * @access public @@ -115,10 +120,11 @@ function deny($aro, $aco, $action = "*") { } /** - * Pass-thru function for ACL inherit instance. + * Pass-thru function for ACL inherit instance. Inherit methods + * modify the permission for an ARO to be that of its parent object. * - * @param string $aro ARO - * @param string $aco ACO + * @param string $aro ARO The requesting object identifier. + * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success * @access public @@ -128,10 +134,10 @@ function inherit($aro, $aco, $action = "*") { } /** - * Pass-thru function for ACL grant instance. + * Pass-thru function for ACL grant instance. An alias for AclComponent::allow() * - * @param string $aro ARO - * @param string $aco ACO + * @param string $aro ARO The requesting object identifier. + * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success * @access public @@ -141,10 +147,10 @@ function grant($aro, $aco, $action = "*") { } /** - * Pass-thru function for ACL grant instance. + * Pass-thru function for ACL grant instance. An alias for AclComponent::deny() * - * @param string $aro ARO - * @param string $aco ACO + * @param string $aro ARO The requesting object identifier. + * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success * @access public @@ -178,8 +184,8 @@ function __construct() { /** * Empty method to be overridden in subclasses * - * @param string $aro ARO - * @param string $aco ACO + * @param string $aro ARO The requesting object identifier. + * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @access public */ @@ -197,7 +203,21 @@ function initialize(&$component) { } /** - * In this file you can extend the AclBase. + * DbAcl implements an ACL control system in the database. ARO's and ACO's are + * structured into trees and a linking table is used to define permissions. You + * can install the schema for DbAcl with the Schema Shell. + * + * `$aco` and `$aro` parameters can be slash delimited paths to tree nodes. + * + * eg. `controllers/Users/edit` + * + * Would point to a tree structure like + * + * {{{ + * controllers + * Users + * edit + * }}} * * @package cake * @subpackage cake.cake.libs.model @@ -218,9 +238,9 @@ function __construct() { } /** - * Enter description here... + * Initializes the containing component and sets the Aro/Aco objects to it. * - * @param object $component + * @param AclComponent $component * @return void * @access public */ @@ -232,8 +252,8 @@ function initialize(&$component) { /** * Checks if the given $aro has access to action $action in $aco * - * @param string $aro ARO - * @param string $aco ACO + * @param string $aro ARO The requesting object identifier. + * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success (true if ARO has access to action in ACO, false otherwise) * @access public @@ -322,8 +342,8 @@ function check($aro, $aco, $action = "*") { /** * Allow $aro to have access to action $actions in $aco * - * @param string $aro ARO - * @param string $aco ACO + * @param string $aro ARO The requesting object identifier. + * @param string $aco ACO The controlled object identifier. * @param string $actions Action (defaults to *) * @param integer $value Value to indicate access type (1 to give access, -1 to deny, 0 to inherit) * @return boolean Success @@ -374,8 +394,8 @@ function allow($aro, $aco, $actions = "*", $value = 1) { /** * Deny access for $aro to action $action in $aco * - * @param string $aro ARO - * @param string $aco ACO + * @param string $aro ARO The requesting object identifier. + * @param string $aco ACO The controlled object identifier. * @param string $actions Action (defaults to *) * @return boolean Success * @access public @@ -387,8 +407,8 @@ function deny($aro, $aco, $action = "*") { /** * Let access for $aro to action $action in $aco be inherited * - * @param string $aro ARO - * @param string $aco ACO + * @param string $aro ARO The requesting object identifier. + * @param string $aco ACO The controlled object identifier. * @param string $actions Action (defaults to *) * @return boolean Success * @access public @@ -400,8 +420,8 @@ function inherit($aro, $aco, $action = "*") { /** * Allow $aro to have access to action $actions in $aco * - * @param string $aro ARO - * @param string $aco ACO + * @param string $aro ARO The requesting object identifier. + * @param string $aco ACO The controlled object identifier. * @param string $actions Action (defaults to *) * @return boolean Success * @see allow() @@ -414,8 +434,8 @@ function grant($aro, $aco, $action = "*") { /** * Deny access for $aro to action $action in $aco * - * @param string $aro ARO - * @param string $aco ACO + * @param string $aro ARO The requesting object identifier. + * @param string $aco ACO The controlled object identifier. * @param string $actions Action (defaults to *) * @return boolean Success * @see deny() @@ -428,8 +448,8 @@ function revoke($aro, $aco, $action = "*") { /** * Get an array of access-control links between the given Aro and Aco * - * @param string $aro ARO - * @param string $aco ACO + * @param string $aro ARO The requesting object identifier. + * @param string $aco ACO The controlled object identifier. * @return array Indexed array with: 'aro', 'aco' and 'link' * @access public */ From bb941c2bc2d9bca812a494e20de5a63008879537 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Mar 2010 12:20:02 -0400 Subject: [PATCH 1839/2083] Adding documentation to IniAcl. --- cake/libs/controller/components/acl.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cake/libs/controller/components/acl.php b/cake/libs/controller/components/acl.php index dbee341eb..8b2d68c7d 100644 --- a/cake/libs/controller/components/acl.php +++ b/cake/libs/controller/components/acl.php @@ -492,7 +492,8 @@ function _getAcoKeys($keys) { } /** - * In this file you can extend the AclBase. + * IniAcl implements an access control system using an INI file. An example + * of the ini file used can be found in /config/acl.ini.php. * * @package cake * @subpackage cake.cake.libs.model.iniacl @@ -515,8 +516,9 @@ function __construct() { } /** - * Main ACL check function. Checks to see if the ARO (access request object) has access to the ACO (access control object). - * Looks at the acl.ini.php file for permissions (see instructions in /config/acl.ini.php). + * Main ACL check function. Checks to see if the ARO (access request object) has access to the + * ACO (access control object).Looks at the acl.ini.php file for permissions + * (see instructions in /config/acl.ini.php). * * @param string $aro ARO * @param string $aco ACO From 6c515739a1b8cadb20713f4825add35cfd0a363d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Mar 2010 12:31:52 -0400 Subject: [PATCH 1840/2083] Expanding documentation for Debugger. --- cake/libs/debugger.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index 6c567d149..e19b5ed66 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -207,7 +207,7 @@ function &getInstance($class = null) { * * @param $var mixed the variable to dump * @return void - * @see exportVar + * @see Debugger::exportVar() * @access public * @static * @link http://book.cakephp.org/view/1191/Using-the-Debugger-Class @@ -218,8 +218,8 @@ function dump($var) { } /** - * Creates a detailed stack trace log at the time of invocation, much like dump() - * but to debug.log. + * Creates an entry in the log file. The log entry will contain a stack trace from where it was called. + * as well as export the variable using exportVar. By default the log is written to the debug log. * * @param $var mixed Variable or content to log * @param $level int type of log to use. Defaults to LOG_DEBUG @@ -320,8 +320,17 @@ function handleError($code, $description, $file = null, $line = null, $context = /** * Outputs a stack trace based on the supplied options. * + * ### Options + * + * - `depth` - The number of stack frames to return. Defaults to 999 + * - `format` - The format you want the return. Defaults to the currently selected format. If + * format is 'array' or 'points' the return will be an array. + * - `args` - Should arguments for functions be shown? If true, the arguments for each method call + * will be displayed. + * - `start` - The stack frame to start generating a trace from. Defaults to 0 + * * @param array $options Format for outputting stack trace - * @return string Formatted stack trace + * @return mixed Formatted stack trace * @access public * @static * @link http://book.cakephp.org/view/1191/Using-the-Debugger-Class @@ -523,7 +532,7 @@ function exportVar($var, $recursion = 0) { * @param string $var Object to convert * @return string * @access private - * @see Debugger:exportVar() + * @see Debugger::exportVar() */ function __object($var) { $out = array(); @@ -552,7 +561,8 @@ function __object($var) { * Switches output format, updates format strings * * @param string $format Format to use, including 'js' for JavaScript-enhanced HTML, 'html' for - * straight HTML output, or 'text' for unformatted text. + * straight HTML output, or 'txt' for unformatted text. + * @param array $strings Template strings to be used for the output format. * @access protected */ function output($format = null, $strings = array()) { From 46348e9bbd00dd967c79da1060081832552b7328 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Mar 2010 12:53:57 -0400 Subject: [PATCH 1841/2083] Adding and correcting doc blocks. --- cake/libs/cake_socket.php | 3 ++- cake/libs/string.php | 6 +++--- cake/libs/view/helper.php | 8 +++++--- cake/libs/view/view.php | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/cake/libs/cake_socket.php b/cake/libs/cake_socket.php index d7d328d92..0b9394922 100644 --- a/cake/libs/cake_socket.php +++ b/cake/libs/cake_socket.php @@ -87,6 +87,7 @@ class CakeSocket extends Object { * Constructor. * * @param array $config Socket configuration, which will be merged with the base configuration + * @see CakeSocket::$_baseConfig */ function __construct($config = array()) { parent::__construct(); @@ -181,7 +182,7 @@ function addresses() { */ function lastError() { if (!empty($this->lastError)) { - return $this->lastError['num'].': '.$this->lastError['str']; + return $this->lastError['num'] . ': ' . $this->lastError['str']; } else { return null; } diff --git a/cake/libs/string.php b/cake/libs/string.php index 87d481324..119267e78 100644 --- a/cake/libs/string.php +++ b/cake/libs/string.php @@ -260,17 +260,17 @@ function insert($str, $data, $options = array()) { } /** - * Cleans up a Set::insert formated string with given $options depending on the 'clean' key in + * Cleans up a String::insert() formated string with given $options depending on the 'clean' key in * $options. The default method used is text but html is also available. The goal of this function * is to replace all whitespace and uneeded markup around placeholders that did not get replaced - * by Set::insert. + * by String::insert(). * * @param string $str * @param string $options * @return string * @access public * @static - * @see Set::insert() + * @see String::insert() */ function cleanInsert($str, $options) { $clean = $options['clean']; diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index 20e1f0335..c37348da7 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -191,7 +191,7 @@ function url($url = null, $full = false) { * Checks if a file exists when theme is used, if no file is found default location is returned * * @param string $file The file to create a webroot path to. - * @return string $webPath web path to file. + * @return string Web accessible path to file. * @access public */ function webroot($file) { @@ -250,9 +250,11 @@ function assetTimestamp($path) { } /** - * Used to remove harmful tags from content + * Used to remove harmful tags from content. Removes a number of well known XSS attacks + * from content. However, is not guaranteed to remove all possiblities. Escaping + * content is the best way to prevent all possible attacks. * - * @param mixed $output + * @param mixed $output Either an array of strings to clean or a single string to clean. * @return cleaned content for output * @access public */ diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index 92bb27f02..1d80636b5 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -448,7 +448,7 @@ function render($action = null, $layout = null, $file = null) { * Renders a layout. Returns output from _render(). Returns false on error. * Several variables are created for use in layout. * - * - `title_for_layout` - contains page title + * - `title_for_layout` - A backwards compatible place holder, you should set this value if you want more control. * - `content_for_layout` - contains rendered view file * - `scripts_for_layout` - contains scripts added to header * From 068631ebe227cf79fcd8fe660e79e1d80ce84731 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Mar 2010 16:59:24 -0400 Subject: [PATCH 1842/2083] Fixing AclNode::node() so that node expressions that could match deeper elements are contained to their parent elements. Test added. --- cake/libs/model/db_acl.php | 3 ++- cake/tests/cases/libs/model/db_acl.test.php | 16 ++++++++++++++-- cake/tests/fixtures/aco_fixture.php | 5 ++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/cake/libs/model/db_acl.php b/cake/libs/model/db_acl.php index cf85b1d06..a497c1da4 100644 --- a/cake/libs/model/db_acl.php +++ b/cake/libs/model/db_acl.php @@ -111,7 +111,8 @@ function node($ref = null) { 'conditions' => array( $db->name("{$type}{$i}.lft") . ' > ' . $db->name("{$type}{$j}.lft"), $db->name("{$type}{$i}.rght") . ' < ' . $db->name("{$type}{$j}.rght"), - $db->name("{$type}{$i}.alias") . ' = ' . $db->value($alias, 'string') + $db->name("{$type}{$i}.alias") . ' = ' . $db->value($alias, 'string'), + $db->name("{$type}{$j}.id") . ' = ' . $db->name("{$type}{$i}.parent_id") ) ); diff --git a/cake/tests/cases/libs/model/db_acl.test.php b/cake/tests/cases/libs/model/db_acl.test.php index 51a6ac096..432bf94b3 100644 --- a/cake/tests/cases/libs/model/db_acl.test.php +++ b/cake/tests/cases/libs/model/db_acl.test.php @@ -283,7 +283,7 @@ function setUp() { * @return void */ function testNode() { - $Aco = new DbAcoTest(); + $Aco =& new DbAcoTest(); $result = Set::extract($Aco->node('Controller1'), '{n}.DbAcoTest.id'); $expected = array(2, 1); $this->assertEqual($result, $expected); @@ -317,7 +317,19 @@ function testNode() { $result = $Aco->node(''); $this->assertEqual($result, null); } - /** + +/** + * test that node() doesn't dig deeper than it should. + * + * @return void + */ + function testNodeWithDuplicatePathSegments() { + $Aco =& new DbAcoTest(); + $nodes = $Aco->node('ROOT/Users'); + $this->assertEqual($nodes[0]['DbAcoTest']['parent_id'], 1, 'Parent id does not point at ROOT. %s'); + } + +/** * testNodeArrayFind method * * @access public diff --git a/cake/tests/fixtures/aco_fixture.php b/cake/tests/fixtures/aco_fixture.php index 078be4de1..248b16157 100644 --- a/cake/tests/fixtures/aco_fixture.php +++ b/cake/tests/fixtures/aco_fixture.php @@ -57,7 +57,7 @@ class AcoFixture extends CakeTestFixture { * @access public */ var $records = array( - array('parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'ROOT', 'lft' => 1, 'rght' => 18), + array('parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'ROOT', 'lft' => 1, 'rght' => 24), array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'Controller1', 'lft' => 2, 'rght' => 9), array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'action1', 'lft' => 3, 'rght' => 6), array('parent_id' => 3, 'model' => null, 'foreign_key' => null, 'alias' => 'record1', 'lft' => 4, 'rght' => 5), @@ -66,6 +66,9 @@ class AcoFixture extends CakeTestFixture { array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'action1', 'lft' => 11, 'rght' => 14), array('parent_id' => 7, 'model' => null, 'foreign_key' => null, 'alias' => 'record1', 'lft' => 12, 'rght' => 13), array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'action2', 'lft' => 15, 'rght' => 16), + array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'Users', 'lft' => 18, 'rght' => 23), + array('parent_id' => 9, 'model' => null, 'foreign_key' => null, 'alias' => 'Users', 'lft' => 19, 'rght' => 22), + array('parent_id' => 10, 'model' => null, 'foreign_key' => null, 'alias' => 'view', 'lft' => 20, 'rght' => 21), ); } From 17852ab3aa112ae2cac76d374c42585311b2e19e Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Mar 2010 17:41:58 -0400 Subject: [PATCH 1843/2083] Fixing failing tests in SessionHelper caused by changes in CakeSession. Removing SessionHelper::id() as all it did was call the parent method. --- cake/libs/view/helpers/session.php | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/cake/libs/view/helpers/session.php b/cake/libs/view/helpers/session.php index e823f83c4..8e9b6eada 100644 --- a/cake/libs/view/helpers/session.php +++ b/cake/libs/view/helpers/session.php @@ -52,6 +52,8 @@ class SessionHelper extends CakeSession { function __construct($base = null) { if (Configure::read('Session.start') === true) { parent::__construct($base, false); + $this->start(); + $this->__active = true; } else { $this->__active = false; } @@ -176,27 +178,17 @@ function write() { trigger_error(__('You can not write to a Session from the view', true), E_USER_WARNING); } -/** - * Session id - * - * @return string Session id - * @access public - */ - function id() { - return parent::id(); - } - /** * Determine if Session has been started * and attempt to start it if not * * @return boolean true if Session is already started, false if * Session could not be started - * @access public + * @access private */ function __start() { - if (!parent::started()) { - parent::start(); + if (!$this->started()) { + return $this->start(); } return true; } From 3f343e78743e838823133f38cad680f3d0c7c861 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 28 Mar 2010 19:13:49 -0400 Subject: [PATCH 1844/2083] Updating version numbers to 1.3.0-RC3 --- cake/VERSION.txt | 6 +++--- cake/config/config.php | 2 +- cake/libs/view/pages/home.ctp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cake/VERSION.txt b/cake/VERSION.txt index b115bfc6b..1c1107e4d 100644 --- a/cake/VERSION.txt +++ b/cake/VERSION.txt @@ -5,12 +5,12 @@ // Holds a static string representing the current version of CakePHP // // CakePHP(tm) : Rapid Development Framework (http://cakephp.org) -// Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) +// Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) // // Licensed under The MIT License // Redistributions of files must retain the above copyright notice. // -// @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) +// @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) // @link http://cakephp.org // @package cake // @subpackage cake.cake.libs @@ -18,4 +18,4 @@ // @license MIT License (http://www.opensource.org/licenses/mit-license.php) // +--------------------------------------------------------------------------------------------+ // //////////////////////////////////////////////////////////////////////////////////////////////////// -1.3.0-RC2 \ No newline at end of file +1.3.0-RC3 \ No newline at end of file diff --git a/cake/config/config.php b/cake/config/config.php index ce1d4114d..8f51b3984 100644 --- a/cake/config/config.php +++ b/cake/config/config.php @@ -17,5 +17,5 @@ * @since CakePHP(tm) v 1.1.11.4062 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -return $config['Cake.version'] = '1.3.0-RC2'; +return $config['Cake.version'] = '1.3.0-RC3'; ?> \ No newline at end of file diff --git a/cake/libs/view/pages/home.ctp b/cake/libs/view/pages/home.ctp index 1ec7cd917..dad169919 100644 --- a/cake/libs/view/pages/home.ctp +++ b/cake/libs/view/pages/home.ctp @@ -21,7 +21,7 @@ if (Configure::read() == 0): endif; ?> <h2><?php echo sprintf(__('Release Notes for CakePHP %s.', true), Configure::version()); ?></h2> -<a href="http://cakephp.lighthouseapp.com/projects/42648/changelog-1-3-0-RC2"><?php __('Read the changelog'); ?> </a> +<a href="http://cakephp.lighthouseapp.com/projects/42648/changelog-1-3-0-RC3"><?php __('Read the changelog'); ?> </a> <?php if (Configure::read() > 0): Debugger::checkSecurityKeys(); From 84ad35ca7adf5910ffcb28c640cab7c81ac528fb Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Mon, 29 Mar 2010 12:21:14 +1100 Subject: [PATCH 1845/2083] Added test for XML Helper serialization. Refs #284 --- cake/tests/cases/libs/view/helpers/xml.test.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cake/tests/cases/libs/view/helpers/xml.test.php b/cake/tests/cases/libs/view/helpers/xml.test.php index 538e8dc5b..7b4c03ece 100644 --- a/cake/tests/cases/libs/view/helpers/xml.test.php +++ b/cake/tests/cases/libs/view/helpers/xml.test.php @@ -218,6 +218,13 @@ function testSerialize() { $result = $this->Xml->serialize($data); $expected = '<pages id="2" url="http://www.url.com/rb/153/?id=bbbb&t=access" />'; $this->assertIdentical($result, $expected); + + $test = array( + 'Test' => array('test' => true) + ); + $expected = '<test test="1" />'; + $result = $this->Xml->serialize($test); + $this->assertidentical($expected, $result); } /** From bbf96567ebcdad6d2177dccbc2913a51a7fd1c51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Mon, 29 Mar 2010 23:50:40 -0430 Subject: [PATCH 1846/2083] Using value() in default value generation with CakeSchema and DboPostgres --- cake/libs/model/datasources/dbo/dbo_postgres.php | 2 +- .../cases/libs/model/datasources/dbo/dbo_postgres.test.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index 6a5b5a5b9..a0c0eb3f5 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -600,7 +600,7 @@ function alterSchema($compare, $table = null) { } if (isset($default)) { - $colList[] = 'ALTER COLUMN '. $fieldName .' SET DEFAULT ' . $default; + $colList[] = 'ALTER COLUMN '. $fieldName .' SET DEFAULT ' . $this->value($default, $field); } else { $colList[] = 'ALTER COLUMN '. $fieldName .' DROP DEFAULT'; } diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php index 38f3a28af..a2a313dd1 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php @@ -655,7 +655,7 @@ function testAlterSchema() { 'alter_posts' => array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'author_id' => array('type' => 'integer', 'null' => true), - 'title' => array('type' => 'string', 'null' => false), + 'title' => array('type' => 'string', 'null' => false, 'default' => 'my title'), 'body' => array('type' => 'string', 'length' => 500), 'status' => array('type' => 'integer', 'length' => 3, 'default' => 1), 'created' => array('type' => 'datetime'), From ebde29f63c195af5af3d1582c974e77d821ec420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Mon, 29 Mar 2010 23:58:07 -0430 Subject: [PATCH 1847/2083] Fixing error in las commit --- cake/libs/model/datasources/dbo/dbo_postgres.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index a0c0eb3f5..4389553fe 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -600,7 +600,7 @@ function alterSchema($compare, $table = null) { } if (isset($default)) { - $colList[] = 'ALTER COLUMN '. $fieldName .' SET DEFAULT ' . $this->value($default, $field); + $colList[] = 'ALTER COLUMN '. $fieldName .' SET DEFAULT ' . $this->value($default, $col['type']); } else { $colList[] = 'ALTER COLUMN '. $fieldName .' DROP DEFAULT'; } From 75900883e68fc133e557dcd7194f4f33140e16f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Tue, 30 Mar 2010 00:01:33 -0430 Subject: [PATCH 1848/2083] Making DboPostgres::value() return NULL when given an empty array, as DboMysql does --- cake/libs/model/datasources/dbo/dbo_postgres.php | 2 +- .../cases/libs/model/datasources/dbo/dbo_postgres.test.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index 4389553fe..6c0f4a3d2 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -286,7 +286,7 @@ function value($data, $column = null, $read = true) { return $parent; } - if ($data === null) { + if ($data === null || (is_array($data) && empty($data))) { return 'NULL'; } if (empty($column)) { diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php index a2a313dd1..89be2bfa4 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php @@ -375,6 +375,7 @@ function testValueQuoting() { $this->assertEqual($this->db2->value(1, 'boolean'), 'TRUE'); $this->assertEqual($this->db2->value('1', 'boolean'), 'TRUE'); $this->assertEqual($this->db2->value(null, 'boolean'), "NULL"); + $this->assertEqual($this->db2->value(array()), "NULL"); } /** From 5b1e9f6f5f3b025c631b5b52f5900148f48d36a0 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 30 Mar 2010 21:40:29 -0400 Subject: [PATCH 1849/2083] Fixing fatal error caused by Security class not being loaded When Session.start = false. Fixes #521 --- cake/libs/controller/components/security.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/controller/components/security.php b/cake/libs/controller/components/security.php index 908ea1179..4c5aaeb5a 100644 --- a/cake/libs/controller/components/security.php +++ b/cake/libs/controller/components/security.php @@ -17,7 +17,7 @@ * @since CakePHP(tm) v 0.10.8.2156 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::import('Core', 'String'); +App::import('Core', array('String', 'Security')); /** * Short description for file. * From 176c12e5fecbf9829121ec0661b781bf64f40711 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 30 Mar 2010 22:35:49 -0400 Subject: [PATCH 1850/2083] Adding tests for creating directories with trailing slashes. Closes #520 --- cake/tests/cases/libs/folder.test.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cake/tests/cases/libs/folder.test.php b/cake/tests/cases/libs/folder.test.php index 4e55b9fd5..1b9e8cb3b 100644 --- a/cake/tests/cases/libs/folder.test.php +++ b/cake/tests/cases/libs/folder.test.php @@ -99,6 +99,23 @@ function testCreation() { $this->assertTrue($result); rmdir(TMP . 'tests' . DS . 'first'); } + +/** + * test that creation of folders with trailing ds works + * + * @return void + */ + function testCreateWithTrailingDs() { + $folder =& new Folder(TMP); + $path = TMP . 'tests' . DS . 'trailing' . DS . 'dir' . DS; + $folder->create($path); + + $this->assertTrue(is_dir($path), 'Folder was not made'); + + $folder =& new Folder(TMP . 'tests' . DS . 'trailing'); + $this->assertTrue($folder->delete()); + } + /** * test recurisve directory create failure. * From d92202c6da9eb685cee948a804fcb08567d22f5b Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Fri, 2 Apr 2010 00:01:06 +0530 Subject: [PATCH 1851/2083] Fixed controller test case which generated a property undefined notice --- cake/tests/cases/libs/controller/controller.test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index db98280d8..8b63c8304 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -829,7 +829,7 @@ function testControllerSet() { $Controller->set('title', 'someTitle'); $this->assertIdentical($Controller->viewVars['title'], 'someTitle'); - $this->assertNotEqual($Controller->pageTitle, 'someTitle'); + $this->assertTrue(empty($Controller->pageTitle)); $Controller->viewVars = array(); $expected = array('ModelName' => 'name', 'ModelName2' => 'name2'); From 3627f3b3846e79f315e1a4ee12bce23cf6729786 Mon Sep 17 00:00:00 2001 From: Nick Baker <nwb@cap.(none)> Date: Tue, 30 Mar 2010 15:30:06 -0600 Subject: [PATCH 1852/2083] Patching dbo_mysql listDetailedSources. This fixes the broken test in dbo_mysql and solves ticket: 483-cakeshell-show-table-status-errors Signed-off-by: Mark Story <mark@mark-story.com> --- cake/libs/model/datasources/dbo/dbo_mysql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/model/datasources/dbo/dbo_mysql.php b/cake/libs/model/datasources/dbo/dbo_mysql.php index 2cc215b51..d3b415dbf 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysql.php +++ b/cake/libs/model/datasources/dbo/dbo_mysql.php @@ -424,7 +424,7 @@ function insertMulti($table, $fields, $values) { function listDetailedSources($name = null) { $condition = ''; if (is_string($name)) { - $condition = ' WHERE Name = ' . $this->value($name); + $condition = ' LIKE ' . $this->value($name); } $result = $this->query('SHOW TABLE STATUS FROM ' . $this->name($this->config['database']) . $condition . ';'); if (!$result) { From ffb5c365787b804fe66d949b4d63a308af2e92ba Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 2 Apr 2010 13:32:14 -0400 Subject: [PATCH 1853/2083] Adding tests for plugin shortcut route generation. Refs #535 --- cake/tests/cases/libs/router.test.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 82b4604ec..57b450434 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -745,6 +745,27 @@ function testUrlGenerationPlugins() { $this->assertEqual($result, $expected); } +/** + * test that plugin short cut routes behave properly. Parse and reverse route correctly. + * + * @return void + */ + function testPluginShortcutRoutes() { + $result = Router::url(array('plugin' => 'test_plugin', 'controller' => 'test_plugin', 'action' => 'index')); + $this->assertEqual($result, '/test_plugin', 'Plugin shortcut index action failed.'); + + $result = Router::url(array('plugin' => 'test_plugin', 'controller' => 'test_plugin', 'action' => 'view', 1)); + $this->assertEqual($result, '/test_plugin/view/1', 'Plugin shortcut with passed args failed.'); + + $result = Router::url(array( + 'plugin' => 'test_plugin', 'controller' => 'test_plugin', 'action' => 'view', + 1, 'sort' => 'title', 'dir' => 'asc' + )); + $this->assertEqual( + $result, '/test_plugin/view/1/sort:title/dir:asc', 'Plugin shortcut with passed + named args failed.' + ); + } + /** * test that you can leave active plugin routes with plugin = null * From d058234c1c466f6d62c5f962e0af1c68118a1053 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 2 Apr 2010 13:43:03 -0400 Subject: [PATCH 1854/2083] Adding tests to PaginatorHelper::sort() for creating sort links that point at plugin shortcuts. Refs #535. --- .../libs/view/helpers/paginator.test.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/cake/tests/cases/libs/view/helpers/paginator.test.php b/cake/tests/cases/libs/view/helpers/paginator.test.php index 9333c4e89..9f1c2d02e 100644 --- a/cake/tests/cases/libs/view/helpers/paginator.test.php +++ b/cake/tests/cases/libs/view/helpers/paginator.test.php @@ -218,6 +218,28 @@ function testSortLinks() { $this->assertPattern('/\/accounts\/index\/param\/page:1\/sort:title\/direction:desc" class="asc">Title<\/a>$/', $result); } +/** + * test sort() works with plugin shortcut routes. + * + * @return void + */ + function testSortWithPluginShortcuts() { + Router::reload(); + Router::parse('/'); + Router::setRequestInfo(array( + array('plugin' => 'test_plugin', 'controller' => 'test_plugin', 'action' => 'something', 'pass' => array(), 'form' => array(), 'url' => array('url' => 'test_plugin/something')), + array('base' => '/', 'here' => '/test_plugin/', 'webroot' => '/') + )); + + $result = $this->Paginator->sort('title'); + $expected = array( + 'a' => array('href' => '/test_plugin/something/page:1/sort:title/direction:asc'), + 'Title', + '/a' + ); + $this->assertTags($result, $expected); + } + /** * testSortLinksUsingDirectionOption method From 44b216cec38fd37a70275a16d1b40e3ec356eacb Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 2 Apr 2010 13:53:53 -0400 Subject: [PATCH 1855/2083] Removing Model::$transaction as it did nothing. The property was added but never completed. Leaving the model property looking like it does something when in fact it does absolutely nothing. Refs #531 --- cake/libs/model/model.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 579b21489..b5f36d9da 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -178,14 +178,6 @@ class Model extends Overloadable { */ var $logTransactions = false; -/** - * Whether or not to enable transactions for this model (i.e. BEGIN/COMMIT/ROLLBACK statements) - * - * @var boolean - * @access public - */ - var $transactional = false; - /** * Whether or not to cache queries for this model. This enables in-memory * caching only, the results are not stored beyond the current request. From e6f9c420b6f17dce93a5d34863e97a58c3dbf86a Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 2 Apr 2010 13:55:05 -0400 Subject: [PATCH 1856/2083] Removing transactional property from the Set test, as it was removed from the Model in the last commit. Ref #531 --- cake/tests/cases/libs/set.test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/set.test.php b/cake/tests/cases/libs/set.test.php index 6d62d9367..5fb0c5c4d 100644 --- a/cake/tests/cases/libs/set.test.php +++ b/cake/tests/cases/libs/set.test.php @@ -1962,7 +1962,7 @@ function testMapReverse() { $expected = array( 'Behaviors' => array('modelName' => 'Model', '_attached' => array(), '_disabled' => array(), '__methods' => array(), '__mappedMethods' => array()), 'useDbConfig' => 'default', 'useTable' => false, 'displayField' => null, 'id' => false, 'data' => array(), 'table' => 'models', 'primaryKey' => 'id', '_schema' => null, 'validate' => array(), - 'validationErrors' => array(), 'tablePrefix' => null, 'name' => 'Model', 'alias' => 'Model', 'tableToModel' => array(), 'logTransactions' => false, 'transactional' => false, 'cacheQueries' => false, + 'validationErrors' => array(), 'tablePrefix' => null, 'name' => 'Model', 'alias' => 'Model', 'tableToModel' => array(), 'logTransactions' => false, 'cacheQueries' => false, 'belongsTo' => array(), 'hasOne' => array(), 'hasMany' => array(), 'hasAndBelongsToMany' => array(), 'actsAs' => null, 'whitelist' => array(), 'cacheSources' => true, 'findQueryType' => null, 'recursive' => 1, 'order' => null, 'virtualFields' => array(), '__associationKeys' => array( From fdd8a51a07458231864870f6eff4c34d0ff5afe6 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 2 Apr 2010 14:02:57 -0400 Subject: [PATCH 1857/2083] Removing coercion of error methods into error404 as its generally not helpful to have errors converted into error404. Fixes #538 --- cake/console/error.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cake/console/error.php b/cake/console/error.php index 695f849cb..3d1b066a7 100644 --- a/cake/console/error.php +++ b/cake/console/error.php @@ -51,11 +51,7 @@ class ErrorHandler extends Object { function __construct($method, $messages) { $this->stdout = fopen('php://stdout', 'w'); $this->stderr = fopen('php://stderr', 'w'); - if (Configure::read() > 0 || $method == 'error') { - call_user_func_array(array(&$this, $method), $messages); - } else { - call_user_func_array(array(&$this, 'error404'), $messages); - } + call_user_func_array(array(&$this, $method), $messages); } /** @@ -78,9 +74,11 @@ function error($params) { */ function error404($params) { extract($params, EXTR_OVERWRITE); - $this->error(array('code' => '404', - 'name' => 'Not found', - 'message' => sprintf(__("The requested address %s was not found on this server.", true), $url, $message))); + $this->error(array( + 'code' => '404', + 'name' => 'Not found', + 'message' => sprintf(__("The requested address %s was not found on this server.", true), $url, $message) + )); $this->_stop(); } From 1b8165d8901076ebefce39f313dd276ed9d6c1c5 Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Sat, 3 Apr 2010 00:32:23 +0530 Subject: [PATCH 1858/2083] Enhancing email component to allow using alias for attachments. Closes #6 --- cake/libs/controller/components/email.php | 17 ++++++----- .../libs/controller/components/email.test.php | 28 ++++++++++++++++++- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index ef4a93eb0..73de46195 100755 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -556,15 +556,15 @@ function _createHeader() { if ($this->delivery == 'smtp') { $headers['Subject'] = $this->_encode($this->subject); } - + if ($this->messageId !== false) { if ($this->messageId === true) { $headers['Message-ID'] = '<' . String::UUID() . '@' . env('HTTP_HOST') . '>'; } else { - $headers['Message-ID'] = $this->messageId; + $headers['Message-ID'] = $this->messageId; } } - + $headers['X-Mailer'] = $this->xMailer; if (!empty($this->headers)) { @@ -624,14 +624,17 @@ function _formatMessage($message) { */ function _attachFiles() { $files = array(); - foreach ($this->attachments as $attachment) { + foreach ($this->attachments as $filename => $attachment) { $file = $this->_findFiles($attachment); if (!empty($file)) { - $files[] = $file; + if (is_int($filename)) { + $filename = basename($file); + } + $files[$filename] = $file; } } - foreach ($files as $file) { + foreach ($files as $filename => $file) { $handle = fopen($file, 'rb'); $data = fread($handle, filesize($file)); $data = chunk_split(base64_encode($data)) ; @@ -640,7 +643,7 @@ function _attachFiles() { $this->__message[] = '--' . $this->__boundary; $this->__message[] = 'Content-Type: application/octet-stream'; $this->__message[] = 'Content-Transfer-Encoding: base64'; - $this->__message[] = 'Content-Disposition: attachment; filename="' . basename($file) . '"'; + $this->__message[] = 'Content-Disposition: attachment; filename="' . basename($filename) . '"'; $this->__message[] = ''; $this->__message[] = $data; $this->__message[] = ''; diff --git a/cake/tests/cases/libs/controller/components/email.test.php b/cake/tests/cases/libs/controller/components/email.test.php index 75fea8f1d..b1ee3a5c4 100755 --- a/cake/tests/cases/libs/controller/components/email.test.php +++ b/cake/tests/cases/libs/controller/components/email.test.php @@ -779,6 +779,32 @@ function testMultibyte() { * * @return void * @access public + */ + function testSendWithAttachments() { + $this->Controller->EmailTest->to = 'postmaster@localhost'; + $this->Controller->EmailTest->from = 'noreply@example.com'; + $this->Controller->EmailTest->subject = 'Attachment Test'; + $this->Controller->EmailTest->replyTo = 'noreply@example.com'; + $this->Controller->EmailTest->template = null; + $this->Controller->EmailTest->delivery = 'debug'; + $this->Controller->EmailTest->attachments = array( + __FILE__, + 'some-name.php' => __FILE__ + ); + $body = '<p>This is the body of the message</p>'; + + $this->Controller->EmailTest->sendAs = 'text'; + $this->assertTrue($this->Controller->EmailTest->send($body)); + $msg = $this->Controller->Session->read('Message.email.message'); + $this->assertPattern('/' . preg_quote('Content-Disposition: attachment; filename="email.test.php"') . '/', $msg); + $this->assertPattern('/' . preg_quote('Content-Disposition: attachment; filename="some-name.php"') . '/', $msg); + } + +/** + * testSendAsIsNotIgnoredIfAttachmentsPresent method + * + * @return void + * @access public */ function testSendAsIsNotIgnoredIfAttachmentsPresent() { $this->Controller->EmailTest->to = 'postmaster@localhost'; @@ -812,7 +838,7 @@ function testSendAsIsNotIgnoredIfAttachmentsPresent() { } /** - * undocumented function + * testNoDoubleNewlinesInHeaders function * * @return void * @access public From 3503872ab81dc69344554312006d8e29c73bc45d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Fri, 2 Apr 2010 15:43:20 -0400 Subject: [PATCH 1859/2083] Fixing Form::dateTime() for GET forms. Tests added. Fixes #522 --- cake/libs/view/helpers/form.php | 7 ++++++- .../tests/cases/libs/view/helpers/form.test.php | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index e06cbc349..c086ba777 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -1905,7 +1905,12 @@ function _name($options = array(), $field = null, $key = 'name') { if (is_array($options) && isset($options[$key])) { return $options; } - $name = $this->field(); + + $view = ClassRegistry::getObject('view'); + $name = $view->field; + if (!empty($view->fieldSuffix)) { + $name .= '[' . $view->fieldSuffix . ']'; + } if (is_array($options)) { $options[$key] = $name; diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 0761be82d..6948e1fc8 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -5297,6 +5297,23 @@ function testGetFormCreate() { ))); } +/** + * test that datetime() works with GET style forms. + * + * @return void + */ + function testDateTimeWithGetForms() { + extract($this->dateRegex); + $this->Form->create('Contact', array('type' => 'get')); + $result = $this->Form->datetime('created'); + + $this->assertPattern('/name="created\[year\]"/', $result, 'year name attribute is wrong.'); + $this->assertPattern('/name="created\[month\]"/', $result, 'month name attribute is wrong.'); + $this->assertPattern('/name="created\[day\]"/', $result, 'day name attribute is wrong.'); + $this->assertPattern('/name="created\[hour\]"/', $result, 'hour name attribute is wrong.'); + $this->assertPattern('/name="created\[min\]"/', $result, 'min name attribute is wrong.'); + $this->assertPattern('/name="created\[meridian\]"/', $result, 'meridian name attribute is wrong.'); + } /** * testEditFormWithData method * From 874c511fe21ff5f4bfd7d82b59158d7f5beb294d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 3 Apr 2010 16:29:20 -0400 Subject: [PATCH 1860/2083] Adding PluginShortRoute, and a few test cases. --- cake/libs/router.php | 39 +++++++++++++++ cake/tests/cases/libs/router.test.php | 69 ++++++++++++++++++++++++++- 2 files changed, 107 insertions(+), 1 deletion(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index 0c988ac35..05cccb913 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -1411,6 +1411,7 @@ function parse($url) { $route['pass'] = $route['named'] = array(); $route += $this->defaults; + //move numerically indexed elements from the defaults into pass. foreach ($route as $key => $value) { if (is_integer($key)) { $route['pass'][] = $value; @@ -1576,4 +1577,42 @@ function _writeUrl($params) { return $out; } } + +class PluginShortRoute extends CakeRoute { + var $_plugins = array(); +/** + * Constructor Sets up the plugin sets. + * + * @return void + */ + function PluginShortRoute($template, $defaults = array(), $options = array()) { + parent::CakeRoute($template, $defaults, $options); + $plugins = App::objects('plugin'); + foreach ($plugins as $plugin) { + $this->_plugins[Inflector::underscore($plugin)] = true; + } + } +/** + * Parses urls and creates the correct request parameter set. + * Plugin short cut routes have the same plugin and controller keys. + * If there is no controller available in the plugin with the same + * name as the plugin, this route cannot pass. + * + * @param string $url Url string to parse. + * @return mixed False on failure, or an array of request parameters + */ + function parse($url) { + $params = parent::parse($url); + if (!isset($params['plugin']) || (isset($params['plugin']) && !isset($this->_plugins[$params['plugin']]))) { + return false; + } + $pluginName = Inflector::camelize($params['plugin']); + $controllerName = $pluginName . '.' . $pluginName; + if (!App::import('Controller', $controllerName)) { + return false; + } + $params['controller'] = $params['plugin']; + return $params; + } +} ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 57b450434..3ebf54025 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -17,7 +17,7 @@ * @since CakePHP(tm) v 1.2.0.4206 * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ -App::import('Core', array('Router', 'Debugger')); +App::import('Core', array('Router')); if (!defined('FULL_BASE_URL')) { define('FULL_BASE_URL', 'http://cakephp.org'); @@ -2436,5 +2436,72 @@ function testParse() { $this->assertEqual($result['action'], 'index'); } } +//SimpleTest::ignore('RouterTest'); +//SimpleTest::ignore('CakeRouteTestCase'); +/** + * Test case for PluginShortRoute + * + * @package cake.test.cases.libs + */ +class PluginShortRouteTestCase extends CakeTestCase { +/** + * startTest method + * + * @access public + * @return void + */ + function startTest() { + $this->_routing = Configure::read('Routing'); + Configure::write('Routing', array('admin' => null, 'prefixes' => array())); + + App::build(array( + 'plugins' => array( + TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS + ) + )); + App::objects('plugin', null, false); + Router::reload(); + } + +/** + * end the test and reset the environment + * + * @return void + **/ + function endTest() { + Configure::write('Routing', $this->_routing); + App::build(); + } + +/** + * test the parsing for plugin short routes. + * + * @return void + */ + function testParsing() { + $route =& new PluginShortRoute('/:plugin', array('action' => 'index')); + + $result = $route->parse('/non_existant_plugin'); + $this->assertFalse($result, 'Route matched when it should fail.'); + + $result = $route->parse('/test_plugin'); + $this->assertEqual($result['plugin'], 'test_plugin'); + $this->assertEqual($result['controller'], 'test_plugin'); + $this->assertEqual($result['action'], 'index'); + + $route =& new PluginShortRoute('/:plugin/:action/*'); + + $result = $route->parse('/test_plugin/add'); + $this->assertEqual($result['plugin'], 'test_plugin'); + $this->assertEqual($result['controller'], 'test_plugin'); + $this->assertEqual($result['action'], 'add'); + + $result = $route->parse('/test_plugin/edit/1'); + $this->assertEqual($result['plugin'], 'test_plugin'); + $this->assertEqual($result['controller'], 'test_plugin'); + $this->assertEqual($result['action'], 'edit'); + $this->assertEqual($result['_args_'], '1', 'Passed args were wrong.'); + } +} ?> \ No newline at end of file From f605454aca3fa6320a7fb4e558c2031b27d57d49 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 3 Apr 2010 16:29:36 -0400 Subject: [PATCH 1861/2083] Shrinking number of lines in dispatcher test case. --- cake/tests/cases/dispatcher.test.php | 39 +++++++++------------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index c737d0e53..bb963f90e 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -1534,15 +1534,9 @@ function testAutomaticPluginControllerDispatch() { $url = $pluginUrl; $controller = $Dispatcher->dispatch($url, array('return' => 1)); - - $expected = $pluginUrl; - $this->assertIdentical($controller->plugin, $expected); - - $expected = $plugin; - $this->assertIdentical($controller->name, $expected); - - $expected = 'index'; - $this->assertIdentical($controller->action, $expected); + $this->assertIdentical($controller->plugin, 'my_plugin'); + $this->assertIdentical($controller->name, 'MyPlugin'); + $this->assertIdentical($controller->action, 'index'); $expected = $pluginUrl; $this->assertEqual($controller->params['controller'], $expected); @@ -1556,15 +1550,9 @@ function testAutomaticPluginControllerDispatch() { $url = 'admin/my_plugin/add/5/param:value/param2:value2'; $controller = $Dispatcher->dispatch($url, array('return' => 1)); - - $expected = 'my_plugin'; - $this->assertIdentical($controller->plugin, $expected); - - $expected = 'MyPlugin'; - $this->assertIdentical($controller->name, $expected); - - $expected = 'admin_add'; - $this->assertIdentical($controller->action, $expected); + $this->assertIdentical($controller->plugin, 'my_plugin'); + $this->assertIdentical($controller->name, 'MyPlugin'); + $this->assertIdentical($controller->action, 'admin_add'); $expected = array(0 => 5, 'param'=>'value', 'param2'=>'value2'); $this->assertEqual($controller->passedArgs, $expected); @@ -1575,15 +1563,9 @@ function testAutomaticPluginControllerDispatch() { $Dispatcher->base = false; $controller = $Dispatcher->dispatch('admin/articles_test', array('return' => 1)); - - $expected = 'articles_test'; - $this->assertIdentical($controller->plugin, $expected); - - $expected = 'ArticlesTest'; - $this->assertIdentical($controller->name, $expected); - - $expected = 'admin_index'; - $this->assertIdentical($controller->action, $expected); + $this->assertIdentical($controller->plugin, 'articles_test'); + $this->assertIdentical($controller->name, 'ArticlesTest'); + $this->assertIdentical($controller->action, 'admin_index'); $expected = array( 'pass'=> array(), 'named' => array(), 'controller' => 'articles_test', 'plugin' => 'articles_test', 'action' => 'admin_index', @@ -1633,6 +1615,9 @@ function testAutomaticPluginDispatchWithShortAccess() { $url = 'my_plugin/add'; $controller = $Dispatcher->dispatch($url, array('return' => 1)); $this->assertFalse(isset($controller->params['pass'][0])); + $this->assertEqual($controller->params['controller'], 'my_plugin'); + $this->assertEqual($controller->params['action'], 'add'); + $this->assertEqual($controller->params['plugin'], 'my_plugin'); $Dispatcher =& new TestDispatcher(); $Dispatcher->base = false; From a18d1be4c3ce8ac1184956322e6dbf8fc009f663 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 3 Apr 2010 16:54:41 -0400 Subject: [PATCH 1862/2083] Adding doc blocks to PluginShortRoute. Adding PluginShortRoute into Router. --- cake/libs/router.php | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index 05cccb913..80a67603e 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -568,6 +568,9 @@ function __connectDefaultRoutes() { $this->connect("/{$prefix}/:plugin/:controller", $indexParams, $match); $this->connect("/{$prefix}/:plugin/:controller/:action/*", $params, $match); } + $shortPlugin = array_merge($match, array('routeClass' => 'PluginShortRoute')); + $this->connect('/:plugin', array('action' => 'index'), $shortPlugin); + $this->connect('/:plugin/:action/*', array(), $shortPlugin); $this->connect('/:plugin/:controller', array('action' => 'index'), $match); $this->connect('/:plugin/:controller/:action/*', array(), $match); } @@ -1578,7 +1581,21 @@ function _writeUrl($params) { } } +/** + * PluginShortRoute is a specialized route class to handle routes + * where the controller and plugin are named the same. It allows you + * to omit the controller key from the template and the defaults. + * When a url is parsed, this class will attempt to import a controller + * with the same name. If that succeeds the request array will be modified. + * + * @package cake.libs + */ class PluginShortRoute extends CakeRoute { +/** + * A cache for all the plugins in the application + * + * @var string + */ var $_plugins = array(); /** * Constructor Sets up the plugin sets. @@ -1594,7 +1611,6 @@ function PluginShortRoute($template, $defaults = array(), $options = array()) { } /** * Parses urls and creates the correct request parameter set. - * Plugin short cut routes have the same plugin and controller keys. * If there is no controller available in the plugin with the same * name as the plugin, this route cannot pass. * @@ -1603,7 +1619,11 @@ function PluginShortRoute($template, $defaults = array(), $options = array()) { */ function parse($url) { $params = parent::parse($url); - if (!isset($params['plugin']) || (isset($params['plugin']) && !isset($this->_plugins[$params['plugin']]))) { + if ( + $params == false || + !isset($params['plugin']) || + (isset($params['plugin']) && !isset($this->_plugins[$params['plugin']])) + ) { return false; } $pluginName = Inflector::camelize($params['plugin']); @@ -1614,5 +1634,6 @@ function parse($url) { $params['controller'] = $params['plugin']; return $params; } + } ?> \ No newline at end of file From 95802176bb20fd6afd3f8923b6405c849837dd63 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 3 Apr 2010 17:10:39 -0400 Subject: [PATCH 1863/2083] Making PluginShortRoute check that the action exists before attempting to proceed. Updated tests. --- cake/libs/router.php | 3 +++ cake/tests/cases/libs/router.test.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index 80a67603e..f124b0d67 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -1631,6 +1631,9 @@ function parse($url) { if (!App::import('Controller', $controllerName)) { return false; } + if (!method_exists($pluginName . 'Controller', $params['action'])) { + return false; + } $params['controller'] = $params['plugin']; return $params; } diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 3ebf54025..2c14e7537 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -2497,10 +2497,10 @@ function testParsing() { $this->assertEqual($result['controller'], 'test_plugin'); $this->assertEqual($result['action'], 'add'); - $result = $route->parse('/test_plugin/edit/1'); + $result = $route->parse('/test_plugin/add/1'); $this->assertEqual($result['plugin'], 'test_plugin'); $this->assertEqual($result['controller'], 'test_plugin'); - $this->assertEqual($result['action'], 'edit'); + $this->assertEqual($result['action'], 'add'); $this->assertEqual($result['_args_'], '1', 'Passed args were wrong.'); } } From 2814ddc2d553e9a66a7cc45babdf41661d3c3ef2 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 3 Apr 2010 22:24:31 -0400 Subject: [PATCH 1864/2083] Modifying Dispatcher tests to modify private variables (which is bad, but there is no way to change which plugins Router uses to create patterns). This allows the removal of two calls to _restructureParams. --- cake/dispatcher.php | 11 +---------- cake/tests/cases/dispatcher.test.php | 6 +++++- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/cake/dispatcher.php b/cake/dispatcher.php index d04826593..4de05fc8f 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -403,16 +403,7 @@ function &__getController() { $controller = false; $ctrlClass = $this->__loadController($params); if (!$ctrlClass) { - if (!isset($params['plugin'])) { - $params = $this->_restructureParams($params); - } else { - $params = $this->_restructureParams($params, true); - } - $ctrlClass = $this->__loadController($params); - if (!$ctrlClass) { - $this->params = $original; - return $controller; - } + return $controller; } $name = $ctrlClass; $ctrlClass .= 'Controller'; diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index bb963f90e..48c0c340f 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -1584,9 +1584,13 @@ function testAutomaticPluginControllerDispatch() { function testAutomaticPluginDispatchWithShortAccess() { $_POST = array(); $_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php'; + $plugins = App::objects('plugin'); + $plugins[] = 'MyPlugin'; + + $app = App::getInstance(); + $app->__objects['plugin'] = $plugins; Router::reload(); - Router::connect('/my_plugin/:controller/:action/*', array('plugin' => 'my_plugin')); $Dispatcher =& new TestDispatcher(); $Dispatcher->base = false; From ed60939292d8626bdfa11e411e0d90dd6c1b4949 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 3 Apr 2010 23:32:14 -0400 Subject: [PATCH 1865/2083] Fixing tests that should have never worked, and removing additional calls to _restructureParams. Adding in prefixed plugin shortcuts as they were missing. --- cake/dispatcher.php | 11 +------ cake/libs/router.php | 7 +++-- cake/tests/cases/dispatcher.test.php | 46 +++++++++++++++++++++++++--- 3 files changed, 47 insertions(+), 17 deletions(-) diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 4de05fc8f..efc554703 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -398,23 +398,14 @@ function _restructureParams($params, $reverse = false) { * @access private */ function &__getController() { - $original = $params = $this->params; - $controller = false; - $ctrlClass = $this->__loadController($params); + $ctrlClass = $this->__loadController($this->params); if (!$ctrlClass) { return $controller; } $name = $ctrlClass; $ctrlClass .= 'Controller'; if (class_exists($ctrlClass)) { - if ( - empty($params['plugin']) && - strtolower(get_parent_class($ctrlClass)) === strtolower($name . 'AppController') - ) { - $params = $this->_restructureParams($params); - } - $this->params = $params; $controller =& new $ctrlClass(); } return $controller; diff --git a/cake/libs/router.php b/cake/libs/router.php index f124b0d67..85b268a9f 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -560,15 +560,18 @@ function __connectDefaultRoutes() { foreach ($plugins as $key => $value) { $plugins[$key] = Inflector::underscore($value); } - $match = array('plugin' => implode('|', $plugins)); + $pluginPiped = implode('|', $plugins); + $match = array('plugin' => $pluginPiped); + $shortPlugin = array('plugin' => $pluginPiped, 'routeClass' => 'PluginShortRoute'); foreach ($this->__prefixes as $prefix) { $params = array('prefix' => $prefix, $prefix => true); $indexParams = $params + array('action' => 'index'); + $this->connect("/{$prefix}/:plugin", $indexParams, $shortPlugin); + $this->connect("/{$prefix}/:plugin/:action/*", $params, $shortPlugin); $this->connect("/{$prefix}/:plugin/:controller", $indexParams, $match); $this->connect("/{$prefix}/:plugin/:controller/:action/*", $params, $match); } - $shortPlugin = array_merge($match, array('routeClass' => 'PluginShortRoute')); $this->connect('/:plugin', array('action' => 'index'), $shortPlugin); $this->connect('/:plugin/:action/*', array(), $shortPlugin); $this->connect('/:plugin/:controller', array('action' => 'index'), $match); diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index 48c0c340f..ceaddcdef 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -340,6 +340,14 @@ class ArticlesTestController extends ArticlesTestAppController { function admin_index() { return true; } +/** + * fake index method. + * + * @return void + */ + function index() { + return true; + } } /** @@ -1423,7 +1431,10 @@ function testPluginDispatch() { Router::reload(); $Dispatcher =& new TestDispatcher(); - Router::connect('/my_plugin/:controller/*', array('plugin'=>'my_plugin', 'controller'=>'pages', 'action'=>'display')); + Router::connect( + '/my_plugin/:controller/*', + array('plugin' => 'my_plugin', 'controller' => 'pages', 'action' => 'display') + ); $Dispatcher->base = false; $url = 'my_plugin/some_pages/home/param:value/param2:value2'; @@ -1472,7 +1483,10 @@ function testAutomaticPluginDispatch() { Router::reload(); $Dispatcher =& new TestDispatcher(); - Router::connect('/my_plugin/:controller/:action/*', array('plugin'=>'my_plugin', 'controller'=>'pages', 'action'=>'display')); + Router::connect( + '/my_plugin/:controller/:action/*', + array('plugin' => 'my_plugin', 'controller' => 'pages', 'action' => 'display') + ); $Dispatcher->base = false; @@ -1508,6 +1522,13 @@ function testAutomaticPluginControllerDispatch() { $_POST = array(); $_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php'; + $plugins = App::objects('plugin'); + $plugins[] = 'MyPlugin'; + $plugins[] = 'ArticlesTest'; + + $app = App::getInstance(); + $app->__objects['plugin'] = $plugins; + Router::reload(); $Dispatcher =& new TestDispatcher(); $Dispatcher->base = false; @@ -1526,7 +1547,7 @@ function testAutomaticPluginControllerDispatch() { $Dispatcher =& new TestDispatcher(); $Dispatcher->base = false; - /* Simulates the Route for a real plugin, installed in APP/plugins */ + // Simulates the Route for a real plugin, installed in APP/plugins Router::connect('/my_plugin/:controller/:action/*', array('plugin' => 'my_plugin')); $plugin = 'MyPlugin'; @@ -1550,6 +1571,12 @@ function testAutomaticPluginControllerDispatch() { $url = 'admin/my_plugin/add/5/param:value/param2:value2'; $controller = $Dispatcher->dispatch($url, array('return' => 1)); + + $this->assertEqual($controller->params['plugin'], 'my_plugin'); + $this->assertEqual($controller->params['controller'], 'my_plugin'); + $this->assertEqual($controller->params['action'], 'admin_add'); + $this->assertEqual($controller->params['pass'], array(5)); + $this->assertEqual($controller->params['named'], array('param' => 'value', 'param2' => 'value2')); $this->assertIdentical($controller->plugin, 'my_plugin'); $this->assertIdentical($controller->name, 'MyPlugin'); $this->assertIdentical($controller->action, 'admin_add'); @@ -1557,6 +1584,7 @@ function testAutomaticPluginControllerDispatch() { $expected = array(0 => 5, 'param'=>'value', 'param2'=>'value2'); $this->assertEqual($controller->passedArgs, $expected); + Configure::write('Routing.prefixes', array('admin')); Router::reload(); $Dispatcher =& new TestDispatcher(); @@ -1568,8 +1596,16 @@ function testAutomaticPluginControllerDispatch() { $this->assertIdentical($controller->action, 'admin_index'); $expected = array( - 'pass'=> array(), 'named' => array(), 'controller' => 'articles_test', 'plugin' => 'articles_test', 'action' => 'admin_index', - 'prefix' => 'admin', 'admin' => true, 'form' => array(), 'url' => array('url' => 'admin/articles_test'), 'return' => 1 + 'pass'=> array(), + 'named' => array(), + 'controller' => 'articles_test', + 'plugin' => 'articles_test', + 'action' => 'admin_index', + 'prefix' => 'admin', + 'admin' => true, + 'form' => array(), + 'url' => array('url' => 'admin/articles_test'), + 'return' => 1 ); $this->assertEqual($controller->params, $expected); } From 87f1972f75fbe169356c5fd048fa8c314402d19a Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 3 Apr 2010 23:37:31 -0400 Subject: [PATCH 1866/2083] Moving expectations inline. --- cake/tests/cases/dispatcher.test.php | 36 ++++++++-------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index ceaddcdef..03128d4c3 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -1405,11 +1405,9 @@ function testAdminDispatch() { $Router =& Router::getInstance(); $controller = $Dispatcher->dispatch($url, array('return' => 1)); - $expected = 'TestDispatchPages'; - $this->assertEqual($expected, $controller->name); + $this->assertEqual($controller->name, 'TestDispatchPages'); - $expected = array('param' => 'value', 'param2' => 'value2'); - $this->assertIdentical($expected, $controller->passedArgs); + $this->assertIdentical($controller->passedArgs, array('param' => 'value', 'param2' => 'value2')); $this->assertTrue($controller->params['admin']); $expected = '/cake/repo/branches/1.2.x.x/index.php/admin/test_dispatch_pages/index/param:value/param2:value2'; @@ -1452,17 +1450,10 @@ function testPluginDispatch() { $this->assertEqual($expected, $result); - $expected = 'my_plugin'; - $this->assertIdentical($expected, $controller->plugin); - - $expected = 'SomePages'; - $this->assertIdentical($expected, $controller->name); - - $expected = 'some_pages'; - $this->assertIdentical($expected, $controller->params['controller']); - - $expected = array('0' => 'home', 'param'=>'value', 'param2'=>'value2'); - $this->assertIdentical($expected, $controller->passedArgs); + $this->assertIdentical($controller->plugin, 'my_plugin'); + $this->assertIdentical($controller->name, 'SomePages'); + $this->assertIdentical($controller->params['controller'], 'some_pages'); + $this->assertIdentical($controller->passedArgs, array('0' => 'home', 'param'=>'value', 'param2'=>'value2')); $expected = '/cake/repo/branches/1.2.x.x/my_plugin/some_pages/home/param:value/param2:value2'; $this->assertIdentical($expected, $controller->here); @@ -1493,17 +1484,10 @@ function testAutomaticPluginDispatch() { $url = 'my_plugin/other_pages/index/param:value/param2:value2'; $controller = $Dispatcher->dispatch($url, array('return' => 1)); - $expected = 'my_plugin'; - $this->assertIdentical($expected, $controller->plugin); - - $expected = 'OtherPages'; - $this->assertIdentical($expected, $controller->name); - - $expected = 'index'; - $this->assertIdentical($expected, $controller->action); - - $expected = array('param' => 'value', 'param2' => 'value2'); - $this->assertIdentical($expected, $controller->passedArgs); + $this->assertIdentical($controller->plugin, 'my_plugin'); + $this->assertIdentical($controller->name, 'OtherPages'); + $this->assertIdentical($controller->action, 'index'); + $this->assertIdentical($controller->passedArgs, array('param' => 'value', 'param2' => 'value2')); $expected = '/cake/repo/branches/1.2.x.x/my_plugin/other_pages/index/param:value/param2:value2'; $this->assertIdentical($expected, $controller->here); From 6fe46314c96399ab42af8200f2894633e149cab2 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 3 Apr 2010 23:56:06 -0400 Subject: [PATCH 1867/2083] Removing Dispatcher::_restructureParams() as it is no longer used. --- cake/dispatcher.php | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/cake/dispatcher.php b/cake/dispatcher.php index efc554703..da301e473 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -366,29 +366,6 @@ function baseUrl() { } return $base . $file; } -/** - * Restructure params in case we're serving a plugin. - * - * @param array $params Array on where to re-set 'controller', 'action', and 'pass' indexes - * @param boolean $reverse If true all the params are shifted one forward, so plugin becomes - * controller, controller becomes action etc. If false, plugin is made equal to controller - * @return array Restructured array - * @access protected - */ - function _restructureParams($params, $reverse = false) { - if ($reverse === true) { - extract(Router::getArgs($params['action'])); - $params = array_merge($params, array( - 'controller'=> $params['plugin'], - 'action'=> $params['controller'], - 'pass' => array_merge($pass, $params['pass']), - 'named' => array_merge($named, $params['named']) - )); - } else { - $params['plugin'] = $params['controller']; - } - return $params; - } /** * Get controller to use, either plugin controller or application controller From 781af4a80cd7713750fabc53c69ff1faf628bd2f Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 4 Apr 2010 00:13:16 -0400 Subject: [PATCH 1868/2083] Updating doc block for Router::__connectDefaultRoutes() --- cake/libs/router.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index 85b268a9f..bccd2b271 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -540,17 +540,29 @@ function __parseExtension($url) { * Connects the default, built-in routes, including prefix and plugin routes. The following routes are created * in the order below: * + * For each of the Routing.prefixes the following routes are created. Routes containing `:plugin` are only + * created when your application has one or more plugins. + * + * - `/:prefix/:plugin` a plugin shortcut route. + * - `/:prefix/:plugin/:action/*` a plugin shortcut route. * - `/:prefix/:plugin/:controller` * - `/:prefix/:plugin/:controller/:action/*` * - `/:prefix/:controller` * - `/:prefix/:controller/:action/*` + * + * If plugins are found in your application the following routes are created: + * + * - `/:plugin` a plugin shortcut route. + * - `/:plugin/:action/*` a plugin shortcut route. * - `/:plugin/:controller` * - `/:plugin/:controller/:action/*` + * + * And lastly the following catch-all routes are connected. + * * - `/:controller' * - `/:controller/:action/*' * - * A prefix route is generated for each Routing.prefixes declared in core.php. You can disable the - * connection of default routes with Router::defaults(). + * You can disable the connection of default routes with Router::defaults(). * * @return void * @access private From e57e8f396270841024a44632da6ccb2a34411619 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 4 Apr 2010 00:21:21 -0400 Subject: [PATCH 1869/2083] Adding additional test for plugin shortcut routes including prefixed shortcut routes. --- cake/tests/cases/libs/router.test.php | 34 +++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 2c14e7537..70d384a34 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -751,6 +751,15 @@ function testUrlGenerationPlugins() { * @return void */ function testPluginShortcutRoutes() { + App::build(array( + 'plugins' => array( + TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS + ) + ), true); + App::objects('plugin', null, false); + Configure::write('Routing.prefixes', array('admin')); + Router::reload(); + $result = Router::url(array('plugin' => 'test_plugin', 'controller' => 'test_plugin', 'action' => 'index')); $this->assertEqual($result, '/test_plugin', 'Plugin shortcut index action failed.'); @@ -764,6 +773,29 @@ function testPluginShortcutRoutes() { $this->assertEqual( $result, '/test_plugin/view/1/sort:title/dir:asc', 'Plugin shortcut with passed + named args failed.' ); + + $result = Router::parse('/test_plugin'); + $this->assertEqual($result['plugin'], 'test_plugin'); + $this->assertEqual($result['controller'], 'test_plugin'); + $this->assertEqual($result['action'], 'index'); + + $result = Router::parse('/test_plugin/add'); + $this->assertEqual($result['plugin'], 'test_plugin'); + $this->assertEqual($result['controller'], 'test_plugin'); + $this->assertEqual($result['action'], 'add'); + + $result = Router::parse('/admin/test_plugin'); + $this->assertEqual($result['plugin'], 'test_plugin'); + $this->assertEqual($result['controller'], 'test_plugin'); + $this->assertEqual($result['action'], 'index'); + $this->assertEqual($result['prefix'], 'admin'); + + $result = Router::parse('/admin/test_plugin/add/1'); + $this->assertEqual($result['plugin'], 'test_plugin'); + $this->assertEqual($result['controller'], 'test_plugin'); + $this->assertEqual($result['action'], 'add'); + $this->assertEqual($result['prefix'], 'admin'); + $this->assertEqual($result['pass'], array(1)); } /** @@ -2436,8 +2468,6 @@ function testParse() { $this->assertEqual($result['action'], 'index'); } } -//SimpleTest::ignore('RouterTest'); -//SimpleTest::ignore('CakeRouteTestCase'); /** * Test case for PluginShortRoute From 29dc12dbc256114e0113ee0b75f42a9043de794a Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Sun, 4 Apr 2010 16:33:39 +1000 Subject: [PATCH 1870/2083] Changed all $__ declared variables to private. --- cake/console/libs/schema.php | 2 +- cake/console/libs/tasks/db_config.php | 2 +- cake/console/libs/tasks/extract.php | 16 ++++++------- cake/libs/cache.php | 6 ++--- cake/libs/cache/memcache.php | 2 +- cake/libs/class_registry.php | 6 ++--- cake/libs/configure.php | 10 ++++---- cake/libs/controller/component.php | 4 ++-- cake/libs/controller/components/cookie.php | 8 +++---- cake/libs/controller/components/email.php | 8 +++---- .../controller/components/request_handler.php | 10 ++++---- cake/libs/controller/components/session.php | 4 ++-- cake/libs/controller/controller.php | 2 +- cake/libs/controller/scaffold.php | 2 +- cake/libs/folder.php | 8 +++---- cake/libs/i18n.php | 10 ++++---- cake/libs/l10n.php | 4 ++-- cake/libs/model/behaviors/acl.php | 2 +- cake/libs/model/datasources/datasource.php | 2 +- cake/libs/model/datasources/dbo/dbo_mssql.php | 4 ++-- .../libs/model/datasources/dbo/dbo_oracle.php | 2 +- cake/libs/model/datasources/dbo_source.php | 4 ++-- cake/libs/model/model.php | 12 +++++----- cake/libs/model/model_behavior.php | 4 ++-- cake/libs/multibyte.php | 6 ++--- cake/libs/router.php | 24 +++++++++---------- cake/libs/validation.php | 2 +- cake/libs/view/helper.php | 4 ++-- cake/libs/view/helpers/ajax.php | 2 +- cake/libs/view/helpers/cache.php | 4 ++-- cake/libs/view/helpers/form.php | 2 +- cake/libs/view/helpers/html.php | 4 ++-- cake/libs/view/helpers/javascript.php | 2 +- cake/libs/view/helpers/js.php | 6 ++--- cake/libs/view/helpers/paginator.php | 2 +- cake/libs/view/helpers/session.php | 2 +- cake/libs/view/view.php | 6 ++--- cake/libs/xml.php | 12 +++++----- cake/tests/lib/cake_test_case.php | 4 ++-- 39 files changed, 108 insertions(+), 108 deletions(-) diff --git a/cake/console/libs/schema.php b/cake/console/libs/schema.php index b8efe2a55..9ecd9a794 100644 --- a/cake/console/libs/schema.php +++ b/cake/console/libs/schema.php @@ -38,7 +38,7 @@ class SchemaShell extends Shell { * @var boolean * @access private */ - var $__dry = null; + private $__dry = null; /** * Override initialize diff --git a/cake/console/libs/tasks/db_config.php b/cake/console/libs/tasks/db_config.php index 00ad98fcf..b311d80c6 100644 --- a/cake/console/libs/tasks/db_config.php +++ b/cake/console/libs/tasks/db_config.php @@ -40,7 +40,7 @@ class DbConfigTask extends Shell { * @var array * @access private */ - var $__defaultConfig = array( + private $__defaultConfig = array( 'name' => 'default', 'driver'=> 'mysql', 'persistent'=> 'false', 'host'=> 'localhost', 'login'=> 'root', 'password'=> 'password', 'database'=> 'project_name', 'schema'=> null, 'prefix'=> null, 'encoding' => null, 'port' => null diff --git a/cake/console/libs/tasks/extract.php b/cake/console/libs/tasks/extract.php index f2a1275d8..0c30e2909 100644 --- a/cake/console/libs/tasks/extract.php +++ b/cake/console/libs/tasks/extract.php @@ -32,7 +32,7 @@ class ExtractTask extends Shell { * @var string * @access private */ - var $__paths = array(); + private $__paths = array(); /** * Files from where to extract @@ -40,7 +40,7 @@ class ExtractTask extends Shell { * @var array * @access private */ - var $__files = array(); + private $__files = array(); /** * Merge all domains string into the default.pot file @@ -48,7 +48,7 @@ class ExtractTask extends Shell { * @var boolean * @access private */ - var $__merge = false; + private $__merge = false; /** * Current file being processed @@ -56,7 +56,7 @@ class ExtractTask extends Shell { * @var string * @access private */ - var $__file = null; + private $__file = null; /** * Contains all content waiting to be write @@ -64,7 +64,7 @@ class ExtractTask extends Shell { * @var string * @access private */ - var $__storage = array(); + private $__storage = array(); /** * Extracted tokens @@ -72,7 +72,7 @@ class ExtractTask extends Shell { * @var array * @access private */ - var $__tokens = array(); + private $__tokens = array(); /** * Extracted strings @@ -80,7 +80,7 @@ class ExtractTask extends Shell { * @var array * @access private */ - var $__strings = array(); + private $__strings = array(); /** * Destination path @@ -88,7 +88,7 @@ class ExtractTask extends Shell { * @var string * @access private */ - var $__output = null; + private $__output = null; /** * Execution method always used for tasks diff --git a/cake/libs/cache.php b/cake/libs/cache.php index a0c448d4d..6335338f3 100644 --- a/cake/libs/cache.php +++ b/cake/libs/cache.php @@ -35,7 +35,7 @@ class Cache { * @var array * @access private */ - var $__config = array(); + private $__config = array(); /** * Holds name of the current configuration name being used. @@ -43,7 +43,7 @@ class Cache { * @var array * @access private */ - var $__name = 'default'; + private $__name = 'default'; /** * Whether to reset the settings with the next call to Cache::set(); @@ -51,7 +51,7 @@ class Cache { * @var array * @access private */ - var $__reset = false; + private $__reset = false; /** * Engine instances keyed by configuration name. diff --git a/cake/libs/cache/memcache.php b/cake/libs/cache/memcache.php index 013ef2759..ec4e99a57 100644 --- a/cake/libs/cache/memcache.php +++ b/cake/libs/cache/memcache.php @@ -33,7 +33,7 @@ class MemcacheEngine extends CacheEngine { * @var Memcache * @access private */ - var $__Memcache = null; + private $__Memcache = null; /** * Settings diff --git a/cake/libs/class_registry.php b/cake/libs/class_registry.php index e0eff1832..dd78c35c9 100644 --- a/cake/libs/class_registry.php +++ b/cake/libs/class_registry.php @@ -38,7 +38,7 @@ class ClassRegistry { * @var array * @access private */ - var $__objects = array(); + private $__objects = array(); /** * Names of class names mapped to the object in the registry. @@ -46,7 +46,7 @@ class ClassRegistry { * @var array * @access private */ - var $__map = array(); + private $__map = array(); /** * Default constructor parameter settings, indexed by type @@ -54,7 +54,7 @@ class ClassRegistry { * @var array * @access private */ - var $__config = array(); + private $__config = array(); /** * Return a singleton instance of the ClassRegistry. diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 802ed1c3b..b561a5e3f 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -584,7 +584,7 @@ class App extends Object { * @var boolean * @access private */ - var $__cache = false; + private $__cache = false; /** * Holds key/value pairs of $type => file path. @@ -592,7 +592,7 @@ class App extends Object { * @var array * @access private */ - var $__map = array(); + private $__map = array(); /** * Holds paths for deep searching of files. @@ -600,7 +600,7 @@ class App extends Object { * @var array * @access private */ - var $__paths = array(); + private $__paths = array(); /** * Holds loaded files. @@ -608,7 +608,7 @@ class App extends Object { * @var array * @access private */ - var $__loaded = array(); + private $__loaded = array(); /** * Holds and key => value array of object types. @@ -616,7 +616,7 @@ class App extends Object { * @var array * @access private */ - var $__objects = array(); + private $__objects = array(); /** * Used to read information stored path diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php index 4df0b1257..89a35636a 100644 --- a/cake/libs/controller/component.php +++ b/cake/libs/controller/component.php @@ -32,7 +32,7 @@ class Component extends Object { * @var object * @access private */ - var $__controllerVars = array('plugin' => null, 'name' => null, 'base' => null); + private $__controllerVars = array('plugin' => null, 'name' => null, 'base' => null); /** * List of loaded components. @@ -57,7 +57,7 @@ class Component extends Object { * @var array * @access private */ - var $__settings = array(); + private $__settings = array(); /** * Used to initialize the components for current controller. diff --git a/cake/libs/controller/components/cookie.php b/cake/libs/controller/components/cookie.php index 4b24d3343..1e09fb66b 100644 --- a/cake/libs/controller/components/cookie.php +++ b/cake/libs/controller/components/cookie.php @@ -124,7 +124,7 @@ class CookieComponent extends Object { * @var string * @access private */ - var $__values = array(); + private $__values = array(); /** * Type of encryption to use. @@ -136,7 +136,7 @@ class CookieComponent extends Object { * @access private * @todo add additional encryption methods */ - var $__type = 'cipher'; + private $__type = 'cipher'; /** * Used to reset cookie time if $expire is passed to CookieComponent::write() @@ -144,7 +144,7 @@ class CookieComponent extends Object { * @var string * @access private */ - var $__reset = null; + private $__reset = null; /** * Expire time of the cookie @@ -154,7 +154,7 @@ class CookieComponent extends Object { * @var string * @access private */ - var $__expires = 0; + private $__expires = 0; /** * Main execution method. diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index 73de46195..d92b082a4 100755 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -272,7 +272,7 @@ class EmailComponent extends Object{ * @var array * @access private */ - var $__header = array(); + private $__header = array(); /** * If set, boundary to use for multipart mime messages @@ -280,7 +280,7 @@ class EmailComponent extends Object{ * @var string * @access private */ - var $__boundary = null; + private $__boundary = null; /** * Temporary store of message lines @@ -288,7 +288,7 @@ class EmailComponent extends Object{ * @var array * @access private */ - var $__message = array(); + private $__message = array(); /** * Variable that holds SMTP connection @@ -296,7 +296,7 @@ class EmailComponent extends Object{ * @var resource * @access private */ - var $__smtpConnection = null; + private $__smtpConnection = null; /** * Initialize component diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php index ef166baac..26213fb38 100644 --- a/cake/libs/controller/components/request_handler.php +++ b/cake/libs/controller/components/request_handler.php @@ -53,7 +53,7 @@ class RequestHandlerComponent extends Object { * @var string * @access private */ - var $__responseTypeSet = null; + private $__responseTypeSet = null; /** * Holds the copy of Controller::$params @@ -71,7 +71,7 @@ class RequestHandlerComponent extends Object { * @access private * @see RequestHandlerComponent::setContent */ - var $__requestContent = array( + private $__requestContent = array( 'javascript' => 'text/javascript', 'js' => 'text/javascript', 'json' => 'application/json', @@ -141,7 +141,7 @@ class RequestHandlerComponent extends Object { * @access private * @see Router::parseExtensions() */ - var $__acceptTypes = array(); + private $__acceptTypes = array(); /** * The template to use when rendering the given content type. @@ -149,7 +149,7 @@ class RequestHandlerComponent extends Object { * @var string * @access private */ - var $__renderType = null; + private $__renderType = null; /** * Contains the file extension parsed out by the Router @@ -167,7 +167,7 @@ class RequestHandlerComponent extends Object { * @access private * @see RequestHandler::__initializeTypes() */ - var $__typesInitialized = false; + private $__typesInitialized = false; /** * Constructor. Parses the accepted content types accepted by the client using HTTP_ACCEPT diff --git a/cake/libs/controller/components/session.php b/cake/libs/controller/components/session.php index fbe572009..17d46584b 100644 --- a/cake/libs/controller/components/session.php +++ b/cake/libs/controller/components/session.php @@ -38,7 +38,7 @@ class SessionComponent extends CakeSession { * @var boolean * @access private */ - var $__active = true; + private $__active = true; /** * Used to determine if request are from an Ajax request @@ -46,7 +46,7 @@ class SessionComponent extends CakeSession { * @var boolean * @access private */ - var $__bare = 0; + private $__bare = 0; /** * Class constructor diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index f2cfcce9c..8a1d5de04 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -353,7 +353,7 @@ class Controller extends Object { * @var array Associative array of HTTP codes and their associated messages. * @access private */ - var $__httpCodes = null; + private $__httpCodes = null; /** * Constructor. diff --git a/cake/libs/controller/scaffold.php b/cake/libs/controller/scaffold.php index 1abd00c2c..0c80875f9 100644 --- a/cake/libs/controller/scaffold.php +++ b/cake/libs/controller/scaffold.php @@ -135,7 +135,7 @@ class Scaffold extends Object { * @var array * @access private */ - var $__passedVars = array( + private $__passedVars = array( 'action', 'base', 'webroot', 'layout', 'name', 'viewPath', 'ext', 'params', 'data', 'plugin', 'cacheAction' ); diff --git a/cake/libs/folder.php b/cake/libs/folder.php index 523d1928d..fb0f77228 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -66,7 +66,7 @@ class Folder extends Object { * @var array * @access private */ - var $__messages = array(); + private $__messages = array(); /** * Holds errors from last method. @@ -74,7 +74,7 @@ class Folder extends Object { * @var array * @access private */ - var $__errors = false; + private $__errors = false; /** * Holds array of complete directory paths. @@ -82,7 +82,7 @@ class Folder extends Object { * @var array * @access private */ - var $__directories; + private $__directories; /** * Holds array of complete file paths. @@ -90,7 +90,7 @@ class Folder extends Object { * @var array * @access private */ - var $__files; + private $__files; /** * Constructor. diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index 37abc0061..03d1d1209 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -61,7 +61,7 @@ class I18n extends Object { * @var string * @access private */ - var $__lang = null; + private $__lang = null; /** * Translation strings for a specific domain read from the .mo or .po files @@ -69,7 +69,7 @@ class I18n extends Object { * @var array * @access private */ - var $__domains = array(); + private $__domains = array(); /** * Set to true when I18N::__bindTextDomain() is called for the first time. @@ -78,7 +78,7 @@ class I18n extends Object { * @var boolean * @access private */ - var $__noLocale = false; + private $__noLocale = false; /** * Determine if $__domains cache should be wrote @@ -86,7 +86,7 @@ class I18n extends Object { * @var boolean * @access private */ - var $__cache = false; + private $__cache = false; /** * Set to true when I18N::__bindTextDomain() is called for the first time. @@ -95,7 +95,7 @@ class I18n extends Object { * @var array * @access private */ - var $__categories = array( + private $__categories = array( 'LC_ALL', 'LC_COLLATE', 'LC_CTYPE', 'LC_MONETARY', 'LC_NUMERIC', 'LC_TIME', 'LC_MESSAGES' ); diff --git a/cake/libs/l10n.php b/cake/libs/l10n.php index 534009f7a..1198015ae 100644 --- a/cake/libs/l10n.php +++ b/cake/libs/l10n.php @@ -98,7 +98,7 @@ class L10n extends Object { * @var array * @access private */ - var $__l10nMap = array(/* Afrikaans */ 'afr' => 'af', + private $__l10nMap = array(/* Afrikaans */ 'afr' => 'af', /* Albanian */ 'alb' => 'sq', /* Arabic */ 'ara' => 'ar', /* Armenian - Armenia */ 'hye' => 'hy', @@ -184,7 +184,7 @@ class L10n extends Object { * @var array * @access private */ - var $__l10nCatalog = array('af' => array('language' => 'Afrikaans', 'locale' => 'afr', 'localeFallback' => 'afr', 'charset' => 'utf-8', 'direction' => 'ltr'), + private $__l10nCatalog = array('af' => array('language' => 'Afrikaans', 'locale' => 'afr', 'localeFallback' => 'afr', 'charset' => 'utf-8', 'direction' => 'ltr'), 'ar' => array('language' => 'Arabic', 'locale' => 'ara', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), 'ar-ae' => array('language' => 'Arabic (U.A.E.)', 'locale' => 'ar_ae', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), 'ar-bh' => array('language' => 'Arabic (Bahrain)', 'locale' => 'ar_bh', 'localeFallback' => 'ara', 'charset' => 'utf-8', 'direction' => 'rtl'), diff --git a/cake/libs/model/behaviors/acl.php b/cake/libs/model/behaviors/acl.php index 3bc033b61..c30dffd15 100644 --- a/cake/libs/model/behaviors/acl.php +++ b/cake/libs/model/behaviors/acl.php @@ -34,7 +34,7 @@ class AclBehavior extends ModelBehavior { * @var array * @access protected */ - var $__typeMaps = array('requester' => 'Aro', 'controlled' => 'Aco'); + private $__typeMaps = array('requester' => 'Aro', 'controlled' => 'Aco'); /** * Sets up the configuation for the model, and loads ACL models if they haven't been already diff --git a/cake/libs/model/datasources/datasource.php b/cake/libs/model/datasources/datasource.php index eef8a4283..74e3ffe94 100644 --- a/cake/libs/model/datasources/datasource.php +++ b/cake/libs/model/datasources/datasource.php @@ -154,7 +154,7 @@ class DataSource extends Object { * @var array * @access private */ - var $__descriptions = array(); + private $__descriptions = array(); /** * Holds a list of sources (tables) contained in the DataSource diff --git a/cake/libs/model/datasources/dbo/dbo_mssql.php b/cake/libs/model/datasources/dbo/dbo_mssql.php index 273d4364c..5efce898e 100644 --- a/cake/libs/model/datasources/dbo/dbo_mssql.php +++ b/cake/libs/model/datasources/dbo/dbo_mssql.php @@ -55,7 +55,7 @@ class DboMssql extends DboSource { * * @var array */ - var $__fieldMappings = array(); + private $__fieldMappings = array(); /** * Base configuration settings for MS SQL driver @@ -108,7 +108,7 @@ class DboMssql extends DboSource { * @var string * @access private */ - var $__lastQueryHadError = false; + private $__lastQueryHadError = false; /** * MS SQL DBO driver constructor; sets SQL Server error reporting defaults * diff --git a/cake/libs/model/datasources/dbo/dbo_oracle.php b/cake/libs/model/datasources/dbo/dbo_oracle.php index 1e078ccee..44986c0f9 100644 --- a/cake/libs/model/datasources/dbo/dbo_oracle.php +++ b/cake/libs/model/datasources/dbo/dbo_oracle.php @@ -53,7 +53,7 @@ class DboOracle extends DboSource { * * @var boolean */ - var $__transactionStarted = false; + private $__transactionStarted = false; /** * Enter description here... diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 8c3da9226..9ac2a85d9 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -75,7 +75,7 @@ class DboSource extends DataSource { * @var boolean * @access private */ - var $__bypass = false; + private $__bypass = false; /** * The set of valid SQL operations usable in a WHERE statement @@ -83,7 +83,7 @@ class DboSource extends DataSource { * @var array * @access private */ - var $__sqlOps = array('like', 'ilike', 'or', 'not', 'in', 'between', 'regexp', 'similar to'); + private $__sqlOps = array('like', 'ilike', 'or', 'not', 'in', 'between', 'regexp', 'similar to'); /** * Index of basic SQL commands diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index b5f36d9da..1faa2d0ea 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -310,7 +310,7 @@ class Model extends Overloadable { * @var array * @access private */ - var $__associationKeys = array( + private $__associationKeys = array( 'belongsTo' => array('className', 'foreignKey', 'conditions', 'fields', 'order', 'counterCache'), 'hasOne' => array('className', 'foreignKey','conditions', 'fields','order', 'dependent'), 'hasMany' => array('className', 'foreignKey', 'conditions', 'fields', 'order', 'limit', 'offset', 'dependent', 'exclusive', 'finderQuery', 'counterQuery'), @@ -323,7 +323,7 @@ class Model extends Overloadable { * @var array * @access private */ - var $__associations = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany'); + private $__associations = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany'); /** * Holds model associations temporarily to allow for dynamic (un)binding. @@ -331,7 +331,7 @@ class Model extends Overloadable { * @var array * @access private */ - var $__backAssociation = array(); + private $__backAssociation = array(); /** * The ID of the model record that was last inserted. @@ -339,7 +339,7 @@ class Model extends Overloadable { * @var integer * @access private */ - var $__insertID = null; + private $__insertID = null; /** * The number of records returned by the last query. @@ -347,7 +347,7 @@ class Model extends Overloadable { * @var integer * @access private */ - var $__numRows = null; + private $__numRows = null; /** * The number of records affected by the last query. @@ -355,7 +355,7 @@ class Model extends Overloadable { * @var integer * @access private */ - var $__affectedRows = null; + private $__affectedRows = null; /** * List of valid finder method options, supplied as the first parameter to find(). diff --git a/cake/libs/model/model_behavior.php b/cake/libs/model/model_behavior.php index 51273ba62..119b3d95a 100644 --- a/cake/libs/model/model_behavior.php +++ b/cake/libs/model/model_behavior.php @@ -245,14 +245,14 @@ class BehaviorCollection extends Object { * * @var array */ - var $__methods = array(); + private $__methods = array(); /** * Keeps a list of all methods which have been mapped with regular expressions * * @var array */ - var $__mappedMethods = array(); + private $__mappedMethods = array(); /** * Attaches a model object and loads a list of behaviors diff --git a/cake/libs/multibyte.php b/cake/libs/multibyte.php index 261960760..33a0d2211 100644 --- a/cake/libs/multibyte.php +++ b/cake/libs/multibyte.php @@ -267,7 +267,7 @@ class Multibyte extends Object { * @var array * @access private */ - var $__caseFold = array(); + private $__caseFold = array(); /** * Holds an array of Unicode code point ranges @@ -275,7 +275,7 @@ class Multibyte extends Object { * @var array * @access private */ - var $__codeRange = array(); + private $__codeRange = array(); /** * Holds the current code point range @@ -283,7 +283,7 @@ class Multibyte extends Object { * @var string * @access private */ - var $__table = null; + private $__table = null; /** * Gets a reference to the Multibyte object instance diff --git a/cake/libs/router.php b/cake/libs/router.php index 0c988ac35..ee3905518 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -41,7 +41,7 @@ class Router { * @var array * @access private */ - var $__prefixes = array(); + private $__prefixes = array(); /** * Directive for Router to parse out file extensions for mapping to Content-types. @@ -49,7 +49,7 @@ class Router { * @var boolean * @access private */ - var $__parseExtensions = false; + private $__parseExtensions = false; /** * List of valid extensions to parse from a URL. If null, any extension is allowed. @@ -57,7 +57,7 @@ class Router { * @var array * @access private */ - var $__validExtensions = null; + private $__validExtensions = null; /** * 'Constant' regular expression definitions for named route elements @@ -65,7 +65,7 @@ class Router { * @var array * @access private */ - var $__named = array( + private $__named = array( 'Action' => 'index|show|add|create|edit|update|remove|del|delete|view|item', 'Year' => '[12][0-9]{3}', 'Month' => '0[1-9]|1[012]', @@ -93,7 +93,7 @@ class Router { * @var array * @access private */ - var $__currentRoute = array(); + private $__currentRoute = array(); /** * Default HTTP request method => controller action map. @@ -101,7 +101,7 @@ class Router { * @var array * @access private */ - var $__resourceMap = array( + private $__resourceMap = array( array('action' => 'index', 'method' => 'GET', 'id' => false), array('action' => 'view', 'method' => 'GET', 'id' => true), array('action' => 'add', 'method' => 'POST', 'id' => false), @@ -116,7 +116,7 @@ class Router { * @var array * @access private */ - var $__resourceMapped = array(); + private $__resourceMapped = array(); /** * Maintains the parameter stack for the current request @@ -124,7 +124,7 @@ class Router { * @var array * @access private */ - var $__params = array(); + private $__params = array(); /** * Maintains the path stack for the current request @@ -132,7 +132,7 @@ class Router { * @var array * @access private */ - var $__paths = array(); + private $__paths = array(); /** * Keeps Router state to determine if default routes have already been connected @@ -140,7 +140,7 @@ class Router { * @var boolean * @access private */ - var $__defaultsMapped = false; + private $__defaultsMapped = false; /** * Keeps track of whether the connection of default routes is enabled or disabled. @@ -148,7 +148,7 @@ class Router { * @var boolean * @access private */ - var $__connectDefaults = true; + private $__connectDefaults = true; /** * Constructor for Router. @@ -1273,7 +1273,7 @@ class CakeRoute { * @var array * @access private */ - var $__headerMap = array( + private $__headerMap = array( 'type' => 'content_type', 'method' => 'request_method', 'server' => 'server_name' diff --git a/cake/libs/validation.php b/cake/libs/validation.php index 4b732f25e..f5a561f7a 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -52,7 +52,7 @@ class Validation extends Object { * @var array * @access private */ - var $__pattern = array( + private $__pattern = array( 'hostname' => '(?:[a-z0-9][-a-z0-9]*\.)*(?:[a-z0-9][-a-z0-9]{0,62})\.(?:(?:[a-z]{2}\.)?[a-z]{2,4}|museum|travel)' ); diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index c37348da7..1ec808aa0 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -133,7 +133,7 @@ class Helper extends Overloadable { * @access private * @var mixed */ - var $__tainted = null; + private $__tainted = null; /** * Holds the cleaned content. @@ -141,7 +141,7 @@ class Helper extends Overloadable { * @access private * @var mixed */ - var $__cleaned = null; + private $__cleaned = null; /** * Default overload methods diff --git a/cake/libs/view/helpers/ajax.php b/cake/libs/view/helpers/ajax.php index e84eb87a9..6e5b6fcd2 100644 --- a/cake/libs/view/helpers/ajax.php +++ b/cake/libs/view/helpers/ajax.php @@ -144,7 +144,7 @@ class AjaxHelper extends AppHelper { * * @var array */ - var $__ajaxBuffer = array(); + private $__ajaxBuffer = array(); /** * Returns link to remote action diff --git a/cake/libs/view/helpers/cache.php b/cake/libs/view/helpers/cache.php index 35d05f80a..a495d5085 100644 --- a/cake/libs/view/helpers/cache.php +++ b/cake/libs/view/helpers/cache.php @@ -36,7 +36,7 @@ class CacheHelper extends AppHelper { * @var array * @access private */ - var $__replace = array(); + private $__replace = array(); /** * Array of string that are replace with there var replace above. @@ -45,7 +45,7 @@ class CacheHelper extends AppHelper { * @var array * @access private */ - var $__match = array(); + private $__match = array(); /** * cache action time diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index c086ba777..7eef71d46 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -51,7 +51,7 @@ class FormHelper extends AppHelper { * * @var array */ - var $__options = array( + private $__options = array( 'day' => array(), 'minute' => array(), 'hour' => array(), 'month' => array(), 'year' => array(), 'meridian' => array() ); diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php index 3161a96fb..2dbebb7d3 100644 --- a/cake/libs/view/helpers/html.php +++ b/cake/libs/view/helpers/html.php @@ -105,7 +105,7 @@ class HtmlHelper extends AppHelper { * @var array * @access private */ - var $__includedScripts = array(); + private $__includedScripts = array(); /** * Options for the currently opened script block buffer if any. * @@ -119,7 +119,7 @@ class HtmlHelper extends AppHelper { * @var array * @access private */ - var $__docTypes = array( + private $__docTypes = array( 'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">', 'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">', 'html4-frame' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">', diff --git a/cake/libs/view/helpers/javascript.php b/cake/libs/view/helpers/javascript.php index 86a101b58..4517479f3 100644 --- a/cake/libs/view/helpers/javascript.php +++ b/cake/libs/view/helpers/javascript.php @@ -130,7 +130,7 @@ class JavascriptHelper extends AppHelper { * @var string * @access private */ - var $__scriptBuffer = null; + private $__scriptBuffer = null; /** * Constructor. Checks for presence of native PHP JSON extension to use for object encoding diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 5ad10191d..cf6cb9947 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -51,7 +51,7 @@ class JsHelper extends AppHelper { * @see JsHelper::set() * @access private */ - var $__jsVars = array(); + private $__jsVars = array(); /** * Scripts that are queued for output @@ -60,7 +60,7 @@ class JsHelper extends AppHelper { * @see JsHelper::buffer() * @access private */ - var $__bufferedScripts = array(); + private $__bufferedScripts = array(); /** * Current Javascript Engine that is being used @@ -68,7 +68,7 @@ class JsHelper extends AppHelper { * @var string * @access private */ - var $__engineName; + private $__engineName; /** * The javascript variable created by set() variables. diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index 47f0652ef..aca981388 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -40,7 +40,7 @@ class PaginatorHelper extends AppHelper { * * @var string */ - var $__defaultModel = null; + private $__defaultModel = null; /** * The class used for 'Ajax' pagination links. diff --git a/cake/libs/view/helpers/session.php b/cake/libs/view/helpers/session.php index 8e9b6eada..29db2ff4b 100644 --- a/cake/libs/view/helpers/session.php +++ b/cake/libs/view/helpers/session.php @@ -42,7 +42,7 @@ class SessionHelper extends CakeSession { * * @var boolean */ - var $__active = true; + private $__active = true; /** * Class constructor diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index 1d80636b5..11062487d 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -275,7 +275,7 @@ class View extends Object { * @var array * @access protected */ - var $__passedVars = array( + private $__passedVars = array( 'viewVars', 'action', 'autoLayout', 'autoRender', 'ext', 'base', 'webroot', 'helpers', 'here', 'layout', 'name', 'layoutPath', 'viewPath', 'params', 'data', 'plugin', 'passedArgs', 'cacheAction' @@ -287,7 +287,7 @@ class View extends Object { * @var array * @access private */ - var $__scripts = array(); + private $__scripts = array(); /** * Holds an array of paths. @@ -295,7 +295,7 @@ class View extends Object { * @var array * @access private */ - var $__paths = array(); + private $__paths = array(); /** * Constructor diff --git a/cake/libs/xml.php b/cake/libs/xml.php index c61cfa0c0..a2bf6527f 100644 --- a/cake/libs/xml.php +++ b/cake/libs/xml.php @@ -86,7 +86,7 @@ class XmlNode extends Object { * @var XmlNode * @access private */ - var $__parent = null; + private $__parent = null; /** * Constructor. @@ -788,7 +788,7 @@ class Xml extends XmlNode { * @var resource * @access private */ - var $__parser; + private $__parser; /** * File handle to XML indata file. @@ -796,7 +796,7 @@ class Xml extends XmlNode { * @var resource * @access private */ - var $__file; + private $__file; /** * Raw XML string data (for loading purposes) @@ -804,7 +804,7 @@ class Xml extends XmlNode { * @var string * @access private */ - var $__rawData = null; + private $__rawData = null; /** * XML document header @@ -812,7 +812,7 @@ class Xml extends XmlNode { * @var string * @access private */ - var $__header = null; + private $__header = null; /** * Default array keys/object properties to use as tag names when converting objects or array @@ -821,7 +821,7 @@ class Xml extends XmlNode { * @var array * @access private */ - var $__tags = array(); + private $__tags = array(); /** * XML document version diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index b27636db2..f4ea8ed5e 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -125,7 +125,7 @@ class CakeTestCase extends UnitTestCase { * @var boolean * @access private */ - var $__truncated = true; + private $__truncated = true; /** * savedGetData property @@ -133,7 +133,7 @@ class CakeTestCase extends UnitTestCase { * @var array * @access private */ - var $__savedGetData = array(); + private $__savedGetData = array(); /** * Called when a test case (group of methods) is about to start (to be overriden when needed.) From 329a13fe5fa1e0beb4ced98bf3bee66ab08389af Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Sun, 4 Apr 2010 16:36:12 +1000 Subject: [PATCH 1871/2083] Changed all $_ declared variables to protected. --- cake/console/libs/tasks/fixture.php | 2 +- cake/console/libs/tasks/model.php | 4 ++-- cake/console/libs/tasks/test.php | 2 +- cake/libs/cache.php | 2 +- cake/libs/cache/file.php | 4 ++-- cake/libs/cake_log.php | 2 +- cake/libs/cake_session.php | 4 ++-- cake/libs/cake_socket.php | 2 +- cake/libs/controller/component.php | 4 ++-- cake/libs/controller/components/acl.php | 2 +- cake/libs/controller/components/auth.php | 4 ++-- cake/libs/controller/components/email.php | 2 +- cake/libs/controller/components/security.php | 2 +- cake/libs/controller/scaffold.php | 2 +- cake/libs/debugger.php | 6 ++--- cake/libs/inflector.php | 22 +++++++++---------- cake/libs/log/file_log.php | 2 +- cake/libs/model/behaviors/tree.php | 2 +- cake/libs/model/connection_manager.php | 4 ++-- cake/libs/model/datasources/datasource.php | 18 +++++++-------- cake/libs/model/datasources/dbo/dbo_mssql.php | 4 ++-- cake/libs/model/datasources/dbo/dbo_mysql.php | 6 ++--- .../libs/model/datasources/dbo/dbo_mysqli.php | 2 +- .../libs/model/datasources/dbo/dbo_oracle.php | 20 ++++++++--------- .../model/datasources/dbo/dbo_postgres.php | 6 ++--- .../libs/model/datasources/dbo/dbo_sqlite.php | 6 ++--- cake/libs/model/datasources/dbo_source.php | 2 +- cake/libs/model/model.php | 4 ++-- cake/libs/model/model_behavior.php | 4 ++-- cake/libs/router.php | 4 ++-- cake/libs/view/helpers/form.php | 2 +- cake/libs/view/helpers/html.php | 4 ++-- cake/libs/view/helpers/javascript.php | 12 +++++----- cake/libs/view/helpers/jquery_engine.php | 4 ++-- cake/libs/view/helpers/js.php | 4 ++-- cake/libs/view/helpers/mootools_engine.php | 4 ++-- cake/libs/view/helpers/number.php | 4 ++-- cake/libs/view/helpers/paginator.php | 2 +- cake/libs/view/helpers/prototype_engine.php | 6 ++--- cake/libs/view/media.php | 2 +- .../libs/controller/components/auth.test.php | 2 +- .../model/datasources/dbo/dbo_mssql.test.php | 4 ++-- .../model/datasources/dbo_source.test.php | 2 +- cake/tests/cases/libs/model/models.php | 8 +++---- .../cases/libs/view/helpers/form.test.php | 16 +++++++------- .../cases/libs/view/helpers/html.test.php | 6 ++--- .../tests/cases/libs/view/helpers/js.test.php | 2 +- cake/tests/lib/cake_test_case.php | 2 +- cake/tests/lib/cake_test_suite_dispatcher.php | 6 ++--- .../tests/lib/reporter/cake_base_reporter.php | 8 +++---- cake/tests/lib/test_manager.php | 4 ++-- 51 files changed, 127 insertions(+), 127 deletions(-) diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 8073cdfd9..57b995f27 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -48,7 +48,7 @@ class FixtureTask extends BakeTask { * @var object * @access protected */ - var $_Schema = null; + protected $_Schema = null; /** * Override initialize diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 7a8115831..921d0eb7f 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -58,7 +58,7 @@ class ModelTask extends BakeTask { * @var array * @access protected */ - var $_tables = array(); + protected $_tables = array(); /** * Holds validation method map. @@ -66,7 +66,7 @@ class ModelTask extends BakeTask { * @var array * @access protected */ - var $_validations = array(); + protected $_validations = array(); /** * Execution method always used for tasks diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index ff7996cde..e29ad68c9 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -58,7 +58,7 @@ class TestTask extends BakeTask { * @var string * @access protected */ - var $_fixtures = array(); + protected $_fixtures = array(); /** diff --git a/cake/libs/cache.php b/cake/libs/cache.php index 6335338f3..d6ea83d39 100644 --- a/cake/libs/cache.php +++ b/cake/libs/cache.php @@ -58,7 +58,7 @@ class Cache { * * @var array */ - var $_engines = array(); + protected $_engines = array(); /** * Returns a singleton instance diff --git a/cake/libs/cache/file.php b/cake/libs/cache/file.php index 31dd70a5d..a6fc81a13 100644 --- a/cake/libs/cache/file.php +++ b/cake/libs/cache/file.php @@ -37,7 +37,7 @@ class FileEngine extends CacheEngine { * @var File * @access protected */ - var $_File = null; + protected $_File = null; /** * Settings @@ -59,7 +59,7 @@ class FileEngine extends CacheEngine { * @var boolean * @access protected */ - var $_init = true; + protected $_init = true; /** * Initialize the Cache Engine diff --git a/cake/libs/cake_log.php b/cake/libs/cake_log.php index 218ce1556..767912173 100644 --- a/cake/libs/cake_log.php +++ b/cake/libs/cake_log.php @@ -54,7 +54,7 @@ class CakeLog { * @var array * @access protected */ - var $_streams = array(); + protected $_streams = array(); /** * Get an instance diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index c63c6a8a3..01bfb82fb 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -56,7 +56,7 @@ class CakeSession extends Object { * @var string * @access protected */ - var $_userAgent = ''; + protected $_userAgent = ''; /** * Path to where the session is active. @@ -120,7 +120,7 @@ class CakeSession extends Object { * @var boolean * @access protected */ - var $_started = false; + protected $_started = false; /** * Hostname diff --git a/cake/libs/cake_socket.php b/cake/libs/cake_socket.php index 0b9394922..38f9af250 100644 --- a/cake/libs/cake_socket.php +++ b/cake/libs/cake_socket.php @@ -43,7 +43,7 @@ class CakeSocket extends Object { * @var array * @access protected */ - var $_baseConfig = array( + protected $_baseConfig = array( 'persistent' => false, 'host' => 'localhost', 'protocol' => 'tcp', diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php index 89a35636a..6400fc6cb 100644 --- a/cake/libs/controller/component.php +++ b/cake/libs/controller/component.php @@ -40,7 +40,7 @@ class Component extends Object { * @var object * @access protected */ - var $_loaded = array(); + protected $_loaded = array(); /** * List of components attached directly to the controller, which callbacks @@ -49,7 +49,7 @@ class Component extends Object { * @var object * @access protected */ - var $_primary = array(); + protected $_primary = array(); /** * Settings for loaded components. diff --git a/cake/libs/controller/components/acl.php b/cake/libs/controller/components/acl.php index 8b2d68c7d..d9afbd3b4 100644 --- a/cake/libs/controller/components/acl.php +++ b/cake/libs/controller/components/acl.php @@ -38,7 +38,7 @@ class AclComponent extends Object { * @var object * @access protected */ - var $_Instance = null; + protected $_Instance = null; /** * Constructor. Will return an instance of the correct ACL class as defined in `Configure::read('Acl.classname')` diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index 4236f614d..92be96759 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -38,7 +38,7 @@ class AuthComponent extends Object { * @var boolean * @access private */ - var $_loggedIn = false; + protected $_loggedIn = false; /** * Other components utilized by AuthComponent @@ -244,7 +244,7 @@ class AuthComponent extends Object { * @var array * @access protected */ - var $_methods = array(); + protected $_methods = array(); /** * Initializes AuthComponent for use in the controller diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index d92b082a4..e0d7d0186 100755 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -150,7 +150,7 @@ class EmailComponent extends Object{ /** * @deprecated see lineLength */ - var $_lineLength = null; + protected $_lineLength = null; /** * What format should the email be sent in diff --git a/cake/libs/controller/components/security.php b/cake/libs/controller/components/security.php index 4c5aaeb5a..44ac7e913 100644 --- a/cake/libs/controller/components/security.php +++ b/cake/libs/controller/components/security.php @@ -166,7 +166,7 @@ class SecurityComponent extends Object { * * @var string */ - var $_action = null; + protected $_action = null; /** * Initialize the SecurityComponent diff --git a/cake/libs/controller/scaffold.php b/cake/libs/controller/scaffold.php index 0c80875f9..2d5c10995 100644 --- a/cake/libs/controller/scaffold.php +++ b/cake/libs/controller/scaffold.php @@ -127,7 +127,7 @@ class Scaffold extends Object { * @var boolean * @access public */ - var $_validSession = null; + protected $_validSession = null; /** * List of variables to collect from the associated controller diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index e19b5ed66..bea8f2046 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -67,7 +67,7 @@ class Debugger extends Object { * @var string * @access protected */ - var $_outputFormat = 'js'; + protected $_outputFormat = 'js'; /** * Templates used when generating trace or error strings. Can be global or indexed by the format @@ -76,7 +76,7 @@ class Debugger extends Object { * @var string * @access protected */ - var $_templates = array( + protected $_templates = array( 'log' => array( 'trace' => '{:reference} - {:path}, line {:line}', 'error' => "{:error} ({:code}): {:description} in [{:file}, line {:line}]" @@ -111,7 +111,7 @@ class Debugger extends Object { * @var string * @access private */ - var $_data = array(); + protected $_data = array(); /** * Constructor. diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index a6ba66361..1be467e95 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -38,7 +38,7 @@ class Inflector { * @var array * @access protected */ - var $_plural = array( + protected $_plural = array( 'rules' => array( '/(s)tatus$/i' => '\1\2tatuses', '/(quiz)$/i' => '\1zes', @@ -106,7 +106,7 @@ class Inflector { * @var array * @access protected */ - var $_singular = array( + protected $_singular = array( 'rules' => array( '/(s)tatuses$/i' => '\1\2tatus', '/^(.*)(menu)s$/i' => '\1\2', @@ -157,7 +157,7 @@ class Inflector { * @var array * @access protected */ - var $_uninflected = array( + protected $_uninflected = array( 'Amoyese', 'bison', 'Borghese', 'bream', 'breeches', 'britches', 'buffalo', 'cantus', 'carp', 'chassis', 'clippers', 'cod', 'coitus', 'Congoese', 'contretemps', 'corps', 'debris', 'diabetes', 'djinn', 'eland', 'elk', 'equipment', 'Faroese', 'flounder', @@ -178,7 +178,7 @@ class Inflector { * @var array * @access protected */ - var $_transliteration = array( + protected $_transliteration = array( '/à|á|Ã¥|â/' => 'a', '/è|é|ê|ẽ|ë/' => 'e', '/ì|í|î/' => 'i', @@ -201,7 +201,7 @@ class Inflector { * @var array * @access protected */ - var $_pluralized = array(); + protected $_pluralized = array(); /** * Cached array identity map of singularized words. @@ -209,7 +209,7 @@ class Inflector { * @var array * @access protected */ - var $_singularized = array(); + protected $_singularized = array(); /** * Cached Underscore Inflections @@ -217,7 +217,7 @@ class Inflector { * @var array * @access protected */ - var $_underscore = array(); + protected $_underscore = array(); /** * Cached Camelize Inflections @@ -225,7 +225,7 @@ class Inflector { * @var array * @access protected */ - var $_camelize = array(); + protected $_camelize = array(); /** * Classify cached inflecctions @@ -233,7 +233,7 @@ class Inflector { * @var array * @access protected */ - var $_classify = array(); + protected $_classify = array(); /** * Tablize cached inflections @@ -241,7 +241,7 @@ class Inflector { * @var array * @access protected */ - var $_tableize = array(); + protected $_tableize = array(); /** * Humanize cached inflections @@ -249,7 +249,7 @@ class Inflector { * @var array * @access protected */ - var $_humanize = array(); + protected $_humanize = array(); /** * Gets a reference to the Inflector object instance diff --git a/cake/libs/log/file_log.php b/cake/libs/log/file_log.php index b5d2bec1c..53cb486bc 100644 --- a/cake/libs/log/file_log.php +++ b/cake/libs/log/file_log.php @@ -34,7 +34,7 @@ class FileLog { * * @var string */ - var $_path = null; + protected $_path = null; /** * Constructs a new File Logger. diff --git a/cake/libs/model/behaviors/tree.php b/cake/libs/model/behaviors/tree.php index 349dcd5eb..6c72fde0e 100644 --- a/cake/libs/model/behaviors/tree.php +++ b/cake/libs/model/behaviors/tree.php @@ -44,7 +44,7 @@ class TreeBehavior extends ModelBehavior { * @var array * @access protected */ - var $_defaults = array( + protected $_defaults = array( 'parent' => 'parent_id', 'left' => 'lft', 'right' => 'rght', 'scope' => '1 = 1', 'type' => 'nested', '__parentChange' => false, 'recursive' => -1 ); diff --git a/cake/libs/model/connection_manager.php b/cake/libs/model/connection_manager.php index 50cfd24da..042782279 100644 --- a/cake/libs/model/connection_manager.php +++ b/cake/libs/model/connection_manager.php @@ -44,7 +44,7 @@ class ConnectionManager extends Object { * @var array * @access protected */ - var $_dataSources = array(); + protected $_dataSources = array(); /** * Contains a list of all file and class names used in Connection settings @@ -52,7 +52,7 @@ class ConnectionManager extends Object { * @var array * @access protected */ - var $_connectionsEnum = array(); + protected $_connectionsEnum = array(); /** * Constructor. diff --git a/cake/libs/model/datasources/datasource.php b/cake/libs/model/datasources/datasource.php index 74e3ffe94..c8b10a7ef 100644 --- a/cake/libs/model/datasources/datasource.php +++ b/cake/libs/model/datasources/datasource.php @@ -96,7 +96,7 @@ class DataSource extends Object { * @var array * @access protected */ - var $_result = null; + protected $_result = null; /** * Queries count. @@ -104,7 +104,7 @@ class DataSource extends Object { * @var int * @access protected */ - var $_queriesCnt = 0; + protected $_queriesCnt = 0; /** * Total duration of all queries. @@ -112,7 +112,7 @@ class DataSource extends Object { * @var unknown_type * @access protected */ - var $_queriesTime = null; + protected $_queriesTime = null; /** * Log of queries executed by this DataSource @@ -120,7 +120,7 @@ class DataSource extends Object { * @var unknown_type * @access protected */ - var $_queriesLog = array(); + protected $_queriesLog = array(); /** * Maximum number of items in query log @@ -130,7 +130,7 @@ class DataSource extends Object { * @var int Maximum number of queries in the queries log. * @access protected */ - var $_queriesLogMax = 200; + protected $_queriesLogMax = 200; /** * Caches serialzed results of executed queries @@ -138,7 +138,7 @@ class DataSource extends Object { * @var array Maximum number of queries in the queries log. * @access protected */ - var $_queryCache = array(); + protected $_queryCache = array(); /** * The default configuration of a specific DataSource @@ -146,7 +146,7 @@ class DataSource extends Object { * @var array * @access protected */ - var $_baseConfig = array(); + protected $_baseConfig = array(); /** * Holds references to descriptions loaded by the DataSource @@ -162,7 +162,7 @@ class DataSource extends Object { * @var array * @access protected */ - var $_sources = null; + protected $_sources = null; /** * A reference to the physical connection of this DataSource @@ -194,7 +194,7 @@ class DataSource extends Object { * @var boolean * @access protected */ - var $_transactionStarted = false; + protected $_transactionStarted = false; /** * Whether or not source data like available tables and schema descriptions diff --git a/cake/libs/model/datasources/dbo/dbo_mssql.php b/cake/libs/model/datasources/dbo/dbo_mssql.php index 5efce898e..bb7d5796b 100644 --- a/cake/libs/model/datasources/dbo/dbo_mssql.php +++ b/cake/libs/model/datasources/dbo/dbo_mssql.php @@ -62,7 +62,7 @@ class DboMssql extends DboSource { * * @var array */ - var $_baseConfig = array( + protected $_baseConfig = array( 'persistent' => true, 'host' => 'localhost', 'login' => 'root', @@ -96,7 +96,7 @@ class DboMssql extends DboSource { * @var array * @access protected */ - var $_commands = array( + protected $_commands = array( 'begin' => 'BEGIN TRANSACTION', 'commit' => 'COMMIT', 'rollback' => 'ROLLBACK' diff --git a/cake/libs/model/datasources/dbo/dbo_mysql.php b/cake/libs/model/datasources/dbo/dbo_mysql.php index d3b415dbf..7f5391b29 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysql.php +++ b/cake/libs/model/datasources/dbo/dbo_mysql.php @@ -53,7 +53,7 @@ class DboMysqlBase extends DboSource { * @var boolean * @access protected */ - var $_useAlias = true; + protected $_useAlias = true; /** * Index of basic SQL commands @@ -61,7 +61,7 @@ class DboMysqlBase extends DboSource { * @var array * @access protected */ - var $_commands = array( + protected $_commands = array( 'begin' => 'START TRANSACTION', 'commit' => 'COMMIT', 'rollback' => 'ROLLBACK' @@ -518,7 +518,7 @@ class DboMysql extends DboMysqlBase { * * @var array */ - var $_baseConfig = array( + protected $_baseConfig = array( 'persistent' => true, 'host' => 'localhost', 'login' => 'root', diff --git a/cake/libs/model/datasources/dbo/dbo_mysqli.php b/cake/libs/model/datasources/dbo/dbo_mysqli.php index 8d5609b86..8c8d53062 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysqli.php +++ b/cake/libs/model/datasources/dbo/dbo_mysqli.php @@ -41,7 +41,7 @@ class DboMysqli extends DboMysqlBase { * * @var array */ - var $_baseConfig = array( + protected $_baseConfig = array( 'persistent' => true, 'host' => 'localhost', 'login' => 'root', diff --git a/cake/libs/model/datasources/dbo/dbo_oracle.php b/cake/libs/model/datasources/dbo/dbo_oracle.php index 44986c0f9..e208849bf 100644 --- a/cake/libs/model/datasources/dbo/dbo_oracle.php +++ b/cake/libs/model/datasources/dbo/dbo_oracle.php @@ -46,7 +46,7 @@ class DboOracle extends DboSource { /** * Sequence names as introspected from the database */ - var $_sequences = array(); + protected $_sequences = array(); /** * Transaction in progress flag @@ -90,7 +90,7 @@ class DboOracle extends DboSource { * @var unknown_type * @access protected */ - var $_limit = -1; + protected $_limit = -1; /** * Enter description here... @@ -98,7 +98,7 @@ class DboOracle extends DboSource { * @var unknown_type * @access protected */ - var $_offset = 0; + protected $_offset = 0; /** * Enter description here... @@ -106,7 +106,7 @@ class DboOracle extends DboSource { * @var unknown_type * @access protected */ - var $_map; + protected $_map; /** * Enter description here... @@ -114,7 +114,7 @@ class DboOracle extends DboSource { * @var unknown_type * @access protected */ - var $_currentRow; + protected $_currentRow; /** * Enter description here... @@ -122,7 +122,7 @@ class DboOracle extends DboSource { * @var unknown_type * @access protected */ - var $_numRows; + protected $_numRows; /** * Enter description here... @@ -130,21 +130,21 @@ class DboOracle extends DboSource { * @var unknown_type * @access protected */ - var $_results; + protected $_results; /** * Last error issued by oci extension * * @var unknown_type */ - var $_error; + protected $_error; /** * Base configuration settings for MySQL driver * * @var array */ - var $_baseConfig = array( + protected $_baseConfig = array( 'persistent' => true, 'host' => 'localhost', 'login' => 'system', @@ -159,7 +159,7 @@ class DboOracle extends DboSource { * * @var unknown_type */ - var $_sequenceMap = array(); + protected $_sequenceMap = array(); /** * Connects to the database using options in the given configuration array. diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index 6c0f4a3d2..cf22d069b 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -42,7 +42,7 @@ class DboPostgres extends DboSource { * @var array * @access protected */ - var $_commands = array( + protected $_commands = array( 'begin' => 'BEGIN', 'commit' => 'COMMIT', 'rollback' => 'ROLLBACK' @@ -54,7 +54,7 @@ class DboPostgres extends DboSource { * @var array * @access protected */ - var $_baseConfig = array( + protected $_baseConfig = array( 'persistent' => true, 'host' => 'localhost', 'login' => 'root', @@ -103,7 +103,7 @@ class DboPostgres extends DboSource { * * @var array */ - var $_sequenceMap = array(); + protected $_sequenceMap = array(); /** * Connects to the database using options in the given configuration array. diff --git a/cake/libs/model/datasources/dbo/dbo_sqlite.php b/cake/libs/model/datasources/dbo/dbo_sqlite.php index 6d267060f..1a2850717 100644 --- a/cake/libs/model/datasources/dbo/dbo_sqlite.php +++ b/cake/libs/model/datasources/dbo/dbo_sqlite.php @@ -55,14 +55,14 @@ class DboSqlite extends DboSource { * @var array * @access protected */ - var $_queryStats = array(); + protected $_queryStats = array(); /** * Base configuration settings for SQLite driver * * @var array */ - var $_baseConfig = array( + protected $_baseConfig = array( 'persistent' => true, 'database' => null ); @@ -73,7 +73,7 @@ class DboSqlite extends DboSource { * @var array * @access protected */ - var $_commands = array( + protected $_commands = array( 'begin' => 'BEGIN TRANSACTION', 'commit' => 'COMMIT TRANSACTION', 'rollback' => 'ROLLBACK TRANSACTION' diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 9ac2a85d9..f3a479595 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -91,7 +91,7 @@ class DboSource extends DataSource { * @var array * @access protected */ - var $_commands = array( + protected $_commands = array( 'begin' => 'BEGIN', 'commit' => 'COMMIT', 'rollback' => 'ROLLBACK' diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 1faa2d0ea..8968cd57b 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -114,7 +114,7 @@ class Model extends Overloadable { * @access protected * @link http://book.cakephp.org/view/1057/Model-Attributes#_schema-1066 */ - var $_schema = null; + protected $_schema = null; /** * List of validation rules. Append entries for validation as ('field_name' => '/^perl_compat_regexp$/') @@ -363,7 +363,7 @@ class Model extends Overloadable { * @var array * @access protected */ - var $_findMethods = array( + protected $_findMethods = array( 'all' => true, 'first' => true, 'count' => true, 'neighbors' => true, 'list' => true, 'threaded' => true ); diff --git a/cake/libs/model/model_behavior.php b/cake/libs/model/model_behavior.php index 119b3d95a..9a5dc9763 100644 --- a/cake/libs/model/model_behavior.php +++ b/cake/libs/model/model_behavior.php @@ -230,7 +230,7 @@ class BehaviorCollection extends Object { * @var array * @access private */ - var $_attached = array(); + protected $_attached = array(); /** * Lists the currently-attached behavior objects which are disabled @@ -238,7 +238,7 @@ class BehaviorCollection extends Object { * @var array * @access private */ - var $_disabled = array(); + protected $_disabled = array(); /** * Keeps a list of all methods of attached behaviors diff --git a/cake/libs/router.php b/cake/libs/router.php index ee3905518..96f7fc0c9 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -1257,7 +1257,7 @@ class CakeRoute { * @var string * @access protected */ - var $_greedy = false; + protected $_greedy = false; /** * The compiled route regular expresssion @@ -1265,7 +1265,7 @@ class CakeRoute { * @var string * @access protected */ - var $_compiledRoute = null; + protected $_compiledRoute = null; /** * HTTP header shortcut map. Used for evaluating header-based route expressions. diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 7eef71d46..61e776c0f 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -87,7 +87,7 @@ class FormHelper extends AppHelper { * @var array * @access protected */ - var $_inputDefaults = array(); + protected $_inputDefaults = array(); /** * Introspects model information and extracts information related diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php index 2dbebb7d3..870aefb79 100644 --- a/cake/libs/view/helpers/html.php +++ b/cake/libs/view/helpers/html.php @@ -97,7 +97,7 @@ class HtmlHelper extends AppHelper { * @var array * @access protected */ - var $_crumbs = array(); + protected $_crumbs = array(); /** * Names of script files that have been included once @@ -112,7 +112,7 @@ class HtmlHelper extends AppHelper { * @var array * @access protected */ - var $_scriptBlockOptions = array(); + protected $_scriptBlockOptions = array(); /** * Document type definitions * diff --git a/cake/libs/view/helpers/javascript.php b/cake/libs/view/helpers/javascript.php index 4517479f3..847d6d090 100644 --- a/cake/libs/view/helpers/javascript.php +++ b/cake/libs/view/helpers/javascript.php @@ -73,7 +73,7 @@ class JavascriptHelper extends AppHelper { * @access protected * @see JavascriptHelper::codeBlock() */ - var $_blockOptions = array(); + protected $_blockOptions = array(); /** * Caches events written by event() for output at the end of page execution @@ -82,7 +82,7 @@ class JavascriptHelper extends AppHelper { * @access protected * @see JavascriptHelper::event() */ - var $_cachedEvents = array(); + protected $_cachedEvents = array(); /** * Indicates whether generated events should be cached for later output (can be written at the @@ -93,7 +93,7 @@ class JavascriptHelper extends AppHelper { * @see JavascriptHelper::event() * @see JavascriptHelper::writeEvents() */ - var $_cacheEvents = false; + protected $_cacheEvents = false; /** * Indicates whether cached events should be written to an external file @@ -103,7 +103,7 @@ class JavascriptHelper extends AppHelper { * @see JavascriptHelper::event() * @see JavascriptHelper::writeEvents() */ - var $_cacheToFile = false; + protected $_cacheToFile = false; /** * Indicates whether *all* generated JavaScript should be cached for later output @@ -113,7 +113,7 @@ class JavascriptHelper extends AppHelper { * @see JavascriptHelper::codeBlock() * @see JavascriptHelper::blockEnd() */ - var $_cacheAll = false; + protected $_cacheAll = false; /** * Contains event rules attached with CSS selectors. Used with the event:Selectors JavaScript @@ -124,7 +124,7 @@ class JavascriptHelper extends AppHelper { * @see JavascriptHelper::event() * @link http://alternateidea.com/event-selectors/ */ - var $_rules = array(); + protected $_rules = array(); /** * @var string diff --git a/cake/libs/view/helpers/jquery_engine.php b/cake/libs/view/helpers/jquery_engine.php index ea14fb8f1..235b0e0c5 100644 --- a/cake/libs/view/helpers/jquery_engine.php +++ b/cake/libs/view/helpers/jquery_engine.php @@ -31,7 +31,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper { * @var array * @access protected */ - var $_optionMap = array( + protected $_optionMap = array( 'request' => array( 'type' => 'dataType', 'before' => 'beforeSend', @@ -60,7 +60,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper { * @var string * @access protected */ - var $_callbackArguments = array( + protected $_callbackArguments = array( 'slider' => array( 'start' => 'event, ui', 'slide' => 'event, ui', diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index cf6cb9947..3ec992a1f 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -460,7 +460,7 @@ class JsBaseEngineHelper extends AppHelper { * @var array * @access protected */ - var $_optionMap = array(); + protected $_optionMap = array(); /** * An array of lowercase method names in the Engine that are buffered unless otherwise disabled. @@ -477,7 +477,7 @@ class JsBaseEngineHelper extends AppHelper { * @var array * @access protected */ - var $_callbackArguments = array(); + protected $_callbackArguments = array(); /** * Constructor. diff --git a/cake/libs/view/helpers/mootools_engine.php b/cake/libs/view/helpers/mootools_engine.php index 4a67cc98b..b0919f418 100644 --- a/cake/libs/view/helpers/mootools_engine.php +++ b/cake/libs/view/helpers/mootools_engine.php @@ -33,7 +33,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper { * * @var array */ - var $_optionMap = array( + protected $_optionMap = array( 'request' => array( 'complete' => 'onComplete', 'success' => 'onSuccess', @@ -71,7 +71,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper { * * @var array */ - var $_callbackArguments = array( + protected $_callbackArguments = array( 'slider' => array( 'onTick' => 'position', 'onChange' => 'step', diff --git a/cake/libs/view/helpers/number.php b/cake/libs/view/helpers/number.php index 77c0277f3..6ebf5a2c2 100644 --- a/cake/libs/view/helpers/number.php +++ b/cake/libs/view/helpers/number.php @@ -37,7 +37,7 @@ class NumberHelper extends AppHelper { * @var array * @access protected */ - var $_currencies = array( + protected $_currencies = array( 'USD' => array( 'before' => '$', 'after' => 'c', 'zero' => 0, 'places' => 2, 'thousands' => ',', 'decimals' => '.', 'negative' => '()', 'escape' => true @@ -58,7 +58,7 @@ class NumberHelper extends AppHelper { * @var array * @access protected */ - var $_currencyDefaults = array( + protected $_currencyDefaults = array( 'before'=>'', 'after' => '', 'zero' => '0', 'places' => 2, 'thousands' => ',', 'decimals' => '.','negative' => '()', 'escape' => true ); diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index aca981388..93c6afb05 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -47,7 +47,7 @@ class PaginatorHelper extends AppHelper { * * @var string */ - var $_ajaxHelperClass = 'Js'; + protected $_ajaxHelperClass = 'Js'; /** * Holds the default options for pagination links diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php index b838afaca..9031adb4a 100644 --- a/cake/libs/view/helpers/prototype_engine.php +++ b/cake/libs/view/helpers/prototype_engine.php @@ -28,14 +28,14 @@ class PrototypeEngineHelper extends JsBaseEngineHelper { * * @var boolean */ - var $_multiple = false; + protected $_multiple = false; /** * Option mappings for Prototype * * @var array */ - var $_optionMap = array( + protected $_optionMap = array( 'request' => array( 'async' => 'asynchronous', 'data' => 'parameters', @@ -75,7 +75,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper { * * @var array */ - var $_callbackArguments = array( + protected $_callbackArguments = array( 'slider' => array( 'onSlide' => 'value', 'onChange' => 'value', diff --git a/cake/libs/view/media.php b/cake/libs/view/media.php index 8e88fb321..ce77c4aba 100644 --- a/cake/libs/view/media.php +++ b/cake/libs/view/media.php @@ -88,7 +88,7 @@ class MediaView extends View { * @var array * @access protected */ - var $_headers = array(); + protected $_headers = array(); /** * Constructor diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php index 122db1b76..2dab41a6f 100644 --- a/cake/tests/cases/libs/controller/components/auth.test.php +++ b/cake/tests/cases/libs/controller/components/auth.test.php @@ -45,7 +45,7 @@ class TestAuthComponent extends AuthComponent { * @var bool true * @access protected */ - var $_loggedIn = true; + protected $_loggedIn = true; /** * stop method diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php index b406448f7..8c28bc05c 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php @@ -159,7 +159,7 @@ class MssqlTestModel extends Model { * @var array * @access protected */ - var $_schema = array( + protected $_schema = array( 'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8', 'key' => 'primary'), 'client_id' => array('type' => 'integer', 'null' => '', 'default' => '0', 'length' => '11'), 'name' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), @@ -258,7 +258,7 @@ class MssqlClientTestModel extends Model { * @var array * @access protected */ - var $_schema = array( + protected $_schema = array( 'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8', 'key' => 'primary'), 'name' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), 'email' => array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'), diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index 096f2eeca..f5aafa3a0 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -53,7 +53,7 @@ class TestModel extends CakeTestModel { * @var array * @access protected */ - var $_schema = array( + protected $_schema = array( 'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), 'client_id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '11'), 'name' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), diff --git a/cake/tests/cases/libs/model/models.php b/cake/tests/cases/libs/model/models.php index 33b2a6720..a324d30e5 100644 --- a/cake/tests/cases/libs/model/models.php +++ b/cake/tests/cases/libs/model/models.php @@ -53,7 +53,7 @@ class Test extends CakeTestModel { * @var array * @access protected */ - var $_schema = array( + protected $_schema = array( 'id'=> array('type' => 'integer', 'null' => '', 'default' => '1', 'length' => '8', 'key'=>'primary'), 'name'=> array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), 'email'=> array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'), @@ -101,7 +101,7 @@ class TestAlias extends CakeTestModel { * @var array * @access protected */ - var $_schema = array( + protected $_schema = array( 'id'=> array('type' => 'integer', 'null' => '', 'default' => '1', 'length' => '8', 'key'=>'primary'), 'name'=> array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), 'email'=> array('type' => 'string', 'null' => '1', 'default' => '', 'length' => '155'), @@ -141,7 +141,7 @@ class TestValidate extends CakeTestModel { * @var array * @access protected */ - var $_schema = array( + protected $_schema = array( 'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), 'title' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), 'body' => array('type' => 'string', 'null' => '1', 'default' => '', 'length' => ''), @@ -2168,7 +2168,7 @@ class ValidationTest1 extends CakeTestModel { * @var array * @access protected */ - var $_schema = array(); + protected $_schema = array(); /** * validate property diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 6948e1fc8..58885fbc7 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -84,7 +84,7 @@ class Contact extends CakeTestModel { * @var array * @access public */ - var $_schema = array( + protected $_schema = array( 'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), 'name' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), 'email' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), @@ -161,7 +161,7 @@ class ContactTagsContact extends CakeTestModel { * @var array * @access public */ - var $_schema = array( + protected $_schema = array( 'contact_id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), 'contact_tag_id' => array( 'type' => 'integer', 'null' => '', 'default' => '', 'length' => '8' @@ -239,7 +239,7 @@ class ContactTag extends Model { * @var array * @access protected */ - var $_schema = array( + protected $_schema = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '8'), 'name' => array('type' => 'string', 'null' => false, 'default' => '', 'length' => '255'), 'created' => array('type' => 'date', 'null' => true, 'default' => '', 'length' => ''), @@ -295,7 +295,7 @@ class UserForm extends CakeTestModel { * @var array * @access protected */ - var $_schema = array( + protected $_schema = array( 'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), 'published' => array('type' => 'date', 'null' => true, 'default' => null, 'length' => null), 'other' => array('type' => 'text', 'null' => true, 'default' => null, 'length' => null), @@ -362,7 +362,7 @@ class OpenidUrl extends CakeTestModel { * @var array * @access protected */ - var $_schema = array( + protected $_schema = array( 'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), 'user_form_id' => array( 'type' => 'user_form_id', 'null' => '', 'default' => '', 'length' => '8' @@ -430,7 +430,7 @@ class ValidateUser extends CakeTestModel { * @var array * @access protected */ - var $_schema = array( + protected $_schema = array( 'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), 'name' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), 'email' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), @@ -481,7 +481,7 @@ class ValidateProfile extends CakeTestModel { * @var array * @access protected */ - var $_schema = array( + protected $_schema = array( 'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), 'user_id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), 'full_name' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), @@ -569,7 +569,7 @@ class ValidateItem extends CakeTestModel { * @var array * @access protected */ - var $_schema = array( + protected $_schema = array( 'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), 'profile_id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), 'name' => array('type' => 'text', 'null' => '', 'default' => '', 'length' => '255'), diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/cake/tests/cases/libs/view/helpers/html.test.php index 17011ae5c..6d5283409 100644 --- a/cake/tests/cases/libs/view/helpers/html.test.php +++ b/cake/tests/cases/libs/view/helpers/html.test.php @@ -81,7 +81,7 @@ class HtmlHelperTest extends CakeTestCase { * @var string * @access protected */ - var $_appEncoding; + protected $_appEncoding; /** * Backup of asset configuration settings @@ -89,7 +89,7 @@ class HtmlHelperTest extends CakeTestCase { * @var string * @access protected */ - var $_asset; + protected $_asset; /** * Backup of debug configuration setting @@ -97,7 +97,7 @@ class HtmlHelperTest extends CakeTestCase { * @var integer * @access protected */ - var $_debug; + protected $_debug; /** * setUp method diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index 292bbb19e..ab31eab2c 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -26,7 +26,7 @@ Mock::generate('View', 'JsHelperMockView'); class OptionEngineHelper extends JsBaseEngineHelper { - var $_optionMap = array( + protected $_optionMap = array( 'request' => array( 'complete' => 'success', 'request' => 'beforeSend', diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index f4ea8ed5e..e83e9f343 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -117,7 +117,7 @@ class CakeTestCase extends UnitTestCase { * @var array * @access protected */ - var $_fixtureClassMap = array(); + protected $_fixtureClassMap = array(); /** * truncated property diff --git a/cake/tests/lib/cake_test_suite_dispatcher.php b/cake/tests/lib/cake_test_suite_dispatcher.php index 531448d7c..27cd06be3 100644 --- a/cake/tests/lib/cake_test_suite_dispatcher.php +++ b/cake/tests/lib/cake_test_suite_dispatcher.php @@ -46,7 +46,7 @@ class CakeTestSuiteDispatcher { * * @var string */ - var $_managerClass = 'TestManager'; + protected $_managerClass = 'TestManager'; /** * The Instance of the Manager being used. @@ -60,14 +60,14 @@ class CakeTestSuiteDispatcher { * * @var string */ - var $_baseUrl; + protected $_baseUrl; /** * Base dir of the request. Used for accessing assets. * * @var string */ - var $_baseDir; + protected $_baseDir; /** * constructor diff --git a/cake/tests/lib/reporter/cake_base_reporter.php b/cake/tests/lib/reporter/cake_base_reporter.php index 0c1b12d14..cc4b2cd60 100644 --- a/cake/tests/lib/reporter/cake_base_reporter.php +++ b/cake/tests/lib/reporter/cake_base_reporter.php @@ -32,7 +32,7 @@ class CakeBaseReporter extends SimpleReporter { * @var integer * @access protected */ - var $_timeStart = 0; + protected $_timeStart = 0; /** * Time the test runs ended @@ -40,7 +40,7 @@ class CakeBaseReporter extends SimpleReporter { * @var integer * @access protected */ - var $_timeEnd = 0; + protected $_timeEnd = 0; /** * Duration of all test methods. @@ -48,7 +48,7 @@ class CakeBaseReporter extends SimpleReporter { * @var integer * @access protected */ - var $_timeDuration = 0; + protected $_timeDuration = 0; /** * Array of request parameters. Usually parsed GET params. @@ -63,7 +63,7 @@ class CakeBaseReporter extends SimpleReporter { * @var string * @access protected */ - var $_characterSet; + protected $_characterSet; /** * Does nothing yet. The first output will diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index 5bfbc6279..92e6e7850 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -35,14 +35,14 @@ class TestManager { * * @var string */ - var $_testExtension = '.test.php'; + protected $_testExtension = '.test.php'; /** * Extension suffix for group test case files. * * @var string */ - var $_groupExtension = '.group.php'; + protected $_groupExtension = '.group.php'; /** * Is this test an AppTest? From 4c93fc9e52565ac6a2c5a9782a11ef1ceee384b0 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Sun, 4 Apr 2010 16:46:01 +1000 Subject: [PATCH 1872/2083] Uopdate default bake template to assign public to functions and variables. --- .../default/actions/controller_actions.ctp | 10 +++++----- .../templates/default/classes/controller.ctp | 6 +++--- .../templates/default/classes/fixture.ctp | 10 +++++----- .../templates/default/classes/model.ctp | 18 +++++++++--------- .../console/templates/default/classes/test.ctp | 12 ++++++------ .../skel/controllers/pages_controller.php | 8 ++++---- 6 files changed, 32 insertions(+), 32 deletions(-) diff --git a/cake/console/templates/default/actions/controller_actions.ctp b/cake/console/templates/default/actions/controller_actions.ctp index 4be40637f..c5de02596 100644 --- a/cake/console/templates/default/actions/controller_actions.ctp +++ b/cake/console/templates/default/actions/controller_actions.ctp @@ -19,12 +19,12 @@ */ ?> - function <?php echo $admin ?>index() { + public function <?php echo $admin ?>index() { $this-><?php echo $currentModelName ?>->recursive = 0; $this->set('<?php echo $pluralName ?>', $this->paginate()); } - function <?php echo $admin ?>view($id = null) { + public function <?php echo $admin ?>view($id = null) { if (!$id) { <?php if ($wannaUseSession): ?> $this->Session->setFlash(sprintf(__('Invalid %s', true), '<?php echo strtolower($singularHumanName) ?>')); @@ -37,7 +37,7 @@ } <?php $compact = array(); ?> - function <?php echo $admin ?>add() { + public function <?php echo $admin ?>add() { if (!empty($this->data)) { $this-><?php echo $currentModelName; ?>->create(); if ($this-><?php echo $currentModelName; ?>->save($this->data)) { @@ -71,7 +71,7 @@ } <?php $compact = array(); ?> - function <?php echo $admin; ?>edit($id = null) { + public function <?php echo $admin; ?>edit($id = null) { if (!$id && empty($this->data)) { <?php if ($wannaUseSession): ?> $this->Session->setFlash(sprintf(__('Invalid %s', true), '<?php echo strtolower($singularHumanName); ?>')); @@ -114,7 +114,7 @@ ?> } - function <?php echo $admin; ?>delete($id = null) { + public function <?php echo $admin; ?>delete($id = null) { if (!$id) { <?php if ($wannaUseSession): ?> $this->Session->setFlash(sprintf(__('Invalid id for %s', true), '<?php echo strtolower($singularHumanName); ?>')); diff --git a/cake/console/templates/default/classes/controller.ctp b/cake/console/templates/default/classes/controller.ctp index e727fc26d..2c8499e65 100644 --- a/cake/console/templates/default/classes/controller.ctp +++ b/cake/console/templates/default/classes/controller.ctp @@ -24,9 +24,9 @@ echo "<?php\n"; ?> class <?php echo $controllerName; ?>Controller extends <?php echo $plugin; ?>AppController { - var $name = '<?php echo $controllerName; ?>'; + public $name = '<?php echo $controllerName; ?>'; <?php if ($isScaffold): ?> - var $scaffold; + public $scaffold; <?php else: ?> <?php if (count($helpers)): @@ -42,7 +42,7 @@ if (count($helpers)): endif; if (count($components)): - echo "\tvar \$components = array("; + echo "\tpublic \$components = array("; for ($i = 0, $len = count($components); $i < $len; $i++): if ($i != $len - 1): echo "'" . Inflector::camelize($components[$i]) . "', "; diff --git a/cake/console/templates/default/classes/fixture.ctp b/cake/console/templates/default/classes/fixture.ctp index 0f516e101..26bb36dc0 100644 --- a/cake/console/templates/default/classes/fixture.ctp +++ b/cake/console/templates/default/classes/fixture.ctp @@ -23,20 +23,20 @@ <?php echo '<?php' . "\n"; ?> /* <?php echo $model; ?> Fixture generated on: <?php echo date('Y-m-d H:m:s') . " : ". time(); ?> */ class <?php echo $model; ?>Fixture extends CakeTestFixture { - var $name = '<?php echo $model; ?>'; + public $name = '<?php echo $model; ?>'; <?php if ($table): ?> - var $table = '<?php echo $table; ?>'; + public $table = '<?php echo $table; ?>'; <?php endif; ?> <?php if ($import): ?> - var $import = <?php echo $import; ?>; + public $import = <?php echo $import; ?>; <?php endif; ?> <?php if ($schema): ?> - var $fields = <?php echo $schema; ?>; + public $fields = <?php echo $schema; ?>; <?php endif;?> <?php if ($records): ?> - var $records = <?php echo $records; ?>; + public $records = <?php echo $records; ?>; <?php endif;?> } <?php echo '?>'; ?> \ No newline at end of file diff --git a/cake/console/templates/default/classes/model.ctp b/cake/console/templates/default/classes/model.ctp index 7ac659b5b..cc1d96e69 100644 --- a/cake/console/templates/default/classes/model.ctp +++ b/cake/console/templates/default/classes/model.ctp @@ -22,23 +22,23 @@ echo "<?php\n"; ?> class <?php echo $name ?> extends <?php echo $plugin; ?>AppModel { - var $name = '<?php echo $name; ?>'; + public $name = '<?php echo $name; ?>'; <?php if ($useDbConfig != 'default'): ?> - var $useDbConfig = '<?php echo $useDbConfig; ?>'; + public $useDbConfig = '<?php echo $useDbConfig; ?>'; <?php endif;?> <?php if ($useTable && $useTable !== Inflector::tableize($name)): $table = "'$useTable'"; - echo "\tvar \$useTable = $table;\n"; + echo "\tpublic \$useTable = $table;\n"; endif; if ($primaryKey !== 'id'): ?> - var $primaryKey = '<?php echo $primaryKey; ?>'; + public $primaryKey = '<?php echo $primaryKey; ?>'; <?php endif; if ($displayField): ?> - var $displayField = '<?php echo $displayField; ?>'; + public $displayField = '<?php echo $displayField; ?>'; <?php endif; if (!empty($validate)): - echo "\tvar \$validate = array(\n"; + echo "\tpublic \$validate = array(\n"; foreach ($validate as $field => $validations): echo "\t\t'$field' => array(\n"; foreach ($validations as $key => $validator): @@ -68,7 +68,7 @@ endforeach; foreach (array('hasOne', 'belongsTo') as $assocType): if (!empty($associations[$assocType])): $typeCount = count($associations[$assocType]); - echo "\n\tvar \$$assocType = array("; + echo "\n\tpublic \$$assocType = array("; foreach ($associations[$assocType] as $i => $relation): $out = "\n\t\t'{$relation['alias']}' => array(\n"; $out .= "\t\t\t'className' => '{$relation['className']}',\n"; @@ -88,7 +88,7 @@ endforeach; if (!empty($associations['hasMany'])): $belongsToCount = count($associations['hasMany']); - echo "\n\tvar \$hasMany = array("; + echo "\n\tpublic \$hasMany = array("; foreach ($associations['hasMany'] as $i => $relation): $out = "\n\t\t'{$relation['alias']}' => array(\n"; $out .= "\t\t\t'className' => '{$relation['className']}',\n"; @@ -113,7 +113,7 @@ endif; if (!empty($associations['hasAndBelongsToMany'])): $habtmCount = count($associations['hasAndBelongsToMany']); - echo "\n\tvar \$hasAndBelongsToMany = array("; + echo "\n\tpublic \$hasAndBelongsToMany = array("; foreach ($associations['hasAndBelongsToMany'] as $i => $relation): $out = "\n\t\t'{$relation['alias']}' => array(\n"; $out .= "\t\t\t'className' => '{$relation['className']}',\n"; diff --git a/cake/console/templates/default/classes/test.ctp b/cake/console/templates/default/classes/test.ctp index a3f96931b..b3412b130 100644 --- a/cake/console/templates/default/classes/test.ctp +++ b/cake/console/templates/default/classes/test.ctp @@ -25,9 +25,9 @@ App::import('<?php echo $type; ?>', '<?php echo $plugin . $className;?>'); <?php if ($mock and strtolower($type) == 'controller'): ?> class Test<?php echo $fullClassName; ?> extends <?php echo $fullClassName; ?> { - var $autoRender = false; + public $autoRender = false; - function redirect($url, $status = null, $exit = true) { + public function redirect($url, $status = null, $exit = true) { $this->redirectUrl = $url; } } @@ -35,20 +35,20 @@ class Test<?php echo $fullClassName; ?> extends <?php echo $fullClassName; ?> { <?php endif; ?> class <?php echo $fullClassName; ?>TestCase extends CakeTestCase { <?php if (!empty($fixtures)): ?> - var $fixtures = array('<?php echo join("', '", $fixtures); ?>'); + public $fixtures = array('<?php echo join("', '", $fixtures); ?>'); <?php endif; ?> - function startTest() { + public function startTest() { $this-><?php echo $className . ' =& ' . $construction; ?> } - function endTest() { + public function endTest() { unset($this-><?php echo $className;?>); ClassRegistry::flush(); } <?php foreach ($methods as $method): ?> - function test<?php echo Inflector::classify($method); ?>() { + public function test<?php echo Inflector::classify($method); ?>() { } diff --git a/cake/console/templates/skel/controllers/pages_controller.php b/cake/console/templates/skel/controllers/pages_controller.php index 795202c93..29ffb561f 100644 --- a/cake/console/templates/skel/controllers/pages_controller.php +++ b/cake/console/templates/skel/controllers/pages_controller.php @@ -36,7 +36,7 @@ class PagesController extends AppController { * @var string * @access public */ - var $name = 'Pages'; + public $name = 'Pages'; /** * Default helper @@ -44,7 +44,7 @@ class PagesController extends AppController { * @var array * @access public */ - var $helpers = array('Html'); + public $helpers = array('Html'); /** * This controller does not use a model @@ -52,7 +52,7 @@ class PagesController extends AppController { * @var array * @access public */ - var $uses = array(); + public $uses = array(); /** * Displays a view @@ -60,7 +60,7 @@ class PagesController extends AppController { * @param mixed What page to display * @access public */ - function display() { + public function display() { $path = func_get_args(); $count = count($path); From 850ca02bb64d86bb874f79b332ea33d4499c8819 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Sun, 4 Apr 2010 17:14:00 +1000 Subject: [PATCH 1873/2083] Changed all public 'var' declarations to be 'public $var' --- cake/console/cake.php | 22 +- cake/console/error.php | 4 +- cake/console/libs/acl.php | 8 +- cake/console/libs/api.php | 2 +- cake/console/libs/bake.php | 2 +- cake/console/libs/console.php | 6 +- cake/console/libs/i18n.php | 4 +- cake/console/libs/shell.php | 32 +- cake/console/libs/tasks/bake.php | 6 +- cake/console/libs/tasks/controller.php | 4 +- cake/console/libs/tasks/db_config.php | 4 +- cake/console/libs/tasks/fixture.php | 6 +- cake/console/libs/tasks/model.php | 6 +- cake/console/libs/tasks/plugin.php | 4 +- cake/console/libs/tasks/project.php | 2 +- cake/console/libs/tasks/template.php | 4 +- cake/console/libs/tasks/test.php | 6 +- cake/console/libs/tasks/view.php | 14 +- cake/console/libs/testsuite.php | 12 +- cake/console/templates/skel/config/core.php | 4 +- .../skel/config/database.php.default | 4 +- .../templates/skel/config/schema/db_acl.php | 8 +- .../templates/skel/config/schema/i18n.php | 4 +- .../templates/skel/config/schema/sessions.php | 4 +- cake/dispatcher.php | 8 +- cake/libs/cache.php | 2 +- cake/libs/cache/file.php | 2 +- cake/libs/cache/memcache.php | 2 +- cake/libs/cache/xcache.php | 2 +- cake/libs/cake_session.php | 20 +- cake/libs/cake_socket.php | 10 +- cake/libs/configure.php | 32 +- cake/libs/controller/components/acl.php | 2 +- cake/libs/controller/components/auth.php | 42 +- cake/libs/controller/components/cookie.php | 18 +- cake/libs/controller/components/email.php | 48 +- .../controller/components/request_handler.php | 10 +- cake/libs/controller/components/security.php | 30 +- cake/libs/controller/controller.php | 72 +-- cake/libs/controller/pages_controller.php | 6 +- cake/libs/controller/scaffold.php | 26 +- cake/libs/debugger.php | 4 +- cake/libs/error.php | 6 +- cake/libs/file.php | 12 +- cake/libs/folder.php | 6 +- cake/libs/http_socket.php | 12 +- cake/libs/i18n.php | 6 +- cake/libs/l10n.php | 16 +- cake/libs/magic_db.php | 8 +- cake/libs/model/behaviors/containable.php | 4 +- cake/libs/model/behaviors/translate.php | 8 +- cake/libs/model/behaviors/tree.php | 2 +- cake/libs/model/cake_schema.php | 12 +- cake/libs/model/connection_manager.php | 2 +- cake/libs/model/datasources/datasource.php | 24 +- cake/libs/model/datasources/dbo/dbo_mssql.php | 8 +- cake/libs/model/datasources/dbo/dbo_mysql.php | 14 +- .../libs/model/datasources/dbo/dbo_mysqli.php | 2 +- .../libs/model/datasources/dbo/dbo_oracle.php | 8 +- .../model/datasources/dbo/dbo_postgres.php | 8 +- .../libs/model/datasources/dbo/dbo_sqlite.php | 10 +- cake/libs/model/datasources/dbo_source.php | 14 +- cake/libs/model/db_acl.php | 26 +- cake/libs/model/model.php | 66 +- cake/libs/model/model_behavior.php | 6 +- cake/libs/router.php | 12 +- cake/libs/security.php | 2 +- cake/libs/validation.php | 12 +- cake/libs/view/errors/missing_action.ctp | 2 +- cake/libs/view/errors/missing_controller.ctp | 2 +- cake/libs/view/errors/missing_model.ctp | 2 +- cake/libs/view/helper.php | 26 +- cake/libs/view/helpers/ajax.php | 22 +- cake/libs/view/helpers/cache.php | 2 +- cake/libs/view/helpers/form.php | 10 +- cake/libs/view/helpers/html.php | 2 +- cake/libs/view/helpers/javascript.php | 8 +- cake/libs/view/helpers/jquery_engine.php | 2 +- cake/libs/view/helpers/js.php | 12 +- cake/libs/view/helpers/paginator.php | 6 +- cake/libs/view/helpers/rss.php | 18 +- cake/libs/view/helpers/session.php | 2 +- cake/libs/view/helpers/xml.php | 2 +- cake/libs/view/media.php | 2 +- cake/libs/view/view.php | 60 +- cake/libs/xml.php | 26 +- cake/tests/cases/console/cake.test.php | 10 +- cake/tests/cases/console/libs/acl.test.php | 2 +- cake/tests/cases/console/libs/bake.test.php | 4 +- cake/tests/cases/console/libs/schema.test.php | 10 +- cake/tests/cases/console/libs/shell.test.php | 6 +- .../console/libs/tasks/controller.test.php | 8 +- .../console/libs/tasks/db_config.test.php | 4 +- .../cases/console/libs/tasks/fixture.test.php | 2 +- .../cases/console/libs/tasks/model.test.php | 2 +- .../cases/console/libs/tasks/test.test.php | 26 +- .../cases/console/libs/tasks/view.test.php | 16 +- cake/tests/cases/dispatcher.test.php | 40 +- cake/tests/cases/libs/cache/file.test.php | 2 +- cake/tests/cases/libs/cake_session.test.php | 2 +- .../cases/libs/cake_test_fixture.test.php | 20 +- cake/tests/cases/libs/class_registry.test.php | 14 +- .../cases/libs/controller/component.test.php | 30 +- .../libs/controller/components/acl.test.php | 28 +- .../libs/controller/components/auth.test.php | 36 +- .../controller/components/cookie.test.php | 4 +- .../libs/controller/components/email.test.php | 12 +- .../components/request_handler.test.php | 10 +- .../controller/components/security.test.php | 12 +- .../controller/components/session.test.php | 4 +- .../cases/libs/controller/controller.test.php | 54 +- .../controller/controller_merge_vars.test.php | 16 +- .../cases/libs/controller/scaffold.test.php | 32 +- cake/tests/cases/libs/error.test.php | 16 +- cake/tests/cases/libs/file.test.php | 2 +- cake/tests/cases/libs/http_socket.test.php | 4 +- cake/tests/cases/libs/inflector.test.php | 2 +- cake/tests/cases/libs/magic_db.test.php | 4 +- .../cases/libs/model/behaviors/acl.test.php | 28 +- .../libs/model/behaviors/containable.test.php | 2 +- .../libs/model/behaviors/translate.test.php | 4 +- .../cases/libs/model/behaviors/tree.test.php | 20 +- .../cases/libs/model/cake_schema.test.php | 62 +- .../model/datasources/dbo/dbo_mssql.test.php | 22 +- .../model/datasources/dbo/dbo_mysql.test.php | 12 +- .../model/datasources/dbo/dbo_mysqli.test.php | 12 +- .../model/datasources/dbo/dbo_oracle.test.php | 2 +- .../datasources/dbo/dbo_postgres.test.php | 20 +- .../model/datasources/dbo/dbo_sqlite.test.php | 10 +- .../model/datasources/dbo_source.test.php | 156 ++--- cake/tests/cases/libs/model/db_acl.test.php | 36 +- cake/tests/cases/libs/model/model.test.php | 4 +- .../cases/libs/model/model_behavior.test.php | 4 +- cake/tests/cases/libs/model/models.php | 588 +++++++++--------- cake/tests/cases/libs/object.test.php | 22 +- cake/tests/cases/libs/sanitize.test.php | 12 +- cake/tests/cases/libs/security.test.php | 2 +- cake/tests/cases/libs/validation.test.php | 2 +- cake/tests/cases/libs/view/helper.test.php | 10 +- .../cases/libs/view/helpers/ajax.test.php | 14 +- .../cases/libs/view/helpers/cache.test.php | 2 +- .../cases/libs/view/helpers/form.test.php | 76 +-- .../cases/libs/view/helpers/html.test.php | 10 +- .../libs/view/helpers/javascript.test.php | 12 +- .../tests/cases/libs/view/helpers/js.test.php | 4 +- .../cases/libs/view/helpers/number.test.php | 2 +- .../cases/libs/view/helpers/text.test.php | 2 +- .../cases/libs/view/helpers/xml.test.php | 2 +- cake/tests/cases/libs/view/theme.test.php | 2 +- cake/tests/cases/libs/view/view.test.php | 6 +- cake/tests/fixtures/account_fixture.php | 8 +- cake/tests/fixtures/aco_action_fixture.php | 6 +- cake/tests/fixtures/aco_fixture.php | 6 +- cake/tests/fixtures/aco_two_fixture.php | 6 +- cake/tests/fixtures/ad_fixture.php | 6 +- cake/tests/fixtures/advertisement_fixture.php | 6 +- cake/tests/fixtures/after_tree_fixture.php | 6 +- .../fixtures/another_article_fixture.php | 6 +- cake/tests/fixtures/apple_fixture.php | 6 +- cake/tests/fixtures/aro_fixture.php | 6 +- cake/tests/fixtures/aro_two_fixture.php | 6 +- cake/tests/fixtures/aros_aco_fixture.php | 6 +- cake/tests/fixtures/aros_aco_two_fixture.php | 6 +- .../fixtures/article_featured_fixture.php | 6 +- .../article_featureds_tags_fixture.php | 4 +- cake/tests/fixtures/article_fixture.php | 6 +- cake/tests/fixtures/articles_tag_fixture.php | 6 +- cake/tests/fixtures/attachment_fixture.php | 6 +- .../auth_user_custom_field_fixture.php | 6 +- cake/tests/fixtures/auth_user_fixture.php | 6 +- cake/tests/fixtures/author_fixture.php | 6 +- cake/tests/fixtures/basket_fixture.php | 6 +- cake/tests/fixtures/bid_fixture.php | 6 +- cake/tests/fixtures/binary_test_fixture.php | 6 +- cake/tests/fixtures/book_fixture.php | 6 +- .../fixtures/cache_test_model_fixture.php | 4 +- cake/tests/fixtures/callback_fixture.php | 6 +- cake/tests/fixtures/campaign_fixture.php | 6 +- cake/tests/fixtures/category_fixture.php | 6 +- .../fixtures/category_thread_fixture.php | 6 +- cake/tests/fixtures/cd_fixture.php | 6 +- cake/tests/fixtures/comment_fixture.php | 6 +- .../fixtures/content_account_fixture.php | 8 +- cake/tests/fixtures/content_fixture.php | 8 +- .../fixtures/counter_cache_post_fixture.php | 6 +- ...e_post_nonstandard_primary_key_fixture.php | 6 +- .../fixtures/counter_cache_user_fixture.php | 6 +- ...e_user_nonstandard_primary_key_fixture.php | 6 +- cake/tests/fixtures/data_test_fixture.php | 6 +- cake/tests/fixtures/datatype_fixture.php | 6 +- cake/tests/fixtures/dependency_fixture.php | 6 +- cake/tests/fixtures/device_fixture.php | 6 +- .../fixtures/device_type_category_fixture.php | 6 +- cake/tests/fixtures/device_type_fixture.php | 6 +- .../fixtures/document_directory_fixture.php | 6 +- cake/tests/fixtures/document_fixture.php | 6 +- .../exterior_type_category_fixture.php | 6 +- cake/tests/fixtures/feature_set_fixture.php | 6 +- cake/tests/fixtures/featured_fixture.php | 6 +- cake/tests/fixtures/film_file_fixture.php | 6 +- cake/tests/fixtures/flag_tree_fixture.php | 4 +- cake/tests/fixtures/fruit_fixture.php | 6 +- .../fixtures/fruits_uuid_tag_fixture.php | 6 +- .../fixtures/group_update_all_fixture.php | 8 +- cake/tests/fixtures/home_fixture.php | 6 +- cake/tests/fixtures/image_fixture.php | 6 +- cake/tests/fixtures/item_fixture.php | 6 +- .../fixtures/items_portfolio_fixture.php | 6 +- cake/tests/fixtures/join_a_b_fixture.php | 6 +- cake/tests/fixtures/join_a_c_fixture.php | 6 +- cake/tests/fixtures/join_a_fixture.php | 6 +- cake/tests/fixtures/join_b_fixture.php | 6 +- cake/tests/fixtures/join_c_fixture.php | 6 +- cake/tests/fixtures/join_thing_fixture.php | 6 +- cake/tests/fixtures/message_fixture.php | 6 +- .../my_categories_my_products_fixture.php | 6 +- .../my_categories_my_users_fixture.php | 6 +- cake/tests/fixtures/my_category_fixture.php | 6 +- cake/tests/fixtures/my_product_fixture.php | 6 +- cake/tests/fixtures/my_user_fixture.php | 6 +- cake/tests/fixtures/node_fixture.php | 6 +- cake/tests/fixtures/number_tree_fixture.php | 4 +- .../fixtures/number_tree_two_fixture.php | 4 +- .../fixtures/numeric_article_fixture.php | 6 +- .../fixtures/overall_favorite_fixture.php | 6 +- cake/tests/fixtures/person_fixture.php | 6 +- cake/tests/fixtures/portfolio_fixture.php | 6 +- cake/tests/fixtures/post_fixture.php | 6 +- cake/tests/fixtures/posts_tag_fixture.php | 6 +- cake/tests/fixtures/primary_model_fixture.php | 6 +- cake/tests/fixtures/product_fixture.php | 6 +- .../fixtures/product_update_all_fixture.php | 8 +- cake/tests/fixtures/project_fixture.php | 6 +- cake/tests/fixtures/sample_fixture.php | 6 +- .../fixtures/secondary_model_fixture.php | 6 +- cake/tests/fixtures/session_fixture.php | 8 +- .../tests/fixtures/something_else_fixture.php | 6 +- cake/tests/fixtures/something_fixture.php | 6 +- cake/tests/fixtures/stories_tag_fixture.php | 6 +- cake/tests/fixtures/story_fixture.php | 6 +- cake/tests/fixtures/syfile_fixture.php | 6 +- cake/tests/fixtures/tag_fixture.php | 6 +- .../fixtures/test_plugin_article_fixture.php | 6 +- .../fixtures/test_plugin_comment_fixture.php | 6 +- .../fixtures/the_paper_monkies_fixture.php | 6 +- cake/tests/fixtures/thread_fixture.php | 6 +- .../fixtures/translate_article_fixture.php | 8 +- cake/tests/fixtures/translate_fixture.php | 8 +- .../fixtures/translate_table_fixture.php | 8 +- .../translate_with_prefix_fixture.php | 8 +- .../fixtures/translated_article_fixture.php | 6 +- .../fixtures/translated_item_fixture.php | 6 +- .../fixtures/unconventional_tree_fixture.php | 4 +- .../fixtures/underscore_field_fixture.php | 6 +- cake/tests/fixtures/user_fixture.php | 6 +- cake/tests/fixtures/uuid_fixture.php | 6 +- cake/tests/fixtures/uuid_tag_fixture.php | 6 +- cake/tests/fixtures/uuid_tree_fixture.php | 4 +- cake/tests/fixtures/uuiditem_fixture.php | 6 +- .../uuiditems_uuidportfolio_fixture.php | 6 +- ...ditems_uuidportfolio_numericid_fixture.php | 6 +- cake/tests/fixtures/uuidportfolio_fixture.php | 6 +- cake/tests/groups/acl.group.php | 2 +- cake/tests/groups/bake.group.php | 2 +- cake/tests/groups/behaviors.group.php | 2 +- cake/tests/groups/cache.group.php | 2 +- cake/tests/groups/components.group.php | 2 +- cake/tests/groups/configure.group.php | 2 +- cake/tests/groups/console.group.php | 2 +- cake/tests/groups/controller.group.php | 2 +- cake/tests/groups/database.group.php | 2 +- cake/tests/groups/helpers.group.php | 2 +- cake/tests/groups/i18n.group.php | 2 +- cake/tests/groups/javascript.group.php | 2 +- cake/tests/groups/lib.group.php | 2 +- cake/tests/groups/model.group.php | 2 +- .../groups/no_cross_contamination.group.php | 4 +- cake/tests/groups/routing_system.group.php | 2 +- cake/tests/groups/socket.group.php | 2 +- cake/tests/groups/test_suite.group.php | 2 +- cake/tests/groups/view.group.php | 2 +- cake/tests/groups/xml.group.php | 2 +- cake/tests/lib/cake_test_case.php | 12 +- cake/tests/lib/cake_test_fixture.php | 6 +- cake/tests/lib/cake_test_model.php | 4 +- cake/tests/lib/cake_test_suite_dispatcher.php | 4 +- cake/tests/lib/code_coverage_manager.php | 12 +- .../tests/lib/reporter/cake_base_reporter.php | 2 +- cake/tests/lib/reporter/cake_cli_reporter.php | 4 +- cake/tests/lib/test_manager.php | 4 +- .../controllers/tests_apps_controller.php | 4 +- .../tests_apps_posts_controller.php | 6 +- cake/tests/test_app/models/comment.php | 4 +- cake/tests/test_app/models/persister_one.php | 8 +- cake/tests/test_app/models/persister_two.php | 8 +- cake/tests/test_app/models/post.php | 4 +- .../test_plugin/config/schema/schema.php | 4 +- .../components/plugins_component.php | 2 +- .../components/test_plugin_component.php | 2 +- .../controllers/test_plugin_controller.php | 2 +- .../controllers/tests_controller.php | 8 +- .../models/test_plugin_auth_user.php | 6 +- .../models/test_plugin_authors.php | 4 +- .../models/test_plugin_comment.php | 4 +- .../test_plugin/models/test_plugin_post.php | 4 +- .../views/helpers/plugged_helper.php | 2 +- 306 files changed, 1728 insertions(+), 1728 deletions(-) diff --git a/cake/console/cake.php b/cake/console/cake.php index 5d8669f9e..4428b9d82 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -37,7 +37,7 @@ class ShellDispatcher { * @var filehandle * @access public */ - var $stdin; + public $stdin; /** * Standard output stream. @@ -45,7 +45,7 @@ class ShellDispatcher { * @var filehandle * @access public */ - var $stdout; + public $stdout; /** * Standard error stream. @@ -53,7 +53,7 @@ class ShellDispatcher { * @var filehandle * @access public */ - var $stderr; + public $stderr; /** * Contains command switches parsed from the command line. @@ -61,7 +61,7 @@ class ShellDispatcher { * @var array * @access public */ - var $params = array(); + public $params = array(); /** * Contains arguments parsed from the command line. @@ -69,7 +69,7 @@ class ShellDispatcher { * @var array * @access public */ - var $args = array(); + public $args = array(); /** * The file name of the shell that was invoked. @@ -77,7 +77,7 @@ class ShellDispatcher { * @var string * @access public */ - var $shell = null; + public $shell = null; /** * The class name of the shell that was invoked. @@ -85,7 +85,7 @@ class ShellDispatcher { * @var string * @access public */ - var $shellClass = null; + public $shellClass = null; /** * The command called if public methods are available. @@ -93,7 +93,7 @@ class ShellDispatcher { * @var string * @access public */ - var $shellCommand = null; + public $shellCommand = null; /** * The path locations of shells. @@ -101,7 +101,7 @@ class ShellDispatcher { * @var array * @access public */ - var $shellPaths = array(); + public $shellPaths = array(); /** * The path to the current shell location. @@ -109,7 +109,7 @@ class ShellDispatcher { * @var string * @access public */ - var $shellPath = null; + public $shellPath = null; /** * The name of the shell in camelized. @@ -117,7 +117,7 @@ class ShellDispatcher { * @var string * @access public */ - var $shellName = null; + public $shellName = null; /** * Constructor diff --git a/cake/console/error.php b/cake/console/error.php index 3d1b066a7..f64d8d788 100644 --- a/cake/console/error.php +++ b/cake/console/error.php @@ -32,7 +32,7 @@ class ErrorHandler extends Object { * @var filehandle * @access public */ - var $stdout; + public $stdout; /** * Standard error stream. @@ -40,7 +40,7 @@ class ErrorHandler extends Object { * @var filehandle * @access public */ - var $stderr; + public $stderr; /** * Class constructor. diff --git a/cake/console/libs/acl.php b/cake/console/libs/acl.php index 2b28323c7..0ab5ea6dd 100644 --- a/cake/console/libs/acl.php +++ b/cake/console/libs/acl.php @@ -34,7 +34,7 @@ class AclShell extends Shell { * @var AclComponent * @access public */ - var $Acl; + public $Acl; /** * Contains arguments parsed from the command line. @@ -42,7 +42,7 @@ class AclShell extends Shell { * @var array * @access public */ - var $args; + public $args; /** * Contains database source to use @@ -50,7 +50,7 @@ class AclShell extends Shell { * @var string * @access public */ - var $connection = 'default'; + public $connection = 'default'; /** * Contains tasks to load and instantiate @@ -58,7 +58,7 @@ class AclShell extends Shell { * @var array * @access public */ - var $tasks = array('DbConfig'); + public $tasks = array('DbConfig'); /** * Override startup of the Shell diff --git a/cake/console/libs/api.php b/cake/console/libs/api.php index fb7264ecc..5b60fa04f 100644 --- a/cake/console/libs/api.php +++ b/cake/console/libs/api.php @@ -34,7 +34,7 @@ class ApiShell extends Shell { * @var array * @access public */ - var $paths = array(); + public $paths = array(); /** * Override intialize of the Shell diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index 05a5e020a..c88f4b496 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -37,7 +37,7 @@ class BakeShell extends Shell { * @var array * @access public */ - var $tasks = array('Project', 'DbConfig', 'Model', 'Controller', 'View', 'Plugin', 'Fixture', 'Test'); + public $tasks = array('Project', 'DbConfig', 'Model', 'Controller', 'View', 'Plugin', 'Fixture', 'Test'); /** * Override loadTasks() to handle paths diff --git a/cake/console/libs/console.php b/cake/console/libs/console.php index 21044c8b3..94f318647 100644 --- a/cake/console/libs/console.php +++ b/cake/console/libs/console.php @@ -30,7 +30,7 @@ class ConsoleShell extends Shell { * @var array * @access public */ - var $associations = array('hasOne', 'hasMany', 'belongsTo', 'hasAndBelongsToMany'); + public $associations = array('hasOne', 'hasMany', 'belongsTo', 'hasAndBelongsToMany'); /** * Chars that describe invalid commands @@ -38,7 +38,7 @@ class ConsoleShell extends Shell { * @var array * @access public */ - var $badCommandChars = array('$', ';'); + public $badCommandChars = array('$', ';'); /** * Available models @@ -46,7 +46,7 @@ class ConsoleShell extends Shell { * @var array * @access public */ - var $models = array(); + public $models = array(); /** * Override intialize of the Shell diff --git a/cake/console/libs/i18n.php b/cake/console/libs/i18n.php index 0b49c6492..5d28b16da 100644 --- a/cake/console/libs/i18n.php +++ b/cake/console/libs/i18n.php @@ -32,7 +32,7 @@ class I18nShell extends Shell { * @var string * @access public */ - var $dataSource = 'default'; + public $dataSource = 'default'; /** * Contains tasks to load and instantiate @@ -40,7 +40,7 @@ class I18nShell extends Shell { * @var array * @access public */ - var $tasks = array('DbConfig', 'Extract'); + public $tasks = array('DbConfig', 'Extract'); /** * Override startup of the Shell diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php index c4d6c212d..0fc16bbea 100644 --- a/cake/console/libs/shell.php +++ b/cake/console/libs/shell.php @@ -32,7 +32,7 @@ class Shell extends Object { * @var ShellDispatcher * @access public */ - var $Dispatch = null; + public $Dispatch = null; /** * If true, the script will ask for permission to perform actions. @@ -40,7 +40,7 @@ class Shell extends Object { * @var boolean * @access public */ - var $interactive = true; + public $interactive = true; /** * Holds the DATABASE_CONFIG object for the app. Null if database.php could not be found, @@ -49,7 +49,7 @@ class Shell extends Object { * @var DATABASE_CONFIG * @access public */ - var $DbConfig = null; + public $DbConfig = null; /** * Contains command switches parsed from the command line. @@ -57,7 +57,7 @@ class Shell extends Object { * @var array * @access public */ - var $params = array(); + public $params = array(); /** * Contains arguments parsed from the command line. @@ -65,7 +65,7 @@ class Shell extends Object { * @var array * @access public */ - var $args = array(); + public $args = array(); /** * The file name of the shell that was invoked. @@ -73,7 +73,7 @@ class Shell extends Object { * @var string * @access public */ - var $shell = null; + public $shell = null; /** * The class name of the shell that was invoked. @@ -81,7 +81,7 @@ class Shell extends Object { * @var string * @access public */ - var $className = null; + public $className = null; /** * The command called if public methods are available. @@ -89,7 +89,7 @@ class Shell extends Object { * @var string * @access public */ - var $command = null; + public $command = null; /** * The name of the shell in camelized. @@ -97,7 +97,7 @@ class Shell extends Object { * @var string * @access public */ - var $name = null; + public $name = null; /** * An alias for the shell @@ -105,7 +105,7 @@ class Shell extends Object { * @var string * @access public */ - var $alias = null; + public $alias = null; /** * Contains tasks to load and instantiate @@ -113,7 +113,7 @@ class Shell extends Object { * @var array * @access public */ - var $tasks = array(); + public $tasks = array(); /** * Contains the loaded tasks @@ -121,7 +121,7 @@ class Shell extends Object { * @var array * @access public */ - var $taskNames = array(); + public $taskNames = array(); /** * Contains models to load and instantiate @@ -129,7 +129,7 @@ class Shell extends Object { * @var array * @access public */ - var $uses = array(); + public $uses = array(); /** * Constructs this Shell instance. @@ -224,10 +224,10 @@ function _loadDbConfig() { } /** - * if var $uses = true + * if public $uses = true * Loads AppModel file and constructs AppModel class * makes $this->AppModel available to subclasses - * if var $uses is an array of models will load those models + * if public $uses is an array of models will load those models * * @return bool * @access protected @@ -265,7 +265,7 @@ function _loadModels() { } /** - * Loads tasks defined in var $tasks + * Loads tasks defined in public $tasks * * @return bool * @access public diff --git a/cake/console/libs/tasks/bake.php b/cake/console/libs/tasks/bake.php index db0aa0aca..38128cfcb 100644 --- a/cake/console/libs/tasks/bake.php +++ b/cake/console/libs/tasks/bake.php @@ -25,7 +25,7 @@ class BakeTask extends Shell { * @var string * @access public */ - var $plugin = null; + public $plugin = null; /** * The db connection being used for baking @@ -33,14 +33,14 @@ class BakeTask extends Shell { * @var string * @access public */ - var $connection = null; + public $connection = null; /** * Flag for interactive mode * * @var boolean */ - var $interactive = false; + public $interactive = false; /** * Gets the path for output. Checks the plugin property diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index a32f60bc3..444f82915 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -34,7 +34,7 @@ class ControllerTask extends BakeTask { * @var array * @access public */ - var $tasks = array('Model', 'Test', 'Template', 'DbConfig', 'Project'); + public $tasks = array('Model', 'Test', 'Template', 'DbConfig', 'Project'); /** * path to CONTROLLERS directory @@ -42,7 +42,7 @@ class ControllerTask extends BakeTask { * @var array * @access public */ - var $path = CONTROLLERS; + public $path = CONTROLLERS; /** * Override initialize diff --git a/cake/console/libs/tasks/db_config.php b/cake/console/libs/tasks/db_config.php index b311d80c6..ee75b7819 100644 --- a/cake/console/libs/tasks/db_config.php +++ b/cake/console/libs/tasks/db_config.php @@ -32,7 +32,7 @@ class DbConfigTask extends Shell { * @var string * @access public */ - var $path = null; + public $path = null; /** * Default configuration settings to use @@ -52,7 +52,7 @@ class DbConfigTask extends Shell { * * @var string */ - var $databaseClassName = 'DATABASE_CONFIG'; + public $databaseClassName = 'DATABASE_CONFIG'; /** * initialization callback diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 57b995f27..87822b65c 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -32,7 +32,7 @@ class FixtureTask extends BakeTask { * @var array * @access public */ - var $tasks = array('DbConfig', 'Model', 'Template'); + public $tasks = array('DbConfig', 'Model', 'Template'); /** * path to fixtures directory @@ -40,7 +40,7 @@ class FixtureTask extends BakeTask { * @var string * @access public */ - var $path = null; + public $path = null; /** * Schema instance @@ -153,7 +153,7 @@ function importOptions($modelName) { * * @param string $model Name of model to bake. * @param string $useTable Name of table to use. - * @param array $importOptions Options for var $import + * @param array $importOptions Options for public $import * @return string Baked fixture content * @access public */ diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 921d0eb7f..61395b9f3 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -34,7 +34,7 @@ class ModelTask extends BakeTask { * @var string * @access public */ - var $path = MODELS; + public $path = MODELS; /** * tasks @@ -42,7 +42,7 @@ class ModelTask extends BakeTask { * @var array * @access public */ - var $tasks = array('DbConfig', 'Fixture', 'Test', 'Template'); + public $tasks = array('DbConfig', 'Fixture', 'Test', 'Template'); /** * Tables to skip when running all() @@ -50,7 +50,7 @@ class ModelTask extends BakeTask { * @var array * @access protected */ - var $skipTables = array('i18n'); + public $skipTables = array('i18n'); /** * Holds tables found on connection. diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index 5ea1caa55..e8c5f3371 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -30,7 +30,7 @@ class PluginTask extends Shell { * Tasks * */ - var $tasks = array('Model', 'Controller', 'View'); + public $tasks = array('Model', 'Controller', 'View'); /** * path to CONTROLLERS directory @@ -38,7 +38,7 @@ class PluginTask extends Shell { * @var array * @access public */ - var $path = null; + public $path = null; /** * initialize diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php index 2c6e701d2..c64d65e14 100644 --- a/cake/console/libs/tasks/project.php +++ b/cake/console/libs/tasks/project.php @@ -31,7 +31,7 @@ class ProjectTask extends Shell { * * @var string */ - var $configPath = null; + public $configPath = null; /** * Checks that given project path does not already exist, and diff --git a/cake/console/libs/tasks/template.php b/cake/console/libs/tasks/template.php index 72b2c7d17..08e8a19aa 100644 --- a/cake/console/libs/tasks/template.php +++ b/cake/console/libs/tasks/template.php @@ -24,7 +24,7 @@ class TemplateTask extends Shell { * * @var array */ - var $templateVars = array(); + public $templateVars = array(); /** * Paths to look for templates on. @@ -32,7 +32,7 @@ class TemplateTask extends Shell { * * @var array */ - var $templatePaths = array(); + public $templatePaths = array(); /** * Initialize callback. Setup paths for the template task. diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index e29ad68c9..356cf2313 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -34,7 +34,7 @@ class TestTask extends BakeTask { * @var string * @access public */ - var $path = TESTS; + public $path = TESTS; /** * Tasks used. @@ -42,7 +42,7 @@ class TestTask extends BakeTask { * @var array * @access public */ - var $tasks = array('Template'); + public $tasks = array('Template'); /** * class types that methods can be generated for @@ -50,7 +50,7 @@ class TestTask extends BakeTask { * @var array * @access public */ - var $classTypes = array('Model', 'Controller', 'Component', 'Behavior', 'Helper'); + public $classTypes = array('Model', 'Controller', 'Component', 'Behavior', 'Helper'); /** * Internal list of fixtures that have been added so far. diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index bdb5a72bc..790ab8c0c 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -34,7 +34,7 @@ class ViewTask extends BakeTask { * @var array * @access public */ - var $tasks = array('Project', 'Controller', 'DbConfig', 'Template'); + public $tasks = array('Project', 'Controller', 'DbConfig', 'Template'); /** * path to VIEWS directory @@ -42,7 +42,7 @@ class ViewTask extends BakeTask { * @var array * @access public */ - var $path = VIEWS; + public $path = VIEWS; /** * Name of the controller being used @@ -50,7 +50,7 @@ class ViewTask extends BakeTask { * @var string * @access public */ - var $controllerName = null; + public $controllerName = null; /** * Path to controller to put views @@ -58,7 +58,7 @@ class ViewTask extends BakeTask { * @var string * @access public */ - var $controllerPath = null; + public $controllerPath = null; /** * The template file to use @@ -66,7 +66,7 @@ class ViewTask extends BakeTask { * @var string * @access public */ - var $template = null; + public $template = null; /** * Actions to use for scaffolding @@ -74,7 +74,7 @@ class ViewTask extends BakeTask { * @var array * @access public */ - var $scaffoldActions = array('index', 'view', 'add', 'edit'); + public $scaffoldActions = array('index', 'view', 'add', 'edit'); /** * An array of action names that don't require templates. These @@ -83,7 +83,7 @@ class ViewTask extends BakeTask { * @var array * @access public */ - var $noTemplateActions = array('delete'); + public $noTemplateActions = array('delete'); /** * Override initialize diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php index 6dbd47cb4..4dfb1f6bf 100644 --- a/cake/console/libs/testsuite.php +++ b/cake/console/libs/testsuite.php @@ -27,7 +27,7 @@ class TestSuiteShell extends Shell { * @var string * @access public */ - var $category = ''; + public $category = ''; /** * "group", "case" or "all" @@ -35,7 +35,7 @@ class TestSuiteShell extends Shell { * @var string * @access public */ - var $type = ''; + public $type = ''; /** * Path to the test case/group file @@ -43,7 +43,7 @@ class TestSuiteShell extends Shell { * @var string * @access public */ - var $file = ''; + public $file = ''; /** * Storage for plugins that have tests @@ -51,7 +51,7 @@ class TestSuiteShell extends Shell { * @var string * @access public */ - var $plugins = array(); + public $plugins = array(); /** * Convenience variable to avoid duplicated code @@ -59,7 +59,7 @@ class TestSuiteShell extends Shell { * @var string * @access public */ - var $isPluginTest = false; + public $isPluginTest = false; /** * Stores if the user wishes to get a code coverage analysis report @@ -67,7 +67,7 @@ class TestSuiteShell extends Shell { * @var string * @access public */ - var $doCoverage = false; + public $doCoverage = false; /** * Initialization method installs Simpletest and loads all plugins diff --git a/cake/console/templates/skel/config/core.php b/cake/console/templates/skel/config/core.php index 017dd9413..d1105b1a2 100644 --- a/cake/console/templates/skel/config/core.php +++ b/cake/console/templates/skel/config/core.php @@ -106,8 +106,8 @@ * Enable cache checking. * * If set to true, for view caching you must still use the controller - * var $cacheAction inside your controllers to define caching settings. - * You can either set it controller-wide by setting var $cacheAction = true, + * public $cacheAction inside your controllers to define caching settings. + * You can either set it controller-wide by setting public $cacheAction = true, * or in each action using $this->cacheAction = true. * */ diff --git a/cake/console/templates/skel/config/database.php.default b/cake/console/templates/skel/config/database.php.default index 8549025a6..cf9a6327c 100644 --- a/cake/console/templates/skel/config/database.php.default +++ b/cake/console/templates/skel/config/database.php.default @@ -73,7 +73,7 @@ */ class DATABASE_CONFIG { - var $default = array( + public $default = array( 'driver' => 'mysql', 'persistent' => false, 'host' => 'localhost', @@ -83,7 +83,7 @@ class DATABASE_CONFIG { 'prefix' => '', ); - var $test = array( + public $test = array( 'driver' => 'mysql', 'persistent' => false, 'host' => 'localhost', diff --git a/cake/console/templates/skel/config/schema/db_acl.php b/cake/console/templates/skel/config/schema/db_acl.php index bfc59467b..656d3f568 100644 --- a/cake/console/templates/skel/config/schema/db_acl.php +++ b/cake/console/templates/skel/config/schema/db_acl.php @@ -30,7 +30,7 @@ */ class DbAclSchema extends CakeSchema { - var $name = 'DbAcl'; + public $name = 'DbAcl'; function before($event = array()) { return true; @@ -39,7 +39,7 @@ function before($event = array()) { function after($event = array()) { } - var $acos = array( + public $acos = array( 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), 'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), 'model' => array('type'=>'string', 'null' => true), @@ -50,7 +50,7 @@ function after($event = array()) { 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) ); - var $aros = array( + public $aros = array( 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), 'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), 'model' => array('type'=>'string', 'null' => true), @@ -61,7 +61,7 @@ function after($event = array()) { 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) ); - var $aros_acos = array( + public $aros_acos = array( 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), 'aro_id' => array('type'=>'integer', 'null' => false, 'length' => 10, 'key' => 'index'), 'aco_id' => array('type'=>'integer', 'null' => false, 'length' => 10), diff --git a/cake/console/templates/skel/config/schema/i18n.php b/cake/console/templates/skel/config/schema/i18n.php index a9fab64a4..8929169e2 100644 --- a/cake/console/templates/skel/config/schema/i18n.php +++ b/cake/console/templates/skel/config/schema/i18n.php @@ -30,7 +30,7 @@ */ class i18nSchema extends CakeSchema { - var $name = 'i18n'; + public $name = 'i18n'; function before($event = array()) { return true; @@ -39,7 +39,7 @@ function before($event = array()) { function after($event = array()) { } - var $i18n = array( + public $i18n = array( 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), 'locale' => array('type'=>'string', 'null' => false, 'length' => 6, 'key' => 'index'), 'model' => array('type'=>'string', 'null' => false, 'key' => 'index'), diff --git a/cake/console/templates/skel/config/schema/sessions.php b/cake/console/templates/skel/config/schema/sessions.php index 7cb1e5470..68654d592 100644 --- a/cake/console/templates/skel/config/schema/sessions.php +++ b/cake/console/templates/skel/config/schema/sessions.php @@ -30,7 +30,7 @@ */ class SessionsSchema extends CakeSchema { - var $name = 'Sessions'; + public $name = 'Sessions'; function before($event = array()) { return true; @@ -39,7 +39,7 @@ function before($event = array()) { function after($event = array()) { } - var $cake_sessions = array( + public $cake_sessions = array( 'id' => array('type'=>'string', 'null' => false, 'key' => 'primary'), 'data' => array('type'=>'text', 'null' => true, 'default' => NULL), 'expires' => array('type'=>'integer', 'null' => true, 'default' => NULL), diff --git a/cake/dispatcher.php b/cake/dispatcher.php index d04826593..9e91c68e2 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -43,7 +43,7 @@ class Dispatcher extends Object { * @var string * @access public */ - var $base = false; + public $base = false; /** * webroot path @@ -51,7 +51,7 @@ class Dispatcher extends Object { * @var string * @access public */ - var $webroot = '/'; + public $webroot = '/'; /** * Current URL @@ -59,7 +59,7 @@ class Dispatcher extends Object { * @var string * @access public */ - var $here = false; + public $here = false; /** * the params for this request @@ -67,7 +67,7 @@ class Dispatcher extends Object { * @var string * @access public */ - var $params = null; + public $params = null; /** * Constructor. diff --git a/cake/libs/cache.php b/cake/libs/cache.php index d6ea83d39..a3e918656 100644 --- a/cake/libs/cache.php +++ b/cake/libs/cache.php @@ -549,7 +549,7 @@ class CacheEngine { * @var int * @access public */ - var $settings = array(); + public $settings = array(); /** * Initialize the cache engine diff --git a/cake/libs/cache/file.php b/cake/libs/cache/file.php index a6fc81a13..2c677f359 100644 --- a/cake/libs/cache/file.php +++ b/cake/libs/cache/file.php @@ -51,7 +51,7 @@ class FileEngine extends CacheEngine { * @see CacheEngine::__defaults * @access public */ - var $settings = array(); + public $settings = array(); /** * True unless FileEngine::__active(); fails diff --git a/cake/libs/cache/memcache.php b/cake/libs/cache/memcache.php index ec4e99a57..0e54da760 100644 --- a/cake/libs/cache/memcache.php +++ b/cake/libs/cache/memcache.php @@ -45,7 +45,7 @@ class MemcacheEngine extends CacheEngine { * @var array * @access public */ - var $settings = array(); + public $settings = array(); /** * Initialize the Cache Engine diff --git a/cake/libs/cache/xcache.php b/cake/libs/cache/xcache.php index f30531724..f6e094001 100644 --- a/cake/libs/cache/xcache.php +++ b/cake/libs/cache/xcache.php @@ -36,7 +36,7 @@ class XcacheEngine extends CacheEngine { * @var array * @access public */ - var $settings = array(); + public $settings = array(); /** * Initialize the Cache Engine diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index 01bfb82fb..bf85595c1 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -40,7 +40,7 @@ class CakeSession extends Object { * @var boolean * @access public */ - var $valid = false; + public $valid = false; /** * Error messages for this session @@ -48,7 +48,7 @@ class CakeSession extends Object { * @var array * @access public */ - var $error = false; + public $error = false; /** * User agent string @@ -64,7 +64,7 @@ class CakeSession extends Object { * @var string * @access public */ - var $path = '/'; + public $path = '/'; /** * Error number of last occurred error @@ -72,7 +72,7 @@ class CakeSession extends Object { * @var integer * @access public */ - var $lastError = null; + public $lastError = null; /** * 'Security.level' setting, "high", "medium", or "low". @@ -80,7 +80,7 @@ class CakeSession extends Object { * @var string * @access public */ - var $security = null; + public $security = null; /** * Start time for this session. @@ -88,7 +88,7 @@ class CakeSession extends Object { * @var integer * @access public */ - var $time = false; + public $time = false; /** * Time when this session becomes invalid. @@ -96,7 +96,7 @@ class CakeSession extends Object { * @var integer * @access public */ - var $sessionTime = false; + public $sessionTime = false; /** * Keeps track of keys to watch for writes on @@ -104,7 +104,7 @@ class CakeSession extends Object { * @var array * @access public */ - var $watchKeys = array(); + public $watchKeys = array(); /** * Current Session id @@ -112,7 +112,7 @@ class CakeSession extends Object { * @var string * @access public */ - var $id = null; + public $id = null; /** * Session Started @@ -128,7 +128,7 @@ class CakeSession extends Object { * @var string * @access public */ - var $host = null; + public $host = null; /** * Constructor. diff --git a/cake/libs/cake_socket.php b/cake/libs/cake_socket.php index 38f9af250..0c14876b9 100644 --- a/cake/libs/cake_socket.php +++ b/cake/libs/cake_socket.php @@ -35,7 +35,7 @@ class CakeSocket extends Object { * @var string * @access public */ - var $description = 'Remote DataSource Network Socket Interface'; + public $description = 'Remote DataSource Network Socket Interface'; /** * Base configuration settings for the socket connection @@ -57,7 +57,7 @@ class CakeSocket extends Object { * @var array * @access public */ - var $config = array(); + public $config = array(); /** * Reference to socket connection resource @@ -65,7 +65,7 @@ class CakeSocket extends Object { * @var resource * @access public */ - var $connection = null; + public $connection = null; /** * This boolean contains the current state of the CakeSocket class @@ -73,7 +73,7 @@ class CakeSocket extends Object { * @var boolean * @access public */ - var $connected = false; + public $connected = false; /** * This variable contains an array with the last error number (num) and string (str) @@ -81,7 +81,7 @@ class CakeSocket extends Object { * @var array * @access public */ - var $lastError = array(); + public $lastError = array(); /** * Constructor. diff --git a/cake/libs/configure.php b/cake/libs/configure.php index b561a5e3f..4fef8051d 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -34,7 +34,7 @@ class Configure extends Object { * @var integer * @access public */ - var $debug = 0; + public $debug = 0; /** * Returns a singleton instance of the Configure class. @@ -452,7 +452,7 @@ class App extends Object { * @var array * @access public */ - var $types = array( + public $types = array( 'class' => array('suffix' => '.php', 'extends' => null, 'core' => true), 'file' => array('suffix' => '.php', 'extends' => null, 'core' => true), 'model' => array('suffix' => '.php', 'extends' => 'AppModel', 'core' => false), @@ -473,7 +473,7 @@ class App extends Object { * @var array * @access public */ - var $models = array(); + public $models = array(); /** * List of additional path(s) where behavior files reside. @@ -481,7 +481,7 @@ class App extends Object { * @var array * @access public */ - var $behaviors = array(); + public $behaviors = array(); /** * List of additional path(s) where controller files reside. @@ -489,7 +489,7 @@ class App extends Object { * @var array * @access public */ - var $controllers = array(); + public $controllers = array(); /** * List of additional path(s) where component files reside. @@ -497,7 +497,7 @@ class App extends Object { * @var array * @access public */ - var $components = array(); + public $components = array(); /** * List of additional path(s) where datasource files reside. @@ -505,7 +505,7 @@ class App extends Object { * @var array * @access public */ - var $datasources = array(); + public $datasources = array(); /** * List of additional path(s) where libs files reside. @@ -513,14 +513,14 @@ class App extends Object { * @var array * @access public */ - var $libs = array(); + public $libs = array(); /** * List of additional path(s) where view files reside. * * @var array * @access public */ - var $views = array(); + public $views = array(); /** * List of additional path(s) where helper files reside. @@ -528,7 +528,7 @@ class App extends Object { * @var array * @access public */ - var $helpers = array(); + public $helpers = array(); /** * List of additional path(s) where plugins reside. @@ -536,7 +536,7 @@ class App extends Object { * @var array * @access public */ - var $plugins = array(); + public $plugins = array(); /** * List of additional path(s) where vendor packages reside. @@ -544,7 +544,7 @@ class App extends Object { * @var array * @access public */ - var $vendors = array(); + public $vendors = array(); /** * List of additional path(s) where locale files reside. @@ -552,7 +552,7 @@ class App extends Object { * @var array * @access public */ - var $locales = array(); + public $locales = array(); /** * List of additional path(s) where console shell files reside. @@ -560,7 +560,7 @@ class App extends Object { * @var array * @access public */ - var $shells = array(); + public $shells = array(); /** * Paths to search for files. @@ -568,7 +568,7 @@ class App extends Object { * @var array * @access public */ - var $search = array(); + public $search = array(); /** * Whether or not to return the file that is loaded. @@ -576,7 +576,7 @@ class App extends Object { * @var boolean * @access public */ - var $return = false; + public $return = false; /** * Determines if $__maps and $__paths cache should be written. diff --git a/cake/libs/controller/components/acl.php b/cake/libs/controller/components/acl.php index d9afbd3b4..417282161 100644 --- a/cake/libs/controller/components/acl.php +++ b/cake/libs/controller/components/acl.php @@ -506,7 +506,7 @@ class IniAcl extends AclBase { * @var array * @access public */ - var $config = null; + public $config = null; /** * The constructor must be overridden, as AclBase is abstract. diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index 92be96759..8cca285a5 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -46,7 +46,7 @@ class AuthComponent extends Object { * @var array * @access public */ - var $components = array('Session', 'RequestHandler'); + public $components = array('Session', 'RequestHandler'); /** * A reference to the object used for authentication @@ -54,7 +54,7 @@ class AuthComponent extends Object { * @var object * @access public */ - var $authenticate = null; + public $authenticate = null; /** * The name of the component to use for Authorization or set this to @@ -67,7 +67,7 @@ class AuthComponent extends Object { * @var mixed * @access public */ - var $authorize = false; + public $authorize = false; /** * The name of an optional view element to render when an Ajax request is made @@ -76,7 +76,7 @@ class AuthComponent extends Object { * @var string * @access public */ - var $ajaxLogin = null; + public $ajaxLogin = null; /** * The name of the element used for SessionComponent::setFlash @@ -84,7 +84,7 @@ class AuthComponent extends Object { * @var string * @access public */ - var $flashElement = 'default'; + public $flashElement = 'default'; /** * The name of the model that represents users which will be authenticated. Defaults to 'User'. @@ -92,7 +92,7 @@ class AuthComponent extends Object { * @var string * @access public */ - var $userModel = 'User'; + public $userModel = 'User'; /** * Additional query conditions to use when looking up and authenticating users, @@ -101,7 +101,7 @@ class AuthComponent extends Object { * @var array * @access public */ - var $userScope = array(); + public $userScope = array(); /** * Allows you to specify non-default login name and password fields used in @@ -110,7 +110,7 @@ class AuthComponent extends Object { * @var array * @access public */ - var $fields = array('username' => 'username', 'password' => 'password'); + public $fields = array('username' => 'username', 'password' => 'password'); /** * The session key name where the record of the current user is stored. If @@ -119,7 +119,7 @@ class AuthComponent extends Object { * @var string * @access public */ - var $sessionKey = null; + public $sessionKey = null; /** * If using action-based access control, this defines how the paths to action @@ -130,7 +130,7 @@ class AuthComponent extends Object { * @var string * @access public */ - var $actionPath = null; + public $actionPath = null; /** * A URL (defined as a string or array) to the controller action that handles @@ -139,7 +139,7 @@ class AuthComponent extends Object { * @var mixed * @access public */ - var $loginAction = null; + public $loginAction = null; /** * Normally, if a user is redirected to the $loginAction page, the location they @@ -150,7 +150,7 @@ class AuthComponent extends Object { * @var mixed * @access public */ - var $loginRedirect = null; + public $loginRedirect = null; /** * The the default action to redirect to after the user is logged out. While AuthComponent does @@ -162,7 +162,7 @@ class AuthComponent extends Object { * @see AuthComponent::$loginAction * @see AuthComponent::logout() */ - var $logoutRedirect = null; + public $logoutRedirect = null; /** * The name of model or model object, or any other object has an isAuthorized method. @@ -170,7 +170,7 @@ class AuthComponent extends Object { * @var string * @access public */ - var $object = null; + public $object = null; /** * Error to display when user login fails. For security purposes, only one error is used for all @@ -179,7 +179,7 @@ class AuthComponent extends Object { * @var string * @access public */ - var $loginError = null; + public $loginError = null; /** * Error to display when user attempts to access an object or action to which they do not have @@ -188,7 +188,7 @@ class AuthComponent extends Object { * @var string * @access public */ - var $authError = null; + public $authError = null; /** * Determines whether AuthComponent will automatically redirect and exit if login is successful. @@ -196,7 +196,7 @@ class AuthComponent extends Object { * @var boolean * @access public */ - var $autoRedirect = true; + public $autoRedirect = true; /** * Controller actions for which user validation is not required. @@ -205,7 +205,7 @@ class AuthComponent extends Object { * @access public * @see AuthComponent::allow() */ - var $allowedActions = array(); + public $allowedActions = array(); /** * Maps actions to CRUD operations. Used for controller-based validation ($validate = 'controller'). @@ -214,7 +214,7 @@ class AuthComponent extends Object { * @access public * @see AuthComponent::mapActions() */ - var $actionMap = array( + public $actionMap = array( 'index' => 'read', 'add' => 'create', 'edit' => 'update', @@ -228,7 +228,7 @@ class AuthComponent extends Object { * @var array * @access public */ - var $data = array(); + public $data = array(); /** * Parameter data from Controller::$params @@ -236,7 +236,7 @@ class AuthComponent extends Object { * @var array * @access public */ - var $params = array(); + public $params = array(); /** * Method list for bound controller diff --git a/cake/libs/controller/components/cookie.php b/cake/libs/controller/components/cookie.php index 1e09fb66b..ce6266006 100644 --- a/cake/libs/controller/components/cookie.php +++ b/cake/libs/controller/components/cookie.php @@ -43,7 +43,7 @@ class CookieComponent extends Object { * @var string * @access public */ - var $name = 'CakeCookie'; + public $name = 'CakeCookie'; /** * The time a cookie will remain valid. @@ -56,7 +56,7 @@ class CookieComponent extends Object { * @var mixed * @access public */ - var $time = null; + public $time = null; /** * Cookie path. @@ -65,14 +65,14 @@ class CookieComponent extends Object { * $this->Cookie->path = '/'; * * The path on the server in which the cookie will be available on. - * If var $cookiePath is set to '/foo/', the cookie will only be available + * If public $cookiePath is set to '/foo/', the cookie will only be available * within the /foo/ directory and all sub-directories such as /foo/bar/ of domain. * The default value is the entire domain. * * @var string * @access public */ - var $path = '/'; + public $path = '/'; /** * Domain path. @@ -88,7 +88,7 @@ class CookieComponent extends Object { * @var string * @access public */ - var $domain = ''; + public $domain = ''; /** * Secure HTTPS only cookie. @@ -102,7 +102,7 @@ class CookieComponent extends Object { * @var boolean * @access public */ - var $secure = false; + public $secure = false; /** * Encryption key. @@ -113,7 +113,7 @@ class CookieComponent extends Object { * @var string * @access protected */ - var $key = null; + public $key = null; /** * Values stored in the cookie. @@ -381,7 +381,7 @@ function __delete($name) { } /** - * Encrypts $value using var $type method in Security class + * Encrypts $value using public $type method in Security class * * @param string $value Value to encrypt * @return string encrypted string @@ -400,7 +400,7 @@ function __encrypt($value) { } /** - * Decrypts $value using var $type method in Security class + * Decrypts $value using public $type method in Security class * * @param array $values Values to decrypt * @return string decrypted string diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index e0d7d0186..bf3253b79 100755 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -37,7 +37,7 @@ class EmailComponent extends Object{ * @var string * @access public */ - var $to = null; + public $to = null; /** * The mail which the email is sent from @@ -45,7 +45,7 @@ class EmailComponent extends Object{ * @var string * @access public */ - var $from = null; + public $from = null; /** * The email the recipient will reply to @@ -53,7 +53,7 @@ class EmailComponent extends Object{ * @var string * @access public */ - var $replyTo = null; + public $replyTo = null; /** * The read receipt email @@ -61,7 +61,7 @@ class EmailComponent extends Object{ * @var string * @access public */ - var $readReceipt = null; + public $readReceipt = null; /** * The mail that will be used in case of any errors like @@ -72,7 +72,7 @@ class EmailComponent extends Object{ * @var string * @access public */ - var $return = null; + public $return = null; /** * Carbon Copy @@ -83,7 +83,7 @@ class EmailComponent extends Object{ * @var array * @access public */ - var $cc = array(); + public $cc = array(); /** * Blind Carbon Copy @@ -94,7 +94,7 @@ class EmailComponent extends Object{ * @var array * @access public */ - var $bcc = array(); + public $bcc = array(); /** * The subject of the email @@ -102,7 +102,7 @@ class EmailComponent extends Object{ * @var string * @access public */ - var $subject = null; + public $subject = null; /** * Associative array of a user defined headers @@ -111,7 +111,7 @@ class EmailComponent extends Object{ * @var array * @access public */ - var $headers = array(); + public $headers = array(); /** * List of additional headers @@ -121,7 +121,7 @@ class EmailComponent extends Object{ * @var string * @access public */ - var $additionalParams = null; + public $additionalParams = null; /** * Layout for the View @@ -129,7 +129,7 @@ class EmailComponent extends Object{ * @var string * @access public */ - var $layout = 'default'; + public $layout = 'default'; /** * Template for the view @@ -137,7 +137,7 @@ class EmailComponent extends Object{ * @var string * @access public */ - var $template = null; + public $template = null; /** * as per RFC2822 Section 2.1.1 @@ -145,7 +145,7 @@ class EmailComponent extends Object{ * @var integer * @access public */ - var $lineLength = 70; + public $lineLength = 70; /** * @deprecated see lineLength @@ -163,7 +163,7 @@ class EmailComponent extends Object{ * @var string * @access public */ - var $sendAs = 'text'; + public $sendAs = 'text'; /** * What method should the email be sent by @@ -176,7 +176,7 @@ class EmailComponent extends Object{ * @var string * @access public */ - var $delivery = 'mail'; + public $delivery = 'mail'; /** * charset the email is sent in @@ -184,7 +184,7 @@ class EmailComponent extends Object{ * @var string * @access public */ - var $charset = 'utf-8'; + public $charset = 'utf-8'; /** * List of files that should be attached to the email. @@ -194,7 +194,7 @@ class EmailComponent extends Object{ * @var array * @access public */ - var $attachments = array(); + public $attachments = array(); /** * What mailer should EmailComponent identify itself as @@ -202,7 +202,7 @@ class EmailComponent extends Object{ * @var string * @access public */ - var $xMailer = 'CakePHP Email Component'; + public $xMailer = 'CakePHP Email Component'; /** * The list of paths to search if an attachment isnt absolute @@ -210,7 +210,7 @@ class EmailComponent extends Object{ * @var array * @access public */ - var $filePaths = array(); + public $filePaths = array(); /** * List of options to use for smtp mail method @@ -226,7 +226,7 @@ class EmailComponent extends Object{ * @var array * @access public */ - var $smtpOptions = array( + public $smtpOptions = array( 'port'=> 25, 'host' => 'localhost', 'timeout' => 30 ); @@ -237,7 +237,7 @@ class EmailComponent extends Object{ * @var string * @access public */ - var $smtpError = null; + public $smtpError = null; /** * Contains the rendered plain text message if one was sent. @@ -245,7 +245,7 @@ class EmailComponent extends Object{ * @var string * @access public */ - var $textMessage = null; + public $textMessage = null; /** * Contains the rendered HTML message if one was sent. @@ -253,7 +253,7 @@ class EmailComponent extends Object{ * @var string * @access public */ - var $htmlMessage = null; + public $htmlMessage = null; /** * Whether to generate a Message-ID header for the @@ -264,7 +264,7 @@ class EmailComponent extends Object{ * @var mixed * @access public */ - var $messageId = true; + public $messageId = true; /** * Temporary store of message header lines diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php index 26213fb38..6b63552b6 100644 --- a/cake/libs/controller/components/request_handler.php +++ b/cake/libs/controller/components/request_handler.php @@ -36,7 +36,7 @@ class RequestHandlerComponent extends Object { * @access public * @see RequestHandler::setAjax() */ - var $ajaxLayout = 'ajax'; + public $ajaxLayout = 'ajax'; /** * Determines whether or not callbacks will be fired on this component @@ -44,7 +44,7 @@ class RequestHandlerComponent extends Object { * @var boolean * @access public */ - var $enabled = true; + public $enabled = true; /** * Holds the content-type of the response that is set when using @@ -61,7 +61,7 @@ class RequestHandlerComponent extends Object { * @var array * @access public */ - var $params = array(); + public $params = array(); /** * Friendly content-type mappings used to set response types and determine @@ -107,7 +107,7 @@ class RequestHandlerComponent extends Object { * @var array * @access public */ - var $mobileUA = array( + public $mobileUA = array( 'Android', 'AvantGo', 'BlackBerry', @@ -158,7 +158,7 @@ class RequestHandlerComponent extends Object { * @access public * @see Router::parseExtensions() */ - var $ext = null; + public $ext = null; /** * Flag set when MIME types have been initialized diff --git a/cake/libs/controller/components/security.php b/cake/libs/controller/components/security.php index 44ac7e913..4d09d80a8 100644 --- a/cake/libs/controller/components/security.php +++ b/cake/libs/controller/components/security.php @@ -32,7 +32,7 @@ class SecurityComponent extends Object { * @var string * @access public */ - var $blackHoleCallback = null; + public $blackHoleCallback = null; /** * List of controller actions for which a POST request is required @@ -41,7 +41,7 @@ class SecurityComponent extends Object { * @access public * @see SecurityComponent::requirePost() */ - var $requirePost = array(); + public $requirePost = array(); /** * List of controller actions for which a GET request is required @@ -50,7 +50,7 @@ class SecurityComponent extends Object { * @access public * @see SecurityComponent::requireGet() */ - var $requireGet = array(); + public $requireGet = array(); /** * List of controller actions for which a PUT request is required @@ -59,7 +59,7 @@ class SecurityComponent extends Object { * @access public * @see SecurityComponent::requirePut() */ - var $requirePut = array(); + public $requirePut = array(); /** * List of controller actions for which a DELETE request is required @@ -68,7 +68,7 @@ class SecurityComponent extends Object { * @access public * @see SecurityComponent::requireDelete() */ - var $requireDelete = array(); + public $requireDelete = array(); /** * List of actions that require an SSL-secured connection @@ -77,7 +77,7 @@ class SecurityComponent extends Object { * @access public * @see SecurityComponent::requireSecure() */ - var $requireSecure = array(); + public $requireSecure = array(); /** * List of actions that require a valid authentication key @@ -86,7 +86,7 @@ class SecurityComponent extends Object { * @access public * @see SecurityComponent::requireAuth() */ - var $requireAuth = array(); + public $requireAuth = array(); /** * List of actions that require an HTTP-authenticated login (basic or digest) @@ -95,7 +95,7 @@ class SecurityComponent extends Object { * @access public * @see SecurityComponent::requireLogin() */ - var $requireLogin = array(); + public $requireLogin = array(); /** * Login options for SecurityComponent::requireLogin() @@ -104,7 +104,7 @@ class SecurityComponent extends Object { * @access public * @see SecurityComponent::requireLogin() */ - var $loginOptions = array('type' => '', 'prompt' => null); + public $loginOptions = array('type' => '', 'prompt' => null); /** * An associative array of usernames/passwords used for HTTP-authenticated logins. @@ -114,7 +114,7 @@ class SecurityComponent extends Object { * @access public * @see SecurityComponent::requireLogin() */ - var $loginUsers = array(); + public $loginUsers = array(); /** * Controllers from which actions of the current controller are allowed to receive @@ -124,7 +124,7 @@ class SecurityComponent extends Object { * @access public * @see SecurityComponent::requireAuth() */ - var $allowedControllers = array(); + public $allowedControllers = array(); /** * Actions from which actions of the current controller are allowed to receive @@ -134,7 +134,7 @@ class SecurityComponent extends Object { * @access public * @see SecurityComponent::requireAuth() */ - var $allowedActions = array(); + public $allowedActions = array(); /** * Form fields to disable @@ -142,7 +142,7 @@ class SecurityComponent extends Object { * @var array * @access public */ - var $disabledFields = array(); + public $disabledFields = array(); /** * Whether to validate POST data. Set to false to disable for data coming from 3rd party @@ -151,7 +151,7 @@ class SecurityComponent extends Object { * @var boolean * @access public */ - var $validatePost = true; + public $validatePost = true; /** * Other components used by the Security component @@ -159,7 +159,7 @@ class SecurityComponent extends Object { * @var array * @access public */ - var $components = array('RequestHandler', 'Session'); + public $components = array('RequestHandler', 'Session'); /** * Holds the current action of the controller diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 8a1d5de04..f82906fa8 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -43,7 +43,7 @@ class Controller extends Object { * @access public * @link http://book.cakephp.org/view/959/Controller-Attributes */ - var $name = null; + public $name = null; /** * Stores the current URL, relative to the webroot of the application. @@ -51,7 +51,7 @@ class Controller extends Object { * @var string * @access public */ - var $here = null; + public $here = null; /** * The webroot of the application. @@ -59,7 +59,7 @@ class Controller extends Object { * @var string * @access public */ - var $webroot = null; + public $webroot = null; /** * The name of the currently requested controller action. @@ -67,12 +67,12 @@ class Controller extends Object { * @var string * @access public */ - var $action = null; + public $action = null; /** * An array containing the class names of models this controller uses. * - * Example: `var $uses = array('Product', 'Post', 'Comment');` + * Example: `public $uses = array('Product', 'Post', 'Comment');` * * Can be set to array() to use no models. Can be set to false to * use no models and prevent the merging of $uses with AppController @@ -81,19 +81,19 @@ class Controller extends Object { * @access protected * @link http://book.cakephp.org/view/961/components-helpers-and-uses */ - var $uses = false; + public $uses = false; /** * An array containing the names of helpers this controller uses. The array elements should * not contain the "Helper" part of the classname. * - * Example: `var $helpers = array('Html', 'Javascript', 'Time', 'Ajax');` + * Example: `public $helpers = array('Html', 'Javascript', 'Time', 'Ajax');` * * @var mixed A single name as a string or a list of names as an array. * @access protected * @link http://book.cakephp.org/view/961/components-helpers-and-uses */ - var $helpers = array('Session', 'Html', 'Form'); + public $helpers = array('Session', 'Html', 'Form'); /** * Parameters received in the current request: GET and POST data, information @@ -103,7 +103,7 @@ class Controller extends Object { * @access public * @link http://book.cakephp.org/view/963/The-Parameters-Attribute-params */ - var $params = array(); + public $params = array(); /** * Data POSTed to the controller using the HtmlHelper. Data here is accessible @@ -112,7 +112,7 @@ class Controller extends Object { * @var array * @access public */ - var $data = array(); + public $data = array(); /** * Holds pagination defaults for controller actions. The keys that can be included @@ -123,7 +123,7 @@ class Controller extends Object { * the name of the model as a key for a pagination array: * * {{{ - * var $paginate = array( + * public $paginate = array( * 'Post' => array(...), * 'Comment' => array(...) * ); @@ -133,7 +133,7 @@ class Controller extends Object { * @access public * @link http://book.cakephp.org/view/1231/Pagination */ - var $paginate = array('limit' => 20, 'page' => 1); + public $paginate = array('limit' => 20, 'page' => 1); /** * The name of the views subfolder containing views for this controller. @@ -141,7 +141,7 @@ class Controller extends Object { * @var string * @access public */ - var $viewPath = null; + public $viewPath = null; /** * The name of the layouts subfolder containing layouts for this controller. @@ -149,7 +149,7 @@ class Controller extends Object { * @var string * @access public */ - var $layoutPath = null; + public $layoutPath = null; /** * Contains variables to be handed to the view. @@ -157,7 +157,7 @@ class Controller extends Object { * @var array * @access public */ - var $viewVars = array(); + public $viewVars = array(); /** * An array containing the class names of the models this controller uses. @@ -165,7 +165,7 @@ class Controller extends Object { * @var array Array of model objects. * @access public */ - var $modelNames = array(); + public $modelNames = array(); /** * Base URL path. @@ -173,7 +173,7 @@ class Controller extends Object { * @var string * @access public */ - var $base = null; + public $base = null; /** * The name of the layout file to render the view inside of. The name specified @@ -184,7 +184,7 @@ class Controller extends Object { * @access public * @link http://book.cakephp.org/view/962/Page-related-Attributes-layout-and-pageTitle */ - var $layout = 'default'; + public $layout = 'default'; /** * Set to true to automatically render the view @@ -193,7 +193,7 @@ class Controller extends Object { * @var boolean * @access public */ - var $autoRender = true; + public $autoRender = true; /** * Set to true to automatically render the layout around views. @@ -201,7 +201,7 @@ class Controller extends Object { * @var boolean * @access public */ - var $autoLayout = true; + public $autoLayout = true; /** * Instance of Component used to handle callbacks. @@ -209,19 +209,19 @@ class Controller extends Object { * @var string * @access public */ - var $Component = null; + public $Component = null; /** * Array containing the names of components this controller uses. Component names * should not contain the "Component" portion of the classname. * - * Example: `var $components = array('Session', 'RequestHandler', 'Acl');` + * Example: `public $components = array('Session', 'RequestHandler', 'Acl');` * * @var array * @access public * @link http://book.cakephp.org/view/961/components-helpers-and-uses */ - var $components = array('Session'); + public $components = array('Session'); /** * The name of the View class this controller sends output to. @@ -229,7 +229,7 @@ class Controller extends Object { * @var string * @access public */ - var $view = 'View'; + public $view = 'View'; /** * File extension for view templates. Defaults to Cake's conventional ".ctp". @@ -237,7 +237,7 @@ class Controller extends Object { * @var string * @access public */ - var $ext = '.ctp'; + public $ext = '.ctp'; /** * The output of the requested action. Contains either a variable @@ -247,7 +247,7 @@ class Controller extends Object { * @var string * @access public */ - var $output = null; + public $output = null; /** * Automatically set to the name of a plugin. @@ -255,7 +255,7 @@ class Controller extends Object { * @var string * @access public */ - var $plugin = null; + public $plugin = null; /** * Used to define methods a controller that will be cached. To cache a @@ -265,7 +265,7 @@ class Controller extends Object { * Example: * * {{{ - * var $cacheAction = array( + * public $cacheAction = array( * 'view/23/' => 21600, * 'recalled/' => 86400 * ); @@ -278,7 +278,7 @@ class Controller extends Object { * @access public * @link http://book.cakephp.org/view/1380/Caching-in-the-Controller */ - var $cacheAction = false; + public $cacheAction = false; /** * Used to create cached instances of models a controller uses. @@ -288,7 +288,7 @@ class Controller extends Object { * @var boolean * @access public */ - var $persistModel = false; + public $persistModel = false; /** * Holds all params passed and named. @@ -296,7 +296,7 @@ class Controller extends Object { * @var mixed * @access public */ - var $passedArgs = array(); + public $passedArgs = array(); /** * Triggers Scaffolding @@ -305,7 +305,7 @@ class Controller extends Object { * @access public * @link http://book.cakephp.org/view/1103/Scaffolding */ - var $scaffold = false; + public $scaffold = false; /** * Holds current methods of the controller @@ -314,7 +314,7 @@ class Controller extends Object { * @access public * @link */ - var $methods = array(); + public $methods = array(); /** * This controller's primary model class name, the Inflector::classify()'ed version of @@ -325,7 +325,7 @@ class Controller extends Object { * @var string * @access public */ - var $modelClass = null; + public $modelClass = null; /** * This controller's model key name, an underscored version of the controller's $modelClass property. @@ -335,7 +335,7 @@ class Controller extends Object { * @var string * @access public */ - var $modelKey = null; + public $modelKey = null; /** * Holds any validation errors produced by the last call of the validateErrors() method/ @@ -343,7 +343,7 @@ class Controller extends Object { * @var array Validation errors, or false if none * @access public */ - var $validationErrors = null; + public $validationErrors = null; /** * Contains a list of the HTTP codes that CakePHP recognizes. These may be diff --git a/cake/libs/controller/pages_controller.php b/cake/libs/controller/pages_controller.php index b26f71a74..74979eaab 100644 --- a/cake/libs/controller/pages_controller.php +++ b/cake/libs/controller/pages_controller.php @@ -36,7 +36,7 @@ class PagesController extends AppController { * @var string * @access public */ - var $name = 'Pages'; + public $name = 'Pages'; /** * Default helper @@ -44,7 +44,7 @@ class PagesController extends AppController { * @var array * @access public */ - var $helpers = array('Html', 'Session'); + public $helpers = array('Html', 'Session'); /** * This controller does not use a model @@ -52,7 +52,7 @@ class PagesController extends AppController { * @var array * @access public */ - var $uses = array(); + public $uses = array(); /** * Displays a view diff --git a/cake/libs/controller/scaffold.php b/cake/libs/controller/scaffold.php index 2d5c10995..14f9566c7 100644 --- a/cake/libs/controller/scaffold.php +++ b/cake/libs/controller/scaffold.php @@ -39,7 +39,7 @@ class Scaffold extends Object { * @var Controller * @access public */ - var $controller = null; + public $controller = null; /** * Name of the controller to scaffold @@ -47,7 +47,7 @@ class Scaffold extends Object { * @var string * @access public */ - var $name = null; + public $name = null; /** * Action to be performed. @@ -55,7 +55,7 @@ class Scaffold extends Object { * @var string * @access public */ - var $action = null; + public $action = null; /** * Name of current model this view context is attached to @@ -63,7 +63,7 @@ class Scaffold extends Object { * @var string * @access public */ - var $model = null; + public $model = null; /** * Path to View. @@ -71,7 +71,7 @@ class Scaffold extends Object { * @var string * @access public */ - var $viewPath; + public $viewPath; /** * Path parts for creating links in views. @@ -79,7 +79,7 @@ class Scaffold extends Object { * @var string Base URL * @access public */ - var $base = null; + public $base = null; /** * Name of layout to use with this View. @@ -87,7 +87,7 @@ class Scaffold extends Object { * @var string * @access public */ - var $layout = 'default'; + public $layout = 'default'; /** * Array of parameter data @@ -95,7 +95,7 @@ class Scaffold extends Object { * @var array * @access public */ - var $params; + public $params; /** * File extension. Defaults to Cake's template ".ctp". @@ -103,7 +103,7 @@ class Scaffold extends Object { * @var array * @access public */ - var $ext = '.ctp'; + public $ext = '.ctp'; /** * Sub-directory for this view file. @@ -111,7 +111,7 @@ class Scaffold extends Object { * @var string * @access public */ - var $subDir = null; + public $subDir = null; /** * Plugin name. @@ -119,7 +119,7 @@ class Scaffold extends Object { * @var string * @access public */ - var $plugin = null; + public $plugin = null; /** * valid session. @@ -146,7 +146,7 @@ class Scaffold extends Object { * @var string * @access public */ - var $scaffoldTitle = null; + public $scaffoldTitle = null; /** * Construct and set up given controller with given parameters. @@ -433,7 +433,7 @@ function __scaffoldError() { /** * When methods are now present in a controller * scaffoldView is used to call default Scaffold methods if: - * `var $scaffold;` is placed in the controller's class definition. + * `public $scaffold;` is placed in the controller's class definition. * * @param array $params Parameters for scaffolding * @return mixed A rendered view of scaffold action, or showing the error diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index bea8f2046..4aac72060 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -51,7 +51,7 @@ class Debugger extends Object { * @var array * @access public */ - var $errors = array(); + public $errors = array(); /** * Contains the base URL for error code documentation. @@ -59,7 +59,7 @@ class Debugger extends Object { * @var string * @access public */ - var $helpPath = null; + public $helpPath = null; /** * The current output format. diff --git a/cake/libs/error.php b/cake/libs/error.php index a56489b57..be6dae192 100644 --- a/cake/libs/error.php +++ b/cake/libs/error.php @@ -30,14 +30,14 @@ * @subpackage cake.cake.libs */ class CakeErrorController extends AppController { - var $name = 'CakeError'; + public $name = 'CakeError'; /** * Uses Property * * @var array */ - var $uses = array(); + public $uses = array(); /** * __construct @@ -73,7 +73,7 @@ class ErrorHandler extends Object { * @var Controller * @access public */ - var $controller = null; + public $controller = null; /** * Class constructor. diff --git a/cake/libs/file.php b/cake/libs/file.php index 1ff463fd2..ee9428773 100644 --- a/cake/libs/file.php +++ b/cake/libs/file.php @@ -43,7 +43,7 @@ class File extends Object { * @var Folder * @access public */ - var $Folder = null; + public $Folder = null; /** * Filename @@ -51,7 +51,7 @@ class File extends Object { * @var string * @access public */ - var $name = null; + public $name = null; /** * file info @@ -59,7 +59,7 @@ class File extends Object { * @var string * @access public */ - var $info = array(); + public $info = array(); /** * Holds the file handler resource if the file is opened @@ -67,7 +67,7 @@ class File extends Object { * @var resource * @access public */ - var $handle = null; + public $handle = null; /** * enable locking for file reading and writing @@ -75,7 +75,7 @@ class File extends Object { * @var boolean * @access public */ - var $lock = null; + public $lock = null; /** * path property @@ -85,7 +85,7 @@ class File extends Object { * @var mixed null * @access public */ - var $path = null; + public $path = null; /** * Constructor diff --git a/cake/libs/folder.php b/cake/libs/folder.php index fb0f77228..a3031f018 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -41,7 +41,7 @@ class Folder extends Object { * @var string * @access public */ - var $path = null; + public $path = null; /** * Sortedness. Whether or not list results @@ -50,7 +50,7 @@ class Folder extends Object { * @var boolean * @access public */ - var $sort = false; + public $sort = false; /** * Mode to be used on create. Does nothing on windows platforms. @@ -58,7 +58,7 @@ class Folder extends Object { * @var integer * @access public */ - var $mode = 0755; + public $mode = 0755; /** * Holds messages from last method. diff --git a/cake/libs/http_socket.php b/cake/libs/http_socket.php index 16ea7af77..767f149d9 100644 --- a/cake/libs/http_socket.php +++ b/cake/libs/http_socket.php @@ -36,7 +36,7 @@ class HttpSocket extends CakeSocket { * @var string * @access public */ - var $description = 'HTTP-based DataSource Interface'; + public $description = 'HTTP-based DataSource Interface'; /** * When one activates the $quirksMode by setting it to true, all checks meant to @@ -46,7 +46,7 @@ class HttpSocket extends CakeSocket { * @var boolean * @access public */ - var $quirksMode = false; + public $quirksMode = false; /** * The default values to use for a request @@ -54,7 +54,7 @@ class HttpSocket extends CakeSocket { * @var array * @access public */ - var $request = array( + public $request = array( 'method' => 'GET', 'uri' => array( 'scheme' => 'http', @@ -88,7 +88,7 @@ class HttpSocket extends CakeSocket { * @var array * @access public */ - var $response = array( + public $response = array( 'raw' => array( 'status-line' => null, 'header' => null, @@ -111,7 +111,7 @@ class HttpSocket extends CakeSocket { * @var array * @access public */ - var $config = array( + public $config = array( 'persistent' => false, 'host' => 'localhost', 'protocol' => 'tcp', @@ -138,7 +138,7 @@ class HttpSocket extends CakeSocket { * @var string * @access public */ - var $lineBreak = "\r\n"; + public $lineBreak = "\r\n"; /** * Build an HTTP Socket using the specified configuration. diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index 03d1d1209..e20e241c5 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -37,7 +37,7 @@ class I18n extends Object { * @var I10n * @access public */ - var $l10n = null; + public $l10n = null; /** * Current domain of translation @@ -45,7 +45,7 @@ class I18n extends Object { * @var string * @access public */ - var $domain = null; + public $domain = null; /** * Current category of translation @@ -53,7 +53,7 @@ class I18n extends Object { * @var string * @access public */ - var $category = 'LC_MESSAGES'; + public $category = 'LC_MESSAGES'; /** * Current language used for translations diff --git a/cake/libs/l10n.php b/cake/libs/l10n.php index 1198015ae..0bd41e80c 100644 --- a/cake/libs/l10n.php +++ b/cake/libs/l10n.php @@ -32,7 +32,7 @@ class L10n extends Object { * @var string * @access public */ - var $language = 'English (United States)'; + public $language = 'English (United States)'; /** * Locale search paths @@ -40,7 +40,7 @@ class L10n extends Object { * @var array * @access public */ - var $languagePath = array('eng'); + public $languagePath = array('eng'); /** * ISO 639-3 for current locale @@ -48,7 +48,7 @@ class L10n extends Object { * @var string * @access public */ - var $lang = 'eng'; + public $lang = 'eng'; /** * Locale @@ -56,7 +56,7 @@ class L10n extends Object { * @var string * @access public */ - var $locale = 'en_us'; + public $locale = 'en_us'; /** * Default ISO 639-3 language. @@ -66,7 +66,7 @@ class L10n extends Object { * @var string * @access public */ - var $default = null; + public $default = null; /** * Encoding used for current locale @@ -74,7 +74,7 @@ class L10n extends Object { * @var string * @access public */ - var $charset = 'utf-8'; + public $charset = 'utf-8'; /** * Text direction for current locale @@ -82,7 +82,7 @@ class L10n extends Object { * @var string * @access public */ - var $direction = 'ltr'; + public $direction = 'ltr'; /** * Set to true if a locale is found @@ -90,7 +90,7 @@ class L10n extends Object { * @var string * @access public */ - var $found = false; + public $found = false; /** * Maps ISO 639-3 to I10n::__l10nCatalog diff --git a/cake/libs/magic_db.php b/cake/libs/magic_db.php index dd37d4d31..002a3073a 100644 --- a/cake/libs/magic_db.php +++ b/cake/libs/magic_db.php @@ -37,12 +37,12 @@ class MagicDb extends Object { * * @var array */ - var $db = array(); + public $db = array(); /** * Reads a MagicDb from various formats * - * @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 + * @public $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 */ @@ -186,7 +186,7 @@ class MagicFileResource extends Object{ * @var unknown * @access public */ - var $resource = null; + public $resource = null; /** * undocumented variable @@ -194,7 +194,7 @@ class MagicFileResource extends Object{ * @var unknown * @access public */ - var $offset = 0; + public $offset = 0; /** * undocumented function diff --git a/cake/libs/model/behaviors/containable.php b/cake/libs/model/behaviors/containable.php index be0890940..f5d6a1b08 100644 --- a/cake/libs/model/behaviors/containable.php +++ b/cake/libs/model/behaviors/containable.php @@ -35,7 +35,7 @@ class ContainableBehavior extends ModelBehavior { * @var array * @access private */ - var $types = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany'); + public $types = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany'); /** * Runtime configuration for this behavior @@ -43,7 +43,7 @@ class ContainableBehavior extends ModelBehavior { * @var array * @access private */ - var $runtime = array(); + public $runtime = array(); /** * Initiate behavior for the model using specified settings. diff --git a/cake/libs/model/behaviors/translate.php b/cake/libs/model/behaviors/translate.php index f9cfed4ca..a6104d13f 100644 --- a/cake/libs/model/behaviors/translate.php +++ b/cake/libs/model/behaviors/translate.php @@ -29,7 +29,7 @@ class TranslateBehavior extends ModelBehavior { /** * Used for runtime configuration of model */ - var $runtime = array(); + public $runtime = array(); /** * Callback @@ -517,9 +517,9 @@ function unbindTranslation(&$model, $fields = null) { * @subpackage cake.cake.libs.model.behaviors */ class I18nModel extends AppModel { - var $name = 'I18nModel'; - var $useTable = 'i18n'; - var $displayField = 'field'; + public $name = 'I18nModel'; + public $useTable = 'i18n'; + public $displayField = 'field'; } } ?> \ No newline at end of file diff --git a/cake/libs/model/behaviors/tree.php b/cake/libs/model/behaviors/tree.php index 6c72fde0e..bf48a72cd 100644 --- a/cake/libs/model/behaviors/tree.php +++ b/cake/libs/model/behaviors/tree.php @@ -36,7 +36,7 @@ class TreeBehavior extends ModelBehavior { * * @var array */ - var $errors = array(); + public $errors = array(); /** * Defaults diff --git a/cake/libs/model/cake_schema.php b/cake/libs/model/cake_schema.php index ae745c76e..fb6db0566 100644 --- a/cake/libs/model/cake_schema.php +++ b/cake/libs/model/cake_schema.php @@ -33,7 +33,7 @@ class CakeSchema extends Object { * @var string * @access public */ - var $name = null; + public $name = null; /** * Path to write location @@ -41,7 +41,7 @@ class CakeSchema extends Object { * @var string * @access public */ - var $path = null; + public $path = null; /** * File to write @@ -49,7 +49,7 @@ class CakeSchema extends Object { * @var string * @access public */ - var $file = 'schema.php'; + public $file = 'schema.php'; /** * Connection used for read @@ -57,14 +57,14 @@ class CakeSchema extends Object { * @var string * @access public */ - var $connection = 'default'; + public $connection = 'default'; /** * plugin name. * * @var string */ - var $plugin = null; + public $plugin = null; /** * Set of tables @@ -72,7 +72,7 @@ class CakeSchema extends Object { * @var array * @access public */ - var $tables = array(); + public $tables = array(); /** * Constructor diff --git a/cake/libs/model/connection_manager.php b/cake/libs/model/connection_manager.php index 042782279..45397e97a 100644 --- a/cake/libs/model/connection_manager.php +++ b/cake/libs/model/connection_manager.php @@ -36,7 +36,7 @@ class ConnectionManager extends Object { * @var DATABASE_CONFIG * @access public */ - var $config = null; + public $config = null; /** * Holds instances DataSource objects diff --git a/cake/libs/model/datasources/datasource.php b/cake/libs/model/datasources/datasource.php index c8b10a7ef..7bc700c7e 100644 --- a/cake/libs/model/datasources/datasource.php +++ b/cake/libs/model/datasources/datasource.php @@ -32,7 +32,7 @@ class DataSource extends Object { * @var boolean * @access public */ - var $connected = false; + public $connected = false; /** * Print full query debug info? @@ -40,7 +40,7 @@ class DataSource extends Object { * @var boolean * @access public */ - var $fullDebug = false; + public $fullDebug = false; /** * Error description of last query @@ -48,7 +48,7 @@ class DataSource extends Object { * @var unknown_type * @access public */ - var $error = null; + public $error = null; /** * String to hold how many rows were affected by the last SQL operation. @@ -56,7 +56,7 @@ class DataSource extends Object { * @var string * @access public */ - var $affected = null; + public $affected = null; /** * Number of rows in current resultset @@ -64,7 +64,7 @@ class DataSource extends Object { * @var int * @access public */ - var $numRows = null; + public $numRows = null; /** * Time the last query took @@ -72,7 +72,7 @@ class DataSource extends Object { * @var int * @access public */ - var $took = null; + public $took = null; /** * The starting character that this DataSource uses for quoted identifiers. @@ -80,7 +80,7 @@ class DataSource extends Object { * @var string * @access public */ - var $startQuote = null; + public $startQuote = null; /** * The ending character that this DataSource uses for quoted identifiers. @@ -88,7 +88,7 @@ class DataSource extends Object { * @var string * @access public */ - var $endQuote = null; + public $endQuote = null; /** * Enter description here... @@ -170,7 +170,7 @@ class DataSource extends Object { * @var array * @access public */ - var $connection = null; + public $connection = null; /** * The DataSource configuration @@ -178,7 +178,7 @@ class DataSource extends Object { * @var array * @access public */ - var $config = array(); + public $config = array(); /** * The DataSource configuration key name @@ -186,7 +186,7 @@ class DataSource extends Object { * @var string * @access public */ - var $configKeyName = null; + public $configKeyName = null; /** * Whether or not this DataSource is in the middle of a transaction @@ -203,7 +203,7 @@ class DataSource extends Object { * @var boolean * @access public */ - var $cacheSources = true; + public $cacheSources = true; /** * Constructor. diff --git a/cake/libs/model/datasources/dbo/dbo_mssql.php b/cake/libs/model/datasources/dbo/dbo_mssql.php index bb7d5796b..082557d9a 100644 --- a/cake/libs/model/datasources/dbo/dbo_mssql.php +++ b/cake/libs/model/datasources/dbo/dbo_mssql.php @@ -33,21 +33,21 @@ class DboMssql extends DboSource { * * @var string */ - var $description = "MS SQL DBO Driver"; + public $description = "MS SQL DBO Driver"; /** * Starting quote character for quoted identifiers * * @var string */ - var $startQuote = "["; + public $startQuote = "["; /** * Ending quote character for quoted identifiers * * @var string */ - var $endQuote = "]"; + public $endQuote = "]"; /** * Creates a map between field aliases and numeric indexes. Workaround for the @@ -76,7 +76,7 @@ class DboMssql extends DboSource { * * @var array */ - var $columns = array( + public $columns = array( 'primary_key' => array('name' => 'IDENTITY (1, 1) NOT NULL'), 'string' => array('name' => 'varchar', 'limit' => '255'), 'text' => array('name' => 'text'), diff --git a/cake/libs/model/datasources/dbo/dbo_mysql.php b/cake/libs/model/datasources/dbo/dbo_mysql.php index 7f5391b29..75048237a 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysql.php +++ b/cake/libs/model/datasources/dbo/dbo_mysql.php @@ -31,21 +31,21 @@ class DboMysqlBase extends DboSource { * * @var string */ - var $description = "MySQL DBO Base Driver"; + public $description = "MySQL DBO Base Driver"; /** * Start quote * * @var string */ - var $startQuote = "`"; + public $startQuote = "`"; /** * End quote * * @var string */ - var $endQuote = "`"; + public $endQuote = "`"; /** * use alias for update and delete. Set to true if version >= 4.1 @@ -73,7 +73,7 @@ class DboMysqlBase extends DboSource { * @var array * @access public */ - var $fieldParameters = array( + public $fieldParameters = array( 'charset' => array('value' => 'CHARACTER SET', 'quote' => false, 'join' => ' ', 'column' => false, 'position' => 'beforeDefault'), 'collate' => array('value' => 'COLLATE', 'quote' => false, 'join' => ' ', 'column' => 'Collation', 'position' => 'beforeDefault'), 'comment' => array('value' => 'COMMENT', 'quote' => true, 'join' => ' ', 'column' => 'Comment', 'position' => 'afterDefault') @@ -85,7 +85,7 @@ class DboMysqlBase extends DboSource { * @var array * @access public */ - var $tableParameters = array( + public $tableParameters = array( 'charset' => array('value' => 'DEFAULT CHARSET', 'quote' => false, 'join' => '=', 'column' => 'charset'), 'collate' => array('value' => 'COLLATE', 'quote' => false, 'join' => '=', 'column' => 'Collation'), 'engine' => array('value' => 'ENGINE', 'quote' => false, 'join' => '=', 'column' => 'Engine') @@ -96,7 +96,7 @@ class DboMysqlBase extends DboSource { * * @var array */ - var $columns = array( + public $columns = array( 'primary_key' => array('name' => 'NOT NULL AUTO_INCREMENT'), 'string' => array('name' => 'varchar', 'limit' => '255'), 'text' => array('name' => 'text'), @@ -511,7 +511,7 @@ class DboMysql extends DboMysqlBase { * * @var unknown_type */ - var $description = "MySQL DBO Driver"; + public $description = "MySQL DBO Driver"; /** * Base configuration settings for MySQL driver diff --git a/cake/libs/model/datasources/dbo/dbo_mysqli.php b/cake/libs/model/datasources/dbo/dbo_mysqli.php index 8c8d53062..3c02f9eb1 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysqli.php +++ b/cake/libs/model/datasources/dbo/dbo_mysqli.php @@ -34,7 +34,7 @@ class DboMysqli extends DboMysqlBase { * * @var unknown_type */ - var $description = "Mysqli DBO Driver"; + public $description = "Mysqli DBO Driver"; /** * Base configuration settings for Mysqli driver diff --git a/cake/libs/model/datasources/dbo/dbo_oracle.php b/cake/libs/model/datasources/dbo/dbo_oracle.php index e208849bf..063dc4764 100644 --- a/cake/libs/model/datasources/dbo/dbo_oracle.php +++ b/cake/libs/model/datasources/dbo/dbo_oracle.php @@ -34,14 +34,14 @@ class DboOracle extends DboSource { * @var unknown_type * @access public */ - var $config = array(); + public $config = array(); /** * Enter description here... * * @var unknown_type */ - var $alias = ''; + public $alias = ''; /** * Sequence names as introspected from the database @@ -61,7 +61,7 @@ class DboOracle extends DboSource { * @var unknown_type * @access public */ - var $columns = array( + public $columns = array( 'primary_key' => array('name' => ''), 'string' => array('name' => 'varchar2', 'limit' => '255'), 'text' => array('name' => 'varchar2'), @@ -82,7 +82,7 @@ class DboOracle extends DboSource { * @var unknown_type * @access protected */ - var $connection; + public $connection; /** * Enter description here... diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index cf22d069b..37f61b950 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -34,7 +34,7 @@ class DboPostgres extends DboSource { * @var string * @access public */ - var $description = "PostgreSQL DBO Driver"; + public $description = "PostgreSQL DBO Driver"; /** * Index of basic SQL commands @@ -65,7 +65,7 @@ class DboPostgres extends DboSource { 'encoding' => '' ); - var $columns = array( + public $columns = array( 'primary_key' => array('name' => 'serial NOT NULL'), 'string' => array('name' => 'varchar', 'limit' => '255'), 'text' => array('name' => 'text'), @@ -87,7 +87,7 @@ class DboPostgres extends DboSource { * @var string * @access public */ - var $startQuote = '"'; + public $startQuote = '"'; /** * Ending Quote @@ -95,7 +95,7 @@ class DboPostgres extends DboSource { * @var string * @access public */ - var $endQuote = '"'; + public $endQuote = '"'; /** * Contains mappings of custom auto-increment sequences, if a table uses a sequence name diff --git a/cake/libs/model/datasources/dbo/dbo_sqlite.php b/cake/libs/model/datasources/dbo/dbo_sqlite.php index 1a2850717..290c17981 100644 --- a/cake/libs/model/datasources/dbo/dbo_sqlite.php +++ b/cake/libs/model/datasources/dbo/dbo_sqlite.php @@ -33,21 +33,21 @@ class DboSqlite extends DboSource { * * @var unknown_type */ - var $description = "SQLite DBO Driver"; + public $description = "SQLite DBO Driver"; /** * Opening quote for quoted identifiers * * @var string */ - var $startQuote = '"'; + public $startQuote = '"'; /** * Closing quote for quoted identifiers * * @var string */ - var $endQuote = '"'; + public $endQuote = '"'; /** * Keeps the transaction statistics of CREATE/UPDATE/DELETE queries @@ -84,7 +84,7 @@ class DboSqlite extends DboSource { * * @var array */ - var $columns = array( + public $columns = array( 'primary_key' => array('name' => 'integer primary key'), 'string' => array('name' => 'varchar', 'limit' => '255'), 'text' => array('name' => 'text'), @@ -104,7 +104,7 @@ class DboSqlite extends DboSource { * @var array * @access public */ - var $fieldParameters = array( + public $fieldParameters = array( 'collate' => array( 'value' => 'COLLATE', 'quote' => false, diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index f3a479595..55416c63c 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -35,14 +35,14 @@ class DboSource extends DataSource { * @var string * @access public */ - var $description = "Database Data Source"; + public $description = "Database Data Source"; /** * index definition, standard cake, primary, index, unique * * @var array */ - var $index = array('PRI' => 'primary', 'MUL' => 'index', 'UNI' => 'unique'); + public $index = array('PRI' => 'primary', 'MUL' => 'index', 'UNI' => 'unique'); /** * Database keyword used to assign aliases to identifiers. @@ -50,7 +50,7 @@ class DboSource extends DataSource { * @var string * @access public */ - var $alias = 'AS '; + public $alias = 'AS '; /** * Caches result from query parsing operations @@ -58,7 +58,7 @@ class DboSource extends DataSource { * @var array * @access public */ - var $methodCache = array(); + public $methodCache = array(); /** * Whether or not to cache the results of DboSource::name() and DboSource::conditions() @@ -67,7 +67,7 @@ class DboSource extends DataSource { * @var boolean. * @access public */ - var $cacheMethods = true ; + public $cacheMethods = true ; /** * Bypass automatic adding of joined fields/associations. @@ -103,7 +103,7 @@ class DboSource extends DataSource { * @var array * @access public */ - var $tableParameters = array(); + public $tableParameters = array(); /** * List of engine specific additional field parameters used on table creating @@ -111,7 +111,7 @@ class DboSource extends DataSource { * @var array * @access public */ - var $fieldParameters = array(); + public $fieldParameters = array(); /** * Constructor diff --git a/cake/libs/model/db_acl.php b/cake/libs/model/db_acl.php index a497c1da4..1c78532ef 100644 --- a/cake/libs/model/db_acl.php +++ b/cake/libs/model/db_acl.php @@ -40,7 +40,7 @@ class AclNode extends AppModel { * @var boolean * @access public */ - var $cacheQueries = false; + public $cacheQueries = false; /** * ACL models use the Tree behavior @@ -48,7 +48,7 @@ class AclNode extends AppModel { * @var array * @access public */ - var $actsAs = array('Tree' => 'nested'); + public $actsAs = array('Tree' => 'nested'); /** * Constructor @@ -209,7 +209,7 @@ class Aco extends AclNode { * @var string * @access public */ - var $name = 'Aco'; + public $name = 'Aco'; /** * Binds to ARO nodes through permissions settings @@ -217,7 +217,7 @@ class Aco extends AclNode { * @var array * @access public */ - var $hasAndBelongsToMany = array('Aro' => array('with' => 'Permission')); + public $hasAndBelongsToMany = array('Aro' => array('with' => 'Permission')); } /** @@ -234,7 +234,7 @@ class AcoAction extends AppModel { * @var string * @access public */ - var $name = 'AcoAction'; + public $name = 'AcoAction'; /** * ACO Actions belong to ACOs @@ -242,7 +242,7 @@ class AcoAction extends AppModel { * @var array * @access public */ - var $belongsTo = array('Aco'); + public $belongsTo = array('Aco'); } /** @@ -259,7 +259,7 @@ class Aro extends AclNode { * @var string * @access public */ - var $name = 'Aro'; + public $name = 'Aro'; /** * AROs are linked to ACOs by means of Permission @@ -267,7 +267,7 @@ class Aro extends AclNode { * @var array * @access public */ - var $hasAndBelongsToMany = array('Aco' => array('with' => 'Permission')); + public $hasAndBelongsToMany = array('Aco' => array('with' => 'Permission')); } /** @@ -284,7 +284,7 @@ class Permission extends AppModel { * @var string * @access public */ - var $name = 'Permission'; + public $name = 'Permission'; /** * Explicitly disable in-memory query caching @@ -292,7 +292,7 @@ class Permission extends AppModel { * @var boolean * @access public */ - var $cacheQueries = false; + public $cacheQueries = false; /** * Override default table name @@ -300,7 +300,7 @@ class Permission extends AppModel { * @var string * @access public */ - var $useTable = 'aros_acos'; + public $useTable = 'aros_acos'; /** * Permissions link AROs with ACOs @@ -308,7 +308,7 @@ class Permission extends AppModel { * @var array * @access public */ - var $belongsTo = array('Aro', 'Aco'); + public $belongsTo = array('Aro', 'Aco'); /** * No behaviors for this model @@ -316,7 +316,7 @@ class Permission extends AppModel { * @var array * @access public */ - var $actsAs = null; + public $actsAs = null; /** * Constructor, used to tell this model to use the diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 8968cd57b..ab26e8dae 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -52,7 +52,7 @@ class Model extends Overloadable { * @access public * @link http://book.cakephp.org/view/1057/Model-Attributes#useDbConfig-1058 */ - var $useDbConfig = 'default'; + public $useDbConfig = 'default'; /** * Custom database table name, or null/false if no table association is desired. @@ -61,7 +61,7 @@ class Model extends Overloadable { * @access public * @link http://book.cakephp.org/view/1057/Model-Attributes#useTable-1059 */ - var $useTable = null; + public $useTable = null; /** * Custom display field name. Display fields are used by Scaffold, in SELECT boxes' OPTION elements. @@ -70,7 +70,7 @@ class Model extends Overloadable { * @access public * @link http://book.cakephp.org/view/1057/Model-Attributes#displayField-1062 */ - var $displayField = null; + public $displayField = null; /** * Value of the primary key ID of the record that this model is currently pointing to. @@ -79,7 +79,7 @@ class Model extends Overloadable { * @var mixed * @access public */ - var $id = false; + public $id = false; /** * Container for the data that this model gets from persistent storage (usually, a database). @@ -88,7 +88,7 @@ class Model extends Overloadable { * @access public * @link http://book.cakephp.org/view/1057/Model-Attributes#data-1065 */ - var $data = array(); + public $data = array(); /** * Table name for this Model. @@ -96,7 +96,7 @@ class Model extends Overloadable { * @var string * @access public */ - var $table = false; + public $table = false; /** * The name of the primary key field for this model. @@ -105,7 +105,7 @@ class Model extends Overloadable { * @access public * @link http://book.cakephp.org/view/1057/Model-Attributes#primaryKey-1061 */ - var $primaryKey = null; + public $primaryKey = null; /** * Field-by-field table metadata. @@ -125,7 +125,7 @@ class Model extends Overloadable { * @link http://book.cakephp.org/view/1057/Model-Attributes#validate-1067 * @link http://book.cakephp.org/view/1143/Data-Validation */ - var $validate = array(); + public $validate = array(); /** * List of validation errors. @@ -134,7 +134,7 @@ class Model extends Overloadable { * @access public * @link http://book.cakephp.org/view/1182/Validating-Data-from-the-Controller */ - var $validationErrors = array(); + public $validationErrors = array(); /** * Database table prefix for tables in model. @@ -143,7 +143,7 @@ class Model extends Overloadable { * @access public * @link http://book.cakephp.org/view/1057/Model-Attributes#tablePrefix-1060 */ - var $tablePrefix = null; + public $tablePrefix = null; /** * Name of the model. @@ -152,7 +152,7 @@ class Model extends Overloadable { * @access public * @link http://book.cakephp.org/view/1057/Model-Attributes#name-1068 */ - var $name = null; + public $name = null; /** * Alias name for model. @@ -160,7 +160,7 @@ class Model extends Overloadable { * @var string * @access public */ - var $alias = null; + public $alias = null; /** * List of table names included in the model description. Used for associations. @@ -168,7 +168,7 @@ class Model extends Overloadable { * @var array * @access public */ - var $tableToModel = array(); + public $tableToModel = array(); /** * Whether or not to log transactions for this model. @@ -176,7 +176,7 @@ class Model extends Overloadable { * @var boolean * @access public */ - var $logTransactions = false; + public $logTransactions = false; /** * Whether or not to cache queries for this model. This enables in-memory @@ -186,7 +186,7 @@ class Model extends Overloadable { * @access public * @link http://book.cakephp.org/view/1057/Model-Attributes#cacheQueries-1069 */ - var $cacheQueries = false; + public $cacheQueries = false; /** * Detailed list of belongsTo associations. @@ -195,7 +195,7 @@ class Model extends Overloadable { * @access public * @link http://book.cakephp.org/view/1042/belongsTo */ - var $belongsTo = array(); + public $belongsTo = array(); /** * Detailed list of hasOne associations. @@ -204,7 +204,7 @@ class Model extends Overloadable { * @access public * @link http://book.cakephp.org/view/1041/hasOne */ - var $hasOne = array(); + public $hasOne = array(); /** * Detailed list of hasMany associations. @@ -213,7 +213,7 @@ class Model extends Overloadable { * @access public * @link http://book.cakephp.org/view/1043/hasMany */ - var $hasMany = array(); + public $hasMany = array(); /** * Detailed list of hasAndBelongsToMany associations. @@ -222,19 +222,19 @@ class Model extends Overloadable { * @access public * @link http://book.cakephp.org/view/1044/hasAndBelongsToMany-HABTM */ - var $hasAndBelongsToMany = array(); + public $hasAndBelongsToMany = array(); /** * List of behaviors to load when the model object is initialized. Settings can be * passed to behaviors by using the behavior name as index. Eg: * - * var $actsAs = array('Translate', 'MyBehavior' => array('setting1' => 'value1')) + * public $actsAs = array('Translate', 'MyBehavior' => array('setting1' => 'value1')) * * @var array * @access public * @link http://book.cakephp.org/view/1072/Using-Behaviors */ - var $actsAs = null; + public $actsAs = null; /** * Holds the Behavior objects currently bound to this model. @@ -242,7 +242,7 @@ class Model extends Overloadable { * @var BehaviorCollection * @access public */ - var $Behaviors = null; + public $Behaviors = null; /** * Whitelist of fields allowed to be saved. @@ -250,7 +250,7 @@ class Model extends Overloadable { * @var array * @access public */ - var $whitelist = array(); + public $whitelist = array(); /** * Whether or not to cache sources for this model. @@ -258,7 +258,7 @@ class Model extends Overloadable { * @var boolean * @access public */ - var $cacheSources = true; + public $cacheSources = true; /** * Type of find query currently executing. @@ -266,7 +266,7 @@ class Model extends Overloadable { * @var string * @access public */ - var $findQueryType = null; + public $findQueryType = null; /** * Number of associations to recurse through during find calls. Fetches only @@ -276,33 +276,33 @@ class Model extends Overloadable { * @access public * @link http://book.cakephp.org/view/1057/Model-Attributes#recursive-1063 */ - var $recursive = 1; + public $recursive = 1; /** * The column name(s) and direction(s) to order find results by default. * - * var $order = "Post.created DESC"; - * var $order = array("Post.view_count DESC", "Post.rating DESC"); + * public $order = "Post.created DESC"; + * public $order = array("Post.view_count DESC", "Post.rating DESC"); * * @var string * @access public * @link http://book.cakephp.org/view/1057/Model-Attributes#order-1064 */ - var $order = null; + public $order = null; /** * Array of virtual fields this model has. Virtual fields are aliased * SQL expressions. Fields added to this property will be read as other fields in a model * but will not be saveable. * - * `var $virtualFields = array('two' => '1 + 1');` + * `public $virtualFields = array('two' => '1 + 1');` * * Is a simplistic example of how to set virtualFields * * @var array * @access public */ - var $virtualFields = array(); + public $virtualFields = array(); /** * Default list of association keys. @@ -633,10 +633,10 @@ function __createLinks() { * @param string $assoc Association name * @param string $className Class name * @deprecated $this->$className use $this->$assoc instead. $assoc is the 'key' in the associations array; - * examples: var $hasMany = array('Assoc' => array('className' => 'ModelName')); + * examples: public $hasMany = array('Assoc' => array('className' => 'ModelName')); * usage: $this->Assoc->modelMethods(); * - * var $hasMany = array('ModelName'); + * public $hasMany = array('ModelName'); * usage: $this->ModelName->modelMethods(); * @return void * @access private diff --git a/cake/libs/model/model_behavior.php b/cake/libs/model/model_behavior.php index 9a5dc9763..c5eb06d10 100644 --- a/cake/libs/model/model_behavior.php +++ b/cake/libs/model/model_behavior.php @@ -40,7 +40,7 @@ class ModelBehavior extends Object { * @access public * @see Model::$alias */ - var $settings = array(); + public $settings = array(); /** * Allows the mapping of preg-compatible regular expressions to public or @@ -51,7 +51,7 @@ class ModelBehavior extends Object { * @var array * @access public */ - var $mapMethods = array(); + public $mapMethods = array(); /** * Setup this behavior with the specified configuration settings. @@ -222,7 +222,7 @@ class BehaviorCollection extends Object { * @var string * @access public */ - var $modelName = null; + public $modelName = null; /** * Lists the currently-attached behavior objects diff --git a/cake/libs/router.php b/cake/libs/router.php index 96f7fc0c9..e8c3c9649 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -32,7 +32,7 @@ class Router { * @var array * @access public */ - var $routes = array(); + public $routes = array(); /** * List of action prefixes used in connected routes. @@ -80,7 +80,7 @@ class Router { * @var string * @access public */ - var $named = array( + public $named = array( 'default' => array('page', 'fields', 'order', 'limit', 'recursive', 'sort', 'direction', 'step'), 'greedy' => true, 'separator' => ':', @@ -1224,7 +1224,7 @@ class CakeRoute { * @var array * @access public */ - var $keys = array(); + public $keys = array(); /** * An array of additional parameters for the Route. @@ -1232,7 +1232,7 @@ class CakeRoute { * @var array * @access public */ - var $options = array(); + public $options = array(); /** * Default parameters for a Route @@ -1240,7 +1240,7 @@ class CakeRoute { * @var array * @access public */ - var $defaults = array(); + public $defaults = array(); /** * The routes template string. @@ -1248,7 +1248,7 @@ class CakeRoute { * @var string * @access public */ - var $template = null; + public $template = null; /** * Is this route a greedy route? Greedy routes have a `/*` in their diff --git a/cake/libs/security.php b/cake/libs/security.php index 53a5e519b..b6668c361 100644 --- a/cake/libs/security.php +++ b/cake/libs/security.php @@ -32,7 +32,7 @@ class Security extends Object { * @var string * @access public */ - var $hashType = null; + public $hashType = null; /** * Singleton implementation to get object instance. diff --git a/cake/libs/validation.php b/cake/libs/validation.php index f5a561f7a..a7e3aae43 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -35,7 +35,7 @@ class Validation extends Object { * @var string * @access public */ - var $check = null; + public $check = null; /** * Set to a valid regular expression in the class methods. @@ -44,7 +44,7 @@ class Validation extends Object { * @var string * @access public */ - var $regex = null; + public $regex = null; /** * Some complex patterns needed in multiple places @@ -63,7 +63,7 @@ class Validation extends Object { * @var string * @access public */ - var $country = null; + public $country = null; /** * Some class methods use a deeper validation when set to true @@ -71,7 +71,7 @@ class Validation extends Object { * @var string * @access public */ - var $deep = null; + public $deep = null; /** * Some class methods use the $type param to determine which validation to perfom in the method @@ -79,7 +79,7 @@ class Validation extends Object { * @var string * @access public */ - var $type = null; + public $type = null; /** * Holds an array of errors messages set in this class. @@ -88,7 +88,7 @@ class Validation extends Object { * @var array * @access public */ - var $errors = array(); + public $errors = array(); /** * Gets a reference to the Validation object instance diff --git a/cake/libs/view/errors/missing_action.ctp b/cake/libs/view/errors/missing_action.ctp index 949f02a77..0e3ce9724 100644 --- a/cake/libs/view/errors/missing_action.ctp +++ b/cake/libs/view/errors/missing_action.ctp @@ -30,7 +30,7 @@ <?php class <?php echo $controller;?> extends AppController { - var $name = '<?php echo $controllerName;?>'; + public $name = '<?php echo $controllerName;?>'; <strong> function <?php echo $action;?>() { diff --git a/cake/libs/view/errors/missing_controller.ctp b/cake/libs/view/errors/missing_controller.ctp index 606f2c020..255835d75 100644 --- a/cake/libs/view/errors/missing_controller.ctp +++ b/cake/libs/view/errors/missing_controller.ctp @@ -30,7 +30,7 @@ <?php class <?php echo $controller;?> extends AppController { - var $name = '<?php echo $controllerName;?>'; + public $name = '<?php echo $controllerName;?>'; } ?> </pre> diff --git a/cake/libs/view/errors/missing_model.ctp b/cake/libs/view/errors/missing_model.ctp index f4211f9ca..86488bd34 100644 --- a/cake/libs/view/errors/missing_model.ctp +++ b/cake/libs/view/errors/missing_model.ctp @@ -30,7 +30,7 @@ <?php class <?php echo $model;?> extends AppModel { - var $name = '<?php echo $model;?>'; + public $name = '<?php echo $model;?>'; } ?> diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index 1ec808aa0..72b4b7f30 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -39,77 +39,77 @@ class Helper extends Overloadable { * * @var array */ - var $helpers = null; + public $helpers = null; /** * Base URL * * @var string */ - var $base = null; + public $base = null; /** * Webroot path * * @var string */ - var $webroot = null; + public $webroot = null; /** * The current theme name if any. * * @var string */ - var $theme = null; + public $theme = null; /** * URL to current action. * * @var string */ - var $here = null; + public $here = null; /** * Parameter array. * * @var array */ - var $params = array(); + public $params = array(); /** * Current action. * * @var string */ - var $action = null; + public $action = null; /** * Plugin path * * @var string */ - var $plugin = null; + public $plugin = null; /** * POST data for models * * @var array */ - var $data = null; + public $data = null; /** * List of named arguments * * @var array */ - var $namedArgs = null; + public $namedArgs = null; /** * URL argument separator character * * @var string */ - var $argSeparator = null; + public $argSeparator = null; /** * Contains model validation errors of form post-backs @@ -117,7 +117,7 @@ class Helper extends Overloadable { * @access public * @var array */ - var $validationErrors = null; + public $validationErrors = null; /** * Holds tag templates. @@ -125,7 +125,7 @@ class Helper extends Overloadable { * @access public * @var array */ - var $tags = array(); + public $tags = array(); /** * Holds the content to be cleaned. diff --git a/cake/libs/view/helpers/ajax.php b/cake/libs/view/helpers/ajax.php index 6e5b6fcd2..bbac4998b 100644 --- a/cake/libs/view/helpers/ajax.php +++ b/cake/libs/view/helpers/ajax.php @@ -35,7 +35,7 @@ class AjaxHelper extends AppHelper { * * @var array */ - var $helpers = array('Html', 'Javascript', 'Form'); + public $helpers = array('Html', 'Javascript', 'Form'); /** * HtmlHelper instance @@ -43,7 +43,7 @@ class AjaxHelper extends AppHelper { * @var HtmlHelper * @access public */ - var $Html = null; + public $Html = null; /** * JavaScriptHelper instance @@ -51,14 +51,14 @@ class AjaxHelper extends AppHelper { * @var JavaScriptHelper * @access public */ - var $Javascript = null; + public $Javascript = null; /** * Names of Javascript callback functions. * * @var array */ - var $callbacks = array( + public $callbacks = array( 'complete', 'create', 'exception', 'failure', 'interactive', 'loading', 'loaded', 'success', 'uninitialized' ); @@ -68,7 +68,7 @@ class AjaxHelper extends AppHelper { * * @var array */ - var $ajaxOptions = array( + public $ajaxOptions = array( 'after', 'asynchronous', 'before', 'confirm', 'condition', 'contentType', 'encoding', 'evalScripts', 'failure', 'fallback', 'form', 'indicator', 'insertion', 'interactive', 'loaded', 'loading', 'method', 'onCreate', 'onComplete', 'onException', 'onFailure', @@ -81,7 +81,7 @@ class AjaxHelper extends AppHelper { * * @var array */ - var $dragOptions = array( + public $dragOptions = array( 'handle', 'revert', 'snap', 'zindex', 'constraint', 'change', 'ghosting', 'starteffect', 'reverteffect', 'endeffect', 'scroll', 'scrollSensitivity', 'onStart', 'onDrag', 'onEnd' @@ -92,7 +92,7 @@ class AjaxHelper extends AppHelper { * * @var array */ - var $dropOptions = array( + public $dropOptions = array( 'accept', 'containment', 'greedy', 'hoverclass', 'onHover', 'onDrop', 'overlap' ); @@ -101,7 +101,7 @@ class AjaxHelper extends AppHelper { * * @var array */ - var $sortOptions = array( + public $sortOptions = array( 'constraint', 'containment', 'dropOnEmpty', 'ghosting', 'handle', 'hoverclass', 'onUpdate', 'onChange', 'only', 'overlap', 'scroll', 'scrollSensitivity', 'scrollSpeed', 'tag', 'tree', 'treeTag', 'update' @@ -112,7 +112,7 @@ class AjaxHelper extends AppHelper { * * @var array */ - var $sliderOptions = array( + public $sliderOptions = array( 'alignX', 'alignY', 'axis', 'disabled', 'handleDisabled', 'handleImage', 'increment', 'maximum', 'minimum', 'onChange', 'onSlide', 'range', 'sliderValue', 'values' ); @@ -122,7 +122,7 @@ class AjaxHelper extends AppHelper { * * @var array */ - var $editorOptions = array( + public $editorOptions = array( 'okText', 'cancelText', 'savingText', 'formId', 'externalControl', 'rows', 'cols', 'size', 'highlightcolor', 'highlightendcolor', 'savingClassName', 'formClassName', 'loadTextURL', 'loadingText', 'callback', 'ajaxOptions', 'clickToEditText', 'collection', 'okControl', @@ -134,7 +134,7 @@ class AjaxHelper extends AppHelper { * * @var array */ - var $autoCompleteOptions = array( + public $autoCompleteOptions = array( 'afterUpdateElement', 'callback', 'frequency', 'indicator', 'minChars', 'onShow', 'onHide', 'parameters', 'paramName', 'tokens', 'updateElement' ); diff --git a/cake/libs/view/helpers/cache.php b/cake/libs/view/helpers/cache.php index a495d5085..63c2e6198 100644 --- a/cake/libs/view/helpers/cache.php +++ b/cake/libs/view/helpers/cache.php @@ -53,7 +53,7 @@ class CacheHelper extends AppHelper { * @var object * @access public */ - var $cacheAction; + public $cacheAction; /** * Main method used to cache a view diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 61e776c0f..28f761f16 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -36,7 +36,7 @@ class FormHelper extends AppHelper { * @var array * @access public */ - var $helpers = array('Html'); + public $helpers = array('Html'); /** * Holds the fields array('field_name' => array('type'=> 'string', 'length'=> 100), @@ -44,7 +44,7 @@ class FormHelper extends AppHelper { * * @access public */ - var $fieldset = array(); + public $fieldset = array(); /** * Options used by DateTime fields @@ -62,7 +62,7 @@ class FormHelper extends AppHelper { * @var array * @access public */ - var $fields = array(); + public $fields = array(); /** * Defines the type of form being created. Set by FormHelper::create(). @@ -70,7 +70,7 @@ class FormHelper extends AppHelper { * @var string * @access public */ - var $requestType = null; + public $requestType = null; /** * The default model being used for the current form. @@ -78,7 +78,7 @@ class FormHelper extends AppHelper { * @var string * @access public */ - var $defaultModel = null; + public $defaultModel = null; /** diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php index 870aefb79..0ec9a0d51 100644 --- a/cake/libs/view/helpers/html.php +++ b/cake/libs/view/helpers/html.php @@ -32,7 +32,7 @@ class HtmlHelper extends AppHelper { * @var array * @access public */ - var $tags = array( + public $tags = array( 'meta' => '<meta%s/>', 'metalink' => '<link href="%s"%s/>', 'link' => '<a href="%s"%s>%s</a>', diff --git a/cake/libs/view/helpers/javascript.php b/cake/libs/view/helpers/javascript.php index 847d6d090..e64532cd1 100644 --- a/cake/libs/view/helpers/javascript.php +++ b/cake/libs/view/helpers/javascript.php @@ -34,7 +34,7 @@ class JavascriptHelper extends AppHelper { * @var boolean * @access public */ - var $useNative = false; + public $useNative = false; /** * If true, automatically writes events to the end of a script or to an external JavaScript file @@ -43,7 +43,7 @@ class JavascriptHelper extends AppHelper { * @var boolean * @access public */ - var $enabled = true; + public $enabled = true; /** * Indicates whether <script /> blocks should be written 'safely,' i.e. wrapped in CDATA blocks @@ -51,7 +51,7 @@ class JavascriptHelper extends AppHelper { * @var boolean * @access public */ - var $safe = false; + public $safe = false; /** * HTML tags used by this helper. @@ -59,7 +59,7 @@ class JavascriptHelper extends AppHelper { * @var array * @access public */ - var $tags = array( + public $tags = array( 'javascriptstart' => '<script type="text/javascript">', 'javascriptend' => '</script>', 'javascriptblock' => '<script type="text/javascript">%s</script>', diff --git a/cake/libs/view/helpers/jquery_engine.php b/cake/libs/view/helpers/jquery_engine.php index 235b0e0c5..c6bcb7d81 100644 --- a/cake/libs/view/helpers/jquery_engine.php +++ b/cake/libs/view/helpers/jquery_engine.php @@ -109,7 +109,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper { * @var string * @access public */ - var $jQueryObject = '$'; + public $jQueryObject = '$'; /** * Helper function to wrap repetitive simple method templating. diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 3ec992a1f..03eede43c 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -34,7 +34,7 @@ class JsHelper extends AppHelper { * @var boolean * @access public */ - var $bufferScripts = true; + public $bufferScripts = true; /** * helpers @@ -42,7 +42,7 @@ class JsHelper extends AppHelper { * @var array * @access public */ - var $helpers = array('Html', 'Form'); + public $helpers = array('Html', 'Form'); /** * Variables to pass to Javascript. @@ -76,7 +76,7 @@ class JsHelper extends AppHelper { * @var string * @access public */ - var $setVariable = APP_DIR; + public $setVariable = APP_DIR; /** * Constructor - determines engine helper @@ -442,7 +442,7 @@ class JsBaseEngineHelper extends AppHelper { * @var boolean * @access public */ - var $useNative = false; + public $useNative = false; /** * The js snippet for the current selection. @@ -450,7 +450,7 @@ class JsBaseEngineHelper extends AppHelper { * @var string * @access public */ - var $selection; + public $selection; /** * Collection of option maps. Option maps allow other helpers to use generic names for engine @@ -469,7 +469,7 @@ class JsBaseEngineHelper extends AppHelper { * @var array * @access public */ - var $bufferedMethods = array('event', 'sortable', 'drag', 'drop', 'slider'); + public $bufferedMethods = array('event', 'sortable', 'drag', 'drop', 'slider'); /** * Contains a list of callback names -> default arguments. diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index 93c6afb05..8edce3a9d 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -33,7 +33,7 @@ class PaginatorHelper extends AppHelper { * * @var array */ - var $helpers = array('Html'); + public $helpers = array('Html'); /** * Holds the default model for paged recordsets @@ -73,12 +73,12 @@ class PaginatorHelper extends AppHelper { * @var array * @access public */ - var $options = array(); + public $options = array(); /** * Constructor for the helper. Sets up the helper that is used for creating 'AJAX' links. * - * Use `var $helpers = array('Paginator' => array('ajax' => 'CustomHelper'));` to set a custom Helper + * Use `public $helpers = array('Paginator' => array('ajax' => 'CustomHelper'));` to set a custom Helper * or choose a non JsHelper Helper. If you want to use a specific library with JsHelper declare JsHelper and its * adapter before including PaginatorHelper in your helpers array. * diff --git a/cake/libs/view/helpers/rss.php b/cake/libs/view/helpers/rss.php index 5e8da2353..07b9014cb 100644 --- a/cake/libs/view/helpers/rss.php +++ b/cake/libs/view/helpers/rss.php @@ -35,7 +35,7 @@ class RssHelper extends XmlHelper { * @var array * @access public */ - var $helpers = array('Time'); + public $helpers = array('Time'); /** * Base URL @@ -43,7 +43,7 @@ class RssHelper extends XmlHelper { * @access public * @var string */ - var $base = null; + public $base = null; /** * URL to current action. @@ -51,7 +51,7 @@ class RssHelper extends XmlHelper { * @access public * @var string */ - var $here = null; + public $here = null; /** * Parameter array. @@ -59,7 +59,7 @@ class RssHelper extends XmlHelper { * @access public * @var array */ - var $params = array(); + public $params = array(); /** * Current action. @@ -67,7 +67,7 @@ class RssHelper extends XmlHelper { * @access public * @var string */ - var $action = null; + public $action = null; /** * POSTed model data @@ -75,7 +75,7 @@ class RssHelper extends XmlHelper { * @access public * @var array */ - var $data = null; + public $data = null; /** * Name of the current model @@ -83,7 +83,7 @@ class RssHelper extends XmlHelper { * @access public * @var string */ - var $model = null; + public $model = null; /** * Name of the current field @@ -91,7 +91,7 @@ class RssHelper extends XmlHelper { * @access public * @var string */ - var $field = null; + public $field = null; /** * Default spec version of generated RSS @@ -99,7 +99,7 @@ class RssHelper extends XmlHelper { * @access public * @var string */ - var $version = '2.0'; + public $version = '2.0'; /** * Returns an RSS document wrapped in `<rss />` tags diff --git a/cake/libs/view/helpers/session.php b/cake/libs/view/helpers/session.php index 29db2ff4b..9d8c0037e 100644 --- a/cake/libs/view/helpers/session.php +++ b/cake/libs/view/helpers/session.php @@ -35,7 +35,7 @@ class SessionHelper extends CakeSession { * * @var array */ - var $helpers = array(); + public $helpers = array(); /** * Used to determine if methods implementation is used, or bypassed diff --git a/cake/libs/view/helpers/xml.php b/cake/libs/view/helpers/xml.php index 6b4319134..d6f1226e8 100644 --- a/cake/libs/view/helpers/xml.php +++ b/cake/libs/view/helpers/xml.php @@ -35,7 +35,7 @@ class XmlHelper extends AppHelper { * @access public * @var string */ - var $encoding = 'UTF-8'; + public $encoding = 'UTF-8'; /** * Constructor diff --git a/cake/libs/view/media.php b/cake/libs/view/media.php index ce77c4aba..ba6412e64 100644 --- a/cake/libs/view/media.php +++ b/cake/libs/view/media.php @@ -27,7 +27,7 @@ class MediaView extends View { * @var array * @access public */ - var $mimeType = array( + public $mimeType = array( 'ai' => 'application/postscript', 'bcpio' => 'application/x-bcpio', 'bin' => 'application/octet-stream', 'ccad' => 'application/clariscad', 'cdf' => 'application/x-netcdf', 'class' => 'application/octet-stream', 'cpio' => 'application/x-cpio', 'cpt' => 'application/mac-compactpro', 'csh' => 'application/x-csh', diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index 11062487d..5c9f4eab4 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -40,14 +40,14 @@ class View extends Object { * @var string Base URL * @access public */ - var $base = null; + public $base = null; /** * Stores the current URL (for links etc.) * * @var string Current URL */ - var $here = null; + public $here = null; /** * Name of the plugin. @@ -55,7 +55,7 @@ class View extends Object { * @link http://manual.cakephp.org/chapter/plugins * @var string */ - var $plugin = null; + public $plugin = null; /** * Name of the controller. @@ -63,7 +63,7 @@ class View extends Object { * @var string Name of controller * @access public */ - var $name = null; + public $name = null; /** * Action to be performed. @@ -71,28 +71,28 @@ class View extends Object { * @var string Name of action * @access public */ - var $action = null; + public $action = null; /** * Array of parameter data * * @var array Parameter data */ - var $params = array(); + public $params = array(); /** * Current passed params * * @var mixed */ - var $passedArgs = array(); + public $passedArgs = array(); /** * Array of data * * @var array Parameter data */ - var $data = array(); + public $data = array(); /** * An array of names of built-in helpers to include. @@ -100,14 +100,14 @@ class View extends Object { * @var mixed A single name as a string or a list of names as an array. * @access public */ - var $helpers = array('Html'); + public $helpers = array('Html'); /** * Path to View. * * @var string Path to View */ - var $viewPath = null; + public $viewPath = null; /** * Variables for the view @@ -115,7 +115,7 @@ class View extends Object { * @var array * @access public */ - var $viewVars = array(); + public $viewVars = array(); /** * Name of layout to use with this View. @@ -123,14 +123,14 @@ class View extends Object { * @var string * @access public */ - var $layout = 'default'; + public $layout = 'default'; /** * Path to Layout. * * @var string Path to Layout */ - var $layoutPath = null; + public $layoutPath = null; /** * Turns on or off Cake's conventional mode of rendering views. On by default. @@ -138,7 +138,7 @@ class View extends Object { * @var boolean * @access public */ - var $autoRender = true; + public $autoRender = true; /** * Turns on or off Cake's conventional mode of finding layout files. On by default. @@ -146,7 +146,7 @@ class View extends Object { * @var boolean * @access public */ - var $autoLayout = true; + public $autoLayout = true; /** * File extension. Defaults to Cake's template ".ctp". @@ -154,7 +154,7 @@ class View extends Object { * @var string * @access public */ - var $ext = '.ctp'; + public $ext = '.ctp'; /** * Sub-directory for this view file. @@ -162,7 +162,7 @@ class View extends Object { * @var string * @access public */ - var $subDir = null; + public $subDir = null; /** * Theme name. @@ -170,7 +170,7 @@ class View extends Object { * @var string * @access public */ - var $theme = null; + public $theme = null; /** * Used to define methods a controller that will be cached. @@ -179,7 +179,7 @@ class View extends Object { * @var mixed * @access public */ - var $cacheAction = false; + public $cacheAction = false; /** * holds current errors for the model validation @@ -187,7 +187,7 @@ class View extends Object { * @var array * @access public */ - var $validationErrors = array(); + public $validationErrors = array(); /** * True when the view has been rendered. @@ -195,7 +195,7 @@ class View extends Object { * @var boolean * @access public */ - var $hasRendered = false; + public $hasRendered = false; /** * Array of loaded view helpers. @@ -203,7 +203,7 @@ class View extends Object { * @var array * @access public */ - var $loaded = array(); + public $loaded = array(); /** * True if in scope of model-specific region @@ -211,7 +211,7 @@ class View extends Object { * @var boolean * @access public */ - var $modelScope = false; + public $modelScope = false; /** * Name of current model this view context is attached to @@ -219,7 +219,7 @@ class View extends Object { * @var string * @access public */ - var $model = null; + public $model = null; /** * Name of association model this view context is attached to @@ -227,7 +227,7 @@ class View extends Object { * @var string * @access public */ - var $association = null; + public $association = null; /** * Name of current model field this view context is attached to @@ -235,7 +235,7 @@ class View extends Object { * @var string * @access public */ - var $field = null; + public $field = null; /** * Suffix of current field this view context is attached to @@ -243,7 +243,7 @@ class View extends Object { * @var string * @access public */ - var $fieldSuffix = null; + public $fieldSuffix = null; /** * The current model ID this view context is attached to @@ -251,7 +251,7 @@ class View extends Object { * @var mixed * @access public */ - var $modelId = null; + public $modelId = null; /** * List of generated DOM UUIDs @@ -259,7 +259,7 @@ class View extends Object { * @var array * @access public */ - var $uuids = array(); + public $uuids = array(); /** * Holds View output. @@ -267,7 +267,7 @@ class View extends Object { * @var string * @access public */ - var $output = false; + public $output = false; /** * List of variables to collect from the associated controller diff --git a/cake/libs/xml.php b/cake/libs/xml.php index a2bf6527f..d4fbd1828 100644 --- a/cake/libs/xml.php +++ b/cake/libs/xml.php @@ -38,7 +38,7 @@ class XmlNode extends Object { * @var string * @access public */ - var $name = null; + public $name = null; /** * Node namespace @@ -46,7 +46,7 @@ class XmlNode extends Object { * @var string * @access public */ - var $namespace = null; + public $namespace = null; /** * Namespaces defined for this node and all child nodes @@ -54,7 +54,7 @@ class XmlNode extends Object { * @var array * @access public */ - var $namespaces = array(); + public $namespaces = array(); /** * Value of node @@ -62,7 +62,7 @@ class XmlNode extends Object { * @var string * @access public */ - var $value; + public $value; /** * Attributes on this node @@ -70,7 +70,7 @@ class XmlNode extends Object { * @var array * @access public */ - var $attributes = array(); + public $attributes = array(); /** * This node's children @@ -78,7 +78,7 @@ class XmlNode extends Object { * @var array * @access public */ - var $children = array(); + public $children = array(); /** * Reference to parent node. @@ -829,7 +829,7 @@ class Xml extends XmlNode { * @var string * @access private */ - var $version = '1.0'; + public $version = '1.0'; /** * XML document encoding @@ -837,7 +837,7 @@ class Xml extends XmlNode { * @var string * @access private */ - var $encoding = 'UTF-8'; + public $encoding = 'UTF-8'; /** * Constructor. Sets up the XML parser with options, gives it this object as @@ -1337,14 +1337,14 @@ class XmlTextNode extends XmlNode { * * @var string */ - var $name = '#text'; + public $name = '#text'; /** * The text/data value which this node contains * * @var string */ - var $value = null; + public $value = null; /** * Construct text node with the given parent object and data @@ -1420,7 +1420,7 @@ class XmlManager { * @var array * @access public */ - var $namespaces = array(); + public $namespaces = array(); /** * Global XML document parsing/generation settings. @@ -1428,7 +1428,7 @@ class XmlManager { * @var array * @access public */ - var $options = array(); + public $options = array(); /** * Map of common namespace URIs @@ -1436,7 +1436,7 @@ class XmlManager { * @access private * @var array */ - var $defaultNamespaceMap = array( + public $defaultNamespaceMap = array( 'dc' => 'http://purl.org/dc/elements/1.1/', // Dublin Core 'dct' => 'http://purl.org/dc/terms/', // Dublin Core Terms 'g' => 'http://base.google.com/ns/1.0', // Google Base diff --git a/cake/tests/cases/console/cake.test.php b/cake/tests/cases/console/cake.test.php index eb7985e75..fa1af172e 100644 --- a/cake/tests/cases/console/cake.test.php +++ b/cake/tests/cases/console/cake.test.php @@ -44,7 +44,7 @@ class TestShellDispatcher extends ShellDispatcher { * @var array * @access public */ - var $params = array(); + public $params = array(); /** * stdout property @@ -52,7 +52,7 @@ class TestShellDispatcher extends ShellDispatcher { * @var string * @access public */ - var $stdout = ''; + public $stdout = ''; /** * stderr property @@ -60,7 +60,7 @@ class TestShellDispatcher extends ShellDispatcher { * @var string * @access public */ - var $stderr = ''; + public $stderr = ''; /** * stopped property @@ -68,7 +68,7 @@ class TestShellDispatcher extends ShellDispatcher { * @var string * @access public */ - var $stopped = null; + public $stopped = null; /** * TestShell @@ -76,7 +76,7 @@ class TestShellDispatcher extends ShellDispatcher { * @var mixed * @access public */ - var $TestShell; + public $TestShell; /** * _initEnvironment method diff --git a/cake/tests/cases/console/libs/acl.test.php b/cake/tests/cases/console/libs/acl.test.php index ccd3d0401..834f8d263 100644 --- a/cake/tests/cases/console/libs/acl.test.php +++ b/cake/tests/cases/console/libs/acl.test.php @@ -59,7 +59,7 @@ class AclShellTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.aco', 'core.aro', 'core.aros_aco'); + public $fixtures = array('core.aco', 'core.aro', 'core.aros_aco'); /** * configure Configure for testcase diff --git a/cake/tests/cases/console/libs/bake.test.php b/cake/tests/cases/console/libs/bake.test.php index 37a86b259..0aef9ed21 100644 --- a/cake/tests/cases/console/libs/bake.test.php +++ b/cake/tests/cases/console/libs/bake.test.php @@ -51,7 +51,7 @@ if (!class_exists('UsersController')) { class UsersController extends Controller { - var $name = 'Users'; + public $name = 'Users'; } } @@ -63,7 +63,7 @@ class BakeShellTestCase extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.user'); + public $fixtures = array('core.user'); /** * start test diff --git a/cake/tests/cases/console/libs/schema.test.php b/cake/tests/cases/console/libs/schema.test.php index 78ed58839..a8d9ae411 100644 --- a/cake/tests/cases/console/libs/schema.test.php +++ b/cake/tests/cases/console/libs/schema.test.php @@ -60,7 +60,7 @@ class SchemaShellTestSchema extends CakeSchema { * @var string 'MyApp' * @access public */ - var $name = 'SchemaShellTest'; + public $name = 'SchemaShellTest'; /** * connection property @@ -68,7 +68,7 @@ class SchemaShellTestSchema extends CakeSchema { * @var string 'test_suite' * @access public */ - var $connection = 'test_suite'; + public $connection = 'test_suite'; /** * comments property @@ -76,7 +76,7 @@ class SchemaShellTestSchema extends CakeSchema { * @var array * @access public */ - var $comments = array( + public $comments = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => 0, 'key' => 'primary'), 'post_id' => array('type' => 'integer', 'null' => false, 'default' => 0), 'user_id' => array('type' => 'integer', 'null' => false), @@ -94,7 +94,7 @@ class SchemaShellTestSchema extends CakeSchema { * @var array * @access public */ - var $articles = array( + public $articles = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => 0, 'key' => 'primary'), 'user_id' => array('type' => 'integer', 'null' => true, 'default' => ''), 'title' => array('type' => 'string', 'null' => false, 'default' => 'Title'), @@ -121,7 +121,7 @@ class SchemaShellTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.article', 'core.user', 'core.post', 'core.auth_user', 'core.author', + public $fixtures = array('core.article', 'core.user', 'core.post', 'core.auth_user', 'core.author', 'core.comment', 'core.test_plugin_comment' ); diff --git a/cake/tests/cases/console/libs/shell.test.php b/cake/tests/cases/console/libs/shell.test.php index e728ff38d..3c984f335 100644 --- a/cake/tests/cases/console/libs/shell.test.php +++ b/cake/tests/cases/console/libs/shell.test.php @@ -52,14 +52,14 @@ class TestShell extends Shell { * @var name * @access public */ - var $name = 'TestShell'; + public $name = 'TestShell'; /** * stopped property * * @var integer * @access public */ - var $stopped; + public $stopped; /** * stop method @@ -105,7 +105,7 @@ class ShellTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array( + public $fixtures = array( 'core.post', 'core.comment', 'core.article', 'core.user', 'core.tag', 'core.articles_tag', 'core.attachment' ); diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 13b45d7cb..40071cdd8 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -69,9 +69,9 @@ App::import('Core', 'Model'); class Article extends Model { - var $name = 'Article'; - var $hasMany = array('Comment'); - var $hasAndBelongsToMany = array('Tag'); + public $name = 'Article'; + public $hasMany = array('Comment'); + public $hasAndBelongsToMany = array('Tag'); } } @@ -90,7 +90,7 @@ class ControllerTaskTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag'); + public $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag'); /** * startTest method diff --git a/cake/tests/cases/console/libs/tasks/db_config.test.php b/cake/tests/cases/console/libs/tasks/db_config.test.php index 0297e7adc..886550f94 100644 --- a/cake/tests/cases/console/libs/tasks/db_config.test.php +++ b/cake/tests/cases/console/libs/tasks/db_config.test.php @@ -44,7 +44,7 @@ ); class TEST_DATABASE_CONFIG { - var $default = array( + public $default = array( 'driver' => 'mysql', 'persistent' => false, 'host' => 'localhost', @@ -54,7 +54,7 @@ class TEST_DATABASE_CONFIG { 'prefix' => '', ); - var $otherOne = array( + public $otherOne = array( 'driver' => 'mysql', 'persistent' => false, 'host' => 'localhost', diff --git a/cake/tests/cases/console/libs/tasks/fixture.test.php b/cake/tests/cases/console/libs/tasks/fixture.test.php index 06698ab80..f1d22594e 100644 --- a/cake/tests/cases/console/libs/tasks/fixture.test.php +++ b/cake/tests/cases/console/libs/tasks/fixture.test.php @@ -62,7 +62,7 @@ class FixtureTaskTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.article', 'core.comment', 'core.datatype', 'core.binary_test'); + public $fixtures = array('core.article', 'core.comment', 'core.datatype', 'core.binary_test'); /** * startTest method diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index e8d7acf64..ab7b7e291 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -67,7 +67,7 @@ class ModelTaskTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag', 'core.category_thread'); + public $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag', 'core.category_thread'); /** * starTest method diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index d25de3fbc..38ee3ec39 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -61,7 +61,7 @@ class TestTaskArticle extends Model { * @var string * @access public */ - var $name = 'TestTaskArticle'; + public $name = 'TestTaskArticle'; /** * Table name to use @@ -69,7 +69,7 @@ class TestTaskArticle extends Model { * @var string * @access public */ - var $useTable = 'articles'; + public $useTable = 'articles'; /** * HasMany Associations @@ -77,7 +77,7 @@ class TestTaskArticle extends Model { * @var array * @access public */ - var $hasMany = array( + public $hasMany = array( 'Comment' => array( 'className' => 'TestTask.TestTaskComment', 'foreignKey' => 'article_id', @@ -90,7 +90,7 @@ class TestTaskArticle extends Model { * @var array * @access public */ - var $hasAndBelongsToMany = array( + public $hasAndBelongsToMany = array( 'Tag' => array( 'className' => 'TestTaskTag', 'joinTable' => 'articles_tags', @@ -141,7 +141,7 @@ class TestTaskTag extends Model { * @var string * @access public */ - var $name = 'TestTaskTag'; + public $name = 'TestTaskTag'; /** * Table name @@ -149,7 +149,7 @@ class TestTaskTag extends Model { * @var string * @access public */ - var $useTable = 'tags'; + public $useTable = 'tags'; /** * Has and Belongs To Many Associations @@ -157,7 +157,7 @@ class TestTaskTag extends Model { * @var array * @access public */ - var $hasAndBelongsToMany = array( + public $hasAndBelongsToMany = array( 'Article' => array( 'className' => 'TestTaskArticle', 'joinTable' => 'articles_tags', @@ -190,7 +190,7 @@ class TestTaskComment extends TestTaskAppModel { * @var string * @access public */ - var $name = 'TestTaskComment'; + public $name = 'TestTaskComment'; /** * Table name @@ -198,7 +198,7 @@ class TestTaskComment extends TestTaskAppModel { * @var string * @access public */ - var $useTable = 'comments'; + public $useTable = 'comments'; /** * Belongs To Associations @@ -206,7 +206,7 @@ class TestTaskComment extends TestTaskAppModel { * @var array * @access public */ - var $belongsTo = array( + public $belongsTo = array( 'Article' => array( 'className' => 'TestTaskArticle', 'foreignKey' => 'article_id', @@ -228,7 +228,7 @@ class TestTaskCommentsController extends Controller { * @var string * @access public */ - var $name = 'TestTaskComments'; + public $name = 'TestTaskComments'; /** * Models to use @@ -236,7 +236,7 @@ class TestTaskCommentsController extends Controller { * @var array * @access public */ - var $uses = array('TestTaskComment', 'TestTaskTag'); + public $uses = array('TestTaskComment', 'TestTaskTag'); } /** @@ -253,7 +253,7 @@ class TestTaskTest extends CakeTestCase { * @var string * @access public */ - var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag'); + public $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag'); /** * startTest method diff --git a/cake/tests/cases/console/libs/tasks/view.test.php b/cake/tests/cases/console/libs/tasks/view.test.php index 7426805ed..89d0b02c5 100644 --- a/cake/tests/cases/console/libs/tasks/view.test.php +++ b/cake/tests/cases/console/libs/tasks/view.test.php @@ -63,7 +63,7 @@ class ViewTaskComment extends Model { * @var string * @access public */ - var $name = 'ViewTaskComment'; + public $name = 'ViewTaskComment'; /** * Table name @@ -71,7 +71,7 @@ class ViewTaskComment extends Model { * @var string * @access public */ - var $useTable = 'comments'; + public $useTable = 'comments'; /** * Belongs To Associations @@ -79,7 +79,7 @@ class ViewTaskComment extends Model { * @var array * @access public */ - var $belongsTo = array( + public $belongsTo = array( 'Article' => array( 'className' => 'ViewTaskArticle', 'foreignKey' => 'article_id' @@ -101,7 +101,7 @@ class ViewTaskArticle extends Model { * @var string * @access public */ - var $name = 'ViewTaskArticle'; + public $name = 'ViewTaskArticle'; /** * Table name @@ -109,7 +109,7 @@ class ViewTaskArticle extends Model { * @var string * @access public */ - var $useTable = 'articles'; + public $useTable = 'articles'; } /** @@ -126,7 +126,7 @@ class ViewTaskCommentsController extends Controller { * @var string * @access public */ - var $name = 'ViewTaskComments'; + public $name = 'ViewTaskComments'; /** * Testing public controller action @@ -161,7 +161,7 @@ class ViewTaskArticlesController extends Controller { * @var string * @access public */ - var $name = 'ViewTaskArticles'; + public $name = 'ViewTaskArticles'; /** * Test public controller action @@ -241,7 +241,7 @@ class ViewTaskTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag'); + public $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag'); /** * startTest method diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index c737d0e53..e83c03c6f 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -99,7 +99,7 @@ class MyPluginController extends MyPluginAppController { * @var string 'MyPlugin' * @access public */ - var $name = 'MyPlugin'; + public $name = 'MyPlugin'; /** * uses property @@ -107,7 +107,7 @@ class MyPluginController extends MyPluginAppController { * @var array * @access public */ - var $uses = array(); + public $uses = array(); /** * index method @@ -155,7 +155,7 @@ class SomePagesController extends AppController { * @var string 'SomePages' * @access public */ - var $name = 'SomePages'; + public $name = 'SomePages'; /** * uses property @@ -163,7 +163,7 @@ class SomePagesController extends AppController { * @var array * @access public */ - var $uses = array(); + public $uses = array(); /** * display method @@ -221,7 +221,7 @@ class OtherPagesController extends MyPluginAppController { * @var string 'OtherPages' * @access public */ - var $name = 'OtherPages'; + public $name = 'OtherPages'; /** * uses property @@ -229,7 +229,7 @@ class OtherPagesController extends MyPluginAppController { * @var array * @access public */ - var $uses = array(); + public $uses = array(); /** * display method @@ -267,7 +267,7 @@ class TestDispatchPagesController extends AppController { * @var string 'TestDispatchPages' * @access public */ - var $name = 'TestDispatchPages'; + public $name = 'TestDispatchPages'; /** * uses property @@ -275,7 +275,7 @@ class TestDispatchPagesController extends AppController { * @var array * @access public */ - var $uses = array(); + public $uses = array(); /** * admin_index method @@ -321,7 +321,7 @@ class ArticlesTestController extends ArticlesTestAppController { * @var string 'ArticlesTest' * @access public */ - var $name = 'ArticlesTest'; + public $name = 'ArticlesTest'; /** * uses property @@ -329,7 +329,7 @@ class ArticlesTestController extends ArticlesTestAppController { * @var array * @access public */ - var $uses = array(); + public $uses = array(); /** * admin_index method @@ -356,7 +356,7 @@ class SomePostsController extends AppController { * @var string 'SomePosts' * @access public */ - var $name = 'SomePosts'; + public $name = 'SomePosts'; /** * uses property @@ -364,7 +364,7 @@ class SomePostsController extends AppController { * @var array * @access public */ - var $uses = array(); + public $uses = array(); /** * autoRender property @@ -372,7 +372,7 @@ class SomePostsController extends AppController { * @var bool false * @access public */ - var $autoRender = false; + public $autoRender = false; /** * beforeFilter method @@ -424,7 +424,7 @@ class TestCachedPagesController extends AppController { * @var string 'TestCachedPages' * @access public */ - var $name = 'TestCachedPages'; + public $name = 'TestCachedPages'; /** * uses property @@ -432,7 +432,7 @@ class TestCachedPagesController extends AppController { * @var array * @access public */ - var $uses = array(); + public $uses = array(); /** * helpers property @@ -440,7 +440,7 @@ class TestCachedPagesController extends AppController { * @var array * @access public */ - var $helpers = array('Cache'); + public $helpers = array('Cache'); /** * cacheAction property @@ -448,7 +448,7 @@ class TestCachedPagesController extends AppController { * @var array * @access public */ - var $cacheAction = array( + public $cacheAction = array( 'index' => '+2 sec', 'test_nocache_tags' => '+2 sec', 'view' => '+2 sec' @@ -460,7 +460,7 @@ class TestCachedPagesController extends AppController { * @var string 'posts' * @access public */ - var $viewPath = 'posts'; + public $viewPath = 'posts'; /** * index method @@ -516,7 +516,7 @@ class TimesheetsController extends AppController { * @var string 'Timesheets' * @access public */ - var $name = 'Timesheets'; + public $name = 'Timesheets'; /** * uses property @@ -524,7 +524,7 @@ class TimesheetsController extends AppController { * @var array * @access public */ - var $uses = array(); + public $uses = array(); /** * index method diff --git a/cake/tests/cases/libs/cache/file.test.php b/cake/tests/cases/libs/cache/file.test.php index 16a7bc705..2d6f8a6a4 100644 --- a/cake/tests/cases/libs/cache/file.test.php +++ b/cake/tests/cases/libs/cache/file.test.php @@ -35,7 +35,7 @@ class FileEngineTest extends CakeTestCase { * @var array * @access public */ - var $config = array(); + public $config = array(); /** * startCase method diff --git a/cake/tests/cases/libs/cake_session.test.php b/cake/tests/cases/libs/cake_session.test.php index ed57729cd..3ccde6372 100644 --- a/cake/tests/cases/libs/cake_session.test.php +++ b/cake/tests/cases/libs/cake_session.test.php @@ -35,7 +35,7 @@ class CakeSessionTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.session'); + public $fixtures = array('core.session'); /** * startCase method diff --git a/cake/tests/cases/libs/cake_test_fixture.test.php b/cake/tests/cases/libs/cake_test_fixture.test.php index 6d33f4ce7..354cfab11 100644 --- a/cake/tests/cases/libs/cake_test_fixture.test.php +++ b/cake/tests/cases/libs/cake_test_fixture.test.php @@ -32,21 +32,21 @@ class CakeTestFixtureTestFixture extends CakeTestFixture { * * @var string */ - var $name = 'FixtureTest'; + public $name = 'FixtureTest'; /** * table property * * @var string */ - var $table = 'fixture_tests'; + public $table = 'fixture_tests'; /** * Fields array * * @var array */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'length' => '255'), 'created' => array('type' => 'datetime') @@ -57,7 +57,7 @@ class CakeTestFixtureTestFixture extends CakeTestFixture { * * @var array */ - var $records = array( + public $records = array( array('name' => 'Gandalf', 'created' => '2009-04-28 19:20:00'), array('name' => 'Captain Picard', 'created' => '2009-04-28 19:20:00'), array('name' => 'Chewbacca', 'created' => '2009-04-28 19:20:00') @@ -77,14 +77,14 @@ class CakeTestFixtureImportFixture extends CakeTestFixture { * * @var string */ - var $name = 'ImportFixture'; + public $name = 'ImportFixture'; /** * Import property * * @var mixed */ - var $import = array('table' => 'fixture_tests', 'connection' => 'test_suite'); + public $import = array('table' => 'fixture_tests', 'connection' => 'test_suite'); } /** @@ -100,7 +100,7 @@ class CakeTestFixtureDefaultImportFixture extends CakeTestFixture { * * @var string */ - var $name = 'ImportFixture'; + public $name = 'ImportFixture'; } /** @@ -110,9 +110,9 @@ class CakeTestFixtureDefaultImportFixture extends CakeTestFixture { * @subpackage cake.cake.tests.cases.libs. */ class FixtureImportTestModel extends Model { - var $name = 'FixtureImport'; - var $useTable = 'fixture_tests'; - var $useDbConfig = 'test_suite'; + public $name = 'FixtureImport'; + public $useTable = 'fixture_tests'; + public $useDbConfig = 'test_suite'; } Mock::generate('DboSource', 'FixtureMockDboSource'); diff --git a/cake/tests/cases/libs/class_registry.test.php b/cake/tests/cases/libs/class_registry.test.php index 148faa814..f8d796ffc 100644 --- a/cake/tests/cases/libs/class_registry.test.php +++ b/cake/tests/cases/libs/class_registry.test.php @@ -33,7 +33,7 @@ class ClassRegisterModel extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; } /** @@ -50,7 +50,7 @@ class RegisterArticle extends ClassRegisterModel { * @var string 'RegisterArticle' * @access public */ - var $name = 'RegisterArticle'; + public $name = 'RegisterArticle'; } /** @@ -67,7 +67,7 @@ class RegisterArticleFeatured extends ClassRegisterModel { * @var string 'RegisterArticleFeatured' * @access public */ - var $name = 'RegisterArticleFeatured'; + public $name = 'RegisterArticleFeatured'; } /** @@ -84,7 +84,7 @@ class RegisterArticleTag extends ClassRegisterModel { * @var string 'RegisterArticleTag' * @access public */ - var $name = 'RegisterArticleTag'; + public $name = 'RegisterArticleTag'; } /** @@ -101,7 +101,7 @@ class RegistryPluginAppModel extends ClassRegisterModel { * @var string 'something_' * @access public */ - var $tablePrefix = 'something_'; + public $tablePrefix = 'something_'; } /** @@ -118,7 +118,7 @@ class TestRegistryPluginModel extends RegistryPluginAppModel { * @var string 'TestRegistryPluginModel' * @access public */ - var $name = 'TestRegistryPluginModel'; + public $name = 'TestRegistryPluginModel'; } /** @@ -135,7 +135,7 @@ class RegisterCategory extends ClassRegisterModel { * @var string 'RegisterCategory' * @access public */ - var $name = 'RegisterCategory'; + public $name = 'RegisterCategory'; } /** diff --git a/cake/tests/cases/libs/controller/component.test.php b/cake/tests/cases/libs/controller/component.test.php index c739475cd..3e28b2f45 100644 --- a/cake/tests/cases/libs/controller/component.test.php +++ b/cake/tests/cases/libs/controller/component.test.php @@ -36,7 +36,7 @@ class AppController extends Controller { * @var string 'App' * @access public */ - var $name = 'App'; + public $name = 'App'; /** * uses property @@ -44,7 +44,7 @@ class AppController extends Controller { * @var array * @access public */ - var $uses = array(); + public $uses = array(); /** * helpers property @@ -52,7 +52,7 @@ class AppController extends Controller { * @var array * @access public */ - var $helpers = array(); + public $helpers = array(); /** * components property @@ -60,7 +60,7 @@ class AppController extends Controller { * @var array * @access public */ - var $components = array('Orange' => array('colour' => 'blood orange')); + public $components = array('Orange' => array('colour' => 'blood orange')); } } elseif (!defined('APP_CONTROLLER_EXISTS')){ define('APP_CONTROLLER_EXISTS', true); @@ -80,7 +80,7 @@ class ParamTestComponent extends Object { * @var string 'ParamTest' * @access public */ - var $name = 'ParamTest'; + public $name = 'ParamTest'; /** * components property @@ -88,7 +88,7 @@ class ParamTestComponent extends Object { * @var array * @access public */ - var $components = array('Banana' => array('config' => 'value')); + public $components = array('Banana' => array('config' => 'value')); /** * initialize method @@ -123,7 +123,7 @@ class ComponentTestController extends AppController { * @var string 'ComponentTest' * @access public */ - var $name = 'ComponentTest'; + public $name = 'ComponentTest'; /** * uses property @@ -131,7 +131,7 @@ class ComponentTestController extends AppController { * @var array * @access public */ - var $uses = array(); + public $uses = array(); } /** @@ -148,7 +148,7 @@ class AppleComponent extends Object { * @var array * @access public */ - var $components = array('Orange'); + public $components = array('Orange'); /** * testName property @@ -156,7 +156,7 @@ class AppleComponent extends Object { * @var mixed null * @access public */ - var $testName = null; + public $testName = null; /** * startup method @@ -184,7 +184,7 @@ class OrangeComponent extends Object { * @var array * @access public */ - var $components = array('Banana'); + public $components = array('Banana'); /** * initialize method @@ -225,7 +225,7 @@ class BananaComponent extends Object { * @var string 'BananaField' * @access public */ - var $testField = 'BananaField'; + public $testField = 'BananaField'; /** * startup method @@ -253,7 +253,7 @@ class MutuallyReferencingOneComponent extends Object { * @var array * @access public */ - var $components = array('MutuallyReferencingTwo'); + public $components = array('MutuallyReferencingTwo'); } /** @@ -270,7 +270,7 @@ class MutuallyReferencingTwoComponent extends Object { * @var array * @access public */ - var $components = array('MutuallyReferencingOne'); + public $components = array('MutuallyReferencingOne'); } /** @@ -287,7 +287,7 @@ class SomethingWithEmailComponent extends Object { * @var array * @access public */ - var $components = array('Email'); + public $components = array('Email'); } Mock::generate('Object', 'ComponentMockComponent', array('startup', 'beforeFilter', 'beforeRender', 'other')); diff --git a/cake/tests/cases/libs/controller/components/acl.test.php b/cake/tests/cases/libs/controller/components/acl.test.php index a65352cb1..af36e340a 100644 --- a/cake/tests/cases/libs/controller/components/acl.test.php +++ b/cake/tests/cases/libs/controller/components/acl.test.php @@ -36,7 +36,7 @@ class AclNodeTwoTestBase extends AclNode { * @var string 'test_suite' * @access public */ - var $useDbConfig = 'test_suite'; + public $useDbConfig = 'test_suite'; /** * cacheSources property @@ -44,7 +44,7 @@ class AclNodeTwoTestBase extends AclNode { * @var bool false * @access public */ - var $cacheSources = false; + public $cacheSources = false; } /** @@ -61,7 +61,7 @@ class AroTwoTest extends AclNodeTwoTestBase { * @var string 'AroTwoTest' * @access public */ - var $name = 'AroTwoTest'; + public $name = 'AroTwoTest'; /** * useTable property @@ -69,7 +69,7 @@ class AroTwoTest extends AclNodeTwoTestBase { * @var string 'aro_twos' * @access public */ - var $useTable = 'aro_twos'; + public $useTable = 'aro_twos'; /** * hasAndBelongsToMany property @@ -77,7 +77,7 @@ class AroTwoTest extends AclNodeTwoTestBase { * @var array * @access public */ - var $hasAndBelongsToMany = array('AcoTwoTest' => array('with' => 'PermissionTwoTest')); + public $hasAndBelongsToMany = array('AcoTwoTest' => array('with' => 'PermissionTwoTest')); } /** @@ -94,7 +94,7 @@ class AcoTwoTest extends AclNodeTwoTestBase { * @var string 'AcoTwoTest' * @access public */ - var $name = 'AcoTwoTest'; + public $name = 'AcoTwoTest'; /** * useTable property @@ -102,7 +102,7 @@ class AcoTwoTest extends AclNodeTwoTestBase { * @var string 'aco_twos' * @access public */ - var $useTable = 'aco_twos'; + public $useTable = 'aco_twos'; /** * hasAndBelongsToMany property @@ -110,7 +110,7 @@ class AcoTwoTest extends AclNodeTwoTestBase { * @var array * @access public */ - var $hasAndBelongsToMany = array('AroTwoTest' => array('with' => 'PermissionTwoTest')); + public $hasAndBelongsToMany = array('AroTwoTest' => array('with' => 'PermissionTwoTest')); } /** @@ -127,7 +127,7 @@ class PermissionTwoTest extends CakeTestModel { * @var string 'PermissionTwoTest' * @access public */ - var $name = 'PermissionTwoTest'; + public $name = 'PermissionTwoTest'; /** * useTable property @@ -135,7 +135,7 @@ class PermissionTwoTest extends CakeTestModel { * @var string 'aros_aco_twos' * @access public */ - var $useTable = 'aros_aco_twos'; + public $useTable = 'aros_aco_twos'; /** * cacheQueries property @@ -143,7 +143,7 @@ class PermissionTwoTest extends CakeTestModel { * @var bool false * @access public */ - var $cacheQueries = false; + public $cacheQueries = false; /** * belongsTo property @@ -151,7 +151,7 @@ class PermissionTwoTest extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('AroTwoTest' => array('foreignKey' => 'aro_id'), 'AcoTwoTest' => array('foreignKey' => 'aco_id')); + public $belongsTo = array('AroTwoTest' => array('foreignKey' => 'aro_id'), 'AcoTwoTest' => array('foreignKey' => 'aco_id')); /** * actsAs property @@ -159,7 +159,7 @@ class PermissionTwoTest extends CakeTestModel { * @var mixed null * @access public */ - var $actsAs = null; + public $actsAs = null; } /** @@ -207,7 +207,7 @@ class AclComponentTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.aro_two', 'core.aco_two', 'core.aros_aco_two'); + public $fixtures = array('core.aro_two', 'core.aco_two', 'core.aros_aco_two'); /** * startTest method diff --git a/cake/tests/cases/libs/controller/components/auth.test.php b/cake/tests/cases/libs/controller/components/auth.test.php index 2dab41a6f..f077a9113 100644 --- a/cake/tests/cases/libs/controller/components/auth.test.php +++ b/cake/tests/cases/libs/controller/components/auth.test.php @@ -37,7 +37,7 @@ class TestAuthComponent extends AuthComponent { * @var bool false * @access public */ - var $testStop = false; + public $testStop = false; /** * Sets default login state @@ -72,7 +72,7 @@ class AuthUser extends CakeTestModel { * @var string 'AuthUser' * @access public */ - var $name = 'AuthUser'; + public $name = 'AuthUser'; /** * useDbConfig property @@ -80,7 +80,7 @@ class AuthUser extends CakeTestModel { * @var string 'test_suite' * @access public */ - var $useDbConfig = 'test_suite'; + public $useDbConfig = 'test_suite'; /** * parentNode method @@ -134,7 +134,7 @@ class AuthUserCustomField extends AuthUser { * @var string 'AuthUser' * @access public */ - var $name = 'AuthUserCustomField'; + public $name = 'AuthUserCustomField'; } /** @@ -151,7 +151,7 @@ class UuidUser extends CakeTestModel { * @var string 'AuthUser' * @access public */ - var $name = 'UuidUser'; + public $name = 'UuidUser'; /** * useDbConfig property @@ -159,7 +159,7 @@ class UuidUser extends CakeTestModel { * @var string 'test_suite' * @access public */ - var $useDbConfig = 'test_suite'; + public $useDbConfig = 'test_suite'; /** * useTable property @@ -167,7 +167,7 @@ class UuidUser extends CakeTestModel { * @var string 'uuid' * @access public */ - var $useTable = 'uuids'; + public $useTable = 'uuids'; /** * parentNode method @@ -221,7 +221,7 @@ class AuthTestController extends Controller { * @var string 'AuthTest' * @access public */ - var $name = 'AuthTest'; + public $name = 'AuthTest'; /** * uses property @@ -229,7 +229,7 @@ class AuthTestController extends Controller { * @var array * @access public */ - var $uses = array('AuthUser'); + public $uses = array('AuthUser'); /** * components property @@ -237,7 +237,7 @@ class AuthTestController extends Controller { * @var array * @access public */ - var $components = array('Session', 'Auth', 'Acl'); + public $components = array('Session', 'Auth', 'Acl'); /** * testUrl property @@ -245,7 +245,7 @@ class AuthTestController extends Controller { * @var mixed null * @access public */ - var $testUrl = null; + public $testUrl = null; /** * construct method @@ -374,7 +374,7 @@ class AjaxAuthController extends Controller { * @var string 'AjaxAuth' * @access public */ - var $name = 'AjaxAuth'; + public $name = 'AjaxAuth'; /** * components property @@ -382,7 +382,7 @@ class AjaxAuthController extends Controller { * @var array * @access public */ - var $components = array('Session', 'TestAuth'); + public $components = array('Session', 'TestAuth'); /** * uses property @@ -390,7 +390,7 @@ class AjaxAuthController extends Controller { * @var array * @access public */ - var $uses = array(); + public $uses = array(); /** * testUrl property @@ -398,7 +398,7 @@ class AjaxAuthController extends Controller { * @var mixed null * @access public */ - var $testUrl = null; + public $testUrl = null; /** * beforeFilter method @@ -453,7 +453,7 @@ class AuthTest extends CakeTestCase { * @var string 'Auth' * @access public */ - var $name = 'Auth'; + public $name = 'Auth'; /** * fixtures property @@ -461,7 +461,7 @@ class AuthTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.uuid', 'core.auth_user', 'core.auth_user_custom_field', 'core.aro', 'core.aco', 'core.aros_aco', 'core.aco_action'); + public $fixtures = array('core.uuid', 'core.auth_user', 'core.auth_user_custom_field', 'core.aro', 'core.aco', 'core.aros_aco', 'core.aco_action'); /** * initialized property @@ -469,7 +469,7 @@ class AuthTest extends CakeTestCase { * @var bool false * @access public */ - var $initialized = false; + public $initialized = false; /** * startTest method diff --git a/cake/tests/cases/libs/controller/components/cookie.test.php b/cake/tests/cases/libs/controller/components/cookie.test.php index f32381ba0..1fd86bb74 100644 --- a/cake/tests/cases/libs/controller/components/cookie.test.php +++ b/cake/tests/cases/libs/controller/components/cookie.test.php @@ -34,7 +34,7 @@ class CookieComponentTestController extends Controller { * @var array * @access public */ - var $components = array('Cookie'); + public $components = array('Cookie'); /** * beforeFilter method @@ -66,7 +66,7 @@ class CookieComponentTest extends CakeTestCase { * @var CookieComponentTestController * @access public */ - var $Controller; + public $Controller; /** * start diff --git a/cake/tests/cases/libs/controller/components/email.test.php b/cake/tests/cases/libs/controller/components/email.test.php index b1ee3a5c4..00eeab9aa 100755 --- a/cake/tests/cases/libs/controller/components/email.test.php +++ b/cake/tests/cases/libs/controller/components/email.test.php @@ -134,7 +134,7 @@ class EmailTestController extends Controller { * @var string 'EmailTest' * @access public */ - var $name = 'EmailTest'; + public $name = 'EmailTest'; /** * uses property @@ -142,7 +142,7 @@ class EmailTestController extends Controller { * @var mixed null * @access public */ - var $uses = null; + public $uses = null; /** * components property @@ -150,7 +150,7 @@ class EmailTestController extends Controller { * @var array * @access public */ - var $components = array('Session', 'EmailTest'); + public $components = array('Session', 'EmailTest'); /** * pageTitle property @@ -158,7 +158,7 @@ class EmailTestController extends Controller { * @var string * @access public */ - var $pageTitle = 'EmailTest'; + public $pageTitle = 'EmailTest'; } /** @@ -175,7 +175,7 @@ class EmailComponentTest extends CakeTestCase { * @var EmailTestController * @access public */ - var $Controller; + public $Controller; /** * name property @@ -183,7 +183,7 @@ class EmailComponentTest extends CakeTestCase { * @var string 'Email' * @access public */ - var $name = 'Email'; + public $name = 'Email'; /** * setUp method diff --git a/cake/tests/cases/libs/controller/components/request_handler.test.php b/cake/tests/cases/libs/controller/components/request_handler.test.php index 955a99d5b..046d619df 100644 --- a/cake/tests/cases/libs/controller/components/request_handler.test.php +++ b/cake/tests/cases/libs/controller/components/request_handler.test.php @@ -36,7 +36,7 @@ class RequestHandlerTestController extends Controller { * @var string * @access public */ - var $name = 'RequestHandlerTest'; + public $name = 'RequestHandlerTest'; /** * uses property @@ -44,7 +44,7 @@ class RequestHandlerTestController extends Controller { * @var mixed null * @access public */ - var $uses = null; + public $uses = null; /** * construct method @@ -94,7 +94,7 @@ class RequestHandlerTestDisabledController extends Controller { * @var mixed null * @access public */ - var $uses = null; + public $uses = null; /** * construct method @@ -135,7 +135,7 @@ class RequestHandlerComponentTest extends CakeTestCase { * @var RequestHandlerTestController * @access public */ - var $Controller; + public $Controller; /** * RequestHandler property @@ -143,7 +143,7 @@ class RequestHandlerComponentTest extends CakeTestCase { * @var RequestHandlerComponent * @access public */ - var $RequestHandler; + public $RequestHandler; /** * startTest method diff --git a/cake/tests/cases/libs/controller/components/security.test.php b/cake/tests/cases/libs/controller/components/security.test.php index a1c07d895..492352e88 100644 --- a/cake/tests/cases/libs/controller/components/security.test.php +++ b/cake/tests/cases/libs/controller/components/security.test.php @@ -52,7 +52,7 @@ class SecurityTestController extends Controller { * @var string 'SecurityTest' * @access public */ - var $name = 'SecurityTest'; + public $name = 'SecurityTest'; /** * components property @@ -60,7 +60,7 @@ class SecurityTestController extends Controller { * @var array * @access public */ - var $components = array('Session', 'TestSecurity'); + public $components = array('Session', 'TestSecurity'); /** * failed property @@ -68,7 +68,7 @@ class SecurityTestController extends Controller { * @var bool false * @access public */ - var $failed = false; + public $failed = false; /** * Used for keeping track of headers in test @@ -76,7 +76,7 @@ class SecurityTestController extends Controller { * @var array * @access public */ - var $testHeaders = array(); + public $testHeaders = array(); /** * fail method @@ -127,7 +127,7 @@ class SecurityComponentTest extends CakeTestCase { * @var SecurityTestController * @access public */ - var $Controller; + public $Controller; /** * oldSalt property @@ -135,7 +135,7 @@ class SecurityComponentTest extends CakeTestCase { * @var string * @access public */ - var $oldSalt; + public $oldSalt; /** * setUp method diff --git a/cake/tests/cases/libs/controller/components/session.test.php b/cake/tests/cases/libs/controller/components/session.test.php index 5eb2e39bc..5a303e6f6 100644 --- a/cake/tests/cases/libs/controller/components/session.test.php +++ b/cake/tests/cases/libs/controller/components/session.test.php @@ -34,7 +34,7 @@ class SessionTestController extends Controller { * @var array * @access public */ - var $uses = array(); + public $uses = array(); /** * session_id method @@ -61,7 +61,7 @@ class OrangeSessionTestController extends Controller { * @var array * @access public */ - var $uses = array(); + public $uses = array(); /** * session_id method diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index 8b63c8304..23693941c 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -41,21 +41,21 @@ class AppController extends Controller { * @var array * @access public */ - var $helpers = array('Html', 'Javascript'); + public $helpers = array('Html', 'Javascript'); /** * uses property * * @var array * @access public */ - var $uses = array('ControllerPost'); + public $uses = array('ControllerPost'); /** * components property * * @var array * @access public */ - var $components = array('Cookie'); + public $components = array('Cookie'); } } elseif (!defined('APP_CONTROLLER_EXISTS')) { define('APP_CONTROLLER_EXISTS', true); @@ -75,7 +75,7 @@ class ControllerPost extends CakeTestModel { * @var string 'ControllerPost' * @access public */ - var $name = 'ControllerPost'; + public $name = 'ControllerPost'; /** * useTable property @@ -83,7 +83,7 @@ class ControllerPost extends CakeTestModel { * @var string 'posts' * @access public */ - var $useTable = 'posts'; + public $useTable = 'posts'; /** * invalidFields property @@ -91,7 +91,7 @@ class ControllerPost extends CakeTestModel { * @var array * @access public */ - var $invalidFields = array('name' => 'error_msg'); + public $invalidFields = array('name' => 'error_msg'); /** * lastQuery property @@ -99,7 +99,7 @@ class ControllerPost extends CakeTestModel { * @var mixed null * @access public */ - var $lastQuery = null; + public $lastQuery = null; /** * beforeFind method @@ -144,7 +144,7 @@ class ControllerCommentsController extends AppController { * @var string 'ControllerPost' * @access public */ - var $name = 'ControllerComments'; + public $name = 'ControllerComments'; } /** @@ -161,7 +161,7 @@ class ControllerComment extends CakeTestModel { * @var string 'ControllerComment' * @access public */ - var $name = 'Comment'; + public $name = 'Comment'; /** * useTable property @@ -169,7 +169,7 @@ class ControllerComment extends CakeTestModel { * @var string 'comments' * @access public */ - var $useTable = 'comments'; + public $useTable = 'comments'; /** * data property @@ -177,7 +177,7 @@ class ControllerComment extends CakeTestModel { * @var array * @access public */ - var $data = array('name' => 'Some Name'); + public $data = array('name' => 'Some Name'); /** * alias property @@ -185,7 +185,7 @@ class ControllerComment extends CakeTestModel { * @var string 'ControllerComment' * @access public */ - var $alias = 'ControllerComment'; + public $alias = 'ControllerComment'; } /** @@ -202,7 +202,7 @@ class ControllerAlias extends CakeTestModel { * @var string 'ControllerAlias' * @access public */ - var $name = 'ControllerAlias'; + public $name = 'ControllerAlias'; /** * alias property @@ -210,7 +210,7 @@ class ControllerAlias extends CakeTestModel { * @var string 'ControllerSomeAlias' * @access public */ - var $alias = 'ControllerSomeAlias'; + public $alias = 'ControllerSomeAlias'; /** * useTable property @@ -218,7 +218,7 @@ class ControllerAlias extends CakeTestModel { * @var string 'posts' * @access public */ - var $useTable = 'posts'; + public $useTable = 'posts'; } /** @@ -235,7 +235,7 @@ class ControllerPaginateModel extends CakeTestModel { * @var string * @access public */ - var $name = 'ControllerPaginateModel'; + public $name = 'ControllerPaginateModel'; /** * useTable property @@ -243,7 +243,7 @@ class ControllerPaginateModel extends CakeTestModel { * @var string' * @access public */ - var $useTable = 'comments'; + public $useTable = 'comments'; /** * paginate method @@ -279,14 +279,14 @@ class NameTest extends CakeTestModel { * @var string 'Name' * @access public */ - var $name = 'Name'; + public $name = 'Name'; /** * useTable property * @var string 'names' * @access public */ - var $useTable = 'comments'; + public $useTable = 'comments'; /** * alias property @@ -294,7 +294,7 @@ class NameTest extends CakeTestModel { * @var string 'ControllerComment' * @access public */ - var $alias = 'Name'; + public $alias = 'Name'; } /** @@ -310,7 +310,7 @@ class TestController extends AppController { * @var string 'Name' * @access public */ - var $name = 'TestController'; + public $name = 'TestController'; /** * helpers property @@ -318,7 +318,7 @@ class TestController extends AppController { * @var array * @access public */ - var $helpers = array('Session', 'Xml'); + public $helpers = array('Session', 'Xml'); /** * components property @@ -326,7 +326,7 @@ class TestController extends AppController { * @var array * @access public */ - var $components = array('Security'); + public $components = array('Security'); /** * uses property @@ -334,7 +334,7 @@ class TestController extends AppController { * @var array * @access public */ - var $uses = array('ControllerComment', 'ControllerAlias'); + public $uses = array('ControllerComment', 'ControllerAlias'); /** * index method @@ -406,14 +406,14 @@ class AnotherTestController extends AppController { * @var string 'Name' * @access public */ - var $name = 'AnotherTest'; + public $name = 'AnotherTest'; /** * uses property * * @var array * @access public */ - var $uses = null; + public $uses = null; } /** @@ -430,7 +430,7 @@ class ControllerTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.post', 'core.comment', 'core.name'); + public $fixtures = array('core.post', 'core.comment', 'core.name'); /** * endTest diff --git a/cake/tests/cases/libs/controller/controller_merge_vars.test.php b/cake/tests/cases/libs/controller/controller_merge_vars.test.php index 89d541d52..65764322d 100644 --- a/cake/tests/cases/libs/controller/controller_merge_vars.test.php +++ b/cake/tests/cases/libs/controller/controller_merge_vars.test.php @@ -34,13 +34,13 @@ class AppController extends Controller { * * @var array */ - var $components = array('MergeVar' => array('flag', 'otherFlag', 'redirect' => false)); + public $components = array('MergeVar' => array('flag', 'otherFlag', 'redirect' => false)); /** * helpers * * @var array */ - var $helpers = array('MergeVar' => array('format' => 'html', 'terse')); + public $helpers = array('MergeVar' => array('format' => 'html', 'terse')); } } elseif (!defined('APP_CONTROLLER_EXISTS')) { define('APP_CONTROLLER_EXISTS', true); @@ -67,14 +67,14 @@ class MergeVariablesController extends AppController { * * @var string */ - var $name = 'MergeVariables'; + public $name = 'MergeVariables'; /** * uses * * @var arrays */ - var $uses = array(); + public $uses = array(); } /** @@ -89,14 +89,14 @@ class MergeVarPluginAppController extends AppController { * * @var array */ - var $components = array('Auth' => array('setting' => 'val', 'otherVal')); + public $components = array('Auth' => array('setting' => 'val', 'otherVal')); /** * helpers * * @var array */ - var $helpers = array('Javascript'); + public $helpers = array('Javascript'); } /** @@ -111,14 +111,14 @@ class MergePostsController extends MergeVarPluginAppController { * * @var string */ - var $name = 'MergePosts'; + public $name = 'MergePosts'; /** * uses * * @var array */ - var $uses = array(); + public $uses = array(); } diff --git a/cake/tests/cases/libs/controller/scaffold.test.php b/cake/tests/cases/libs/controller/scaffold.test.php index 63ebba91e..a4b4f19a7 100644 --- a/cake/tests/cases/libs/controller/scaffold.test.php +++ b/cake/tests/cases/libs/controller/scaffold.test.php @@ -33,7 +33,7 @@ class ScaffoldMockController extends Controller { * @var string 'ScaffoldMock' * @access public */ - var $name = 'ScaffoldMock'; + public $name = 'ScaffoldMock'; /** * scaffold property @@ -41,7 +41,7 @@ class ScaffoldMockController extends Controller { * @var mixed * @access public */ - var $scaffold; + public $scaffold; } /** @@ -58,7 +58,7 @@ class ScaffoldMockControllerWithFields extends Controller { * @var string 'ScaffoldMock' * @access public */ - var $name = 'ScaffoldMock'; + public $name = 'ScaffoldMock'; /** * scaffold property @@ -66,7 +66,7 @@ class ScaffoldMockControllerWithFields extends Controller { * @var mixed * @access public */ - var $scaffold; + public $scaffold; /** * function _beforeScaffold @@ -120,7 +120,7 @@ class ScaffoldMock extends CakeTestModel { * @var string 'posts' * @access public */ - var $useTable = 'articles'; + public $useTable = 'articles'; /** * belongsTo property @@ -128,7 +128,7 @@ class ScaffoldMock extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array( + public $belongsTo = array( 'User' => array( 'className' => 'ScaffoldUser', 'foreignKey' => 'user_id', @@ -141,7 +141,7 @@ class ScaffoldMock extends CakeTestModel { * @var array * @access public */ - var $hasMany = array( + public $hasMany = array( 'Comment' => array( 'className' => 'ScaffoldComment', 'foreignKey' => 'article_id', @@ -152,7 +152,7 @@ class ScaffoldMock extends CakeTestModel { * * @var string */ - var $hasAndBelongsToMany = array( + public $hasAndBelongsToMany = array( 'ScaffoldTag' => array( 'className' => 'ScaffoldTag', 'foreignKey' => 'something_id', @@ -176,7 +176,7 @@ class ScaffoldUser extends CakeTestModel { * @var string 'posts' * @access public */ - var $useTable = 'users'; + public $useTable = 'users'; /** * hasMany property @@ -184,7 +184,7 @@ class ScaffoldUser extends CakeTestModel { * @var array * @access public */ - var $hasMany = array( + public $hasMany = array( 'Article' => array( 'className' => 'ScaffoldMock', 'foreignKey' => 'article_id', @@ -206,7 +206,7 @@ class ScaffoldComment extends CakeTestModel { * @var string 'posts' * @access public */ - var $useTable = 'comments'; + public $useTable = 'comments'; /** * belongsTo property @@ -214,7 +214,7 @@ class ScaffoldComment extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array( + public $belongsTo = array( 'Article' => array( 'className' => 'ScaffoldMock', 'foreignKey' => 'article_id', @@ -235,7 +235,7 @@ class ScaffoldTag extends CakeTestModel { * @var string 'posts' * @access public */ - var $useTable = 'tags'; + public $useTable = 'tags'; } /** * TestScaffoldView class @@ -271,7 +271,7 @@ class ScaffoldViewTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.article', 'core.user', 'core.comment', 'core.join_thing', 'core.tag'); + public $fixtures = array('core.article', 'core.user', 'core.comment', 'core.join_thing', 'core.tag'); /** * startTest method @@ -669,7 +669,7 @@ class ScaffoldTest extends CakeTestCase { * @var SecurityTestController * @access public */ - var $Controller; + public $Controller; /** * fixtures property @@ -677,7 +677,7 @@ class ScaffoldTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.article', 'core.user', 'core.comment', 'core.join_thing', 'core.tag'); + public $fixtures = array('core.article', 'core.user', 'core.comment', 'core.join_thing', 'core.tag'); /** * startTest method * diff --git a/cake/tests/cases/libs/error.test.php b/cake/tests/cases/libs/error.test.php index 8f53f26b4..c35584995 100644 --- a/cake/tests/cases/libs/error.test.php +++ b/cake/tests/cases/libs/error.test.php @@ -38,7 +38,7 @@ class BlueberryComponent extends Object { * @access public * @return void */ - var $testName = null; + public $testName = null; /** * initialize method @@ -85,7 +85,7 @@ class AuthBlueberryUser extends CakeTestModel { * @var string 'AuthBlueberryUser' * @access public */ - var $name = 'AuthBlueberryUser'; + public $name = 'AuthBlueberryUser'; /** * useTable property @@ -93,7 +93,7 @@ class AuthBlueberryUser extends CakeTestModel { * @var string * @access public */ - var $useTable = false; + public $useTable = false; } if (!class_exists('AppController')) { /** @@ -109,7 +109,7 @@ class AppController extends Controller { * @access public * @return void */ - var $components = array('Blueberry'); + public $components = array('Blueberry'); /** * beforeRender method * @@ -157,7 +157,7 @@ class TestErrorController extends AppController { * @var array * @access public */ - var $uses = array(); + public $uses = array(); /** * index method @@ -185,7 +185,7 @@ class BlueberryController extends AppController { * @access public * @return void */ - var $name = 'BlueberryController'; + public $name = 'BlueberryController'; /** * uses property @@ -193,7 +193,7 @@ class BlueberryController extends AppController { * @access public * @return void */ - var $uses = array('AuthBlueberryUser'); + public $uses = array('AuthBlueberryUser'); /** * components property @@ -201,7 +201,7 @@ class BlueberryController extends AppController { * @access public * @return void */ - var $components = array('Auth'); + public $components = array('Auth'); } /** diff --git a/cake/tests/cases/libs/file.test.php b/cake/tests/cases/libs/file.test.php index aca8eb63c..253787a66 100644 --- a/cake/tests/cases/libs/file.test.php +++ b/cake/tests/cases/libs/file.test.php @@ -33,7 +33,7 @@ class FileTest extends CakeTestCase { * @var mixed null * @access public */ - var $File = null; + public $File = null; /** * testBasic method diff --git a/cake/tests/cases/libs/http_socket.test.php b/cake/tests/cases/libs/http_socket.test.php index 2609596e0..f76e54edd 100644 --- a/cake/tests/cases/libs/http_socket.test.php +++ b/cake/tests/cases/libs/http_socket.test.php @@ -170,7 +170,7 @@ class HttpSocketTest extends CakeTestCase { * @var mixed null * @access public */ - var $Socket = null; + public $Socket = null; /** * RequestSocket property @@ -178,7 +178,7 @@ class HttpSocketTest extends CakeTestCase { * @var mixed null * @access public */ - var $RequestSocket = null; + public $RequestSocket = null; /** * This function sets up a TestHttpSocket instance we are going to use for testing diff --git a/cake/tests/cases/libs/inflector.test.php b/cake/tests/cases/libs/inflector.test.php index 7e38fea77..12c318a6b 100644 --- a/cake/tests/cases/libs/inflector.test.php +++ b/cake/tests/cases/libs/inflector.test.php @@ -40,7 +40,7 @@ class InflectorTest extends CakeTestCase { * @var mixed null * @access public */ - var $Inflector = null; + public $Inflector = null; /** * setUp method diff --git a/cake/tests/cases/libs/magic_db.test.php b/cake/tests/cases/libs/magic_db.test.php index e4fc613d6..344554530 100644 --- a/cake/tests/cases/libs/magic_db.test.php +++ b/cake/tests/cases/libs/magic_db.test.php @@ -33,7 +33,7 @@ class MagicDbTest extends UnitTestCase { * @var MagicDb * @access public */ - var $Db = null; + public $Db = null; /** * Sets up a MagicDb class instance for testing * @@ -165,7 +165,7 @@ class MagicDbTestData extends Object { * @var array * @access public */ - var $data = array( + public $data = array( 'magic.snippet.db' => 'IyBGSUxFX0lEIERCDQojIERhdGU6MjAwNS0wMy0yOQ0KIyBTb3VyY2U6aHR0cDovL3d3dy5tYWdpY2RiLm9yZw0KDQojIE1hZ2ljIElEIGZvciBXb3JkcGVyZmVjdCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTQgYnkgQ2FybA0KMAlzdHJpbmcJXFx4RkZXUEMJW2ZpZD0wMDAwMDEwMDgtMDAtMDAwMDAwMTtleHQ9O21pbWU9O11Xb3JkcGVyZmVjdCBoZWxwIGZpbGUNCiY5CWJ5dGUJMHgwMgkNCj4xMCBieXRlCXgJLCB2ZXJzaW9uICVkDQo+MTEJYnl0ZQl4CS4lZA0KDQojIE1hZ2ljIElEIGZvciBXb3JkcGVyZmVjdCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTQgYnkgQ2FybA0KMAlzdHJpbmcJXFx4RkZXUEMJW2ZpZD0wMDAwMDEwMDgtMDAtMDAwMDAwMTtleHQ9O21pbWU9O11Xb3JkcGVyZmVjdCBhcHBsaWNhdGlvbiByZXNvdXJjZSBsaWJyYXJ5DQomOQlieXRlCTUxCQ0KPjEwCWJ5dGUJeAksIHZlcnNpb24gJWQNCj4xMQlieXRlCXgJLiVkDQoNCiMgTWFnaWMgSUQgZm9yIFdvcmRwZXJmZWN0IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNCBieSBDYXJsDQowCXN0cmluZwlcXHhGRldQQwlbZmlkPTAwMDAwMTAwOC0wMC0wMDAwMDAxO2V4dD07bWltZT07XVdvcmRwZXJmZWN0IGJsb2NrIGZpbGUNCiY5CWJ5dGUJMTMJDQo+MTAJYnl0ZQl4CSwgdmVyc2lvbiAlZA0KPjExCWJ5dGUJeAkuJWQ=', 'magic.snippet.db.result' => 'YToyOntzOjY6ImhlYWRlciI7YToyOntzOjQ6IkRhdGUiO3M6MTA6IjIwMDUtMDMtMjkiO3M6NjoiU291cmNlIjtzOjIyOiJodHRwOi8vd3d3Lm1hZ2ljZGIub3JnIjt9czo4OiJkYXRhYmFzZSI7YToyOntpOjA7YTo0OntpOjA7YTo0OntpOjA7czoxOiIwIjtpOjE7czo2OiJzdHJpbmciO2k6MjtzOjg6IlxceEZGV1BDIjtpOjM7czo1OToiW2ZpZD0wMDAwMDEwMDgtMDAtMDAwMDAwMTtleHQ9O21pbWU9O11Xb3JkcGVyZmVjdCBoZWxwIGZpbGUiO31pOjE7YTo0OntpOjA7czoyOiImOSI7aToxO3M6NDoiYnl0ZSI7aToyO3M6NDoiMHgwMiI7aTozO3M6MDoiIjt9aToyO2E6Mzp7aTowO3M6ODoiPjEwIGJ5dGUiO2k6MTtzOjE6IngiO2k6MjtzOjEyOiIsIHZlcnNpb24gJWQiO31pOjM7YTo0OntpOjA7czozOiI+MTEiO2k6MTtzOjQ6ImJ5dGUiO2k6MjtzOjE6IngiO2k6MztzOjM6Ii4lZCI7fX1pOjE7YTo0OntpOjA7YTo0OntpOjA7czoxOiIwIjtpOjE7czo2OiJzdHJpbmciO2k6MjtzOjg6IlxceEZGV1BDIjtpOjM7czo3ODoiW2ZpZD0wMDAwMDEwMDgtMDAtMDAwMDAwMTtleHQ9O21pbWU9O11Xb3JkcGVyZmVjdCBhcHBsaWNhdGlvbiByZXNvdXJjZSBsaWJyYXJ5Ijt9aToxO2E6NDp7aTowO3M6MjoiJjkiO2k6MTtzOjQ6ImJ5dGUiO2k6MjtzOjI6IjUxIjtpOjM7czowOiIiO31pOjI7YTo0OntpOjA7czozOiI+MTAiO2k6MTtzOjQ6ImJ5dGUiO2k6MjtzOjE6IngiO2k6MztzOjEyOiIsIHZlcnNpb24gJWQiO31pOjM7YTo0OntpOjA7czozOiI+MTEiO2k6MTtzOjQ6ImJ5dGUiO2k6MjtzOjE6IngiO2k6MztzOjM6Ii4lZCI7fX19fQ==', 'magic.db' => 'IyBGSUxFX0lEIERCDQojIERhdGU6MjAwNS0wMy0yOQ0KIyBTb3VyY2U6aHR0cDovL3d3dy5tYWdpY2RiLm9yZw0KDQojIE1hZ2ljIElEIGZvciBXb3JkcGVyZmVjdCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTQgYnkgQ2FybA0KMAlzdHJpbmcJXFx4RkZXUEMJW2ZpZD0wMDAwMDEwMDgtMDAtMDAwMDAwMTtleHQ9O21pbWU9O11Xb3JkcGVyZmVjdCBoZWxwIGZpbGUNCiY5CWJ5dGUJMHgwMgkNCj4xMCBieXRlCXgJLCB2ZXJzaW9uICVkDQo+MTEJYnl0ZQl4CS4lZA0KDQojIE1hZ2ljIElEIGZvciBXb3JkcGVyZmVjdCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTQgYnkgQ2FybA0KMAlzdHJpbmcJXFx4RkZXUEMJW2ZpZD0wMDAwMDEwMDgtMDAtMDAwMDAwMTtleHQ9O21pbWU9O11Xb3JkcGVyZmVjdCBhcHBsaWNhdGlvbiByZXNvdXJjZSBsaWJyYXJ5DQomOQlieXRlCTUxCQ0KPjEwCWJ5dGUJeAksIHZlcnNpb24gJWQNCj4xMQlieXRlCXgJLiVkDQoNCiMgTWFnaWMgSUQgZm9yIFdvcmRwZXJmZWN0IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNCBieSBDYXJsDQowCXN0cmluZwlcXHhGRldQQwlbZmlkPTAwMDAwMTAwOC0wMC0wMDAwMDAxO2V4dD07bWltZT07XVdvcmRwZXJmZWN0IGJsb2NrIGZpbGUNCiY5CWJ5dGUJMTMJDQo+MTAJYnl0ZQl4CSwgdmVyc2lvbiAlZA0KPjExCWJ5dGUJeAkuJWQNCg0KIyBNYWdpYyBJRCBmb3IgV29yZHBlcmZlY3QgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE0IGJ5IENhcmwNCjAJc3RyaW5nCVxceEZGV1BDCVtmaWQ9MDAwMDAxMDA4LTAwLTAwMDAwMDE7ZXh0PTttaW1lPTtdV29yZHBlcmZlY3QgY29sdW1uIGJsb2NrDQomOQlieXRlCTE1CQ0KPjEwCWJ5dGUJeAksIHZlcnNpb24gJWQNCj4xMQlieXRlCXgJLiVkDQoNCiMgTWFnaWMgSUQgZm9yIFdvcmRwZXJmZWN0IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNCBieSBDYXJsDQowCXN0cmluZwlcXHhGRldQQwlbZmlkPTAwMDAwMTAwOC0wMC0wMDAwMDAxO2V4dD07bWltZT07XVdvcmRwZXJmZWN0IGRpY3Rpb25hcnkgZmlsZQ0KJjkJYnl0ZQkweDBCCQ0KPjEwCWJ5dGUJeAksIHZlcnNpb24gJWQNCj4xMQlieXRlCXgJLiVkDQoNCiMgTWFnaWMgSUQgZm9yIFdvcmRwZXJmZWN0IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNCBieSBDYXJsDQowCXN0cmluZwlcXHhGRldQQwlbZmlkPTAwMDAwMTAwOC0wMC0wMDAwMDAxO2V4dD07bWltZT07XVdvcmRwZXJmZWN0IGRpY3Rpb25hcnkgcnVsZXMgZmlsZQ0KJjkJYnl0ZQkzNAkNCj4xMAlieXRlCXgJLCB2ZXJzaW9uICVkDQo+MTEJYnl0ZQl4CS4lZA0KDQojIE1hZ2ljIElEIGZvciBXb3JkcGVyZmVjdCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTQgYnkgQ2FybA0KMAlzdHJpbmcJXFx4RkZXUEMJW2ZpZD0wMDAwMDEwMDgtMDAtMDAwMDAwMTtleHQ9O21pbWU9O11Xb3JkcGVyZmVjdCBleHRlcm5hbCBzcGVsbCBjb2RlIG1vZHVsZSBmaWxlDQomOQlieXRlCTQ2CQ0KPjEwCWJ5dGUJeAksIHZlcnNpb24gJWQNCj4xMQlieXRlCXgJLiVkDQoNCiMgTWFnaWMgSUQgZm9yIFdvcmRwZXJmZWN0IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNCBieSBDYXJsDQowCXN0cmluZwlcXHhGRldQQwlbZmlkPTAwMDAwMTAwOC0wMC0wMDAwMDAxO2V4dD07bWltZT07XVdvcmRwZXJmZWN0IGV4dGVybmFsIHNwZWxsIGRpY3Rpb25hcnkgZmlsZQ0KJjkJYnl0ZQk0NwkNCj4xMAlieXRlCXgJLCB2ZXJzaW9uICVkDQo+MTEJYnl0ZQl4CS4lZA0KDQojIE1hZ2ljIElEIGZvciBXb3JkcGVyZmVjdCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTQgYnkgQ2FybA0KMAlzdHJpbmcJXFx4RkZXUEMJW2ZpZD0wMDAwMDEwMDgtMDAtMDAwMDAwMTtleHQ9O21pbWU9O11Xb3JkcGVyZmVjdCBHcmFwaGljcyBzY3JlZW4gZHJpdmVyIGZpbGUNCiY5CWJ5dGUJMjYJDQo+MTAJYnl0ZQl4CSwgdmVyc2lvbiAlZA0KPjExCWJ5dGUJeAkuJWQNCg0KIyBNYWdpYyBJRCBmb3IgV29yZHBlcmZlY3QgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE0IGJ5IENhcmwNCjAJc3RyaW5nCVxceEZGV1BDCVtmaWQ9MDAwMDAxMDA4LTAwLTAwMDAwMDE7ZXh0PTttaW1lPTtdV29yZHBlcmZlY3QgaHlwaGVuYXRpb24gY29kZSBtb2R1bGUgZmlsZQ0KJjkJYnl0ZQkyMwkNCj4xMAlieXRlCXgJLCB2ZXJzaW9uICVkDQo+MTEJYnl0ZQl4CS4lZA0KDQojIE1hZ2ljIElEIGZvciBXb3JkcGVyZmVjdCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTQgYnkgQ2FybA0KMAlzdHJpbmcJXFx4RkZXUEMJW2ZpZD0wMDAwMDEwMDgtMDAtMDAwMDAwMTtleHQ9O21pbWU9O11Xb3JkcGVyZmVjdCBoeXBoZW5hdGlvbiBkYXRhIG1vZHVsZSBmaWxlDQomOQlieXRlCTI0CQ0KPjEwCWJ5dGUJeAksIHZlcnNpb24gJWQNCj4xMQlieXRlCXgJLiVkDQoNCiMgTWFnaWMgSUQgZm9yIFdvcmRwZXJmZWN0IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNCBieSBDYXJsDQowCXN0cmluZwlcXHhGRldQQwlbZmlkPTAwMDAwMTAwOC0wMC0wMDAwMDAxO2V4dD07bWltZT07XVdvcmRwZXJmZWN0IGh5cGhlbmF0aW9uIGxleCBtb2R1bGUNCiY5CWJ5dGUJMjcJDQo+MTAJYnl0ZQl4CSwgdmVyc2lvbiAlZA0KPjExCWJ5dGUJeAkuJWQNCg0KIyBNYWdpYyBJRCBmb3IgV29yZHBlcmZlY3QgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE0IGJ5IENhcmwNCjAJc3RyaW5nCVxceEZGV1BDCVtmaWQ9MDAwMDAxMDA4LTAwLTAwMDAwMDE7ZXh0PTttaW1lPTtdV29yZHBlcmZlY3QgaW5zdGFsbGF0aW9uIGluZm9ybWF0aW9uIGZpbGUNCiY5CWJ5dGUJNDEJDQo+MTAJYnl0ZQl4CSwgdmVyc2lvbiAlZA0KPjExCWJ5dGUJeAkuJWQNCg0KIyBNYWdpYyBJRCBmb3IgV29yZHBlcmZlY3QgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE0IGJ5IENhcmwNCjAJc3RyaW5nCVxceEZGV1BDCVtmaWQ9MDAwMDAxMDA4LTAwLTAwMDAwMDE7ZXh0PTttaW1lPTtdV29yZHBlcmZlY3Qga2V5Ym9hcmQgZGVmaW5pdGlvbiBmaWxlDQomOQlieXRlCTB4MDMJDQo+MTAJYnl0ZQl4CSwgdmVyc2lvbiAlZA0KPjExCWJ5dGUJeAkuJWQNCg0KIyBNYWdpYyBJRCBmb3IgV29yZHBlcmZlY3QgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE0IGJ5IENhcmwNCjAJc3RyaW5nCVxceEZGV1BDCVtmaWQ9MDAwMDAxMDA4LTAwLTAwMDAwMDE7ZXh0PTttaW1lPTtdV29yZHBlcmZlY3QgbWFjcm8gZGF0YSBmaWxlDQomOQlieXRlCTB4MDEJDQo+MTAJYnl0ZQl4CSwgdmVyc2lvbiAlZA0KPjExCWJ5dGUJeAkuJWQNCg0KIyBNYWdpYyBJRCBmb3IgV29yZHBlcmZlY3QgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE0IGJ5IENhcmwNCjAJc3RyaW5nCVxceEZGV1BDCVtmaWQ9MDAwMDAxMDA4LTAwLTAwMDAwMDE7ZXh0PTttaW1lPTtdV29yZHBlcmZlY3QgbWFjcm8gcmVzb3VyY2UgZmlsZQ0KJjkJYnl0ZQkyNQkNCj4xMAlieXRlCXgJLCB2ZXJzaW9uICVkDQo+MTEJYnl0ZQl4CS4lZA0KDQojIE1hZ2ljIElEIGZvciBXb3JkcGVyZmVjdCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTQgYnkgQ2FybA0KMAlzdHJpbmcJXFx4RkZXUEMJW2ZpZD0wMDAwMDEwMDgtMDAtMDAwMDAwMTtleHQ9O21pbWU9O11Xb3JkcGVyZmVjdCBwcmludGVyIFEgY29kZXMgKHVzZWQgYnkgVkFYL0RHKQ0KJjkJYnl0ZQkyOAkNCj4xMAlieXRlCXgJLCB2ZXJzaW9uICVkDQo+MTEJYnl0ZQl4CS4lZA0KDQojIE1hZ2ljIElEIGZvciBXb3JkcGVyZmVjdCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTQgYnkgQ2FybA0KMAlzdHJpbmcJXFx4RkZXUEMJW2ZpZD0wMDAwMDEwMDgtMDAtMDAwMDAwMTtleHQ9O21pbWU9O11Xb3JkcGVyZmVjdCByZWN0YW5ndWxhciBibG9jayBmaWxlDQomOQlieXRlCTE0CQ0KPjEwCWJ5dGUJeAksIHZlcnNpb24gJWQNCj4xMQlieXRlCXgJLiVkDQoNCiMgTWFnaWMgSUQgZm9yIFdvcmRwZXJmZWN0IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNCBieSBDYXJsDQowCXN0cmluZwlcXHhGRldQQwlbZmlkPTAwMDAwMTAwOC0wMC0wMDAwMDAxO2V4dD07bWltZT07XVdvcmRwZXJmZWN0IHNwZWxsIGNvZGUgbW9kdWxlIHJ1bGVzIGZpbGUNCiY5CWJ5dGUJMzMJDQo+MTAJYnl0ZQl4CSwgdmVyc2lvbiAlZA0KPjExCWJ5dGUJeAkuJWQNCg0KIyBNYWdpYyBJRCBmb3IgV29yZHBlcmZlY3QgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE0IGJ5IENhcmwNCjAJc3RyaW5nCVxceEZGV1BDCVtmaWQ9MDAwMDAxMDA4LTAwLTAwMDAwMDE7ZXh0PTttaW1lPTtdV29yZHBlcmZlY3Qgc3BlbGwgY29kZSBtb2R1bGUgd29yZCBsaXN0DQomOQlieXRlCTI5CQ0KPjEwCWJ5dGUJeAksIHZlcnNpb24gJWQNCj4xMQlieXRlCXgJLiVkDQoNCiMgTWFnaWMgSUQgZm9yIFdvcmRwZXJmZWN0IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNCBieSBDYXJsDQowCXN0cmluZwlcXHhGRldQQwlbZmlkPTAwMDAwMTAwOC0wMC0wMDAwMDAxO2V4dD07bWltZT07XVdvcmRwZXJmZWN0IHRoZXNhcnVzIGZpbGUNCiY5CWJ5dGUJMTIJDQo+MTAJYnl0ZQl4CSwgdmVyc2lvbiAlZA0KPjExCWJ5dGUJeAkuJWQNCg0KIyBNYWdpYyBJRCBmb3IgV29yZHBlcmZlY3QgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE0IGJ5IENhcmwNCjAJc3RyaW5nCVxceEZGV1BDCVtmaWQ9MDAwMDAxMDA4LTAwLTAwMDAwMDE7ZXh0PTttaW1lPTtdV29yZHBlcmZlY3QgVkFYIGtleWJvYXJkIGRlZmluaXRpb24gZmlsZQ0KJjkJYnl0ZQkweDA0CQ0KPjEwCWJ5dGUJeAksIHZlcnNpb24gJWQNCj4xMQlieXRlCXgJLiVkDQoNCiMgTWFnaWMgSUQgZm9yIFdvcmRwZXJmZWN0IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNCBieSBDYXJsDQowCXN0cmluZwlcXHhGRldQQwlbZmlkPTAwMDAwMTAwOC0wMC0wMDAwQUxMO2V4dD1hbGw7bWltZT07XVdvcmRwZXJmZWN0IHByaW50ZXIgcmVzb3VyY2UgZmlsZQ0KJjkJYnl0ZQkxOQkNCj4xMAlieXRlCXgJLCB2ZXJzaW9uICVkDQo+MTEJYnl0ZQl4CS4lZA0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IENhcmwNCjAJc3RyaW5nCVJJRkYJW2ZpZD0wMDAwMDEwMDEtMDAtMDAwMENPTjtleHQ9Y29uO21pbWU9O11NaWNyb3NvZnQgQW5pbWF0ZWQgY3Vyc29yLCBsaXR0bGUtZW5kaWFuDQomOAlzdHJpbmcJQUNPTgkNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQowCXN0cmluZwlSSUZYCVtmaWQ9MDAwMDAxMDAxLTAwLTAwMDBDT047ZXh0PWNvbjttaW1lPTtdTWljcm9zb2Z0IEFuaW1hdGVkIGN1cnNvciwgYmlnLWVuZGlhbg0KJjgJc3RyaW5nCUFDT04JDQoNCiMgTWFnaWMgSUQgZm9yIFdvcmRwZXJmZWN0IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNCBieSBDYXJsDQowCXN0cmluZwlcXHhGRldQQwlbZmlkPTAwMDAwMTAwOC0wMC0wMDAwRE9DO2V4dD1kb2M7bWltZT07XU1hY2ludG9zaCBXb3JkcGVyZmVjdCBkb2N1bWVudCBmaWxlDQomOQlieXRlCTQ0CQ0KPjEwCWJ5dGUJeAksIHZlcnNpb24gJWQNCj4xMQlieXRlCXgJLiVkDQoNCiMgTWFnaWMgSUQgZm9yIFdvcmRwZXJmZWN0IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNCBieSBDYXJsDQowCXN0cmluZwlcXHhGRldQQwlbZmlkPTAwMDAwMTAwOC0wMC0wMDAwRE9DO2V4dD1kb2M7bWltZT07XVZBWCBXb3JkcGVyZmVjdCBkb2N1bWVudCBmaWxlDQomOQlieXRlCTQ1CQ0KPjEwCWJ5dGUJeAksIHZlcnNpb24gJWQNCj4xMQlieXRlCXgJLiVkDQoNCiMgTWFnaWMgSUQgZm9yIFdvcmRwZXJmZWN0IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNCBieSBDYXJsDQowCXN0cmluZwlcXHhGRldQQwlbZmlkPTAwMDAwMTAwOC0wMC0wMDAwRFJTO2V4dD1kcnM7bWltZT07XVdvcmRwZXJmZWN0IGRpc3BsYXkgcmVzb3VyY2UgZmlsZQ0KJjkJYnl0ZQkyMAkNCj4xMAlieXRlCXgJLCB2ZXJzaW9uICVkDQo+MTEJYnl0ZQl4CS4lZA0KDQojIE1hZ2ljIElEIGZvciBXb3JkcGVyZmVjdCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTQgYnkgQ2FybA0KMAlzdHJpbmcJXFx4RkZXUEMJW2ZpZD0wMDAwMDEwMDgtMDAtMDAwMEZJTDtleHQ9ZmlsO21pbWU9O11Xb3JkcGVyZmVjdCBvdmVybGF5IGZpbGUNCiY5CWJ5dGUJMjEJDQo+MTAJYnl0ZQl4CSwgdmVyc2lvbiAlZA0KPjExCWJ5dGUJeAkuJWQNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNCBieSBDYXJsDQowCXN0cmluZwlQTUNDCVtmaWQ9MDAwMDAxMDAxLTAwLTAwMDBHUlA7ZXh0PWdycDttaW1lPTtdTWljcm9zb2Z0IHdpbmRvd3MgZ3JvdXAgZmlsZQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE0IGJ5IENhcmwNCjAJYmVzaG9ydAkweEUzMTAJW2ZpZD0wMDAwMDEwMDctMDAtMDAwSU5GTztleHQ9aW5mbzttaW1lPTtdQW1pZ2Egc2hvcnRjdXQgLyBpY29uIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgV29yZHBlcmZlY3QgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE0IGJ5IENhcmwNCjAJc3RyaW5nCVxceEZGV1BDCVtmaWQ9MDAwMDAxMDA4LTAwLTAwMDBJTlM7ZXh0PWluczttaW1lPTtdV29yZHBlcmZlY3QgaW5zdGFsbGF0aW9uIGluZm9ybWF0aW9uIGZpbGUNCiY5CWJ5dGUJNDMJDQo+MTAJYnl0ZQl4CSwgdmVyc2lvbiAlZA0KPjExCWJ5dGUJeAkuJWQNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNCBieSBDYXJsDQowCWxlbG9uZwkweDAwMDAwMDRDCVtmaWQ9MDAwMDAxMDAxLTAwLTAwMDBMTks7ZXh0PWxuazttaW1lPTtdTWljcm9zb2Z0IFdpbmRvd3Mgc2hvcnRjdXQgZmlsZQ0KJjQJc3RyaW5nCVxceDAxXFx4MTRcXHgwMgkNCg0KIyBNYWdpYyBJRCBmb3IgV29yZHBlcmZlY3QgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE0IGJ5IENhcmwNCjAJc3RyaW5nCVxceEZGV1BDCVtmaWQ9MDAwMDAxMDA4LTAwLTAwMDBQUlM7ZXh0PXByczttaW1lPTtdV29yZHBlcmZlY3QgcHJpbnRlciByZXNvdXJjZSBmaWxlDQomOQlieXRlCTE2CQ0KPjEwCWJ5dGUJeAksIHZlcnNpb24gJWQNCj4xMQlieXRlCXgJLiVkDQoNCiMgTWFnaWMgSUQgZm9yIFdvcmRwZXJmZWN0IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNCBieSBDYXJsDQowCXN0cmluZwlcXHhGRldQQwlbZmlkPTAwMDAwMTAwOC0wMC0wMDAwUVJTO2V4dD1xcnM7bWltZT07XVdvcmRwZXJmZWN0IDUuMSBlcXVhdGlvbiByZXNvdXJjZSBmaWxlDQomOQlieXRlCTMwCQ0KPjEwCWJ5dGUJeAksIHZlcnNpb24gJWQNCj4xMQlieXRlCXgJLiVkDQoNCiMgTWFnaWMgSUQgZm9yIFdvcmRwZXJmZWN0IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNCBieSBDYXJsDQowCXN0cmluZwlcXHhGRldQQwlbZmlkPTAwMDAwMTAwOC0wMC0wMDAwU0VUO2V4dD1zZXQ7bWltZT07XVdvcmRwZXJmZWN0IHNldHVwIGRhdGENCiY5CWJ5dGUJMTcJDQo+MTAJYnl0ZQl4CSwgdmVyc2lvbiAlZA0KPjExCWJ5dGUJeAkuJWQNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0wOCBieSBDYXJsDQowCXN0cmluZwlSSUZGCVtmaWQ9MDAwMDAxMDAxLTBFLTAwMDBQQUw7ZXh0PXBhbCxyaWZmO21pbWU9O11NaWNyb3NvZnQgUGFsZXR0ZSwgbGl0dGxlLWVuZGlhbg0KJjgJc3RyaW5nCVBBTAkNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0wOCBieSBDYXJsDQowCXN0cmluZwlSSUZYCVtmaWQ9MDAwMDAxMDAxLTBFLTAwMDBQQUw7ZXh0PXBhbCxyaWZ4O21pbWU9O11NaWNyb3NvZnQgUGFsZXR0ZSwgYmlnLWVuZGlhbg0KJjgJc3RyaW5nCVBBTAkNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0wNCBieSBDYXJsDQowCXN0cmluZwlET1MJW2ZpZD0wMDAwMDEwMDctMEYtMDAwMEFERjtleHQ9YWRmO21pbWU9O11BbWlnYU9TIEZpbGUgc3lzdGVtDQomMwlieXRlJjB4ZjgJMAkNCj4zCWJ5dGUmMQkwCSwgT0ZTDQo+MwlieXRlJjEJMQksIEZGUw0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA1LTExIGJ5IENhcmwNCjAJYmVsb25nCTB4MDNGMwlbZmlkPTAwMDAwMTAwNy0xMC1MSUJSQVJZO2V4dD0sbGlicmFyeTttaW1lPTtdQW1pZ2EgQ2xhc3NpYyBleGVjdXRhYmxlIGZpbGUgKDY4MHgwIGZhbWlseSkNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQowCXN0cmluZwlcXHg3ZkVMRglbZmlkPTAwMDAwMDAwMy0xMC0wMDAwMDBPO2V4dD0sbyxzbyxvdXQ7bWltZT07XUV4ZWN1dGFibGUgbGlua2FibGUgZmlsZSAoRUxGKQ0KJjQJYnl0ZQk9MQksIDMyLWJpdA0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IENhcmwNCjAJc3RyaW5nCVxceDdmRUxGCVtmaWQ9MDAwMDAwMDAzLTEwLTAwMDAwME87ZXh0PSxvLHNvLG91dDttaW1lPTtdRXhlY3V0YWJsZSBsaW5rYWJsZSBmaWxlIChFTEYpDQomNAlieXRlCT0yCSwgNjQtYml0DQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMTQgYnkgQ2FybA0KMAlzdHJpbmcJTVoJW2ZpZD0wMDAwMDEwMDEtMTAtMDAwMEVYRTtleHQ9ZXhlLGRsbDttaW1lPTtdTmV3IGV4ZWN1dGFibGUgZmlsZQ0KJjB4MTgJbGVzaG9ydAk+MHgzRgkNCiYoNjAubCkJc3RyaW5nCU5FCQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTE0IGJ5IENhcmwNCjAJc3RyaW5nCVpNCVtmaWQ9MDAwMDAxMDAxLTEwLTAwMDBFWEU7ZXh0PWV4ZSxkbGw7bWltZT07XU5ldyBleGVjdXRhYmxlIGZpbGUNCiYweDE4CWxlc2hvcnQJPjB4M0YJDQomKDYwLmwpCXN0cmluZwlORQkNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xNCBieSBDYXJsDQowCXN0cmluZwlNWglbZmlkPTAwMDAwMTAwMS0xMC0wMDAwRVhFO2V4dD1leGUsZGxsO21pbWU9O11NaWNyb3NvZnQgV2luZG93cyAzLnggTmV3IEV4ZWN1dGFibGUgZmlsZQ0KJjB4MTgJbGVzaG9ydAk+MHgzRgkNCiYoNjAubCkJc3RyaW5nCU5FCQ0KJig2MC5sKzU0KQlieXRlCTB4MDIJDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMTQgYnkgQ2FybA0KMAlzdHJpbmcJWk0JW2ZpZD0wMDAwMDEwMDEtMTAtMDAwMEVYRTtleHQ9ZXhlLGRsbDttaW1lPTtdTWljcm9zb2Z0IFdpbmRvd3MgMy54IE5ldyBFeGVjdXRhYmxlIGZpbGUNCiYweDE4CWxlc2hvcnQJPjB4M0YJDQomKDYwLmwpCXN0cmluZwlORQkNCiYoNjAubCs1NCkJYnl0ZQkweDAyCQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTE0IGJ5IENhcmwNCjAJc3RyaW5nCU1aCVtmaWQ9MDAwMDAxMDA5LTEwLTAwMDBFWEU7ZXh0PWV4ZSxkbGw7bWltZT07XUlCTSBPUy8yIE5ldyBFeGVjdXRhYmxlIGZpbGUNCiYweDE4CWxlc2hvcnQJPjB4M0YJDQomKDYwLmwpCXN0cmluZwlORQkNCiYoNjAubCs1NCkJYnl0ZQkweDAxCQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTE0IGJ5IENhcmwNCjAJc3RyaW5nCVpNCVtmaWQ9MDAwMDAxMDA5LTEwLTAwMDBFWEU7ZXh0PWV4ZSxkbGw7bWltZT07XUlCTSBPUy8yIE5ldyBFeGVjdXRhYmxlIGZpbGUNCiYweDE4CWxlc2hvcnQJPjB4M0YJDQomKDYwLmwpCXN0cmluZwlORQkNCiYoNjAubCs1NCkJYnl0ZQkweDAxCQ0KDQojIE1hZ2ljIElEIGZvciBNaWNyb3NvZnQgV2luZG93cyBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMTMgYnkgQ2FybA0KMAlzdHJpbmcJTVoJW2ZpZD0wMDAwMDEwMDEtMTAtMDAwMEVYRTtleHQ9ZXhlLGRsbDttaW1lPTtdTWljcm9zb2Z0IFdpbmRvd3MgTlQgUG9ydGFibGUgRXhlY3V0YWJsZSBmaWxlDQomMHgxOAlsZXNob3J0CTB4NDAJDQomKDYwLmwpCXN0cmluZwlQRVxceDAwXFx4MDAJDQoNCiMgTWFnaWMgSUQgZm9yIE1pY3Jvc29mdCBXaW5kb3dzIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xMyBieSBDYXJsDQowCXN0cmluZwlaTQlbZmlkPTAwMDAwMTAwMS0xMC0wMDAwRVhFO2V4dD1leGUsZGxsO21pbWU9O11NaWNyb3NvZnQgV2luZG93cyBOVCBQb3J0YWJsZSBFeGVjdXRhYmxlIGZpbGUNCiYweDE4CWxlc2hvcnQJMHg0MAkNCiYoNjAubCkJc3RyaW5nCVBFXFx4MDBcXHgwMAkNCg0KIyBNYWdpYyBJRCBmb3IgTWljcm9zb2Z0IFdpbmRvd3MsRE9TNEdXIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xNCBieSBDYXJsDQowCXN0cmluZwlNWglbZmlkPTAwMDAwMTAwMS0xMC0wMDAwRVhFO2V4dD1leGUsZGxsLGRydjttaW1lPTtdTWljcm9zb2Z0IFdpbmRvd3MgTGluZWFyIGV4ZWN1dGFibGUNCiYweDE4CWxlc2hvcnQJPjB4M0YJDQomKDYwLmwpCXN0cmluZwlMRQkNCg0KIyBNYWdpYyBJRCBmb3IgTWljcm9zb2Z0IFdpbmRvd3MsRE9TNEdXIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xNCBieSBDYXJsDQowCXN0cmluZwlaTQlbZmlkPTAwMDAwMTAwMS0xMC0wMDAwRVhFO2V4dD1leGUsZGxsLGRydjttaW1lPTtdTWljcm9zb2Z0IFdpbmRvd3MgTGluZWFyIGV4ZWN1dGFibGUNCiYweDE4CWxlc2hvcnQJPjB4M0YJDQomKDYwLmwpCXN0cmluZwlMRQkNCg0KIyBNYWdpYyBJRCBmb3IgT1MvMixET1M0R1cgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTE0IGJ5IENhcmwNCjAJc3RyaW5nCU1aCVtmaWQ9MDAwMDAxMDA5LTEwLTAwMDBFWEU7ZXh0PWV4ZSxkbGwsZHJ2O21pbWU9O11PUy8yIExpbmVhciBleGVjdXRhYmxlDQomMHgxOAlsZXNob3J0CT4weDNGCQ0KJig2MC5sKQlzdHJpbmcJTFgJDQoNCiMgTWFnaWMgSUQgZm9yIE9TLzIsRE9TNEdXIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xNCBieSBDYXJsDQowCXN0cmluZwlaTQlbZmlkPTAwMDAwMTAwOS0xMC0wMDAwRVhFO2V4dD1leGUsZGxsLGRydjttaW1lPTtdT1MvMiBMaW5lYXIgZXhlY3V0YWJsZQ0KJjB4MTgJbGVzaG9ydAk+MHgzRgkNCiYoNjAubCkJc3RyaW5nCUxYCQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA3LTMwIGJ5IENhcmwNCjAJc3RyaW5nCU1TRlQJW2ZpZD0wMDAwMDEwMDEtMTAtMDAwMFRMQjtleHQ9dGxiO21pbWU9O11NaWNyb3NvZnQgY29tcG9uZW50IHR5cGUgbGlicmFyeQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA1LTExIGJ5IENhcmwNCjAJYmVzaG9ydAkweDYwMUEJW2ZpZD0wMDAwMDEwMDYtMTAtMDAwMFRUUDtleHQ9dHRwLGdlbSxwcmc7bWltZT07XUF0YXJpIE1pTlQgZXhlY3V0YWJsZS9vYmplY3QgZmlsZQ0KJjB4MTIJc3RyaW5nCU1pTlQJDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDUtMTEgYnkgQ2FybA0KMAliZXNob3J0CTB4NjAxQQlbZmlkPTAwMDAwMTAwNi0xMC0wMDAwVFRQO2V4dD10dHAsZ2VtLHByZzttaW1lPTtdQXRhcmkgVE9TIGV4ZWN1dGFibGUvb2JqZWN0IGZpbGUNCiYweDEyCWJlbG9uZwkweDAwMDAJDQoNCiMgTWFnaWMgSUQgZm9yIFZpcnR1YWwgUGFzY2FsIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNy0zMCBieSBDYXJsDQowCXN0cmluZwlWUEkJW2ZpZD0wMDAwMDAwMDAtMTAtMDAwMFZQSTtleHQ9dnBpO21pbWU9O11WaXJ0dWFsIHBhc2NhbCB1bml0IGZpbGUNCiYweDAzCWJ5dGUJPjQ3CQ0KJjB4MDMJYnl0ZQk8NTgJDQoNCiMgTWFnaWMgSUQgZm9yIEphdmEgY29tcGlsZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA1LTExIGJ5IENhcmwNCjAJYmVsb25nCTB4Q0FGRUJBQkUJW2ZpZD0wMDAwMDEwMTEtMTEtMDBDTEFTUztleHQ9Y2xhc3M7bWltZT07XUphdmFsIHZpcnR1YWwgbWFjaGluZSBjbGFzcyBmaWxlDQo+NgliZXNob3J0CXgJLCB2ZXJzaW9uICVkDQo+NAliZXNob3J0CXgJLiVkDQoNCiMgTWFnaWMgSUQgZm9yIEJvcmxhbmQgRGVscGhpIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNy0zMCBieSBDYXJsDQowCXN0cmluZwlQS0cJW2ZpZD0wMDAwMDEwMDUtMTEtMDAwMERDUDtleHQ9ZGNwO21pbWU9O11Cb3JsYW5kIERlbHBoaSBjb21waWxlZCBwYWNrYWdlIGNvZGUgZmlsZQ0KJjB4MDMJYnl0ZQk+NDcJDQomMHgwMwlieXRlCTw1OAkNCg0KIyBNYWdpYyBJRCBmb3IgQm9ybGFuZCBEZWxwaGkgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA3LTMwIGJ5IENhcmwNCjAJc3RyaW5nCVxceERGXFx4MDBcXHgwMFxceDBGCVtmaWQ9MDAwMDAxMDA1LTExLTAwMDBEQ1U7ZXh0PWRjdTttaW1lPTtdQm9ybGFuZCBEZWxwaGkgY29kZSB1bml0IGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgVHVyYm8gUGFzY2FsIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNy0yOSBieSBDYXJsDQowCXN0cmluZwlUUFU5CVtmaWQ9MDAwMDAxMDA1LTExLTAwMDBUUFU7ZXh0PXRwdTttaW1lPTtdVHVyYm8gUGFzY2FsIDYuMCBjb2RlIHVuaXQgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBUdXJibyBQYXNjYWwsIEJvcmxhbmQgUGFzY2FsIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNy0yOSBieSBDYXJsDQowCXN0cmluZwlUUFVRCVtmaWQ9MDAwMDAxMDA1LTExLTAwMDBUUFU7ZXh0PXRwdSx0cHAsdHB3O21pbWU9O11Cb3JsYW5kIFBhc2NhbCA3LjAgY29kZSB1bml0IGZpbGUNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNSBieSBDYXJsDQoyCXN0cmluZwlBRExJQi0JW2ZpZD0wMDAwMDEwMTYtMjAtMDAwMEJOSztleHQ9Ym5rO21pbWU9O11BZGxpYiBGTSBpbnN0cnVtZW50IGJhbmsgZmlsZQ0KPjAJYnl0ZQl4CSwgdmVyc2lvbiAlZA0KPjEJYnl0ZQl4CS4lZA0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE2IGJ5IENhcmwNCjAJc3RyaW5nCUlCS1xceDFBCVtmaWQ9MDAwMDAxMDEzLTIwLTAwMDBJQks7ZXh0PWliazttaW1lPTtdQ3JlYXRpdmUgTGFicyBGTSBpbnN0cnVtZW50IGJhbmsgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBNaWNyb3NvZnQgSW5zdHJ1bWVudCBEZWZpbml0aW9uIGZpbGUgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAzLTA0IGJ5IENhcmwNCjAJc3RyaW5nCVJJRkYJW2ZpZD0wMDAwMDEwMDEtMjAtMDAwMElERjtleHQ9aWRmO21pbWU9O11NaWNyb3NvZnQgaW5zdHJ1bWVudCBkZWZpbml0aW9uIGZpbGUsIGxpdHRsZS1lbmRpYW4NCiY4CXN0cmluZwlJREZcXCAJDQoNCiMgTWFnaWMgSUQgZm9yIE1pY3Jvc29mdCBJbnN0cnVtZW50IERlZmluaXRpb24gZmlsZSBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMDQgYnkgQ2FybA0KMAlzdHJpbmcJUklGWAlbZmlkPTAwMDAwMTAwMS0yMC0wMDAwSURGO2V4dD1pZGY7bWltZT07XU1pY3Jvc29mdCBpbnN0cnVtZW50IGRlZmluaXRpb24gZmlsZSwgYmlnLWVuZGlhbg0KJjgJc3RyaW5nCUlERlxcIAkNCg0KIyBNYWdpYyBJRCBmb3IgRGlnaXRyYWtrZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAzLTA0IGJ5IENhcmwNCjAJc3RyaW5nCURJU1QJW2ZpZD0wMDAxMDAwODgtMjAtMDAwMElTVDtleHQ9aXN0O21pbWU9O11EaWdpdHJha2tlciBJbnN0cnVtZW50IGZpbGUNCiY0CWJ5dGUJPDIJDQoNCiMgTWFnaWMgSUQgZm9yIEltcHVsc2UgdHJhY2tlciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMDQgYnkgQ2FybA0KMAlzdHJpbmcJSU1QSQlbZmlkPTAwMDEwMDAzMi0yMC0wMDAwSVRJO2V4dD1pdGk7bWltZT07XUltcHVsc2UgdHJhY2tlciBpbnN0cnVtZW50IGZpbGUNCj4weDIwCXN0cmluZwl4CVt0aXRsZT0lLjI2c10NCg0KIyBNYWdpYyBJRCBmb3IgTWFkdHJhY2tlciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMDUgYnkgQ2FybA0KMAlzdHJpbmcJTUkyMQlbZmlkPTAwMDEwMDA5MS0yMC0wMDAwTVRJO2V4dD1tdGk7bWltZT07XU1hZHRyYWNrZXIgaW5zdHJ1bWVudCBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIEdyYXZpcyBVbHRyYXNvdW5kIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNSBieSBDYXJsDQowCXN0cmluZwlHRjFQQVRDSDEwMFxcMElEIzAwMDAwMlxcMAlbZmlkPTAwMDAwMTAxOC0yMC0wMDAwUEFUO2V4dD1wYXQ7bWltZT07XUdyYXZpcyBVbHRyYXNvdW5kIFBhdGNoIChvbGQgaW5zdHJ1bWVudCBkYXRhKQ0KDQojIE1hZ2ljIElEIGZvciBHcmF2aXMgVWx0cmFzb3VuZCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTUgYnkgQ2FybA0KMAlzdHJpbmcJR0YxUEFUQ0gxMTBcXDBJRCMwMDAwMDJcXDAJW2ZpZD0wMDAwMDEwMTgtMjAtMDAwMFBBVDtleHQ9cGF0O21pbWU9O11HcmF2aXMgVWx0cmFzb3VuZCBQYXRjaCAoaW5zdHJ1bWVudCBkYXRhKQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE1IGJ5IENhcmwNCjAJc3RyaW5nCVNCSVxceDFBCVtmaWQ9MDAwMDAxMDEzLTIwLTAwMDBTQkk7ZXh0PXNiaTttaW1lPTtdQ3JlYXRpdmUgTGFicyBGTSBpbnN0cnVtZW50IGRhdGEgZmlsZQ0KPjQJc3RyaW5nCT4wCVt0aXRsZT0lLjMyc10NCg0KIyBNYWdpYyBJRCBmb3IgU2lkcGxheSBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMDUgYnkgQ2FybA0KMAlzdHJpbmcJU0lEUExBWVxcIElORk9GSUxFCVtmaWQ9MDAwMDAwMDAwLTIwLTAwMDBTSUQ7ZXh0PXNpZDttaW1lPTtdU0lEUGxheWVyIG11c2ljIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgRmFzdHRyYWNrZXIgMi4wIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNSBieSBDYXJsDQowCXN0cmluZwlFeHRlbmRlZFxcIEluc3RydW1lbnQ6XFwgCVtmaWQ9MDAwMTAwMDI2LTIwLTAwMDAwWEk7ZXh0PXhpO21pbWU9O11GYXN0VHJhY2tlciBJSSBpbnN0cnVtZW50IGZpbGUNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNSBieSBDYXJsDQowCXN0cmluZwlSSUZGCVtmaWQ9MDAwMDAxMDAxLTIxLTAwMDAwMDA7ZXh0PTttaW1lPTtdTUlESSBtdXNpYyBmaWxlLCBsaXR0bGUtZW5kaWFuDQomOAlzdHJpbmcJUk1JRAkNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNSBieSBDYXJsDQowCXN0cmluZwlSSUZYCVtmaWQ9MDAwMDAxMDAxLTIxLTAwMDAwMDA7ZXh0PTttaW1lPTtdTUlESSBtdXNpYyBmaWxlLCBiaWctZW5kaWFuDQomOAlzdHJpbmcJUk1JRAkNCg0KIyBNYWdpYyBJRCBmb3IgQWJ5c3NcJ3MgaGlnaGVzdCBleHBlcmllbmNlIChBSFgpIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNSBieSBDYXJsDQowCXN0cmluZwlUSFgJW2ZpZD0wMDAxMDAwMjktMjEtMDAwMEFIWDtleHQ9YWh4O21pbWU9O11BSFggbW9kdWxlIG11c2ljIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgQW11c2ljIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNSBieSBDYXJsDQoxMDYyCXN0cmluZwlcXHgzY1xceDZmXFx4ZWZcXHg1MVxceDU1XFx4RUVcXHg1MlxceDZGXFx4NTIJW2ZpZD0wMDAxMDAwMzQtMjEtMDAwMEFNRDtleHQ9YW1kO21pbWU9O11BbXVzaWMgQWRsaWIgdHJhY2tlciBtdXNpYyBmaWxlDQo+MAlzdHJpbmcJPlxceDAwCVt0aXRsZT0lLjIzc10NCj4yNAlzdHJpbmcJPlxcMAlbY3JlYXRvcj0lLjI0c10NCg0KIyBNYWdpYyBJRCBmb3IgVmVsdmV0IFN0dWRpbyBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTUgYnkgQ2FybA0KMAlzdHJpbmcJQU1TaGRyXFx4MWEJW2ZpZD0wMDAwMDEyNzYtMjEtMDAwMEFNUztleHQ9YW1zO21pbWU9O11WZWx2ZXQgU3R1ZGlvIG1vZHVsZSBtdXNpYyBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIEF1ZGlvIHZpc3VhbCByZXNlYXJjaCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMDQgYnkgQ2FybA0KMAlzdHJpbmcJMkJJVAlbZmlkPTAwMDAwMTMwMS0yMS0wMDAwQVZSO2V4dD1hdnI7bWltZT07XUF1ZGlvIHZpc3VhbCByZXNlYXJjaCBhdWRpbyBmaWxlDQo+NAlzdHJpbmcJeAlbdGl0bGU9JS44c10NCg0KIyBNYWdpYyBJRCBmb3IgU291bmRtb24gZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE1IGJ5IENhcmwNCjI2CXN0cmluZwlWLjIJW2ZpZD0wMDAxMDAwMjgtMjEtMDAwMDBCUDtleHQ9YnA7bWltZT07XVNvdW5kbW9uIG1vZHVsZSBtdXNpYyBmaWxlLCB2ZXJzaW9uIDIueA0KPjAJc3RyaW5nCT5cXDAJW3RpdGxlPSUuMjZzXQ0KDQojIE1hZ2ljIElEIGZvciBTb3VuZG1vbiBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTUgYnkgQ2FybA0KMjYJc3RyaW5nCVYuMwlbZmlkPTAwMDEwMDAyOC0yMS0wMDAwQlAzO2V4dD1icDM7bWltZT07XVNvdW5kbW9uIG1vZHVsZSBtdXNpYyBmaWxlLCB2ZXJzaW9uIDMueA0KPjAJc3RyaW5nCT5cXDAJW3RpdGxlPSUuMjZzXQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE1IGJ5IENhcmwNCjAJc3RyaW5nCUNUTUYJW2ZpZD0wMDAwMDEwMTMtMjEtMDAwMENNRjtleHQ9Y21mO21pbWU9O11DcmVhdGl2ZSBMYWJzIG11c2ljIGZpbGUNCj40CWJ5dGUJeAksIHZlcnNpb24gJWQNCj41CWJ5dGUJeAkuJWQNCg0KIyBNYWdpYyBJRCBmb3IgRGlnaWJvb3N0ZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAzLTA0IGJ5IENhcmwNCjAJc3RyaW5nCURJR0kgQm9vc3RlciBtb2R1bGVcXDAJW2ZpZD0wMDAwMDEzMDItMjEtMDAwRElHSTtleHQ9ZGlnaTttaW1lPTtdRGlnaWJvb3N0ZXIgbXVzaWMgZmlsZQ0KPjYxMAlzdHJpbmcJeAlbdGl0bGU9JS4zMnNdDQoNCiMgTWFnaWMgSUQgZm9yIERlbHVzaW9uIFh0cmFja2VyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNSBieSBDYXJsDQowCXN0cmluZwlERE1GCVtmaWQ9MDAwMDAwMDAwLTIxLTAwMDBETUY7ZXh0PWRtZjttaW1lPTtdRGVsdXNpb24gdHJhY2tlciBtb2R1bGUgbXVzaWMgZmlsZQ0KPjQJYnl0ZQl4CSwgdmVyc2lvbiAlZC4wDQo+MTMJc3RyaW5nCT5cXDAJW3RpdGxlPSUuMzBzXQ0KPjQzCXN0cmluZwk+XFwwCVtjcmVhdG9yPSUuMjBzXQ0KDQojIE1hZ2ljIElEIGZvciBET1MgU291bmQgaW50ZXJmYWNlIGtpdCAoRFNJSykgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE1IGJ5IENhcmwNCjAJc3RyaW5nCVJJRkYJW2ZpZD0wMDAwMDAwMDAtMjEtMDAwMERTTTtleHQ9ZHNtO21pbWU9O11ET1MgU291bmQgaW50ZXJmYWNlIGtpdCBtb2R1bGUgbXVzaWMgZmlsZQ0KJjgJc3RyaW5nCURTTUYJDQoNCiMgTWFnaWMgSUQgZm9yIEVkbGliIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0wNyBieSBDYXJsDQowCXN0cmluZwlcXHgwMFxceDA2XFx4RkVcXHhGRAlbZmlkPTAwMDEwMDAyNy0yMS0wMDAwRURMO2V4dD1lZGw7bWltZT07XUVkbGliIEZNIHRyYWNrZXIgbXVzaWMgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBRdWFkcmEgQ29tcG9zZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAzLTA0IGJ5IENhcmwNCjAJc3RyaW5nCUZPUk0JW2ZpZD0wMDAxMDAwODUtMjEtMDAwMEVNRDtleHQ9ZW1kO21pbWU9O11FbmhhbmNlZCBtb2R1bGUgbXVzaWMgZmlsZSAoSUZGKQ0KJjgJc3RyaW5nCUVNT0QJDQoNCiMgTWFnaWMgSUQgZm9yIEZhcmFuZG9sZSBjb21wb3NlciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTUgYnkgQ2FybA0KMAlzdHJpbmcJRkFSXFx4RkUJW2ZpZD0wMDAxMDAwODctMjEtMDAwMEZBUjtleHQ9ZmFyO21pbWU9O11GYXJhbmRvbGUgY29tcG9zZXIgbW9kdWxlIG11c2ljIGZpbGUNCj40CXN0cmluZwk+XFwwCVt0aXRsZT0lLjQwc10NCg0KIyBNYWdpYyBJRCBmb3IgRnVua3RyYWNrZXIgR29sZCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMDQgYnkgQ2FybA0KMAlzdHJpbmcJRnVuawlbZmlkPTAwMDEwMDA4Ni0yMS0wMDAwRk5LO2V4dD1mbms7bWltZT07XUZ1bmt0cmFja2VyIEdvbGQgbXVzaWMgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBCZWxscywgV2hpc3RsZXMsIGFuZCBTb3VuZCBCb2FyZHMgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE2IGJ5IENhcmwNCjAJc3RyaW5nCUdETVxceEZFCVtmaWQ9MDAwMDAxMjgwLTIxLTAwMDBHRE07ZXh0PWdkbTttaW1lPTtdR2VuZXJhbCBEaWdpTXVzaWMgbW9kdWxlIG11c2ljIGZpbGUNCj40CXN0cmluZwk+XFx4MDAJW3RpdGxlPSUuMzJzXQ0KDQojIE1hZ2ljIElEIGZvciBHcmFvdW1mIFRyYWNrZXIgMiBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTUgYnkgQ2FybA0KMAlzdHJpbmcJR1QyCVtmaWQ9MDAwMTAwMDMxLTIxLTAwMDBHVDI7ZXh0PWd0MjttaW1lPTtdR3Jhb3VtZiBUcmFja2VyIG1vZHVsZSBtdXNpYyBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIEltYWdvIE1vcnBoZXVzIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0wNCBieSBDYXJsDQoweDNDCXN0cmluZwlJTTEwCVtmaWQ9MDAwMDAxMjc5LTIxLTAwMDBJTUY7ZXh0PWltZjttaW1lPTtdSW1hZ28gbW9ycGhldXMgbXVzaWMgZmlsZSwgMzIgY2hhbm5lbHMNCj4wCXN0cmluZwl4CVt0aXRsZT0lLjMxc10NCg0KIyBNYWdpYyBJRCBmb3IgSW1wdWxzZSB0cmFja2VyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNSBieSBDYXJsDQowCXN0cmluZwlJTVBNCVtmaWQ9MDAwMTAwMDMyLTIxLTAwMDAwSVQ7ZXh0PWl0O21pbWU9O11JbXB1bHNlIFRyYWNrZXIgbW9kdWxlIG11c2ljIGZpbGUNCj40CXN0cmluZwk+XFx4MDAJW3RpdGxlPSUuMjZzXQ0KDQojIE1hZ2ljIElEIGZvciBKYW1jcmFja2VyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0wNCBieSBDYXJsDQowCXN0cmluZwlCZUVwCVtmaWQ9MDAwMDAwMDAwLTIxLTAwMDBKQU07ZXh0PWphbTttaW1lPTtdSmFtY3JhY2tlciB0cmFja2VyIG1vZHVsZSBtdXNpYyBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIExpcXVpZCB0cmFja2VyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0wNCBieSBDYXJsDQowCXN0cmluZwlMaXF1aWQgTW9kdWxlOglbZmlkPTAwMDEwMDA5MC0yMS0wMDAwTElRO2V4dD1saXE7bWltZT07XUxpcXVpZCB0cmFja2VyIG1vZHVsZSBtdXNpYyBmaWxlDQomMHg0MAlieXRlCTB4MUEJDQo+MHgwRQlzdHJpbmcJPlxcMAlbdGl0bGU9JS4zMHNdDQo+MHgyYwlzdHJpbmcJPlxcMAlbY3JlYXRvcj0lLjIwc10NCg0KIyBNYWdpYyBJRCBmb3IgRGlnaXRyYWtrZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAzLTA0IGJ5IENhcmwNCjAJc3RyaW5nCURNREwJW2ZpZD0wMDAxMDAwODgtMjEtMDAwME1ETDtleHQ9bWRsO21pbWU9O11EaWdpdHJha2tlciBtb2R1bGUgbXVzaWMgZmlsZQ0KJjQJYnl0ZQk8MHgxMgkNCg0KIyBNYWdpYyBJRCBmb3IgTUVEIFNvdW5kc3R1ZGlvIC8gT2N0YU1FRCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTUgYnkgQ2FybA0KMAlzdHJpbmcJTU1EMAlbZmlkPTAwMDAwMTI3OC0yMS0wMDAwTUVEO2V4dD1tZWQ7bWltZT07XU9jdGFtZWQgdHJhY2tlciBtb2R1bGUgbXVzaWMgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBNRUQgU291bmRzdHVkaW8gLyBPY3RhTUVEIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNSBieSBDYXJsDQowCXN0cmluZwlNTUQxCVtmaWQ9MDAwMDAxMjc4LTIxLTAwMDBNRUQ7ZXh0PW1lZDttaW1lPTtdT2N0YW1lZCBQcm8gVHJhY2tlciBtb2R1bGUgbXVzaWMgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBNRUQgU291bmRzdHVkaW8gLyBPY3RhTUVEIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNSBieSBDYXJsDQowCXN0cmluZwlNTUQyCVtmaWQ9MDAwMDAxMjc4LTIxLTAwMDBNRUQ7ZXh0PW1lZDttaW1lPTtdT2N0YW1lZCBQcm8gVHJhY2tlciBtb2R1bGUgbXVzaWMgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBNRUQgU291bmRzdHVkaW8gLyBPY3RhTUVEIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNSBieSBDYXJsDQowCXN0cmluZwlNTUQzCVtmaWQ9MDAwMDAxMjc4LTIxLTAwMDBNRUQ7ZXh0PW1lZDttaW1lPTtdT2N0YW1lZCBTb3VuZCBTdHVkaW8gbW9kdWxlIG11c2ljIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgTXVzaWNsaW5lIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0wNSBieSBDYXJsDQowCXN0cmluZwlNTEVETU9ETAlbZmlkPTAwMDAwMTMwNC0yMS0wMDAwME1MO2V4dD1tbDttaW1lPTtdTXVzaWNsaW5lIG1vZHVsZSBtdXNpYyBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIFByb3RyYWNrZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE1IGJ5IENhcmwNCjEwODAJc3RyaW5nCU0hSyEJW2ZpZD0wMDAxMDAwMjItMjEtMDAwME1PRDtleHQ9bW9kO21pbWU9O11Qcm90cmFja2VyIDIuMyBtb2R1bGUgbXVzaWMgZmlsZQ0KPjAJc3RyaW5nCT5cXDAJW3RpdGxlPSUuMjBzXQ0KDQojIE1hZ2ljIElEIGZvciBQcm90cmFja2VyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNSBieSBDYXJsDQoxMDgwCXN0cmluZwlNLksuCVtmaWQ9MDAwMTAwMDIyLTIxLTAwMDBNT0Q7ZXh0PW1vZDttaW1lPTtdUHJvdHJhY2tlciBtb2R1bGUgbXVzaWMgZmlsZQ0KPjAJc3RyaW5nCT5cXDAJW3RpdGxlPSUuMjBzXQ0KDQojIE1hZ2ljIElEIGZvciBQcm90cmFja2VyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0wNSBieSBDYXJsDQowCXN0cmluZwlGT1JNCVtmaWQ9MDAwMTAwMDIyLTIxLTAwMDBNT0Q7ZXh0PW1vZDttaW1lPTtdUHJvdHJhY2tlciBtb2R1bGUgbXVzaWMgZmlsZSwgdmVyc2lvbiAzLngNCiY4CXN0cmluZwlNT0RMCQ0KDQojIE1hZ2ljIElEIGZvciBTdGFydHJla2tlciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTUgYnkgQ2FybA0KMTA4MAlzdHJpbmcJRkxUNAlbZmlkPTAwMDEwMDAyNC0yMS0wMDAwTU9EO2V4dD1tb2Q7bWltZT07XVN0YXJ0cmVra2VyIG1vZHVsZSBtdXNpYyBmaWxlLCA0IGNoYW5uZWxzDQo+MAlzdHJpbmcJPlxcMAlbdGl0bGU9JS4yMHNdDQoNCiMgTWFnaWMgSUQgZm9yIFN0YXJ0cmVra2VyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNSBieSBDYXJsDQoxMDgwCXN0cmluZwlGTFQ4CVtmaWQ9MDAwMTAwMDI0LTIxLTAwMDBNT0Q7ZXh0PW1vZDttaW1lPTtdU3RhcnRyZWtrZXIgbW9kdWxlIG11c2ljIGZpbGUsIDggY2hhbm5lbHMNCj4wCXN0cmluZwk+XFwwCVt0aXRsZT0lLjIwc10NCg0KIyBNYWdpYyBJRCBmb3IgRmFzdHRyYWNrZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE1IGJ5IENhcmwNCjEwODAJc3RyaW5nCTZDSE4JW2ZpZD0wMDAwMDEyNzUtMjEtMDAwME1PRDtleHQ9bW9kO21pbWU9O11GYXN0dHJhY2tlciBtb2R1bGUgbXVzaWMgZmlsZSwgNiBjaGFubmVscw0KPjAJc3RyaW5nCT5cXDAJW3RpdGxlPSUuMjBzXQ0KDQojIE1hZ2ljIElEIGZvciBGYXN0dHJhY2tlciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTUgYnkgQ2FybA0KMTA4MAlzdHJpbmcJOENITglbZmlkPTAwMDAwMTI3NS0yMS0wMDAwTU9EO2V4dD1tb2Q7bWltZT07XUZhc3R0cmFja2VyIG1vZHVsZSBtdXNpYyBmaWxlLCA2IGNoYW5uZWxzDQo+MAlzdHJpbmcJPlxcMAlbdGl0bGU9JS4yMHNdDQoNCiMgTWFnaWMgSUQgZm9yIE1hZHRyYWNrZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAzLTA1IGJ5IENhcmwNCjAJc3RyaW5nCU1UMjAJW2ZpZD0wMDAxMDAwOTEtMjEtMDAwME1UMjtleHQ9bXQyO21pbWU9O11NYWR0cmFja2VyIG1vZHVsZSBtdXNpYyBmaWxlDQo+NDIJc3RyaW5nCXgJW3RpdGxlPSUuNjRzXQ0KPjExMglsZXNob3J0CXgJW2Nobj0lZF0NCg0KIyBNYWdpYyBJRCBmb3IgTXVsdGl0cmFja2VyIE1vZHVsZSBlZGl0b3IgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE1IGJ5IENhcmwNCjAJc3RyaW5nCU1UTQlbZmlkPTAwMDEwMDA4OS0yMS0wMDAwTVRNO2V4dD1tdG07bWltZT07XU11bHRpVHJhY2tlciBtb2R1bGUgbXVzaWMgZmlsZQ0KPjQJc3RyaW5nCT5cXHgwMAlbdGl0bGU9JS4yMHNdDQoNCiMgTWFnaWMgSUQgZm9yIE1hZHRyYWNrZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAzLTA1IGJ5IENhcmwNCjAJc3RyaW5nCU1UUDIJW2ZpZD0wMDAxMDAwOTEtMjEtMDAwME1UUDtleHQ9bXRwO21pbWU9O11NYWR0cmFja2VyIHBhdHRlcm4gZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBBL05FUyBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMDcgYnkgQ2FybA0KMAlzdHJpbmcJTkVTQQlbZmlkPTAwMDEwMDA5NC0yMS0wMDAwTlNBO2V4dD1uc2E7bWltZT07XUEvTkVTIHJpcHBlZCBhdWRpbyBmaWxlDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMDcgYnkgQ2FybA0KMAlzdHJpbmcJTkVTTVxceDFBCVtmaWQ9MDAwMTAwMDkzLTIxLTAwMDBOU0Y7ZXh0PW5zZjttaW1lPTtdTkVTIHJpcHBlZCBhdWRpbyBmaWxlDQo+NQlieXRlCXgJLCB2ZXJzaW9uICVkLjANCj4weDBFCXN0cmluZwl4CVt0aXRsZT0lLjMyc10NCj4weDJFCXN0cmluZwl4CVtjcmVhdG9yPSUuMzJzXQ0KDQojIE1hZ2ljIElEIGZvciBOb2lzZXRyYWNrZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE1IGJ5IENhcmwNCjEwODAJc3RyaW5nCU0mSyEJW2ZpZD0wMDAxMDAwMjMtMjEtMDAwME5TVDtleHQ9bnN0O21pbWU9O11Ob2lzZXRyYWNrZXIgbW9kdWxlIG11c2ljIGZpbGUNCj4wCXN0cmluZwk+XFwwCVt0aXRsZT0lLjIwc10NCg0KIyBNYWdpYyBJRCBmb3IgT2t0YWx5emVyIHRyYWNrZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE1IGJ5IENhcmwNCjAJc3RyaW5nCU9LVEFTT05HCVtmaWQ9MDAwMTAwMDMwLTIxLTAwMDBPS1Q7ZXh0PW9rdDttaW1lPTtdT2t0YWx5emVyIG1vZHVsZSBtdXNpYyBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIFNCU3R1ZGlvIHNvdW5kIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0wNSBieSBDYXJsDQowCXN0cmluZwlQQUNHCVtmaWQ9MDAwMTAwMDIwLTIxLTAwMDBQQUM7ZXh0PXBhYzttaW1lPTtdU0JTdHVkaW8gbW9kdWxlIG11c2ljIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgUG9seXRyYWNrZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE1IGJ5IENhcmwNCjQ0CXN0cmluZwlQVE1GCVtmaWQ9MDAwMDAwMDAwLTIxLTAwMDBQVE07ZXh0PXB0bTttaW1lPTtdUG9seSBUcmFja2VyIG1vZHVsZSBtdXNpYyBmaWxlDQo+MzgJbGVzaG9ydAk+MAlbY2huPSVkXQ0KPjAJc3RyaW5nCT5cXDAJW3RpdGxlPSUuMjhzXQ0KDQojIE1hZ2ljIElEIGZvciBSZWFsaXR5IEFkbGliIHRyYWNrZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE1IGJ5IENhcmwNCjAJc3RyaW5nCVJBRFxcIGJ5CVtmaWQ9MDAwMDAwMDAwLTIxLTAwMDBSQUQ7ZXh0PXJhZDttaW1lPTtdUmVhbGl0eSBBZGxpYiB0cmFja2VyIG11c2ljIGZpbGUNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNSBieSBDYXJsDQowCXN0cmluZwlSSUZGCVtmaWQ9MDAwMDAwMDAwLTIxLTAwMDBSTUk7ZXh0PXJtaTttaW1lPWFwcGxpY2F0aW9uL3ZuZC5tdXNpYy1uaWZmO11Tb25nIG5vdGF0aW9uIGRhdGEgZmlsZSwgbGl0dGxlLWVuZGlhbg0KJjgJc3RyaW5nCU5JRkYJDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTUgYnkgQ2FybA0KMAlzdHJpbmcJUklGWAlbZmlkPTAwMDAwMDAwMC0yMS0wMDAwUk1JO2V4dD1ybWk7bWltZT1hcHBsaWNhdGlvbi92bmQubXVzaWMtbmlmZjtdU29uZyBub3RhdGlvbiBkYXRhIGZpbGUsIGJpZy1lbmRpYW4NCiY4CXN0cmluZwlOSUZGCQ0KDQojIE1hZ2ljIElEIGZvciBBZGxpYiBWaXN1YWwgQ29tcG9zZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE1IGJ5IENhcmwNCjAJbGVzaG9ydAkweDAwMDAJW2ZpZD0wMDAwMDEwMTYtMjEtMDAwMFJPTDtleHQ9cm9sO21pbWU9O11BZGxpYiBtdXNpYyBmaWxlDQomMglsZXNob3J0CTB4MDAwNAkNCg0KIyBNYWdpYyBJRCBmb3IgU2NyZWFtdHJhY2tlciAzIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNSBieSBDYXJsDQoweDJDCXN0cmluZwlTQ1JNCVtmaWQ9MDAwMTAwMDI1LTIxLTAwMDBTM007ZXh0PXMzbTttaW1lPTtdU2NyZWFtIHRyYWNrZXIgbW9kdWxlIG11c2ljIGZpbGUNCj4weDJBCWxlc2hvcnQJPjAJLCB2ZXJzaW9uICVkLjANCj4wCXN0cmluZwk+XFwwCVt0aXRsZT0lLjI4c10NCg0KIyBNYWdpYyBJRCBmb3IgU3VycHJpc2UhIEFkbGliIFRyYWNrZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE1IGJ5IENhcmwNCjAJc3RyaW5nCVNBZFQJW2ZpZD0wMDAxMDAwMjEtMjEtMDAwMFNBMjtleHQ9c2EyO21pbWU9O11TdXJwcmlzZSBQcm9kdWN0aW9ucyBBZGxpYiB0cmFja2VyIG11c2ljIGZpbGUNCj40CWJ5dGUJeAksIHZlcnNpb24gMC4lZA0KDQojIE1hZ2ljIElEIGZvciBTb3VuZEZYIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNSBieSBDYXJsDQo2MAlzdHJpbmcJU09ORwlbZmlkPTAwMDAwMTI3Ny0yMS0wMDAwU0ZYO2V4dD1zZng7bWltZT07XVNvdW5kRlggVHJhY2tlciBtb2R1bGUgbXVzaWMgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBQbGF5U0lELCBTaWRwbGF5IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0wNSBieSBDYXJsDQowCXN0cmluZwlQU0lECVtmaWQ9MDAwMDAwMDAwLTIxLTAwMDBTSUQ7ZXh0PXNpZDttaW1lPTtdUGxheVNJRCBtdXNpYyBmaWxlDQo+MTYJc3RyaW5nCXgJW3RpdGxlPSUuMjBzXQ0KPjM2CXN0cmluZwl4CVtjcmVhdG9yPSUuMjBzXQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE1IGJ5IENhcmwNCjAJc3RyaW5nCU1UaGQJW2ZpZD0wMDAwMDEwMTctMjEtMDAwMFNNRjtleHQ9c21mLG1pZGk7bWltZT07XVN0YW5kYXJkIE1JREkgbXVzaWMgZmlsZQ0KPjEwCWJlc2hvcnQJPjAJW2Nobj0lZF0NCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0wNSBieSBDYXJsDQowCXN0cmluZwlGT1JNCVtmaWQ9MDAwMDAxMDEwLTIxLTAwMFNNVVM7ZXh0PXNtdXMsbXVzO21pbWU9O11JRkYgU2ltcGxlIE11c2ljYWwgU2NvcmUgZmlsZQ0KJjgJc3RyaW5nCVNNVVMJDQoNCiMgTWFnaWMgSUQgZm9yIFNuZHRvb2wyLG5lenBsYXkgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAzLTA1IGJ5IENhcmwNCjAJc3RyaW5nCVNORFxceDFBCVtmaWQ9MDAwMDAwMDAwLTIxLTAwMDBTTkQ7ZXh0PXNuZDttaW1lPTtdTmludGVuZG8gRW50ZXJ0YWlubWVudCBTeXN0ZW0gYXVkaW8gZmlsZSAoTkVTKQ0KJjQJYnl0ZQkzCSwgdmVyc2lvbiAlMy4wDQo+NQlieXRlCXgJW2Nobj0lZF0NCg0KIyBNYWdpYyBJRCBmb3IgaU5FUyBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMDUgYnkgQ2FybA0KMAlzdHJpbmcJU05EXFx4MUEJW2ZpZD0wMDAxMDAwOTItMjEtMDAwMFNORDtleHQ9c25kO21pbWU9O11pTkVTIGVtdWxhdG9yIGF1ZGlvIGZpbGUNCiY0CWJ5dGUJMQksIHZlcnNpb24gJTEuMA0KPjUJYnl0ZQl4CVtjaG49JWRdDQoNCiMgTWFnaWMgSUQgZm9yIFNUTUlLIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNSBieSBDYXJsDQoweDE1CXN0cmluZwlTY3JlYW0hCVtmaWQ9MDAwMTAwMDI1LTIxLTAwMDBTVFg7ZXh0PXN0eDttaW1lPTtdU1RNSUsgbW9kdWxlIG11c2ljIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgVGhlIEZpbmFsIE11c2ljc3lzdGVtIGVYdGVuZGVkIChURk1YKSBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMDcgYnkgQ2FybA0KMAlzdHJpbmcJVEZNWC1TT05HXFwgCVtmaWQ9MDAwMTAwMDk2LTIxLTAwMDBURlg7ZXh0PXRmeCx0Zm14O21pbWU9O11URk1YIHRyYWNrZXIgbW9kdWxlIG11c2ljIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgVWx0cmEgVHJhY2tlciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMDcgYnkgQ2FybA0KMAlzdHJpbmcJTUFTX1VUcmFja19WMDAJW2ZpZD0wMDAxMDAwOTctMjEtMDAwMFVMVDtleHQ9dWx0O21pbWU9O11VbHRyYSBUcmFja2VyIG1vZHVsZSBtdXNpYyBmaWxlDQo+MTUJc3RyaW5nCXgJW3RpdGxlPSUuMzJzXQ0KDQojIE1hZ2ljIElEIGZvciBBUGxheWVyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNSBieSBDYXJsDQowCXN0cmluZwlBUFVOXFx4MDEJW2ZpZD0wMDAwMDAwMDAtMjEtMDAwMFVOSTtleHQ9dW5pO21pbWU9O11BUGxheWVyIG1vZHVsZSBtdXNpYyBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIE1pa21vZCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTUgYnkgQ2FybA0KMAlzdHJpbmcJVU4wCVtmaWQ9MDAwMDAwMDAwLTIxLTAwMDBVTkk7ZXh0PXVuaTttaW1lPTtdTWlrbW9kIG1vZHVsZSBtdXNpYyBmaWxlDQo+NAlieXRlCXgJW2Nobj0lZF0NCg0KIyBNYWdpYyBJRCBmb3IgRmFzdHRyYWNrZXIgMi4wIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNSBieSBDYXJsDQowCXN0cmluZwlFeHRlbmRlZFxcIE1vZHVsZTpcXCAJW2ZpZD0wMDAxMDAwMjYtMjEtMDAwMDBYTTtleHQ9eG07bWltZT07XUZhc3RUcmFja2VyIElJIG1vZHVsZSBtdXNpYyBmaWxlDQo+NTkJYnl0ZQl4CSwgdmVyc2lvbiAlZA0KPjU4CWJ5dGUJeAkuMCVkDQo+MTcJc3RyaW5nCXgJW3RpdGxlPSUuMjBzXQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IENhcmwNCjAJc3RyaW5nCUZPUk0JW2ZpZD0wMDAwMDEwMTAtMjItMDAwOFNWWDtleHQ9OHN2eDttaW1lPTtdQW1pZ2EgU2FtcGxlZCBhdWRpbyBmaWxlDQomOAlzdHJpbmcJOFNWWAkNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQowCXN0cmluZwlGT1JNCVtmaWQ9MDAwMDAxMDAyLTIyLTAwMEFJRkM7ZXh0PWFpZmMsYWlmO21pbWU9O11BdWRpbyBDb21wcmVzc2VkIEludGVyY2hhbmdlIEZpbGUgRm9ybWF0DQomOAlzdHJpbmcJQUlGQwkNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQowCXN0cmluZwlGT1JNCVtmaWQ9MDAwMDAxMDAyLTIyLTAwMEFJRkY7ZXh0PWFpZmYsYWlmO21pbWU9O11BdWRpbyBJbnRlcmNoYW5nZSBGaWxlIEZvcm1hdA0KJjgJc3RyaW5nCUFJRkYJDQoNCiMgTWFnaWMgSUQgZm9yIE1vbmtleUF1ZGlvIHNvZnR3YXJlIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNS0yMCBieSBDYXJsDQowCXN0cmluZwlNQUNcXCAJW2ZpZD0wMDAxMDAxMjAtMjItMDAwMEFQRTtleHQ9YXBlO21pbWU9O11Nb25rZXlBdWRpbyBjb21wcmVzc2VkIGF1ZGlvIGZpbGUNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQowCXN0cmluZwkuc25kCVtmaWQ9MDAwMDAxMDExLTIyLTAwMDAwQVU7ZXh0PWF1LHNuZDttaW1lPTtdU3VuIC8gTmVYdCBzYW1wbGVkIGF1ZGlvIGZpbGUNCj4xNgliZWxvbmcJPjAJW2ZyZXE9JWRdDQoNCiMgTWFnaWMgSUQgZm9yIFNwcGFjayBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMDQgYnkgQ2FybA0KMjUyCWJlc2hvcnQJMHg0MEMzCVtmaWQ9MDAwMDAxMDE5LTIyLTAwMDAwMEQ7ZXh0PWQ7bWltZT07XVNwcGFjayBhdWRpbyBzYW1wbGUgZmlsZQ0KJjI1NAliZXNob3J0CTB4RkMwRQkNCg0KIyBNYWdpYyBJRCBmb3IgRmxhYyBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMDggYnkgQ2FybA0KMAlzdHJpbmcJZkxhQwlbZmlkPTAwMDEwMDA5OC0yMi0wMDBGTEFDO2V4dD1mbGFjO21pbWU9O11GcmVlIExvc3NsZXNzIEF1ZGlvIENvZGVjIHJhdyBhdWRpbyBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIEZhcmFuZG9sZSBDb21wb3NlciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMDQgYnkgQ2FybA0KMAlzdHJpbmcJRlNNXFx4RkUJW2ZpZD0wMDAxMDAwODctMjItMDAwMEZTTTtleHQ9ZnNtO21pbWU9O11GYXJhbmRvbGUgY29tcG9zZXIgYXVkaW8gc2FtcGxlIGZpbGUNCj40CXN0cmluZwl4CVt0aXRsZT0lLjMyc10NCg0KIyBNYWdpYyBJRCBmb3IgTUFVRCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMDQgYnkgQ2FybA0KMAlzdHJpbmcJRk9STQlbZmlkPTAwMDAwMDAwMC0yMi0wMDBNQVVEO2V4dD1tYXVkO21pbWU9O11NQVVEIGF1ZGlvIHNhbXBsZSBmaWxlDQomNAlzdHJpbmcJTUFVRAkNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNS0wNCBieSBDYXJsDQowCWJlc2hvcnQmMHhGRkUwCTB4ZmZlMAlbZmlkPTAwMDAwMDAwMS0yMi0wMDExMTcyO2V4dD1tcDEsbXAyLG1wMzttaW1lPWF1ZGlvL21wZWc7XU1QMyBBdWRpbyBzdHJlYW0gZmlsZQ0KJloxMjgJc3RyaW5nCVRBRwkNCj5aMTI1CXN0cmluZwl4CVt0aXRsZT0lLjMwc10NCj5aOTUJc3RyaW5nCXgJW2NyZWF0b3I9JS4zMHNdDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDUtMDQgYnkgQ2FybA0KMAlzdHJpbmcJSUQzCVtmaWQ9MDAwMDAwMDAxLTIyLTAwMTExNzI7ZXh0PW1wMSxtcDIsbXAzO21pbWU9YXVkaW8vbXBlZztdTVAzIEF1ZGlvIHN0cmVhbSBmaWxlDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTEgYnkgQ2FybA0KMAlzdHJpbmcJXFwwXFwwMDFcXDI0M1xcMTQ0CVtmaWQ9MDAwMDAxMDE0LTIyLTAwMDAwU0Y7ZXh0PXNmO21pbWU9O11JUkNBTSBhdWRpbyBzYW1wbGUgZmlsZQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IENhcmwNCjAJc3RyaW5nCVxcMFxcMDAyXFwyNDNcXDE0NAlbZmlkPTAwMDAwMTAxNC0yMi0wMDAwMFNGO2V4dD1zZjttaW1lPTtdSVJDQU0gYXVkaW8gc2FtcGxlIGZpbGUsIGxpdHRsZS1lbmRpYW4NCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQowCXN0cmluZwlcXDBcXDAwM1xcMjQzXFwxNDQJW2ZpZD0wMDAwMDEwMTQtMjItMDAwMDBTRjtleHQ9c2Y7bWltZT07XUlSQ0FNIGF1ZGlvIHNhbXBsZSBmaWxlLCBiaWctZW5kaWFuDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTEgYnkgQ2FybA0KMAlzdHJpbmcJXFwxNDRcXDI0M1xcMDAxXFwwCVtmaWQ9MDAwMDAxMDE0LTIyLTAwMDAwU0Y7ZXh0PXNmO21pbWU9O11JUkNBTSBhdWRpbyBzYW1wbGUgZmlsZQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IENhcmwNCjAJc3RyaW5nCVxcMTQ0XFwyNDNcXDAwMlxcMAlbZmlkPTAwMDAwMTAxNC0yMi0wMDAwMFNGO2V4dD1zZjttaW1lPTtdSVJDQU0gYXVkaW8gc2FtcGxlIGZpbGUsIGJpZy1lbmRpYW4NCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQowCXN0cmluZwlcXDE0NFxcMjQzXFwwMDNcXDAJW2ZpZD0wMDAwMDEwMTQtMjItMDAwMDBTRjtleHQ9c2Y7bWltZT07XUlSQ0FNIGF1ZGlvIHNhbXBsZSBmaWxlLCBsaXR0bGUtZW5kaWFuDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTEgYnkgQ2FybA0KMAlzdHJpbmcJXFwxNDRcXDI0M1xcMDA0XFwwCVtmaWQ9MDAwMDAxMDE0LTIyLTAwMDAwU0Y7ZXh0PXNmO21pbWU9O11JUkNBTSBhdWRpbyBzYW1wbGUgZmlsZSwgYmlnLWVuZGlhbg0KDQojIE1hZ2ljIElEIGZvciBTY3JlYW10cmFja2VyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0wNSBieSBDYXJsDQoweDRDCXN0cmluZwlTQ1JTCVtmaWQ9MDAwMTAwMDI1LTIyLTAwMDBTTVA7ZXh0PXNtcDttaW1lPTtdU2NyZWFtdHJhY2tlciBhdWRpbyBzYW1wbGUNCj4weDMwCXN0cmluZwl4CVt0aXRsZT0lLjMwc10NCg0KIyBNYWdpYyBJRCBmb3IgU291bmRUb29sIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0wNyBieSBDYXJsDQowCXN0cmluZwlTT1VORFxceDFBCVtmaWQ9MDAwMTAwMDk1LTIyLTAwMDBTTkQ7ZXh0PXNuZDttaW1lPTtdU291bmQgdG9vbCBhdWRpbyBkYXRhIGZpbGUNCj4xNAlsZXNob3J0CXgJW2ZyZXE9JWRdDQoNCiMgTWFnaWMgSUQgZm9yIFNCU3R1ZGlvIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQowCXN0cmluZwlTTkRcXCAJW2ZpZD0wMDAxMDAwMjAtMjItMDAwMFNPVTtleHQ9c291O21pbWU9O11TQlN0dWRpbyBzYW1wbGVkIGF1ZGlvIGZpbGUNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNS0xOCBieSBDYXJsDQowCXN0cmluZwlTcGVleAlbZmlkPTAwMDAwMDAwMC0yMi0wMFNQRUVYO2V4dD1zcGVleDttaW1lPTtdU3BlZXggTG9zc3kgQXVkaW8gQ29kZWMgcmF3IGF1ZGlvIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgU291bmQgQmxhc3RlciBTREsgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IENhcmwNCjAJc3RyaW5nCUNyZWF0aXZlXFwgVm9pY2VcXCBGaWxlXFx4MUEJW2ZpZD0wMDAwMDEwMTMtMjItMDAwMFZPQztleHQ9dm9jO21pbWU9O11DcmVhdGl2ZSBWb2ljZSBhdWRpbyBmaWxlDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDUtMTggYnkgQ2FybA0KMAlzdHJpbmcJdm9yYmlzCVtmaWQ9MDAwMDAwMDAwLTIyLTBWT1JCSVM7ZXh0PXZvcmJpczttaW1lPTtdVm9yYmlzIExvc3N5IEF1ZGlvIENvZGVjIHJhdyBhdWRpbyBmaWxlDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTEgYnkgQ2FybA0KMAlzdHJpbmcJUklGRglbZmlkPTAwMDAwMTAwMS0yMi0wMDAwV0FWO2V4dD13YXY7bWltZT07XU1pY3Jvc29mdCBXYXZlZm9ybSBBdWRpbyBmaWxlLCBsaXR0bGUtZW5kaWFuDQomOAlzdHJpbmcJV0FWRQkNCj4yNAlsZWxvbmcJPjAJW2ZyZXE9JWRdDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTEgYnkgQ2FybA0KMAlzdHJpbmcJUklGWAlbZmlkPTAwMDAwMTAwMS0yMi0wMDAwV0FWO2V4dD13YXY7bWltZT07XU1pY3Jvc29mdCBXYXZlZm9ybSBBdWRpbyBmaWxlLCBiaWctZW5kaWFuDQomOAlzdHJpbmcJV0FWRQkNCj4yNAliZWxvbmcJPjAJW2ZyZXE9JWRdDQoNCiMgTWFnaWMgSUQgZm9yIE1heWEgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTEyIGJ5IENhcmwNCjAJc3RyaW5nCUZPUjQJW2ZpZD0wMDAwMDEzMTItMzEtMDAwMDAwMDtleHQ9O21pbWU9O11NYXlhIGltYWdlIGZpbGUNCiY4CXN0cmluZwlDSU1HCQ0KDQojIE1hZ2ljIElEIGZvciBNYXlhIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xMiBieSBDYXJsDQowCXN0cmluZwlGT1I4CVtmaWQ9MDAwMDAxMzEyLTMxLTAwMDAwMDA7ZXh0PTttaW1lPTtdTWF5YSBpbWFnZSBmaWxlDQomOAlzdHJpbmcJQ0lNRwkNCg0KIyBNYWdpYyBJRCBmb3IgQU9MIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0wMiBieSBDYXJsDQowCXN0cmluZwlKR1xceDA0XFx4MEUJW2ZpZD0wMDAwMDEwMjMtMzEtMDAwMEFSVDtleHQ9YXJ0O21pbWU9O11BT0wvSm9obnNvbi1HcmFjZSBpbWFnZSBmaWxlLCB2ZXJzaW9uIDIuMA0KPjB4MEQJbGVzaG9ydAl4CVtyZXM9JWR4DQo+MHgwRglsZXNob3J0CXgJJWRdDQoNCiMgTWFnaWMgSUQgZm9yIEJNRiBpbWFnZSBjb21wcmVzc29yIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0yNyBieSBDYXJsDQowCXN0cmluZwlcXHg4MVxceDhBMAlbZmlkPTAwMDEwMDA0OC0zMS0wMDAwQk1GO2V4dD1ibWY7bWltZT07XUJNRiBpbWFnZSBmaWxlDQo+MglzdHJpbmcJeAksIHZlcnNpb24gJS4xcw0KPjMJc3RyaW5nCXgJLiUuMXMNCg0KIyBNYWdpYyBJRCBmb3IgQk1GIGltYWdlIGNvbXByZXNzb3IgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTI3IGJ5IENhcmwNCjAJc3RyaW5nCVxceDgxXFx4OEEyCVtmaWQ9MDAwMTAwMDQ4LTMxLTAwMDBCTUY7ZXh0PWJtZjttaW1lPTtdQk1GIGltYWdlIGZpbGUNCj4yCXN0cmluZwl4CSwgdmVyc2lvbiAlLjFzDQo+MwlzdHJpbmcJeAkuJS4xcw0KDQojIE1hZ2ljIElEIGZvciBCTUYgaW1hZ2UgY29tcHJlc3NvciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMjcgYnkgQ2FybA0KMAlzdHJpbmcJXFx4ODFcXHg4QTEJW2ZpZD0wMDAxMDAwNDgtMzEtMDAwMEJNRjtleHQ9Ym1mO21pbWU9O11CTUYgaW1hZ2UgZmlsZQ0KPjIJc3RyaW5nCXgJLCB2ZXJzaW9uICUuMXMNCj4zCXN0cmluZwl4CS4lLjFzDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTQgYnkgQ2FybA0KMAlzdHJpbmcJQk0JW2ZpZD0wMDAwMDEwMDEtMzEtMDAwMEJNUDtleHQ9Ym1wO21pbWU9O11XaW5kb3dzIG9yIE9TLzIgQml0bWFwIGltYWdlIGZpbGUNCiY2CWxlbG9uZwkwCQ0KDQojIE1hZ2ljIElEIGZvciBBdXRvZGVzayBBbmltYXRvciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMDggYnkgQ2FybA0KMAlsZXNob3J0CTB4OTExOQlbZmlkPTAwMDAwMTI1NC0zMS0wMDAwQ0VMO2V4dD1jZWwscGljO21pbWU9O11BdXRvZGVzayBhbmltYXRvciBpbWFnZSBmaWxlDQomMTAJYnl0ZQk4CQ0KJjExCWJ5dGUJMAkNCj4yCWxlc2hvcnQJeAlbcmVzPSVkDQo+NAlsZXNob3J0CXgJeCVkeDhicHBdDQoNCiMgTWFnaWMgSUQgZm9yIEFuZHJldyBVc2VyIEludGVyZmFjZSBTeXN0ZW0gZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTAyIGJ5IENhcmwNCjEJc3RyaW5nCWJlZ2luZGF0YXtyYXN0ZXIJW2ZpZD0wMDAwMDEzMTUtMzEtMDAwMENNVTtleHQ9Y211O21pbWU9O11BbmRyZXcgdG9vbGtpdCByYXN0ZXIgaW1hZ2UgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBBbml2Z2EgdG9vbGtpdCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMDIgYnkgQ2FybA0KMzgJc3RyaW5nCUtSXFx4MDFcXHgwMAlbZmlkPTAwMDEwMDEwNC0zMS0wMDAwQ09EO2V4dD1jb2Q7bWltZT07XUFuaXZnYSBzcHJpdGUgaW1hZ2UgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBXaW5kb3dzIEN1cnNvciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMDEgYnkgQ2FybA0KMAlzdHJpbmcJXFx4MDBcXHgwMFxceDAyXFx4MDAJW2ZpZD0wMDAwMDEwMDEtMzEtMDAwMENVUjtleHQ9Y3VyO21pbWU9O11NaWNyb3NvZnQgd2luZG93cyBjdXJzb3IgaW1hZ2UgZmlsZQ0KJjB4MDgJYnl0ZQkwCQ0KPjQJbGVzaG9ydAl4CSwgJWQgY3Vyc29yKHMpDQo+NglieXRlCXgJW3Jlcz0lZHgNCj43CWJ5dGUJeAklZHg4YnBwXQ0KDQojIE1hZ2ljIElEIGZvciBXaW5kb3dzIEN1cnNvciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMDEgYnkgQ2FybA0KMAlzdHJpbmcJXFx4MDBcXHgwMFxceDAyXFx4MDAJW2ZpZD0wMDAwMDEwMDEtMzEtMDAwMENVUjtleHQ9Y3VyO21pbWU9O11NaWNyb3NvZnQgd2luZG93cyBjdXJzb3IgaW1hZ2UgZmlsZQ0KJjB4MDgJYnl0ZQkxNgkNCj40CWxlc2hvcnQJeAksICVkIGN1cnNvcihzKQ0KPjYJYnl0ZQl4CVtyZXM9JWR4DQo+NwlieXRlCXgJJWR4NGJwcF0NCg0KIyBNYWdpYyBJRCBmb3IgV2luZG93cyBDdXJzb3IgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTAxIGJ5IENhcmwNCjAJc3RyaW5nCVxceDAwXFx4MDBcXHgwMlxceDAwCVtmaWQ9MDAwMDAxMDAxLTMxLTAwMDBDVVI7ZXh0PWN1cjttaW1lPTtdTWljcm9zb2Z0IHdpbmRvd3MgY3Vyc29yIGltYWdlIGZpbGUNCiYweDA4CWJ5dGUJMgkNCj40CWxlc2hvcnQJeAksICVkIGN1cnNvcihzKQ0KPjYJYnl0ZQl4CVtyZXM9JWR4DQo+NwlieXRlCXgJJWR4MWJwcF0NCg0KIyBNYWdpYyBJRCBmb3IgV2luZG93cyBDdXJzb3IgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTAxIGJ5IENhcmwNCjAJc3RyaW5nCVxceDAwXFx4MDBcXHgwMlxceDAwCVtmaWQ9MDAwMDAxMDAxLTMxLTAwMDBDVVI7ZXh0PWN1cjttaW1lPTtdTWljcm9zb2Z0IHdpbmRvd3MgY3Vyc29yIGltYWdlIGZpbGUNCiYweDA4CWJ5dGUJMzIJDQo+NAlsZXNob3J0CXgJLCAlZCBjdXJzb3IocykNCj42CWJ5dGUJeAlbcmVzPSVkeA0KPjcJYnl0ZQl4CSVkeDVicHBdDQoNCiMgTWFnaWMgSUQgZm9yIFdpbmRvd3MgQ3Vyc29yIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0wMSBieSBDYXJsDQowCXN0cmluZwlcXHgwMFxceDAwXFx4MDJcXHgwMAlbZmlkPTAwMDAwMTAwMS0zMS0wMDAwQ1VSO2V4dD1jdXI7bWltZT07XU1pY3Jvc29mdCB3aW5kb3dzIGN1cnNvciBpbWFnZSBmaWxlDQomMHgwOAlieXRlCTY0CQ0KPjQJbGVzaG9ydAl4CSwgJWQgY3Vyc29yKHMpDQo+NglieXRlCXgJW3Jlcz0lZHgNCj43CWJ5dGUJeAklZHg2YnBwXQ0KDQojIE1hZ2ljIElEIGZvciBXaW5kb3dzIEN1cnNvciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMDEgYnkgQ2FybA0KMAlzdHJpbmcJXFx4MDBcXHgwMFxceDAyXFx4MDAJW2ZpZD0wMDAwMDEwMDEtMzEtMDAwMENVUjtleHQ9Y3VyO21pbWU9O11NaWNyb3NvZnQgd2luZG93cyBjdXJzb3IgaW1hZ2UgZmlsZQ0KJjB4MDgJYnl0ZQk4CQ0KPjQJbGVzaG9ydAl4CSwgJWQgY3Vyc29yKHMpDQo+NglieXRlCXgJW3Jlcz0lZHgNCj43CWJ5dGUJeAklZHgzYnBwXQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTEzIGJ5IENhcmwNCjEyOAlzdHJpbmcJRElDTQlbZmlkPTAwMDAwMDAwNC0zMS0wMDBESUNNO2V4dD1kaWNtLGRjbTttaW1lPTtdRGlnaXRhbCBpbWFnaW5nIGFuZCBjb21tdW5pY2F0aW9uIGluIG1lZGVjaW5lIGltZy4NCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0wMSBieSBDYXJsDQowCXN0cmluZwlTRFBYCVtmaWQ9MDAwMDAxMzA5LTMxLTAwMDBEUFg7ZXh0PWRweDttaW1lPTtdRGlnaXRhbCBNb3ZpbmctUGljdHVyZSBFeGNoYW5nZSBpbWFnZSBmaWxlDQo+MTYwCXN0cmluZwk+XFx4MDAJW2NyZWF0b3I9JS4xMDBzXQ0KPjI2MAlzdHJpbmcJPlxceDAwCVt0aXRsZT0lLjIwMHNdDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMDEgYnkgQ2FybA0KMAlzdHJpbmcJWFBEUwlbZmlkPTAwMDAwMTMwOS0zMS0wMDAwRFBYO2V4dD1kcHg7bWltZT07XURpZ2l0YWwgTW92aW5nLVBpY3R1cmUgRXhjaGFuZ2UgaW1hZ2UgZmlsZQ0KPjE2MAlzdHJpbmcJPlxceDAwCVtjcmVhdG9yPSUuMTAwc10NCj4yNjAJc3RyaW5nCT5cXHgwMAlbdGl0bGU9JS4yMDBzXQ0KDQojIE1hZ2ljIElEIGZvciBMaWdodHdhdmUgM0QgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTEyIGJ5IENhcmwNCjAJc3RyaW5nCUZPUk0JW2ZpZD0wMDAwMDEyNTEtMzEtMDAwRlBCTTtleHQ9ZnBibTttaW1lPTtdRmxleGlibGUgUHJlY2lzaW9uIEJ1ZmZlciBNYXAgaW1hZ2UgZmlsZQ0KJjgJc3RyaW5nCUZQQk0JDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTQgYnkgQ2FybA0KMAlzdHJpbmcJR0lGOAlbZmlkPTAwMDAwMTI3NC0zMS0wMDAwR0lGO2V4dD1naWY7bWltZT1pbWFnZS9naWY7XUdJRiBpbWFnZSBmaWxlDQomMTAJYnl0ZSYweDcwCSEweDcwCQ0KPjQJc3RyaW5nCXgJLCB2ZXJzaW9uIDglLjJzDQo+NglsZXNob3J0CT4wCVtyZXM9JWR4DQo+OAlsZXNob3J0CT4wCSVkXQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE0IGJ5IENhcmwNCjAJc3RyaW5nCUdJRjgJW2ZpZD0wMDAwMDEyNzQtMzEtMDAwMEdJRjtleHQ9Z2lmO21pbWU9aW1hZ2UvZ2lmO11HSUYgaW1hZ2UgZmlsZQ0KJjEwCWJ5dGUmMHg3MAkweDcwCQ0KPjQJc3RyaW5nCXgJLCB2ZXJzaW9uIDglLjJzDQo+NglsZXNob3J0CT4wCVtyZXM9JWR4DQo+OAlsZXNob3J0CT4wCSVkeDhicHBdDQoNCiMgTWFnaWMgSUQgZm9yIFdpbmRvd3MgSWNvbiBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMDEgYnkgQ2FybA0KMAlzdHJpbmcJXFx4MDBcXHgwMFxceDAxXFx4MDAJW2ZpZD0wMDAwMDEwMDEtMzEtMDAwMElDTztleHQ9aWNvO21pbWU9aW1hZ2Uvdm5kLm1pY3Jvc29mdC5pY29uO11NaWNyb3NvZnQgd2luZG93cyBJY29uIGltYWdlIGZpbGUNCiYweDA4CWJ5dGUJMAkNCj40CWxlc2hvcnQJeAksICVkIGljb24ocykNCj42CWJ5dGUJeAlbcmVzPSVkeA0KPjcJYnl0ZQl4CSVkeDhicHBdDQoNCiMgTWFnaWMgSUQgZm9yIFdpbmRvd3MgSWNvbiBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMDEgYnkgQ2FybA0KMAlzdHJpbmcJXFx4MDBcXHgwMFxceDAxXFx4MDAJW2ZpZD0wMDAwMDEwMDEtMzEtMDAwMElDTztleHQ9aWNvO21pbWU9aW1hZ2Uvdm5kLm1pY3Jvc29mdC5pY29uO11NaWNyb3NvZnQgd2luZG93cyBJY29uIGltYWdlIGZpbGUNCiYweDA4CWJ5dGUJMTYJDQo+NAlsZXNob3J0CXgJLCAlZCBpY29uKHMpDQo+NglieXRlCXgJW3Jlcz0lZHgNCj43CWJ5dGUJeAklZHg0YnBwXQ0KDQojIE1hZ2ljIElEIGZvciBXaW5kb3dzIEljb24gZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTAxIGJ5IENhcmwNCjAJc3RyaW5nCVxceDAwXFx4MDBcXHgwMVxceDAwCVtmaWQ9MDAwMDAxMDAxLTMxLTAwMDBJQ087ZXh0PWljbzttaW1lPWltYWdlL3ZuZC5taWNyb3NvZnQuaWNvbjtdTWljcm9zb2Z0IHdpbmRvd3MgSWNvbiBpbWFnZSBmaWxlDQomMHgwOAlieXRlCTIJDQo+NAlsZXNob3J0CXgJLCAlZCBpY29uKHMpDQo+NglieXRlCXgJW3Jlcz0lZHgNCj43CWJ5dGUJeAklZHgxYnBwXQ0KDQojIE1hZ2ljIElEIGZvciBXaW5kb3dzIEljb24gZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTAxIGJ5IENhcmwNCjAJc3RyaW5nCVxceDAwXFx4MDBcXHgwMVxceDAwCVtmaWQ9MDAwMDAxMDAxLTMxLTAwMDBJQ087ZXh0PWljbzttaW1lPWltYWdlL3ZuZC5taWNyb3NvZnQuaWNvbjtdTWljcm9zb2Z0IHdpbmRvd3MgSWNvbiBpbWFnZSBmaWxlDQomMHgwOAlieXRlCTMyCQ0KPjQJbGVzaG9ydAl4CSwgJWQgaWNvbihzKQ0KPjYJYnl0ZQl4CVtyZXM9JWR4DQo+NwlieXRlCXgJJWR4NWJwcF0NCg0KIyBNYWdpYyBJRCBmb3IgV2luZG93cyBJY29uIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0wMSBieSBDYXJsDQowCXN0cmluZwlcXHgwMFxceDAwXFx4MDFcXHgwMAlbZmlkPTAwMDAwMTAwMS0zMS0wMDAwSUNPO2V4dD1pY287bWltZT1pbWFnZS92bmQubWljcm9zb2Z0Lmljb247XU1pY3Jvc29mdCB3aW5kb3dzIEljb24gaW1hZ2UgZmlsZQ0KJjB4MDgJYnl0ZQk2NAkNCj40CWxlc2hvcnQJeAksICVkIGljb24ocykNCj42CWJ5dGUJeAlbcmVzPSVkeA0KPjcJYnl0ZQl4CSVkeDZicHBdDQoNCiMgTWFnaWMgSUQgZm9yIFdpbmRvd3MgSWNvbiBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMDEgYnkgQ2FybA0KMAlzdHJpbmcJXFx4MDBcXHgwMFxceDAxXFx4MDAJW2ZpZD0wMDAwMDEwMDEtMzEtMDAwMElDTztleHQ9aWNvO21pbWU9aW1hZ2Uvdm5kLm1pY3Jvc29mdC5pY29uO11NaWNyb3NvZnQgd2luZG93cyBJY29uIGltYWdlIGZpbGUNCiYweDA4CWJ5dGUJOAkNCj40CWxlc2hvcnQJeAksICVkIGljb24ocykNCj42CWJ5dGUJeAlbcmVzPSVkeA0KPjcJYnl0ZQl4CSVkeDNicHBdDQoNCiMgTWFnaWMgSUQgZm9yIFN1bk9TIEljb24gZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTAyIGJ5IENhcmwNCjAJc3RyaW5nCS8qXFwgRm9ybWF0X3ZlcnNpb249MSxcXCAJW2ZpZD0wMDAwMDEwMTEtMzEtMDAwSUNPTjtleHQ9aWNvbjttaW1lPTtdU3VuT1MgaWNvbiBpbWFnZSBmaWxlDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMzEgYnkgQ2FybA0KMAliZXNob3J0CTB4MDEJW2ZpZD0wMDAwMDEyNzMtMzEtMDAwMElNRztleHQ9aW1nO21pbWU9O11HRU0gQml0IEltYWdlDQomMgliZXNob3J0CTB4MDgJDQo+MTIJYmVzaG9ydAk+MAlbcmVzPSVkeA0KPjE0CWJlc2hvcnQJPjAJJWQNCj40CWJlc2hvcnQJPjAJeCVkYnBwXQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTAyIGJ5IENhcmwNCjAJc3RyaW5nCVxceDhiSk5HXFx4MGRcXHgwYVxceDFhXFx4MGEJW2ZpZD0wMDAwMDAwMDAtMzEtMDAwMEpORztleHQ9am5nO21pbWU9O11KUEVHIE5ldHdvcmsgZ3JhcGhpY3MgaW1hZ2UgZmlsZQ0KJjEyCXN0cmluZwlKSERSCQ0KPjE2CWJlbG9uZwl4CVtyZXM9JWQNCj4yMAliZWxvbmcJeAl4JWRdDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMTMgYnkgQ2FybA0KMAlzdHJpbmcJXFx4MDBcXHgwMFxceDAwXFx4MGNqUFxceDIwXFx4MjAJW2ZpZD0wMDAwMDAwMDEtMzEtMDAxNTQ0NDtleHQ9anAyO21pbWU9aW1hZ2UvanAyO11KUEVHIDIwMDAgaW1hZ2UgZmlsZQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTEzIGJ5IENhcmwNCjAJc3RyaW5nCVxceGZmXFx4NGZcXHhmZlxceDUxCVtmaWQ9MDAwMDAwMDAxLTMxLTAwMTU0NDQ7ZXh0PWpwYzttaW1lPTtdSlBFRyAyMDAwIGNvZGUgc3RyZWFtIGltYWdlIGZpbGUNCiZaMgliZXNob3J0CTB4RkZEOQkNCj44CWJlbG9uZwl4CVtyZXM9JWR4DQo+MTIJYmVsb25nCXgJJWRdDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMzEgYnkgQ2FybA0KMAliZWxvbmcJMHhmZmQ4ZmZlMAlbZmlkPTAwMDAwMTMwNS0zMS0wMDBKUEVHO2V4dD1qcGVnLGpwZzttaW1lPWltYWdlL2pwZWc7XUpvaW50IFBob3RvZ3JhcGhpYyBFeHBlcnRzIEdyb3VwIEpGSUYgaW1hZ2UgZmlsZQ0KJjYJc3RyaW5nCUpGSUZcXHgwMAkNCj4xMQlieXRlCXgJLCB2ZXJzaW9uICVkDQo+MTIJYnl0ZQl4CS4wJWQNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xMyBieSBDYXJsDQowCXN0cmluZwlcXHhmZlxceGQ4XFx4ZmZcXHhlMQlbZmlkPTAwMDAwMDAwNS0zMS0wMDBKUEVHO2V4dD1qcGcsanBlZzttaW1lPWltYWdlL2pwZWc7XURpZ2l0YWwgc3RpbGwgY2FtZXJhIGltYWdlIGZpbGUNCiY2CXN0cmluZwlFeGlmCQ0KDQojIE1hZ2ljIElEIGZvciBEZWx1eGUgUGFpbnQgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAzLTMxIGJ5IENhcmwNCjAJc3RyaW5nCUZPUk0JW2ZpZD0wMDAwMDEwMTAtMzEtMDAwMExCTTtleHQ9bGJtO21pbWU9O11JbnRlcmxlYXZlZCBiaXRtYXAgaW1hZ2UgZmlsZQ0KJjgJc3RyaW5nCUlMQk0JDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMTMgYnkgQ2FybA0KMAlzdHJpbmcJVGhpc1xcIGlzXFwgYVxcIEJpdE1hcFxcIGZpbGUJW2ZpZD0wMDAwMDAwMDAtMzEtMDAwTElTUDtleHQ9bGlzcDttaW1lPTtdTGlzcCBtYWNoaW5lIGZvcm1hdCBpbWFnZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIE1pY3JvZGVzaWduMiwgTWljcm9kZXNpZ24zIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0wMiBieSBDYXJsDQowCXN0cmluZwkuTURBCVtmaWQ9MDAwMDAxMzE2LTMxLTAwMDBNREE7ZXh0PW1kYTttaW1lPTtdTWljcm9kZXNpZ24gQXJlYSBpbWFnZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIE1pY3JvZGVzaWduMiwgTWljcm9kZXNpZ24zIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0wMiBieSBDYXJsDQowCXN0cmluZwkuTURQCVtmaWQ9MDAwMDAxMzE2LTMxLTAwMDBNRFA7ZXh0PW1kcDttaW1lPTtdTWljcm9kZXNpZ24gcGFnZSBpbWFnZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIEltYWdlbWFnaWNrIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0wMSBieSBDYXJsDQowCXN0cmluZwlpZD1JbWFnZU1hZ2ljawlbZmlkPTAwMDEwMDEwMS0zMS0wMDBNSUZGO2V4dD1taWZmLG1pZjttaW1lPTtdSW1hZ2VtYWdpY2sgaW1hZ2UgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBOZXRwYm0gZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTAyIGJ5IENhcmwNCjAJc3RyaW5nCU1SRjEJW2ZpZD0wMDAxMDAxMDUtMzEtMDAwME1SRjtleHQ9bXJmO21pbWU9O11Nb25vY2hyb21lIHJlY3Vyc2l2ZSBmb3JtYXQgaW1hZ2UgZmlsZQ0KPjQJYmVsb25nCXgJW3Jlcz0lZHgNCj44CWJlbG9uZwl4CSVkeDFicHBdDQoNCiMgTWFnaWMgSUQgZm9yIE1pY3Jvc29mdCBQYWludCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMDIgYnkgQ2FybA0KMAlsZXNob3J0CTB4NjE0NAlbZmlkPTAwMDAwMTAwMS0zMS0wMDAwTVNQO2V4dD1tc3A7bWltZT07XU1pY3Jvc29mdCBwYWludCBpbWFnZSBmaWxlLCB2ZXJzaW9uIDEuMA0KJjIJbGVzaG9ydAkweDRkNmUJDQo+NAlsZXNob3J0CXgJW3Jlcz0lZHgNCj42CWxlc2hvcnQJeAklZHgxYnBwXQ0KDQojIE1hZ2ljIElEIGZvciBNaWNyb3NvZnQgUGFpbnQgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTAyIGJ5IENhcmwNCjAJbGVzaG9ydAkweDY5NGMJW2ZpZD0wMDAwMDEwMDEtMzEtMDAwME1TUDtleHQ9bXNwO21pbWU9O11NaWNyb3NvZnQgcGFpbnQgaW1hZ2UgZmlsZSwgdmVyc2lvbiAyLjANCiYyCWxlc2hvcnQJMHg1MzZlCQ0KPjQJbGVzaG9ydAl4CVtyZXM9JWR4DQo+NglsZXNob3J0CXgJJWR4MWJwcF0NCg0KIyBNYWdpYyBJRCBmb3IgTmV0cGJtIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0zMSBieSBDYXJsDQowCXN0cmluZwlQN1xceDBBCVtmaWQ9MDAwMTAwMTAwLTMxLTAwMDBQQU07ZXh0PXBhbTttaW1lPTtdUG9ydGFibGUgYXJiaXRyYXJ5IG1hcCBpbWFnZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIE5ldHBibSBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMzEgYnkgQ2FybA0KMAlzdHJpbmcJUDEJW2ZpZD0wMDAxMDAxMDAtMzEtMDAwMFBCTTtleHQ9cGJtO21pbWU9O11Qb3J0YWJsZSBiaXRtYXAgaW1hZ2UgZmlsZSwgYXNjaWkNCg0KIyBNYWdpYyBJRCBmb3IgTmV0cGJtIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0zMSBieSBDYXJsDQowCXN0cmluZwlQNAlbZmlkPTAwMDEwMDEwMC0zMS0wMDAwUEJNO2V4dD1wYm07bWltZT07XVBvcnRhYmxlIGJpdG1hcCBpbWFnZSBmaWxlLCBiaW5hcnkNCg0KIyBNYWdpYyBJRCBmb3IgUEMtUGFpbnRicnVzaCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMzEgYnkgQ2FybA0KMAliZXNob3J0CTB4MEEwMAlbZmlkPTAwMDAwMTI1Ny0zMS0wMDAwUENYO2V4dD1wY3g7bWltZT07XVBDLVBhaW50YnJ1c2ggaW1hZ2UgZmlsZSwgdmVyc2lvbiAyLjUNCiYyCWJ5dGUJMQkNCg0KIyBNYWdpYyBJRCBmb3IgUEMtUGFpbnRicnVzaCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMzEgYnkgQ2FybA0KMAliZXNob3J0CTB4MEEwMglbZmlkPTAwMDAwMTI1Ny0zMS0wMDAwUENYO2V4dD1wY3g7bWltZT07XVBDLVBhaW50YnJ1c2ggaW1hZ2UgZmlsZSwgdmVyc2lvbiAyLjgNCiYyCWJ5dGUJMQkNCg0KIyBNYWdpYyBJRCBmb3IgUEMtUGFpbnRicnVzaCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMzEgYnkgQ2FybA0KMAliZXNob3J0CTB4MEEwMwlbZmlkPTAwMDAwMTI1Ny0zMS0wMDAwUENYO2V4dD1wY3g7bWltZT07XVBDLVBhaW50YnJ1c2ggaW1hZ2UgZmlsZSwgdmVyc2lvbiAyLjgNCiYyCWJ5dGUJMQkNCg0KIyBNYWdpYyBJRCBmb3IgUEMtUGFpbnRicnVzaCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMzEgYnkgQ2FybA0KMAliZXNob3J0CTB4MEEwNAlbZmlkPTAwMDAwMTI1Ny0zMS0wMDAwUENYO2V4dD1wY3g7bWltZT07XVBDLVBhaW50YnJ1c2ggZm9yIHdpbmRvd3MgaW1hZ2UgZmlsZQ0KJjIJYnl0ZQkxCQ0KDQojIE1hZ2ljIElEIGZvciBQQy1QYWludGJydXNoIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0zMSBieSBDYXJsDQowCWJlc2hvcnQJMHgwQTA1CVtmaWQ9MDAwMDAxMjU3LTMxLTAwMDBQQ1g7ZXh0PXBjeDttaW1lPTtdUEMtUGFpbnRicnVzaCBpbWFnZSBmaWxlLCB2ZXJzaW9uIDMuMA0KJjIJYnl0ZQkxCQ0KDQojIE1hZ2ljIElEIGZvciBOZXRwYm0gZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAzLTMxIGJ5IENhcmwNCjAJc3RyaW5nCVAyCVtmaWQ9MDAwMTAwMTAwLTMxLTAwMDBQR007ZXh0PXBnbTttaW1lPTtdUG9ydGFibGUgZ3JheSBtYXAgaW1hZ2UgZmlsZSwgYXNjaWkNCg0KIyBNYWdpYyBJRCBmb3IgTmV0cGJtIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0zMSBieSBDYXJsDQowCXN0cmluZwlQNQlbZmlkPTAwMDEwMDEwMC0zMS0wMDAwUEdNO2V4dD1wZ207bWltZT07XVBvcnRhYmxlIGdyYXkgbWFwIGltYWdlIGZpbGUsIGJpbmFyeQ0KDQojIE1hZ2ljIElEIGZvciBQQyBQYWludCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMDggYnkgQ2FybA0KMAlsZXNob3J0CTB4MTIzNAlbZmlkPTAwMDAwMTMxOC0zMS0wMDAwUElDO2V4dD1waWM7bWltZT07XVBpY3RvciBQQyBQYWludCBpbWFnZSBmaWxlDQomMTEJYnl0ZQkweEZGCQ0KJjEwCWJ5dGUJMHgwMgkNCj4yCWxlc2hvcnQJeAlbcmVzPSVkDQo+NAlsZXNob3J0CXgJeCVkXQ0KDQojIE1hZ2ljIElEIGZvciBQQyBQYWludCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMDggYnkgQ2FybA0KMAlsZXNob3J0CTB4MTIzNAlbZmlkPTAwMDAwMTMxOC0zMS0wMDAwUElDO2V4dD1waWM7bWltZT07XVBpY3RvciBQQyBQYWludCBpbWFnZSBmaWxlDQomMTEJYnl0ZQkweEZGCQ0KJjEwCWJ5dGUJMHgwOAkNCj4yCWxlc2hvcnQJeAlbcmVzPSVkDQo+NAlsZXNob3J0CXgJeCVkXQ0KDQojIE1hZ2ljIElEIGZvciBQQyBQYWludCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMDggYnkgQ2FybA0KMAlsZXNob3J0CTB4MTIzNAlbZmlkPTAwMDAwMTMxOC0zMS0wMDAwUElDO2V4dD1waWM7bWltZT07XVBpY3RvciBQQyBQYWludCBpbWFnZSBmaWxlDQomMTEJYnl0ZQkweEZGCQ0KJjEwCWJ5dGUJMHgzMQkNCj4yCWxlc2hvcnQJeAlbcmVzPSVkDQo+NAlsZXNob3J0CXgJeCVkXQ0KDQojIE1hZ2ljIElEIGZvciBTb2Z0aW1hZ2UgM0QgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTA4IGJ5IENhcmwNCjAJYmVsb25nCTB4NTM4MGY2MzQJW2ZpZD0wMDAwMDEzMjEtMzEtMDAwMFBJQztleHQ9cGljO21pbWU9O11Tb2Z0aW1hZ2UgM0QgaW1hZ2UgZmlsZQ0KJjg4CXN0cmluZwlQSUNUCQ0KPjgJc3RyaW5nCT5cXHgwMAlbdGl0bGU9JS44MHNdDQo+OTIJYmVzaG9ydAl4CVtyZXM9JWQNCj45NAliZXNob3J0CXgJeCVkXQ0KDQojIE1hZ2ljIElEIGZvciBCaW8tcmFkIG1pY3Jvc2NvcGUgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTA4IGJ5IENhcmwNCjU0CWxlc2hvcnQJMTIzNDUJW2ZpZD0wMDAwMDEzMjItMzEtMDAwMFBJQztleHQ9cGljO21pbWU9O11CaW8tcmFkIGNvbmZvY2FsIG1pY3Jvc2NvcGUgaW1hZ2UgZmlsZQ0KJjE2CWxlc2hvcnQJMAkNCj4wCWxlc2hvcnQJPjAJW3Jlcz0lZA0KPjIJbGVzaG9ydAk+MAl4JWRdDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDYgYnkgQ2FybA0KMAlzdHJpbmcJXFx4ODlQTkdcXHgwZFxceDBhXFx4MWFcXHgwYQlbZmlkPTAwMDAwMDAwMS0zMS0wMDE1OTQ4O2V4dD1wbmc7bWltZT1pbWFnZS9wbmc7XVBvcnRhYmxlIE5ldHdvcmsgR3JhcGhpYyBmaWxlDQomMTIJc3RyaW5nCUlIRFIJDQo+MTYJYmVsb25nCT4wCVtyZXM9JWQNCj4yMAliZWxvbmcJPjAJeCVkDQo+MjQJYnl0ZQl4CXglZGJwcF0NCg0KIyBNYWdpYyBJRCBmb3IgTmV0cGJtIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0zMSBieSBDYXJsDQowCXN0cmluZwlQMwlbZmlkPTAwMDEwMDEwMC0zMS0wMDAwUFBNO2V4dD1wcG07bWltZT07XVBvcnRhYmxlIHBpeGVsIG1hcCBpbWFnZSBmaWxlLCBhc2NpaQ0KDQojIE1hZ2ljIElEIGZvciBOZXRwYm0gZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAzLTMxIGJ5IENhcmwNCjAJc3RyaW5nCVA2CVtmaWQ9MDAwMTAwMTAwLTMxLTAwMDBQUE07ZXh0PXBwbTttaW1lPTtdUG9ydGFibGUgcGl4ZWwgbWFwIGltYWdlIGZpbGUsIGJpbmFyeQ0KDQojIE1hZ2ljIElEIGZvciBQaG90b3Nob3AgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTAxIGJ5IENhcmwNCjAJc3RyaW5nCThCUFNcXHgwMFxceDAxCVtmaWQ9MDAwMDAxMDAzLTMxLTAwMDBQU0Q7ZXh0PXBzZDttaW1lPTtdQWRvYmUgUGhvdG9zaG9wIGltYWdlIGZpbGUNCj4xOAliZWxvbmcJPjAJW3Jlcz0lZHgNCj4xNAliZWxvbmcJPjAJJWRdDQoNCiMgTWFnaWMgSUQgZm9yIFBhaW50IHNob3AgcHJvIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0wMSBieSBDYXJsDQowCXN0cmluZwlQYWludCBTaG9wIFBybyBJbWFnZSBGaWxlXFx4MGFcXHgxYQlbZmlkPTAwMDAwMTMxMC0zMS0wMDAwUFNQO2V4dD1wc3A7bWltZT07XVBhaW50c2hvcCBwcm8gaW1hZ2UgZmlsZQ0KPjUwCWxlbG9uZwk+MAlbcmVzPSVkeA0KPjU0CWxlbG9uZwk+MAklZA0KPjY5CWxlc2hvcnQJPjAJeCVkYnBwXQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA4IGJ5IENhcmwNCjAJYmVsb25nCTB4NTlhNjZhOTUJW2ZpZD0wMDAwMDEwMTEtMzEtMDAwMFJBUztleHQ9cmFzO21pbWU9O11TdW4gcmFzdGVyIGltYWdlDQo+NAliZWxvbmcJPjAJW3Jlcz0lZHgNCj44CWJlbG9uZwk+MAklZA0KPjEyCWJlbG9uZwk+MAl4JWRicHBdDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMzEgYnkgQ2FybA0KMAlzdHJpbmcJXFwweDAxXFx4REEJW2ZpZD0wMDAwMDEwMDQtMzEtMDAwMFJHQjtleHQ9cmdiO21pbWU9O11TR0kgSW1hZ2UgZmlsZQ0KPjI0CXN0cmluZwk+XFx4MDAJW3RpdGxlPSUuODBzXQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAzLTMxIGJ5IENhcmwNCjAJc3RyaW5nCVxceDAxXFx4REFcXHgwMFxceDAxCVtmaWQ9MDAwMDAxMDA0LTMxLTAwMDBSR0I7ZXh0PXJnYjttaW1lPTtdU0dJIEltYWdlIGZpbGUNCiYxMAliZXNob3J0CTEJDQo+NgliZXNob3J0CXgJW3Jlcz0lZHgNCj44CWJlc2hvcnQJeAklZHg4YnBwXQ0KPjI0CXN0cmluZwk+XFx4MAlbdGl0bGU9JS44MHNdDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMzEgYnkgQ2FybA0KMAlzdHJpbmcJXFx4MDFcXHhEQVxceDAwXFx4MDEJW2ZpZD0wMDAwMDEwMDQtMzEtMDAwMFJHQjtleHQ9cmdiO21pbWU9O11TR0kgSW1hZ2UgZmlsZQ0KJjEwCWJlc2hvcnQJMwkNCj42CWJlc2hvcnQJeAlbcmVzPSVkeA0KPjgJYmVzaG9ydAl4CSVkeDI0YnBwXQ0KPjI0CXN0cmluZwk+XFx4MAlbdGl0bGU9JS44MHNdDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMzEgYnkgQ2FybA0KMAlzdHJpbmcJXFx4MDFcXHhEQVxceDAwXFx4MDEJW2ZpZD0wMDAwMDEwMDQtMzEtMDAwMFJHQjtleHQ9cmdiO21pbWU9O11TR0kgSW1hZ2UgZmlsZQ0KJjEwCWJlc2hvcnQJNAkNCj42CWJlc2hvcnQJeAlbcmVzPSVkeA0KPjgJYmVzaG9ydAl4CSVkeDI0YnBwXQ0KPjI0CXN0cmluZwk+XFx4MAlbdGl0bGU9JS44MHNdDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMzEgYnkgQ2FybA0KMAlzdHJpbmcJXFx4MDFcXHhEQVxceDAxXFx4MDEJW2ZpZD0wMDAwMDEwMDQtMzEtMDAwMFJHQjtleHQ9cmdiO21pbWU9O11TR0kgSW1hZ2UgZmlsZSwgY29tcHJlc3NlZA0KJjEwCWJlc2hvcnQJMQkNCj42CWJlc2hvcnQJeAlbcmVzPSVkeA0KPjgJYmVzaG9ydAl4CSVkeDhicHBdDQo+MjQJc3RyaW5nCT5cXHgwCVt0aXRsZT0lLjgwc10NCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0zMSBieSBDYXJsDQowCXN0cmluZwlcXHgwMVxceERBXFx4MDFcXHgwMQlbZmlkPTAwMDAwMTAwNC0zMS0wMDAwUkdCO2V4dD1yZ2I7bWltZT07XVNHSSBJbWFnZSBmaWxlLCBjb21wcmVzc2VkDQomMTAJYmVzaG9ydAkzCQ0KPjYJYmVzaG9ydAl4CVtyZXM9JWR4DQo+OAliZXNob3J0CXgJJWR4MjRicHBdDQo+MjQJc3RyaW5nCT5cXHgwCVt0aXRsZT0lLjgwc10NCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0zMSBieSBDYXJsDQowCXN0cmluZwlcXHgwMVxceERBXFx4MDFcXHgwMQlbZmlkPTAwMDAwMTAwNC0zMS0wMDAwUkdCO2V4dD1yZ2I7bWltZT07XVNHSSBJbWFnZSBmaWxlLCBjb21wcmVzc2VkDQomMTAJYmVzaG9ydAk0CQ0KPjYJYmVzaG9ydAl4CVtyZXM9JWR4DQo+OAliZXNob3J0CXgJJWR4MjRicHBdDQo+MjQJc3RyaW5nCT5cXHgwCVt0aXRsZT0lLjgwc10NCg0KIyBNYWdpYyBJRCBmb3IgVHVyYm8gU2lsdmVyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xMyBieSBDYXJsDQowCXN0cmluZwlGT1JNCVtmaWQ9MDAwMDAxMjUyLTMxLTAwMFJHQjg7ZXh0PXJnYjgscmdiO21pbWU9O11UdXJibyBTaWx2ZXIgMjQtYml0IFJHQiBpbWFnZSBmaWxlDQomOAlzdHJpbmcJUkdCOAkNCg0KIyBNYWdpYyBJRCBmb3IgVHVyYm8gU2lsdmVyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xMyBieSBDYXJsDQowCXN0cmluZwlGT1JNCVtmaWQ9MDAwMDAxMjUyLTMxLTAwMFJHQk47ZXh0PXJnYm4scmdiO21pbWU9O11UdXJibyBTaWx2ZXIgMTItYml0IFJHQiBpbWFnZSBmaWxlDQomOAlzdHJpbmcJUkdCTgkNCg0KIyBNYWdpYyBJRCBmb3IgQ29sb1JJWCBWR0EgUGFpbnQgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTA4IGJ5IENhcmwNCjAJc3RyaW5nCVJJWDMJW2ZpZD0wMDAwMDEzMjAtMzEtMDAwMFNDWjtleHQ9c2N6O21pbWU9O11Db2xvclJJWCBWR0EgUGFpbnQgaW1hZ2UgZmlsZQ0KPjQJbGVzaG9ydAl4CVtyZXM9JWQNCj42CWxlc2hvcnQJeAl4JWRdDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMTMgYnkgQnJ5YW4gSGVuZGVyc29uDQowCXN0cmluZwlcXDExN1xcMDcyCVtmaWQ9MDAwMDAwMDAwLTMxLTAwMDBTSVI7ZXh0PXNpcjttaW1lPTtdU29saXRhaXJlIGltYWdlIHJlY29yZGVyIGltYWdlIGZpbGUsIE1HSSB0eXBlIDExDQomNAlzdHJpbmcJXFwwMTMJDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMTMgYnkgQnJ5YW4gSGVuZGVyc29uDQowCXN0cmluZwlcXDExN1xcMDcyCVtmaWQ9MDAwMDAwMDAwLTMxLTAwMDBTSVI7ZXh0PXNpcjttaW1lPTtdU29saXRhaXJlIGltYWdlIHJlY29yZGVyIGltYWdlIGZpbGUsIE1HSSB0eXBlIDE3DQomNAlzdHJpbmcJXFwwMjEJDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMDEgYnkgQ2FybA0KWjE4CXN0cmluZwlUUlVFVklTSU9OLVhGSUxFCVtmaWQ9MDAwMDAxMzA2LTMxLTAwMDBUR0E7ZXh0PXRnYTttaW1lPTtdVHJ1ZXZpc2lvbiBUYXJnYSBpbWFnZSBmaWxlDQo+MTIJbGVzaG9ydAl4CVtyZXM9JWR4DQo+MTQJbGVzaG9ydAl4CSVkDQo+MTYJYnl0ZQl4CXglZGJwcF0NCg0KIyBNYWdpYyBJRCBmb3IgR3JhcGhpY3MgV29ya3Nob3AgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTAxIGJ5IENhcmwNCjAJc3RyaW5nCVRITkwJW2ZpZD0wMDAwMDEyNTgtMzEtMDAwMFRITjtleHQ9dGhuO21pbWU9O11HcmFwaGljcyB3b3Jrc2hvcCB0aHVtYm5haWwgaW1hZ2UgZmlsZQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAzLTMxIGJ5IENhcmwNCjAJc3RyaW5nCUlJCVtmaWQ9MDAwMDAxMDAzLTMxLTAwMDBUSUY7ZXh0PXRpZix0aWZmLGRuZzttaW1lPWltYWdlL3RpZmY7XVRhZ2dlZCBpbWFnZSBmaWxlIGZvcm1hdCBpbWFnZSBmaWxlLCBsaXR0bGUtZW5kaWFuDQomMglsZXNob3J0CTQyCQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAzLTMxIGJ5IENhcmwNCjAJc3RyaW5nCU1NCVtmaWQ9MDAwMDAxMDAzLTMxLTAwMDBUSUY7ZXh0PXRpZix0aWZmLGRuZzttaW1lPWltYWdlL3RpZmY7XVRhZ2dlZCBpbWFnZSBmaWxlIGZvcm1hdCBpbWFnZSBmaWxlLCBiaWctZW5kaWFuDQomMglsZXNob3J0CQkNCg0KIyBNYWdpYyBJRCBmb3IgVklDQVIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTAxIGJ5IENhcmwNCjAJc3RyaW5nCUxCTFNJWkU9CVtmaWQ9MDAwMDAxMDIyLTMxLTAwMDBWSUM7ZXh0PXZpYyx2aWNhcjttaW1lPTtdVmljYXIgaW1hZ2UgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBLaG9yb3MgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTAxIGJ5IENhcmwNCjAJc3RyaW5nCVxceEFCXFx4MDFcXHgwMVxceDAzCVtmaWQ9MDAwMDAxMzA4LTMxLTAwMDBWSUY7ZXh0PXZpZix2aWZmO21pbWU9O11LaG9yb3MgVmlzdWFsaXphdGlvbi9JbWFnZSBGaWxlIEZvcm1hdCwgdmVyc2lvbiAxLjMNCiY0CWJ5dGUJMgkNCj41MjAJYmVsb25nCT4wCVtyZXM9JWR4DQo+NTI0CWJlbG9uZwk+MAklZF0NCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0wMiBieSBDYXJsDQowCXN0cmluZwlGSUFTQ08JW2ZpZD0wMDAxMDAxMDctMzEtMDAwMFdGQTtleHQ9d2ZhO21pbWU9O11GcmFjdGFsIEltYWdlIEFuZCBTZXF1ZW5jZSBDb2RlYyBpbWFnZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIFgtV2luZG93cyBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMDEgYnkgQ2FybA0KMAlzdHJpbmcJLyogWFBNICovCVtmaWQ9MDAwMDAxMDIwLTMxLTAwMDBYUE07ZXh0PXhwbTttaW1lPTtdWC1XaW5kb3dzIHBpeGVsIG1hcCBpbWFnZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIFhWIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0wMSBieSBDYXJsDQowCXN0cmluZwlQN1xcIDMzMglbZmlkPTAwMDEwMDEwMy0zMS0wMDAwMFhWO2V4dD14djttaW1lPTtdWFYgVGh1bWJuYWlsIGltYWdlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgWFdpbmRvd3MgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTAyIGJ5IENhcmwNCjAJYmVsb25nCTB4NDAJW2ZpZD0wMDAwMDEwMjAtMzEtMDAwMFhXRDtleHQ9eHdkO21pbWU9O11YMTAgWFdpbmRvd3MgZHVtcCBpbWFnZSBmaWxlDQomNAliZWxvbmcJMHgwNgkNCj4yNAliZWxvbmcJeAlbcmVzPSVkDQo+MjgJYmVsb25nCXgJeCVkXQ0KDQojIE1hZ2ljIElEIGZvciBYV2luZG93cyBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMDIgYnkgQ2FybA0KMAlsZWxvbmcJMHg0MAlbZmlkPTAwMDAwMTAyMC0zMS0wMDAwWFdEO2V4dD14d2Q7bWltZT07XVgxMCBYV2luZG93cyBkdW1wIGltYWdlIGZpbGUNCiY0CWxlbG9uZwkweDA2CQ0KPjI0CWxlbG9uZwl4CVtyZXM9JWQNCj4yOAlsZWxvbmcJeAl4JWRdDQoNCiMgTWFnaWMgSUQgZm9yIFByb3ZlY3RvciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMDggYnkgQ2FybA0KMAlzdHJpbmcJRk9STQlbZmlkPTAwMDAwMTMxOS0zMi0wMDBEUjJEO2V4dD1kcjJkO21pbWU9O11Qcm92ZWN0b3IgMkQgaW1hZ2UgZmlsZQ0KJjgJc3RyaW5nCURSMkQJDQoNCiMgTWFnaWMgSUQgZm9yIFhGaWcsIFdpbkZpZywgakZpZyBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KMAlzdHJpbmcJI0ZJRwlbZmlkPTAwMDEwMDAxMS0zMi0wMDAwRklHO2V4dD1maWc7bWltZT07XUZhY2lsaXR5IGZvciBJbnRlcmFjdGl2ZSBHZW5lcmF0aW9uIGZpbGUNCj41CXN0cmluZwl4CSwgdmVyc2lvbiAlLjFzLg0KPjcJc3RyaW5nCXgJJS4xcw0KDQojIE1hZ2ljIElEIGZvciBMb3R1cyAxLTItMyBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMDIgYnkgQ2FybA0KMAlzdHJpbmcJXFx4MDFcXHgwMFxceDAwXFx4MDBcXHgwMVxceDAwXFx4MDhcXHgwMFxceDQ0CVtmaWQ9MDAwMDAxMDA5LTMyLTAwMDBQSUM7ZXh0PXBpYzttaW1lPTtdTG90dXMgMS0yLTMgaW1hZ2UgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBBdXRvY2FkIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xMiBieSBDYXJsDQowCXN0cmluZwlBdXRvQ0FEIFNsaWRlCVtmaWQ9MDAwMDAxMjU0LTMyLTAwMDBTTEQ7ZXh0PXNsZDttaW1lPTtdQXV0b2NhZCBzbGlkZSBpbWFnZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIFdvcmRwZXJmZWN0IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0wOCBieSBDYXJsDQowCXN0cmluZwlcXHhmZldQQwlbZmlkPTAwMDAwMTAwOC0zMi0wMDAwV1BHO2V4dD13cGc7bWltZT07XVdvcmRwZXJmZWN0IEdyYXBoaWNzIHZlY3RvcnMNCiY4CWJ5dGUJMQkNCiY5CWJ5dGUJMHgxNgkNCj4xMAlieXRlCXgJLCB2ZXJzaW9uICVkLg0KPjExCWJ5dGUJeAklZA0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IENhcmwNCjAJc3RyaW5nCUZPUk0JW2ZpZD0wMDAxMDAwMTktMzMtMDAwQU1GRjtleHQ9YW1mZjttaW1lPTtdQW1pZ2EgbWV0YWZpbGUNCiY4CXN0cmluZwlBTUZGCQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IENhcmwNCjAJbGVsb25nCTB4OUFDNkNERDcJW2ZpZD0wMDAwMDEwMDMtMzMtMDAwMEFQTTtleHQ9YXBtO21pbWU9O11BbGR1cyBwbGFjZWFibGUgV2luZG93cyBtZXRhZmlsZQ0KJjQJbGVzaG9ydAkwCQ0KDQojIE1hZ2ljIElEIGZvciBDb3JlbERSQVcgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IENhcmwNCjAJc3RyaW5nCVJJRkYJW2ZpZD0wMDAwMDEwMDgtMzMtMDAwMENEUjtleHQ9Y2RyO21pbWU9O11Db3JlbGRyYXcgIGxpdHRsZS1lbmRpYW4gbWV0YWZpbGUNCiY4CXN0cmluZwlDRFIJDQoNCiMgTWFnaWMgSUQgZm9yIENvcmVsRFJBVyBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTEgYnkgQ2FybA0KMAlzdHJpbmcJUklGWAlbZmlkPTAwMDAwMTAwOC0zMy0wMDAwQ0RSO2V4dD1jZHI7bWltZT07XUNvcmVsZHJhdyAgYmlnLWVuZGlhbiBtZXRhZmlsZQ0KJjgJc3RyaW5nCUNEUgkNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0wOCBieSBDYXJsDQowCWJlc2hvcnQmMHhGRjIwCTB4MDAyMAlbZmlkPTAwMDAwMDAwMS0zMy0wMDA4NjMyO2V4dD1jZ207bWltZT1pbWFnZS9jZ207XUNvbXB1dGVyIGdyYXBoaWNzIG1ldGFmaWxlLCBiaW5hcnkgZW5jb2RlZA0KJloweDAyCWJlc2hvcnQmMHhGRjQwCTB4MDA0MAkNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0wOCBieSBDYXJsDQowCXN0cmluZwlCRUdNRglbZmlkPTAwMDAwMDAwMS0zMy0wMDA4NjMyO2V4dD1jZ207bWltZT1pbWFnZS9jZ207XUNvbXB1dGVyIGdyYXBoaWNzIG1ldGFmaWxlLCBhc2NpaSBlbmNvZGVkDQoNCiMgTWFnaWMgSUQgZm9yIENvcmVsRFJBVyBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTEgYnkgQ2FybA0KMAlzdHJpbmcJUklGRglbZmlkPTAwMDAwMTAwOC0zMy0wMDAwQ01YO2V4dD1jbXg7bWltZT07XUNvcmVsIGxpdHRsZS1lbmRpYW4gbWV0YWZpbGUNCiY4CXN0cmluZwlDTVgxCQ0KDQojIE1hZ2ljIElEIGZvciBDb3JlbERSQVcgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IENhcmwNCjAJc3RyaW5nCVJJRlgJW2ZpZD0wMDAwMDEwMDgtMzMtMDAwMENNWDtleHQ9Y214O21pbWU9O11Db3JlbCBiaWctZW5kaWFuIG1ldGFmaWxlDQomOAlzdHJpbmcJQ01YMQkNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQowCWxlbG9uZwkweDAwMDAwMDAxCVtmaWQ9MDAwMDAxMDAxLTMzLTAwMDBFTUY7ZXh0PWVtZjttaW1lPTtdTWljcm9zb2Z0IFdpbmRvd3MgRW5oYW5jZWQgbWV0YWZpbGUNCiY0MAlsZWxvbmcJMHg0NjRENDUyMAkNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQowCXN0cmluZwklIVBTLUFkb2JlLTIuMFxcIEVQU0YtMS4yCVtmaWQ9MDAwMDAxMDAzLTMzLTAwMEVQU0Y7ZXh0PWVwc2Y7bWltZT1hcHBsaWNhdGlvbi9wb3N0c2NyaXB0O11BZG9iZSBFbmNhcHN1bGF0ZWQgUG9zdHNjcmlwdCBMZXZlbCAyLCB2ZXJzaW9uIDEuMg0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IENhcmwNCjAJc3RyaW5nCSUhUFMtQWRvYmUtMi4wXFwgRVBTRi0yLjAJW2ZpZD0wMDAwMDEwMDMtMzMtMDAwRVBTRjtleHQ9ZXBzZjttaW1lPWFwcGxpY2F0aW9uL3Bvc3RzY3JpcHQ7XUFkb2JlIEVuY2Fwc3VsYXRlZCBQb3N0c2NyaXB0IExldmVsIDIsIHZlcnNpb24gMi4wDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTEgYnkgQ2FybA0KMAlzdHJpbmcJJSFQUy1BZG9iZS0zLjBcXCBFUFNGLTMuMAlbZmlkPTAwMDAwMTAwMy0zMy0wMDBFUFNGO2V4dD1lcHNmO21pbWU9YXBwbGljYXRpb24vcG9zdHNjcmlwdDtdQWRvYmUgRW5jYXBzdWxhdGVkIFBvc3RzY3JpcHQgTGV2ZWwgMywgdmVyc2lvbiAzLjANCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQowCXN0cmluZwlcXHhDNVxceEQwXFx4RDNcXHhDNglbZmlkPTAwMDAwMTAwMy0zMy0wMDBFUFNGO2V4dD1lcHNmLGFpO21pbWU9YXBwbGljYXRpb24vcG9zdHNjcmlwdDtdQWRvYmUgRW5jYXBzdWxhdGVkIFBvc3RzY3JpcHQsIHZlcnNpb24gMy4wLCBiaW5hcnkNCg0KIyBNYWdpYyBJRCBmb3IgR0VNIFBhaW50IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0zMSBieSBDYXJsDQowCWJlc2hvcnQJMHhGRkZGCVtmaWQ9MDAwMDAxMjczLTMzLTAwMDBHRU07ZXh0PWdlbTttaW1lPTtdR2VtRE9TIE1vdG9yb2xhIE1ldGFmaWxlLCB2ZXJzaW9uIDEuMDENCiY0CWJlc2hvcnQJMTAxCQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IGh0dHA6Ly93d3cuc2Vhc2lwLmluZm8vR2VtL2ZmX2dlbS5odG1sDQowCWxlc2hvcnQJMHhGRkZGCVtmaWQ9MDAwMDAxMjczLTMzLTAwMDBHRU07ZXh0PWdlbTttaW1lPTtdR2VtRE9TIE1ldGFmaWxlDQomNAlsZXNob3J0CTAJDQoNCiMgTWFnaWMgSUQgZm9yIEFydGxpbmUgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IGh0dHA6Ly93d3cuc2Vhc2lwLmluZm8vR2VtL2ZmX2dlbS5odG1sDQowCWxlc2hvcnQJMHhGRkZGCVtmaWQ9MDAwMDAxMjczLTMzLTAwMDBHRU07ZXh0PWdlbTttaW1lPTtdR2VtRE9TIEludGVsIE1ldGFmaWxlLCB2ZXJzaW9uIDQuMDANCiY0CWxlc2hvcnQJNDAwCQ0KDQojIE1hZ2ljIElEIGZvciBEZXNrcHJlc3MgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IGh0dHA6Ly93d3cuc2Vhc2lwLmluZm8vR2VtL2ZmX2dlbS5odG1sDQowCWxlc2hvcnQJMHhGRkZGCVtmaWQ9MDAwMDAxMjczLTMzLTAwMDBHRU07ZXh0PWdlbTttaW1lPTtdR2VtRE9TIEludGVsIE1ldGFmaWxlLCB2ZXJzaW9uIDMuMTANCiY0CWxlc2hvcnQJMzEwCQ0KDQojIE1hZ2ljIElEIGZvciBHRU0gUGFpbnQgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IGh0dHA6Ly93d3cuc2Vhc2lwLmluZm8vR2VtL2ZmX2dlbS5odG1sDQowCWxlc2hvcnQJMHhGRkZGCVtmaWQ9MDAwMDAxMjczLTMzLTAwMDBHRU07ZXh0PWdlbTttaW1lPTtdR2VtRE9TIEludGVsIE1ldGFmaWxlLCB2ZXJzaW9uIDEuMDENCiY0CWxlc2hvcnQJMTAxCQ0KDQojIE1hZ2ljIElEIGZvciBRdWlja2RyYXcgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTAxIGJ5IENhcmwNCjB4MjBBCWJlbG9uZwkweDAwMTEwMkZGCVtmaWQ9MDAwMDAxMDAyLTMzLTAwMDBQQ1Q7ZXh0PXBjdDttaW1lPTtdTWFjaW50b3NoIFF1aWNrZHJhdyBtZXRhZmlsZSBcJ1BJQ1RcJywgdmVyc2lvbiAyLjANCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQowCWxlc2hvcnQJMHgwMDAxCVtmaWQ9MDAwMDAxMDAxLTMzLTAwMDBXTUY7ZXh0PXdtZjttaW1lPTtdTWljcm9zb2Z0IFdpbmRvd3MgbWV0YWZpbGUNCiYyCWxlc2hvcnQJOQkNCg0KIyBNYWdpYyBJRCBmb3IgQ2luZW1hIDREIFZlcnNpb24gNS54IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0wNiBieSBDYXJsDQowCXN0cmluZwlNQzUwCVtmaWQ9MDAwMDAxMjU1LTQwLTAwMDAwMDA7ZXh0PTttaW1lPTtdTWF4b24gQ2luZW1hIDREIHZlcnNpb24gNSAzRCBkYXRhDQoNCiMgTWFnaWMgSUQgZm9yIFF1aWNrZHJhdyAzRCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDYgYnkgQ2FybA0KMAlzdHJpbmcJM0RNRglbZmlkPTAwMDAwMTAwMi00MC0wMDAzRE1GO2V4dD0zZG1mO21pbWU9O11BcHBsZSBRdWlja2RyYXcgM0QgbWV0YWZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgUmhpbm8gM2QgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTEyIGJ5IENhcmwNCjAJc3RyaW5nCTNEIEdlb21ldHJ5IEZpbGUgRm9ybWF0CVtmaWQ9MDAwMDAxMzMwLTQwLTAwMDNETUY7ZXh0PTNkbWY7bWltZT07XVJoaW5vM2QgLyBPcGVuTnVyYnMgM2QgbW9kZWwNCg0KIyBNYWdpYyBJRCBmb3IgUXVpY2tkcmF3IDNEIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xMSBieSBDYXJsDQowCXN0cmluZwkzRE1ldGFmaWxlCVtmaWQ9MDAwMDAxMDAyLTQwLTAwMDNETUY7ZXh0PTNkbWYsYTNkO21pbWU9O11BcHBsZSBRdWlja2RyYXcgM0QgbWV0YWZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgQUMzZCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMTIgYnkgQ2FybA0KMAlzdHJpbmcJQUMzRAlbZmlkPTAwMDAwMDAwMC00MC0wMDAwMEFDO2V4dD1hYzttaW1lPTtdQWMzZCAzZCBtb2RlbA0KDQojIE1hZ2ljIElEIGZvciAzZFN0dWRpbyBNYXggZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTEyIGJ5IENhcmwNCjAJc3RyaW5nCSozRFNNQVhfQVNDSUlFWFBPUlQJW2ZpZD0wMDAwMDEzMjYtNDAtMDAwMEFTRTtleHQ9YXNlO21pbWU9O10zZCBzdHVkaW8gbWF4IGFzY2lpIGV4cG9ydCAzRCBtb2RlbA0KDQojIE1hZ2ljIElEIGZvciBDYWxpZ2FyaSBUcnVlc3BhY2UgTW9kZWxlciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDYgYnkgQ2FybA0KMAlzdHJpbmcJQ2FsaWdhcmlcXCBWCVtmaWQ9MDAwMDAxMjU2LTQwLTAwMDBDT0I7ZXh0PWNvYixzY247bWltZT07XUNhbGlnYXJpIFRydWVzcGFjZTIgM0QgbW9kZWwNCg0KIyBNYWdpYyBJRCBmb3IgVGFjaHlvbiBwYXJhbGxlbCByYXl0cmFjZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTEyIGJ5IENhcmwNCjAJc3RyaW5nCUJFR0lOX1NDRU5FCVtmaWQ9MDAwMTAwMTE2LTQwLTAwMDBEQVQ7ZXh0PWRhdDttaW1lPTtdVGFjaHlvbiByYXktdHJhY2VyIDNkIG1vZGVsDQoNCiMgTWFnaWMgSUQgZm9yIEF1dG9jYWQgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTEyIGJ5IENhcmwNCjAJc3RyaW5nCUFDMTAJW2ZpZD0wMDAwMDEyNTQtNDAtMDAwMERXRztleHQ9ZHdnO21pbWU9aW1hZ2Uvdm5kLmR3ZztdQXV0b2NhZCBkcmF3aW5nIGZvcm1hdCAzZCBtb2RlbA0KDQojIE1hZ2ljIElEIGZvciBBdXRvY2FkIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xMiBieSBDYXJsDQowCXN0cmluZwlBdXRvQ0FEIEJpbmFyeSBEWEYJW2ZpZD0wMDAwMDEyNTQtNDAtMDAwMERYRjtleHQ9ZHhmO21pbWU9aW1hZ2Uvdm5kLmR4ZjtdQXV0b2NhZCBkcmF3aW5nIGludGVyY2hhbmdlIDNkIG1vZGVsLCBiaW5hcnkNCg0KIyBNYWdpYyBJRCBmb3IgTXVsdGlnZW4gY3JlYXRvciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMTIgYnkgQ2FybA0KMAliZXNob3J0CTEJW2ZpZD0wMDAwMDEzMzItNDAtMDAwMEZMVDtleHQ9Zmx0O21pbWU9O11PcGVuZmxpZ2h0IHNjZW5lIGRlc2NyaXB0aW9uIDNkIG1vZGVsDQomNAlzdHJpbmcJZGIJDQoNCiMgTWFnaWMgSUQgZm9yIFZpZGVvc2NhcGUgM0QgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTEyIGJ5IENhcmwNCjAJc3RyaW5nCUdPVVIJW2ZpZD0wMDAwMDEzMjgtNDAtMDAwMEdFTztleHQ9Z2VvO21pbWU9O11WaWRlb3NjYXBlIDNkIG1vZGVsIHdpdGggY29sb3JlZCB2ZXJ0aWNlcw0KDQojIE1hZ2ljIElEIGZvciBWaWRlb3NjYXBlIDNELCBCbGVuZGVyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xMiBieSBDYXJsDQowCXN0cmluZwkzREcxCVtmaWQ9MDAwMDAxMzI4LTQwLTAwMDBHRU87ZXh0PWdlbzttaW1lPTtdVmlkZW9zY2FwZSAzZCBtb2RlbCB3aXRoIGNvbG9yZWQgZmFjZXMNCg0KIyBNYWdpYyBJRCBmb3IgVmlkZW9zY2FwZSAzRCwgQmxlbmRlciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMTIgYnkgQ2FybA0KMAlzdHJpbmcJM0RHMglbZmlkPTAwMDAwMTMyOC00MC0wMDAwR0VPO2V4dD1nZW87bWltZT07XVZpZGVvc2NhcGUgM2QgbW9kZWwgbGlnaHQgc291cmNlDQoNCiMgTWFnaWMgSUQgZm9yIFZpZGVvc2NhcGUgM0QsIEJsZW5kZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTEyIGJ5IENhcmwNCjAJc3RyaW5nCTNERzMJW2ZpZD0wMDAwMDEzMjgtNDAtMDAwMEdFTztleHQ9Z2VvO21pbWU9O11WaWRlb3NjYXBlIDNkIG1vZGVsIHdpdGggZ291cmF1ZCBjdXJ2ZXMNCg0KIyBNYWdpYyBJRCBmb3IgU29mdGltYWdlIDREIENyZWF0aXZlIGVudmlyb25tZW50IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xMiBieSBDYXJsDQowCXN0cmluZwlIUkNIOglbZmlkPTAwMDAwMTMyMS00MC0wMDAwSFJDO2V4dD1ocmM7bWltZT07XVNvZnRpbWFnZSA0ZCBtb2RlbCwgYXNjaWkgZW5jb2RlZA0KDQojIE1hZ2ljIElEIGZvciBPcGVuIEludmVudG9yIFRvb2xraXQgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA2IGJ5IENhcmwNCjAJc3RyaW5nCSNJbnZlbnRvcglbZmlkPTAwMDAwMTAwNC00MC0wMDAwMElWO2V4dD1pdjttaW1lPTtdT3BlbiBJbnZlbnRvciAzZCBtb2RlbA0KPjExCXN0cmluZwl4CSwgdmVyc2lvbiAlLjFzLg0KPjEzCXN0cmluZwl4CSUuMXMNCj4xNQlzdHJpbmcJYmluYXJ5CSwgYmluYXJ5IGVuY29kZWQNCj4xNQlzdHJpbmcJYXNjaWkJLCBhc2NpaSBlbmNvZGVkDQoNCiMgTWFnaWMgSUQgZm9yIEdlb212aWV3IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xMiBieSBDYXJsDQowCXN0cmluZwlMSVNUCVtmaWQ9MDAwMTAwMTE4LTQwLTAwMExJU1Q7ZXh0PWxpc3Q7bWltZT07XUdlb212aWV3IGxpc3Qgb2YgM0QgbW9kZWxzIGFuZCBvYmplY3RzDQoNCiMgTWFnaWMgSUQgZm9yIExpZ2h0d2F2ZSAzRCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMTIgYnkgQ2FybA0KMAlzdHJpbmcJRk9STQlbZmlkPTAwMDAwMTI1MS00MC0wMDAwTFdPO2V4dD1sd28sbHdvYjttaW1lPTtdTGlnaHR3YXZlIDNEIG9iamVjdA0KJjgJc3RyaW5nCUxXTzIJDQoNCiMgTWFnaWMgSUQgZm9yIExpZ2h0d2F2ZSAzRCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDYgYnkgQ2FybA0KMAlzdHJpbmcJRk9STQlbZmlkPTAwMDAwMTI1MS00MC0wMDAwTFdPO2V4dD1sd29iLGx3bzttaW1lPTtdTGlnaHR3YXZlIDNEIG9iamVjdA0KJjgJc3RyaW5nCUxXT0IJDQoNCiMgTWFnaWMgSUQgZm9yIExpZ2h0d2F2ZSAzRCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDYgYnkgQ2FybA0KMAlzdHJpbmcJTFdTQwlbZmlkPTAwMDAwMTI1MS00MC0wMDAwTFdTO2V4dD1sd3NjLGx3czttaW1lPTtdTGlnaHR3YXZlIDNEIHNjZW5lDQoNCiMgTWFnaWMgSUQgZm9yIE1heWEgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTEyIGJ5IENhcmwNCjAJc3RyaW5nCS8vTWF5YQlbZmlkPTAwMDAwMTMxMi00MC0wMDAwME1BO2V4dD1tYTttaW1lPTtdTWF5YSAzZCBtb2RlbCwgYXNjaWkgZW5jb2RlZA0KDQojIE1hZ2ljIElEIGZvciBDaW5lbWEgNEQgVmVyc2lvbiA0LnggYW5kIGVhcmxpZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA2IGJ5IENhcmwNCjAJc3RyaW5nCUZPUk0JW2ZpZD0wMDAwMDEyNTUtNDAtMDAwTUM0RDtleHQ9bWM0ZDttaW1lPTtdTWF4b24gQ2luZW1hIDREIHY0LnggM0QgZGF0YQ0KJjgJc3RyaW5nCU1DNEQJDQoNCiMgTWFnaWMgSUQgZm9yIEdlb212aWV3IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xMiBieSBDYXJsDQowCXN0cmluZwlDTUVTSAlbZmlkPTAwMDEwMDExOC00MC0wMDBNRVNIO2V4dD1tZXNoO21pbWU9O11HZW9tdmlldyBwb2x5Z29uDQoNCiMgTWFnaWMgSUQgZm9yIEdlb212aWV3IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xMiBieSBDYXJsDQowCXN0cmluZwlNRVNICVtmaWQ9MDAwMTAwMTE4LTQwLTAwME1FU0g7ZXh0PW1lc2g7bWltZT07XUdlb212aWV3IHBvbHlnb24NCg0KIyBNYWdpYyBJRCBmb3IgTWlsc2hhcGUgM2QgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTEyIGJ5IENhcmwNCjAJc3RyaW5nCU1TM0QwMDAwMDAJW2ZpZD0wMDAxMDAxMTctNDAtMDAwTVMzRDtleHQ9bXMzZDttaW1lPTtdTWlsa3NoYXBlIDNkIG1vZGVsLCBiaW5hcnkgZW5jb2RlZA0KDQojIE1hZ2ljIElEIGZvciBXb3JsZHRvb2xraXQgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA2IGJ5IENhcmwNCjAJc3RyaW5nCW5mZglbZmlkPTAwMDAwMTI1My00MC0wMDAwTkZGO2V4dD1uZmY7bWltZT07XVNlbnNlOCBXb3JsZHRvb2xraXQgM0Qgb2JqZWN0DQoNCiMgTWFnaWMgSUQgZm9yIEF1dG9kZXNrIEFuaW1hdG9yIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xMiBieSBDYXJsDQoyCWxlbG9uZwkweDAwMDAJW2ZpZD0wMDAwMDEyNTQtNDAtMDAwMFBMWTtleHQ9cGx5O21pbWU9O11BdXRvZGVzayBhbmltYXRvciBwb2x5Z29uIGZpbGUNCiY2CWJ5dGUJMAkNCiY3CWJ5dGUJMHg5OQkNCg0KIyBNYWdpYyBJRCBmb3IgQXV0b2Rlc2sgQW5pbWF0b3IgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTEyIGJ5IENhcmwNCjIJbGVsb25nCTB4MDAwMAlbZmlkPTAwMDAwMTI1NC00MC0wMDAwUExZO2V4dD1wbHk7bWltZT07XUF1dG9kZXNrIGFuaW1hdG9yIHBvbHlnb24gZmlsZQ0KJjYJYnl0ZQkxCQ0KJjcJYnl0ZQkweDk5CQ0KDQojIE1hZ2ljIElEIGZvciBRdWljazNkIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xMiBieSBDYXJsDQowCXN0cmluZwlxdWljazNEbwlbZmlkPTAwMDAwMTMzNC00MC0wMDAwUTNPO2V4dD1xM287bWltZT07XVF1aWNrM2QgM0Qgb2JqZWN0DQoNCiMgTWFnaWMgSUQgZm9yIFF1aWNrM2QgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTEyIGJ5IENhcmwNCjAJc3RyaW5nCXF1aWNrM0RzCVtmaWQ9MDAwMDAxMzM0LTQwLTAwMDBRM1M7ZXh0PXEzczttaW1lPTtdUXVpY2szZCAzRCBzY2VuZQ0KDQojIE1hZ2ljIElEIGZvciBSZW5kZXJtYW4gZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTEyIGJ5IENhcmwNCjAJc3RyaW5nCSMjUmVuZGVyTWFuXFwgUklCLVN0cnVjdHVyZQlbZmlkPTAwMDAwMTMyMy00MC0wMDAwUklCO2V4dD1yaWI7bWltZT07XVJlbmRlcm1hbiBieXRlc3RyZWFtIDNEIG1vZGVsDQoNCiMgTWFnaWMgSUQgZm9yIFNjdWxwdCAzZCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMTIgYnkgQ2FybA0KMAlzdHJpbmcJRk9STQlbZmlkPTAwMDAwMDAwMC00MC0wMFNDRU5FO2V4dD1zY2VuZTttaW1lPTtdU2N1bHB0IDNkIHNjZW5lIG1vZGVsDQomOAlzdHJpbmcJU0MzRAkNCg0KIyBNYWdpYyBJRCBmb3IgSW1hZ2luZSAzRCBTdHVkaW8sIFR1cmJvIFNpbHZlciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDYgYnkgQ2FybA0KMAlzdHJpbmcJRk9STQlbZmlkPTAwMDAwMTI1Mi00MC0wMDBUREREO2V4dD10ZGRkLG9iajttaW1lPTtdSW1hZ2luZSAzRCBvYmplY3QNCiY4CXN0cmluZwlURERECQ0KDQojIE1hZ2ljIElEIGZvciBNYWNyb21lZGlhIERpcmVjdG9yIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xMiBieSBDYXJsDQowCXN0cmluZwlJRlgJW2ZpZD0wMDAwMDEyNTktNDAtMDAwMFczRDtleHQ9dzNkO21pbWU9O11TaG9ja3dhdmUgM0QgbW9kZWwNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0wNiBieSBDYXJsDQowCXN0cmluZwkjVlJNTAlbZmlkPTAwMDAwMDAwMS00MC0wMDE0NzcyO2V4dD13cmw7bWltZT1tb2RlbC92cm1sO11WaXJ0dWFsIFJlYWxpdHkgbW9kZWxpbmcgbGFuZ3VhZ2UNCj43CXN0cmluZwl4CSwgdmVyc2lvbiAlLjFzLg0KPjkJc3RyaW5nCXgJJS4xcw0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTEyIGJ5IENhcmwNCjAJc3RyaW5nCTxXT1JMRD4JW2ZpZD0wMDAwMDAwMDAtNDAtMDAwMFhHTDtleHQ9eGdsO21pbWU9O11YR0wgM2QgbW9kZWwNCg0KIyBNYWdpYyBJRCBmb3IgRGlyZWN0M0QgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA0LTExIGJ5IENhcmwNCjAJc3RyaW5nCXhvZlxcIAlbZmlkPTAwMDAwMTAwMS00MC0wMDAwWElFO2V4dD14aWU7bWltZT07XU1pY3Jvc29mdCBkaXJlY3QzZCAzRCBtb2RlbA0KDQojIE1hZ2ljIElEIGZvciBTb2Z0aW1hZ2UgWFNJIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xMiBieSBDYXJsDQowCXN0cmluZwl4c2lcXCAJW2ZpZD0wMDAwMDEzMjEtNDAtMDAwMFhTSTtleHQ9eHNpO21pbWU9O11Tb2Z0aW1hZ2UgM2QgbW9kZWwNCg0KIyBNYWdpYyBJRCBmb3IgS2Fib29tIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0wOCBieSBDYXJsDQowCXN0cmluZwlcXHhBOE1QXFx4QTgJW2ZpZD0wMDAwMDAwMDAtNTAtMDAwMDAwMDtleHQ9O21pbWU9O11LYm9vbSBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgQ1RXIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0wNCBieSBDYXJsDQowCWxlc2hvcnQJMTIJW2ZpZD0wMDAxMDAwNzctNTAtMDAwMDAwMDtleHQ9O21pbWU9O11Db250ZXh0IHRyZWUgd2VpZ2hpbmcgKENUVykgYXJjaGl2ZSBmaWxlDQomMglsZXNob3J0CTAJDQoNCiMgTWFnaWMgSUQgZm9yIE1pY3Jvc29mdCBDb21wcmVzcyBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMDQgYnkgQ2FybA0KMAlzdHJpbmcJU1pERFxceDg4XFx4RjBcXHgyN1xceDMzCVtmaWQ9MDAwMDAxMDAxLTUwLTAwMDAwMDA7ZXh0PTttaW1lPTtdTWljcm9zb2Z0IExaU1MgY29tcHJlc3NlZCBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIEFBWCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTggYnkgQ2FybA0KMAlzdHJpbmcJXFx4NDBcXHhGRVxceDAwXFx4MDAJW2ZpZD0wMDAwMDEyODEtNTAtMDAwMEFBWDtleHQ9YWF4O21pbWU9O11BQVggYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIEFCQ29tcCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTggYnkgQ2FybA0KMAlzdHJpbmcJXFx4MDNBQjIJW2ZpZD0wMDAwMDEyODItNTAtMDAwMEFCUDtleHQ9YWJwO21pbWU9O11BQkNvbXAgYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIEFjZSAvIFdpbkFjZSBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KNwlzdHJpbmcJKipBQ0UqKglbZmlkPTAwMDAwMTI2NS01MC0wMDAwQUNFO2V4dD1hY2U7bWltZT07XUFjZSAvIFdpbkFDRSBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgQWkgQXJjaGl2ZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE4IGJ5IENhcmwNCjAJc3RyaW5nCUFpCVtmaWQ9MDAwMDAwMDAwLTUwLTAwMDAwQUk7ZXh0PWFpO21pbWU9O11BaSBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgQWt0IGFyY2hpdmVyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xOCBieSBDYXJsDQowCXN0cmluZwlBS1RcXHgwQQlbZmlkPTAwMDAwMDAwMC01MC0wMDAwQUtUO2V4dD1ha3Q7bWltZT07XUFLVCBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgQU1HIEFyY2hpdmVyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xOCBieSBDYXJsDQowCXN0cmluZwlcXHhBRFxceDM2CVtmaWQ9MDAwMDAxMjg0LTUwLTAwMDBBTUc7ZXh0PWFtZzttaW1lPTtdQU1HIGFyY2hpdmUgZmlsZQ0KPjIJYnl0ZQl4CSwgdmVyc2lvbiAlYmguDQo+MglieXRlCXgJJWJsDQomMwlieXRlCTAJDQoNCiMgTWFnaWMgSUQgZm9yIGFyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0wNCBieSBDYXJsDQowCXN0cmluZwlcXHgyMTxhcmNoPlxceDBBCVtmaWQ9MDAwMDAwMDAzLTUwLTAwMDAwQVI7ZXh0PWFyO21pbWU9O11VTklYIGFyY2hpdmUgZmlsZSAoYXIpDQoNCiMgTWFnaWMgSUQgZm9yIEFSNyBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTggYnkgQ2FybA0KMAlzdHJpbmcJLEFSNyBlLW1haWxhYmxlIGFyY2hpdmU6CVtmaWQ9MDAwMTAwMDM2LTUwLTAwMDBBUjc7ZXh0PWFyNzttaW1lPTtdQVI3IGFyY2hpdmUgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBTcXVhc2ggZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE4IGJ5IENhcmwNCjMJc3RyaW5nCU9jdFNxdQlbZmlkPTAwMDEwMDAzOC01MC0wMDAwQVJIO2V4dD1hcmg7bWltZT07XVNxdWFzaCBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgQXJqIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xOCBieSBDYXJsDQowCXN0cmluZwlcXHg2MFxceEVBCVtmaWQ9MDAwMDAxMjg1LTUwLTAwMDBBUko7ZXh0PWFyajttaW1lPTtdQVJKIGFyY2hpdmUgZmlsZQ0KJjEwCWJ5dGUJMgkNCg0KIyBNYWdpYyBJRCBmb3IgQVNEIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xOCBieSBDYXJsDQowCXN0cmluZwlBU0QwMVxceDFBCVtmaWQ9MDAwMDAxMjg3LTUwLTAwMDBBU0Q7ZXh0PWFzZDttaW1lPTtdQVNEIGFyY2hpdmUgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBCb2EgY29uc3RyaWN0b3IgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE4IGJ5IENhcmwNCjAJc3RyaW5nCUJPQVxceDAwCVtmaWQ9MDAwMTAwMDQwLTUwLTAwMDBCNTg7ZXh0PWI1ODttaW1lPTtdQk9BIGNvbnN0cmljdG9yIGFyY2hpdmUgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBCV0MgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE4IGJ5IENhcmwNCjAJc3RyaW5nCUJXQwlbZmlkPTAwMDEwMDA0Mi01MC0wMDAwMEJDO2V4dD1iYzttaW1lPTtdQldDIGFyY2hpdmUgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBCaXggZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE4IGJ5IENhcmwNCjAJc3RyaW5nCUJJWDAJW2ZpZD0wMDAxMDAwMzctNTAtMDAwMEJJWDtleHQ9Yml4O21pbWU9O11CSVggYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIEJ0b2EgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE4IGJ5IENhcmwNCjAJc3RyaW5nCXhidG9hNQlbZmlkPTAwMDEwMDA0My01MC0wMDAwQk9PO2V4dD1ib287bWltZT07XUJ0b2EgZW5jb2RlZCBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIEJzYSBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTggYnkgQ2FybA0KMAlzdHJpbmcJXFx4RkZCU0dcXHgwMFxceDAwXFx4RkZCU0EJW2ZpZD0wMDAwMDEyODktNTAtMDAwMEJTTjtleHQ9YnNuO21pbWU9O11Cc2EgYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIEJUUEMgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAzLTAzIGJ5IENhcmwNCjAJc3RyaW5nCWJ0cGNcXCAJW2ZpZD0wMDAxMDAwNzQtNTAtMDAwQlRQQztleHQ9YnRwYzttaW1lPTtdQlRQQyBjb21wcmVzc2VkIGltYWdlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgQlRTIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xOCBieSBDYXJsDQowCXN0cmluZwlcXHgxQVxceDAzRGVzY3JpcHQJW2ZpZD0wMDAxMDAwNDQtNTAtMDAwMEJUUztleHQ9YnRzO21pbWU9O11CVFNwayBhcmNoaXZlIGZpbGUNCiYweDUyMQlzdHJpbmcJQlRTUEshCQ0KDQojIE1hZ2ljIElEIGZvciBCemlwIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xOCBieSBDYXJsDQowCXN0cmluZwlCWjAJW2ZpZD0wMDAxMDAwMDgtNTAtMDAwMDBCWjtleHQ9Yno7bWltZT07XUJ6aXAgYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIEJ6aXAyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0wOCBieSBDYXJsDQowCXN0cmluZwlCWmgJW2ZpZD0wMDAxMDAwMDgtNTAtMDAwMEJaMjtleHQ9YnoyO21pbWU9O11CemlwMiBhcmNoaXZlIGZpbGUNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0wOCBieSBDYXJsDQowCXN0cmluZwlNU0NGCVtmaWQ9MDAwMDAxMDAxLTUwLTAwMDBDQUI7ZXh0PWNhYjttaW1lPTtdTWljcm9zb2Z0IENhYmluZXQgZmlsZQ0KPjI1CWJ5dGUJeAksIHZlcnNpb24gJWQuDQo+MjQJYnl0ZQl4CSVkDQoNCiMgTWFnaWMgSUQgZm9yIENydXNoIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0yMyBieSBDYXJsDQowCXN0cmluZwlDUlVTSFxcIHYxLjgJW2ZpZD0wMDAwMDEyOTAtNTAtMDAwMENSVTtleHQ9Y3J1O21pbWU9O11DcnVzaCBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgQ3R4ZiBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMjMgYnkgQ2FybA0KMAlzdHJpbmcJQ1hGXFx4MUEJW2ZpZD0wMDAxMDAwNDUtNTAtMDAwMENYRjtleHQ9Y3hmO21pbWU9O11DdHggYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIERBWFdhdiBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMDQgYnkgQ2FybA0KMAlzdHJpbmcJRk9STQlbZmlkPTAwMDAwMDAwMC01MC0wMDAwREFYO2V4dD1kYXg7bWltZT07XURBWCBhdWRpbyBhcmNoaXZlIGZpbGUNCiY4CXN0cmluZwlkYXhBCQ0KDQojIE1hZ2ljIElEIGZvciBEaXNrbWFzaGVyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0yMyBieSBDYXJsDQowCXN0cmluZwlETVMhCVtmaWQ9MDAwMDAwMDAwLTUwLTAwMDBETVM7ZXh0PWRtczttaW1lPTtdRGlza21hc2hlciBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgRHBhZSBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMjMgYnkgQ2FybA0KMAlzdHJpbmcJRGlya1xcIFBhZWhsKGMpCVtmaWQ9MDAwMTAwMDQ2LTUwLTAwMDBEUEE7ZXh0PWRwYTttaW1lPTtdRHBhZSBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgRGlzaW50ZWdyYXRvciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMjMgYnkgQ2FybA0KMAlzdHJpbmcJRFNUYglbZmlkPTAwMDEwMDA0Ny01MC0wMDAwRFNUO2V4dD1kc3Q7bWltZT07XURpc2ludGVncmF0b3IgYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIEVuaGFuY2VkIGNvbXByZXNzb3IgKEVOQykgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTIzIGJ5IENhcmwNCjAJc3RyaW5nCUVuY2gJW2ZpZD0wMDAxMDAwNTEtNTAtMDAwMEVOQztleHQ9ZW5jO21pbWU9O11FbmhhbmNlZCBjb21wcmVzc29yIGFyY2hpdmUgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBFU1AgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA4IGJ5IENhcmwNCjAJc3RyaW5nCUVTUD4JW2ZpZD0wMDAxMDAwMDItNTAtMDAwMEVTUDtleHQ9ZXNwO21pbWU9O11FU1AgYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIEVTUCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KMHg1M2YJc3RyaW5nCUVTUAlbZmlkPTAwMDEwMDAwMi01MC0wMDAwRVhFO2V4dD1leGU7bWltZT07XUVTUCBTZWxmLWV4dHJhY3RpbmcgYXJjaGl2ZXcgKE1TLURPUykNCg0KIyBNYWdpYyBJRCBmb3IgRnJlZXplIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQowCXN0cmluZwlcXHgxRlxceDlFCVtmaWQ9MDAwMDAwMDAwLTUwLTAwMDAwMEY7ZXh0PWY7bWltZT07XUZyZWV6ZSBhcmNoaXZlIGZpbGUsIHZlcnNpb24gMS4wDQoNCiMgTWFnaWMgSUQgZm9yIEZyZWV6ZSBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTEgYnkgQ2FybA0KMAlzdHJpbmcJXFx4MUZcXHg5RglbZmlkPTAwMDAwMDAwMC01MC0wMDAwMDBGO2V4dD1mO21pbWU9O11GcmVlemUgYXJjaGl2ZSBmaWxlLCB2ZXJzaW9uIDIuMA0KDQojIE1hZ2ljIElEIGZvciBRbGZjIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0yMyBieSBDYXJsDQowCXN0cmluZwlcXHg0N1xceDY4XFx4NjlcXHg2NFxceDZmCVtmaWQ9MDAwMTAwMDU1LTUwLTAwMDAwR1E7ZXh0PWdxO21pbWU9O11RbGZjIGFyY2hpdmUgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBHemlwIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0wOCBieSBDYXJsDQowCXN0cmluZwlcXHgxRlxceDhCCVtmaWQ9MDAwMDAwMDAyLTUwLTAwMDE5NTI7ZXh0PWd6O21pbWU9O11HemlwIGFyY2hpdmUgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBIYSBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTAgYnkgQ2FybA0KMAlzdHJpbmcJSEEJW2ZpZD0wMDAxMDAwMTMtNTAtMDAwMDBIQTtleHQ9aGE7bWltZT07XUhBIGFyY2hpdmUgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBIQVAgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTIzIGJ5IENhcmwNCjAJc3RyaW5nCVxceDkxM0hGCVtmaWQ9MDAwMDAxMjkxLTUwLTAwMDBIQVA7ZXh0PWhhcDttaW1lPTtdSEFQIGFyY2hpdmUgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBIcGFjayBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTEgYnkgQ2FybA0KMAlzdHJpbmcJSFBBSwlbZmlkPTAwMDEwMDAxNi01MC0wMDAwSFBLO2V4dD1ocGs7bWltZT07XUhwYWNrIGFyY2hpdmUgZmlsZQ0KJlo0CXN0cmluZwlIUEFLCQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTEwIGJ5IENhcmwNCjExCXN0cmluZwltdXN0XFwgYmVcXCBjb252ZXJ0ZWRcXCB3aXRoXFwgQmluSGV4CVtmaWQ9MDAwMDAxMDAyLTUwLTAwMDBIUVg7ZXh0PWhxeDttaW1lPTtdQmluSGV4IGFyY2hpdmUNCg0KIyBNYWdpYyBJRCBmb3IgSFlQIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0yMyBieSBDYXJsDQowCXN0cmluZwlcXHgxQUhQXFx4MjUJW2ZpZD0wMDAxMDAwNTYtNTAtMDAwMEhZUDtleHQ9aHlwO21pbWU9O11IWVAgYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIEhZUCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMjMgYnkgQ2FybA0KMAlzdHJpbmcJXFx4MUFTVFxceDI1CVtmaWQ9MDAwMTAwMDU2LTUwLTAwMDBIWVA7ZXh0PWh5cDttaW1lPTtdSFlQIGFyY2hpdmUgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBXaW5pbXAgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA4IGJ5IENhcmwNCjAJbGVsb25nCTB4QTUwNEQ0OQlbZmlkPTAwMDAwMTI3MC01MC0wMDAwSU1QO2V4dD1pbXA7bWltZT07XVdpbmltcCBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgSlJjaGl2ZSBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KMAlzdHJpbmcJSlJjaGl2ZQlbZmlkPTAwMDAwMTI2My01MC0wMDAwSlJDO2V4dD1qcmM7bWltZT07XUpSY2hpdmUgYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIEFyY2hpdmUgSGFuZGxlciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KMAlzdHJpbmcJTEcJW2ZpZD0wMDAxMDAwMDEtNTAtMDAwMDBMRztleHQ9bGc7bWltZT07XUFyaGFuZ2VsIGFyY2hpdmUgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBMaW1pdCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KMAlzdHJpbmcJTE1cXHgxQQlbZmlkPTAwMDEwMDAwMy01MC0wMDAwTElNO2V4dD1saW07bWltZT07XUxpbWl0IGFyY2hpdmUgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBMYXJjIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQoyCXN0cmluZwktbHo0LQlbZmlkPTAwMDEwMDAxNy01MC0wMDAwTFpIO2V4dD1semg7bWltZT07XUxhcmMgYXJjaGl2ZQ0KDQojIE1hZ2ljIElEIGZvciBMYXJjIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQoyCXN0cmluZwktbHo1LQlbZmlkPTAwMDEwMDAxNy01MC0wMDAwTFpIO2V4dD1semg7bWltZT07XUxhcmMgYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIExhcmMgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IENhcmwNCjIJc3RyaW5nCS1senMtCVtmaWQ9MDAwMTAwMDE3LTUwLTAwMDBMWkg7ZXh0PWx6aDttaW1lPTtdTGFyYyBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgbGhhIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQoyCXN0cmluZwktbGhcXCAtCVtmaWQ9MDAwMTAwMDE3LTUwLTAwMDBMWkg7ZXh0PWx6aCxsaGE7bWltZT07XUxIYXJjIGFyY2hpdmUgZmlsZSwgdmVyc2lvbiAyLngNCg0KIyBNYWdpYyBJRCBmb3IgbGhhIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQoyCXN0cmluZwktbGgwLQlbZmlkPTAwMDEwMDAxNy01MC0wMDAwTFpIO2V4dD1semgsbGhhO21pbWU9O11MSGFyYyBhcmNoaXZlIGZpbGUsIHZlcnNpb24gMS54DQoNCiMgTWFnaWMgSUQgZm9yIGxoYSBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTEgYnkgQ2FybA0KMglzdHJpbmcJLWxoMS0JW2ZpZD0wMDAxMDAwMTctNTAtMDAwMExaSDtleHQ9bHpoLGxoYTttaW1lPTtdTEhhcmMgYXJjaGl2ZSBmaWxlLCB2ZXJzaW9uIDEueA0KDQojIE1hZ2ljIElEIGZvciBsaGEgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IENhcmwNCjIJc3RyaW5nCS1saDItCVtmaWQ9MDAwMTAwMDE3LTUwLTAwMDBMWkg7ZXh0PWx6aCxsaGE7bWltZT07XUxIYXJjIGFyY2hpdmUgZmlsZSwgdmVyc2lvbiAyLngNCg0KIyBNYWdpYyBJRCBmb3IgbGhhIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQoyCXN0cmluZwktbGgzLQlbZmlkPTAwMDEwMDAxNy01MC0wMDAwTFpIO2V4dD1semgsbGhhO21pbWU9O11MSGFyYyBhcmNoaXZlIGZpbGUsIHZlcnNpb24gMi54DQoNCiMgTWFnaWMgSUQgZm9yIGxoYSBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTEgYnkgQ2FybA0KMglzdHJpbmcJLWxoNC0JW2ZpZD0wMDAxMDAwMTctNTAtMDAwMExaSDtleHQ9bHpoLGxoYTttaW1lPTtdTEhhcmMgYXJjaGl2ZSBmaWxlLCB2ZXJzaW9uIDIueA0KDQojIE1hZ2ljIElEIGZvciBsaGEgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IENhcmwNCjIJc3RyaW5nCS1saDUtCVtmaWQ9MDAwMTAwMDE3LTUwLTAwMDBMWkg7ZXh0PWx6aCxsaGE7bWltZT07XUxIYXJjIGFyY2hpdmUgZmlsZSwgdmVyc2lvbiAyLngNCg0KIyBNYWdpYyBJRCBmb3IgbGhhIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQoyCXN0cmluZwktbGg2LQlbZmlkPTAwMDEwMDAxNy01MC0wMDAwTFpIO2V4dD1semgsbGhhO21pbWU9O11MSGFyYyBhcmNoaXZlIGZpbGUsIHZlcnNpb24gMi54DQoNCiMgTWFnaWMgSUQgZm9yIGxoYSBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTEgYnkgQ2FybA0KMglzdHJpbmcJLWxoNy0JW2ZpZD0wMDAxMDAwMTctNTAtMDAwMExaSDtleHQ9bHpoLGxoYTttaW1lPTtdTEhhcmMgYXJjaGl2ZSBmaWxlLCB2ZXJzaW9uIDIueA0KDQojIE1hZ2ljIElEIGZvciBsaGEgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IENhcmwNCjIJc3RyaW5nCS1saGQtCVtmaWQ9MDAwMTAwMDE3LTUwLTAwMDBMWkg7ZXh0PWx6aCxsaGE7bWltZT07XUxIYXJjIGFyY2hpdmUgZmlsZSwgdmVyc2lvbiAyLngNCg0KIyBNYWdpYyBJRCBmb3IgbHpvIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQowCXN0cmluZwlcXHg4OVxceDRjXFx4NWFcXHg0ZlxceDAwXFx4MGRcXHgwYVxceDFhXFx4MGEJW2ZpZD0wMDAxMDAwMTgtNTAtMDAwMExaTztleHQ9bHpvO21pbWU9O11MWk9QIGFyY2hpdmUgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBMenggZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTIzIGJ5IENhcmwNCjAJc3RyaW5nCUxaWAlbZmlkPTAwMDEwMDA1OC01MC0wMDAwTFpYO2V4dD1seng7bWltZT07XUxaWCBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgTWRjZCAoTWlrZSBEYXZlbnBvcnQgY29tcHJlc3NvcikgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA4IGJ5IENhcmwNCjAJc3RyaW5nCU1EbWQJW2ZpZD0wMDAxMDAwMDQtNTAtMDAwMDBNRDtleHQ9bWQ7bWltZT07XU1pa2UgRGF2ZW5wb3J0IGFyY2hpdmUgZmlsZQ0KPjQJYnl0ZQl4CSwgdmVyc2lvbiAlZA0KJjUJYnl0ZQkxCQ0KDQojIE1hZ2ljIElEIGZvciBOYXNocmluayBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMjMgYnkgQ2FybA0KMAlzdHJpbmcJTlNLCVtmaWQ9MDAwMDAxMjkyLTUwLTAwMDBOU0s7ZXh0PW5zazttaW1lPTtdTmFTaHJpbmsgYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIFNlbW9uZSBhcmNoaXZlciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMjcgYnkgQ2FybA0KMAlzdHJpbmcJU0VNaAlbZmlkPTAwMDEwMDA2OC01MC0wMDAwT05FO2V4dD1vbmU7bWltZT07XVNlbW9uZSBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgTHBhYyBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMDQgYnkgQ2FybA0KMAlzdHJpbmcJTFBBQwlbZmlkPTAwMDEwMDA4NC01MC0wMDAwUEFDO2V4dD1wYWM7bWltZT07XUxQQUMgYXVkaW8gYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIENyb3NzZVBBQyBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KMAlzdHJpbmcJRFNJR0RDQwlbZmlkPTAwMDAwMTI2Mi01MC0wMDAwUEFDO2V4dD1wYWM7bWltZT07XUNyb3NzZVBBQyBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgSGlnaCBDb21wcmVzc2lvbiBNYXJrb3YgUHJlZGljdGl2ZSBDb2RlciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMjMgYnkgQ2FybA0KMAlzdHJpbmcJUFBaMglbZmlkPTAwMDEwMDA2MS01MC0wMDAwUE1aO2V4dD1wbXo7bWltZT07XVBQTVoyIGFyY2hpdmUgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBQb3dlcnBhY2tlciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMjcgYnkgQ2FybA0KMAlzdHJpbmcJUFAyMAlbZmlkPTAwMDEwMDA2Mi01MC0wMDAwMFBQO2V4dD1wcDttaW1lPTtdUG93ZXJwYWNrZXIgYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIFBBUTEgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTI3IGJ5IENhcmwNCjAJc3RyaW5nCVBBUTFcXHgwRFxceDBBCVtmaWQ9MDAwMTAwMDY0LTUwLTAwMDBQUTE7ZXh0PXBxMTttaW1lPTtdUEFRMSBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgUEFRMyBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMjcgYnkgQ2FybA0KMAlzdHJpbmcJUEFRM1xceDBEXFx4MEEJW2ZpZD0wMDAxMDAwNjQtNTAtMDAwMFBRMztleHQ9cHEzO21pbWU9O11QQVEzIGFyY2hpdmUgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBQQVE2IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0yNyBieSBDYXJsDQowCXN0cmluZwlQQVE2CVtmaWQ9MDAwMTAwMDY0LTUwLTAwMDBQUTY7ZXh0PXBxNjttaW1lPTtdUEFRNiBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgUHJldHR5IHNpbXBsZSBhcmNoaXZlciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMjcgYnkgQ2FybA0KMAlzdHJpbmcJUFNBXFx4MDFcXHgwMwlbZmlkPTAwMDEwMDA2NS01MC0wMDAwUFNBO2V4dD1wc2E7bWltZT07XVByZXR0eSBzaW1wbGUgYXJjaGl2ZXIgYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIFF1YW50dW0gY29tcHJlc3NvciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMjcgYnkgQ2FybA0KMAlzdHJpbmcJRFMJW2ZpZD0wMDAwMDEyOTQtNTAtMDAwMDAwUTtleHQ9cTttaW1lPTtdUXVhbnR1bSBhcmNoaXZlIGZpbGUNCiYyCWJ5dGUJPDIJDQo+MglieXRlCXgJLCB2ZXJzaW9uICVkDQo+MwlieXRlCXgJLiVkDQoNCiMgTWFnaWMgSUQgZm9yIFJhciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KMAlzdHJpbmcJXFx4NTJcXHg2MVxceDcyXFx4MjFcXHgxYVxceDA3XFx4MDAJW2ZpZD0wMDAwMDEyNjctNTAtMDAwMFJBUjtleHQ9cmFyO21pbWU9O11SQVIgYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIFJvbWFuaWFuIGFyY2hpdmVyIGVYcGVydCAoUkFYKSBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMjcgYnkgQ2FybA0KMAlzdHJpbmcJVUxFQglbZmlkPTAwMDAwMTI5NS01MC0wMDAwUkFYO2V4dD1yYXg7bWltZT07XVJBWCBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgUmVkdXEgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTI3IGJ5IENhcmwNCjAJc3RyaW5nCXJkcXgJW2ZpZD0wMDAxMDAwNjYtNTAtMDAwMFJEUTtleHQ9cmRxO21pbWU9O11SZWR1cSBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgUlBNIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0wNCBieSBDYXJsDQowCXN0cmluZwlcXHhlZFxceGFiXFx4ZWVcXHhkYglbZmlkPTAwMDAwMDAwMC01MC0wMDAwUlBNO2V4dD1ycG07bWltZT07XVJQTSBhcmNoaXZlDQo+NAlieXRlCXgJLCB2ZXJzaW9uICVkDQo+NQlieXRlCXgJLiVkDQoNCiMgTWFnaWMgSUQgZm9yIHJ6aXAgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAzLTA0IGJ5IENhcmwNCjAJc3RyaW5nCVJaSVAJW2ZpZD0wMDAxMDAwNzYtNTAtMDAwMDBSWjtleHQ9cno7bWltZT07XVJ6aXAgYXJjaGl2ZSBmaWxlDQo+NAlieXRlCXgJLCB2ZXJzaW9uICVkDQo+NQlieXRlCXgJLiVkDQoNCiMgTWFnaWMgSUQgZm9yIFN0cmVhbWxpbmUgQXJjaGl2YWwgVXRpbGl0eSBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KMwlzdHJpbmcJTEgwCVtmaWQ9MDAwMDAxMjY0LTUwLTAwMDBTQVI7ZXh0PXNhcjttaW1lPTtdU3RyZWFtaW5nIEFyY2hpdmVyIFV0aWxpdHkgYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIFN0cmVhbWxpbmUgQXJjaGl2YWwgVXRpbGl0eSBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KMwlzdHJpbmcJTEg0CVtmaWQ9MDAwMDAxMjY0LTUwLTAwMDBTQVI7ZXh0PXNhcjttaW1lPTtdU3RyZWFtaW5nIEFyY2hpdmVyIFV0aWxpdHkgYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIFN0cmVhbWxpbmUgQXJjaGl2YWwgVXRpbGl0eSBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KMwlzdHJpbmcJTEg1CVtmaWQ9MDAwMDAxMjY0LTUwLTAwMDBTQVI7ZXh0PXNhcjttaW1lPTtdU3RyZWFtaW5nIEFyY2hpdmVyIFV0aWxpdHkgYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIFNCWCBBcmNoaXZlciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMjcgYnkgQ2FybA0KMAlzdHJpbmcJU0IxXFx4MDAJW2ZpZD0wMDAwMDEyOTctNTAtMDAwMDBTQjtleHQ9c2I7bWltZT07XVNCWCBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgU0JDIEFyY2hpdmVyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0yNyBieSBDYXJsDQowCXN0cmluZwlTQkNcXHgxRQlbZmlkPTAwMDEwMDA2Ny01MC0wMDAwU0JDO2V4dD1zYmM7bWltZT07XVNCQyBhcmNoaXZlIGZpbGUNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMCBieSBDYXJsDQoxMAlzdHJpbmcJI1xcIFRoaXNcXCBpc1xcIGFcXCBzaGVsbFxcIGFyY2hpdmUJW2ZpZD0wMDAwMDAwMDAtNTAtMDAwU0hBUjtleHQ9c2hhcjttaW1lPTtdVU5JWCBzaGVsbCBhcmNoaXZlDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTAgYnkgQ2FybA0KMTEJc3RyaW5nCSNcXCBUaGlzXFwgaXNcXCBhXFwgc2hlbGxcXCBhcmNoaXZlCVtmaWQ9MDAwMDAwMDAwLTUwLTAwMFNIQVI7ZXh0PXNoYXI7bWltZT07XVVOSVggc2hlbGwgYXJjaGl2ZQ0KDQojIE1hZ2ljIElEIGZvciBOdWxpYiBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KMAlzdHJpbmcJXFx4NGVcXHhmNVxceDQ2XFx4ZDgJW2ZpZD0wMDAxMDAwMDUtNTAtMDAwMFNISztleHQ9c2hrO21pbWU9O11TaHJpbmtpdC9OdWxpYiBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgTnVsaWIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA4IGJ5IENhcmwNCjAJc3RyaW5nCVxceDRlXFx4ZjVcXHg0NlxceGU5XFx4NmNcXHhlNQlbZmlkPTAwMDEwMDAwNS01MC0wMDAwU0hLO2V4dD1zaGs7bWltZT07XVNocmlua2l0L051bGliIGFyY2hpdmUgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBTdHVmZml0IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0wNCBieSBDYXJsDQowCXN0cmluZwlTdHVmZkl0XFwgCVtmaWQ9MDAwMDAxMjcyLTUwLTAwMDBTSVQ7ZXh0PXNpdDttaW1lPTtdU3R1ZmZpdCBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgU3R1ZmZpdCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTEgYnkgQ2FybA0KMAlzdHJpbmcJU0lUIQlbZmlkPTAwMDAwMTI3Mi01MC0wMDAwU0lUO2V4dD1zaXQ7bWltZT07XVN0dWZmaXQgYXJjaGl2ZSBmaWxlDQomMTAJc3RyaW5nCXJMYXUJDQo+MTQJYnl0ZQl4CSwgdmVyc2lvbiAlZC4wDQoNCiMgTWFnaWMgSUQgZm9yIFN0dWZmaXQgRXh0ZW5kZWQgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAzLTA0IGJ5IENhcmwNCjAJc3RyaW5nCVN0dWZmSXQhCVtmaWQ9MDAwMDAxMjcyLTUwLTAwMFNJVFg7ZXh0PXNpdHg7bWltZT07XVN0dWZmaXQgZXh0ZW5kZWQgYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIFNvZiBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDMtMDQgYnkgQ2FybA0KMAlzdHJpbmcJUEtcXHgwM1xceDA2CVtmaWQ9MDAwMDAwMDAwLTUwLTAwMDBTT0Y7ZXh0PXNvZjttaW1lPTtdU09GIGFyY2hpdmUgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBTcGxpbnQgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA4IGJ5IENhcmwNCjAJc3RyaW5nCVxceDkzXFx4QjlcXHgwNglbZmlkPTAwMDEwMDAwNi01MC0wMDAwU1BMO2V4dD1zcGw7bWltZT07XVNwbGludCBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgU3F3ZWV6IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMCBieSBDYXJsDQowCXN0cmluZwlTUVdFWlxcIAlbZmlkPTAwMDEwMDAxNC01MC0wMDAwU1FaO2V4dD1zcXo7bWltZT07XVNxd2V6IGFyY2hpdmUgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBTcXogZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTEwIGJ5IENhcmwNCjAJc3RyaW5nCUhMU1FaCVtmaWQ9MDAwMTAwMDE1LTUwLTAwMDBTUVo7ZXh0PXNxejttaW1lPTtdU3F1ZWV6ZSBhcmNoaXZlIGZpbGUNCj41CXN0cmluZwl4CSwgdmVyc2lvbiAlLjFzLjANCg0KIyBNYWdpYyBJRCBmb3IgU3RvbmVjcmFja2VyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0yNyBieSBDYXJsDQowCXN0cmluZwlTNDAxCVtmaWQ9MDAwMTAwMDYzLTUwLTAwMDBTVEM7ZXh0PXN0YzttaW1lPTtdU3RvbmVjcmFja2VyIGFyY2hpdmUgZmlsZQ0KPjAJc3RyaW5nCVM0MDEJLCB2ZXJzaW9uIDQuMDENCg0KIyBNYWdpYyBJRCBmb3IgU3RvbmVjcmFja2VyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0yNyBieSBDYXJsDQowCXN0cmluZwlTNDAzCVtmaWQ9MDAwMTAwMDYzLTUwLTAwMDBTVEM7ZXh0PXN0YzttaW1lPTtdU3RvbmVjcmFja2VyIGFyY2hpdmUgZmlsZQ0KPjAJc3RyaW5nCVM0MDMJLCB2ZXJzaW9uIDQuMDMNCg0KIyBNYWdpYyBJRCBmb3IgU3RvbmVjcmFja2VyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0yNyBieSBDYXJsDQowCXN0cmluZwlTNDA0CVtmaWQ9MDAwMTAwMDYzLTUwLTAwMDBTVEM7ZXh0PXN0YzttaW1lPTtdU3RvbmVjcmFja2VyIGFyY2hpdmUgZmlsZQ0KPjAJc3RyaW5nCVM0MDQJLCB2ZXJzaW9uIDQuMDQNCg0KIyBNYWdpYyBJRCBmb3IgU3ppcCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KMAlzdHJpbmcJU1pcXHgwQVxceDA0CVtmaWQ9MDAwMTAwMDA5LTUwLTAwMDAwU1o7ZXh0PXN6O21pbWU9O11TWklQIGFyY2hpdmUgZmlsZQ0KPjQJYnl0ZQl4CSwgdmVyc2lvbiAlZA0KPjUJYnl0ZQl4CS4lZA0KDQojIE1hZ2ljIElEIGZvciBUYXIscGF4IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMCBieSBDYXJsDQoyNTcJc3RyaW5nCXVzdGFyXFwwNDBcXDA0MFxcMAlbZmlkPTAwMDAwMDAwMC01MC0wMDAwVEFSO2V4dD10YXI7bWltZT07XUdOVSB0YXIgYXJjaGl2ZQ0KDQojIE1hZ2ljIElEIGZvciBUYXIscGF4IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMCBieSBDYXJsDQoyNTcJc3RyaW5nCXVzdGFyXFwwXFx4MDYJW2ZpZD0wMDAwMDAwMDMtNTAtMDAwMTAwMztleHQ9dGFyO21pbWU9O11PcGVuZ3JvdXAvUE9TSVggdGFyIGFyY2hpdmUNCg0KIyBNYWdpYyBJRCBmb3IgdWMyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMCBieSBDYXJsDQowCXN0cmluZwlVQzJcXHgxYQlbZmlkPTAwMDAwMTI3MS01MC0wMDAwVUMyO2V4dD11YzI7bWltZT07XVVsdHJhIENvbXByZXNzb3IgYXJjaGl2ZSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIFVoYXJjIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0wNCBieSBDYXJsDQowCXN0cmluZwlVSEEJW2ZpZD0wMDAxMDAwODMtNTAtMDAwMFVIQTtleHQ9dWhhO21pbWU9O11VSEFyYyBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgWUJTIGFyY2hpdmVyIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0yNyBieSBDYXJsDQowCXN0cmluZwlZQlMzCVtmaWQ9MDAwMTAwMDcxLTUwLTAwMDBZQlM7ZXh0PXliczttaW1lPTtdWUJTIGFyY2hpdmUgZmlsZQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IENhcmwNCjAJc3RyaW5nCVxcMDM3XFwyMzUJW2ZpZD0wMDAwMDAwMDAtNTAtMDAwMDAwWjtleHQ9ejttaW1lPTtdVU5JWCBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgUGt1bnppcCwgSW5mby16aXAgVW56aXAgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA4IGJ5IENhcmwNCjAJbGVsb25nCTB4MDQwMzRiNTAJW2ZpZD0wMDAwMDEyNjYtNTAtMDAwMFpJUDtleHQ9emlwO21pbWU9YXBwbGljYXRpb24vemlwO11Qa3ppcCBhcmNoaXZlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3Igem9vIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMCBieSBDYXJsDQowCXN0cmluZwlaT08JW2ZpZD0wMDAxMDAwMTItNTAtMDAwMFpPTztleHQ9em9vO21pbWU9O11ab28gYXJjaGl2ZSBmaWxlDQomMHgxNAlsZWxvbmcJMHgwRkRDNEE3REMJDQo+MzIJYnl0ZQl4CSwgdmVyc2lvbiAlZA0KPjMzCWJ5dGUJeAkuJWQNCg0KIyBNYWdpYyBJRCBmb3IgWnppcCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KMAlzdHJpbmcJWloJW2ZpZD0wMDAxMDAwMDctNTAtMDAwMDBaWjtleHQ9eno7bWltZT07XVpaaXAgYXJjaGl2ZSBmaWxlDQo+MglieXRlCXgJLCB2ZXJzaW9uICVkLjANCg0KIyBNYWdpYyBJRCBmb3IgNjI0IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0wMyBieSBDYXJsDQowCXN0cmluZwlbRVNQXVxceEI1XFx4NzgJW2ZpZD0wMDAxMDAwMDItNTEtMDAwMENPTTtleHQ9Y29tO21pbWU9O102MjQgZXhlY3V0YWJsZSBjb21wcmVzc2VkIGZpbGUgKE1TLURPUykNCg0KIyBNYWdpYyBJRCBmb3IgNjI0IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMy0wMyBieSBDYXJsDQowCXN0cmluZwlQVUxQXFx4ODMJW2ZpZD0wMDAxMDAwMDItNTEtMDAwMENPTTtleHQ9Y29tO21pbWU9O102MjQgZXhlY3V0YWJsZSBjb21wcmVzc2VkIGZpbGUgKE1TLURPUykNCg0KIyBNYWdpYyBJRCBmb3IgTHpleGUgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTIzIGJ5IENhcmwNCjB4MUMJc3RyaW5nCUxaOTEJW2ZpZD0wMDAxMDAwNTMtNTEtMDAwMEVYRTtleHQ9ZXhlO21pbWU9O11MemV4ZSBjb21wcmVzc2VkIGV4ZWN1dGFibGUgZmlsZSAoTVMtRE9TKQ0KDQojIE1hZ2ljIElEIGZvciBIVE1MIEhlbHAgV29ya3Nob3AgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA4IGJ5IENhcmwNCjAJc3RyaW5nCUlUU0YJW2ZpZD0wMDAwMDEwMDEtNjAtMDAwMENITTtleHQ9Y2htO21pbWU9O11NaWNyb3NvZnQgY29tcGlsZWQgaHlwZXJ0ZXh0IGRvY3VtZW50DQoNCiMgTWFnaWMgSUQgZm9yIEJvcmxhbmQgRGVscGhpIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNy0zMCBieSBDYXJsDQoyCXN0cmluZwlERUxQSEkuRElBR1JBTS5QT1JURk9MSU8JW2ZpZD0wMDAwMDEwMDUtNjAtMDAwMEREUDtleHQ9ZGRwO21pbWU9O11EZWxwaGkgRGlhZ3JhbSBQb3J0Zm9saW8gZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBQYWdlc3RyZWFtIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0wOCBieSBDYXJsDQowCXN0cmluZwlGT1JNCVtmaWQ9MDAwMDAxMjY4LTYwLTAwMDBET0M7ZXh0PWRvYzttaW1lPTtdUGFnZXN0cmVhbSBkb2N1bWVudA0KJjgJc3RyaW5nCURPQ1xcIAkNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0wOCBieSBDYXJsDQowCXN0cmluZwlDQVRcXCAJW2ZpZD0wMDAwMDEwMTAtNjAtMDAwRlRYVDtleHQ9ZnR4dDttaW1lPTtdRm9ybWF0dGVkIHRleHQgaW50ZXJjaGFuZ2UgZmlsZQ0KJjgJc3RyaW5nCUZUWFQJDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KMAlzdHJpbmcJRk9STQlbZmlkPTAwMDAwMTAxMC02MC0wMDBGVFhUO2V4dD1mdHh0O21pbWU9O11Gb3JtYXR0ZWQgdGV4dCBpbnRlcmNoYW5nZSBmaWxlDQomOAlzdHJpbmcJRlRYVAkNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0wOCBieSBDYXJsDQowCXN0cmluZwlMSVNUCVtmaWQ9MDAwMDAxMDEwLTYwLTAwMEZUWFQ7ZXh0PWZ0eHQ7bWltZT07XUZvcm1hdHRlZCB0ZXh0IGludGVyY2hhbmdlIGZpbGUNCiY4CXN0cmluZwlGVFhUCQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA4IGJ5IENhcmwNCjAJc3RyaW5nCUBkYXRhYmFzZQlbZmlkPTAwMDAwMTAwNy02MC0wMEdVSURFO2V4dD1ndWlkZTttaW1lPTtdQW1pZ2FHdWlkZSBoeXBlcnRleHQgZG9jdW1lbnQNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNCBieSBDYXJsDQowCWxlbG9uZwkweDAwMDM1RjNGCVtmaWQ9MDAwMDAxMDAxLTYwLTAwMDBITFA7ZXh0PWhscDttaW1lPTtdTWljcm9zb2Z0IFdpbmRvd3MgSGVscCBmaWxlDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMTAtMDggYnkgQ2FybA0KMAlzdHJpbmcJPCFET0NUWVBFXFwgCVtmaWQ9MDAwMDAwMDAxLTYwLTAwMTU0NDU7ZXh0PWh0bWwsaHRtO21pbWU9dGV4dC9odG1sO11IeXBlclRleHQgTWFya3VwIExhbmd1YWdlIGRvY3VtZW50IChIVE1MKQ0KJjEwCXN0cmluZy9jCWh0bWwJDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KMAlzdHJpbmcJSERPQwlbZmlkPTAwMDAwMTAwNi02MC0wMDAwSFlQO2V4dD1oeXA7bWltZT07XUF0YXJpIFNULUd1aWRlIGh5cGVydGV4dCBkb2N1bWVudA0KDQojIE1hZ2ljIElEIGZvciBPUy8yIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0wOCBieSBDYXJsDQowCXN0cmluZwlIU1AJW2ZpZD0wMDAwMDEwMDktNjAtMDAwMElORjtleHQ9aW5mO21pbWU9O11PUy8yIEd1aWRlIGh5cGVydGV4dCBkb2N1bWVudA0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA4IGJ5IENhcmwNCjAJc3RyaW5nCVRoaXNcXCBpc1xcIEluZm9cXCBmaWxlCVtmaWQ9MDAwMTAwMDEwLTYwLTAwMElORk87ZXh0PWluZm87bWltZT07XUdOVSBJbmZvIGh5cGVydGV4dCBkb2N1bWVudA0KDQojIE1hZ2ljIElEIGZvciBBZG9iZSBBY3JvYmF0IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0xMC0wOCBieSBDYXJsDQowCXN0cmluZwklUERGLQlbZmlkPTAwMDAwMDAwMS02MC0wMDE1OTMwO2V4dD1wZGY7bWltZT1hcHBsaWNhdGlvbi9wZGY7XVBvcnRhYmxlIGRvY3VtZW50IGZvcm1hdCBkb2N1bWVudCBmaWxlIChQREYpDQo+NQlzdHJpbmcJeAksIHZlcnNpb24gJS4xcw0KPjcJc3RyaW5nCXgJLiUuMXMNCg0KIyBNYWdpYyBJRCBmb3IgTWljcm9zb2Z0IFdvcmRwYWQgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA4IGJ5IENhcmwNCjAJc3RyaW5nCXtcXFxccnRmCVtmaWQ9MDAwMDAxMDAxLTYwLTAwMDBSVEY7ZXh0PXJ0ZjttaW1lPXRleHQvcnRmO11SaWNoIFRleHQgRm9ybWF0IGRvY3VtZW50DQo+NQlzdHJpbmcJeAksIHZlcnNpb24gJS4xcy54DQoNCiMgTWFnaWMgSUQgZm9yIERvY0Jvb2sgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTEwLTA4IGJ5IENhcmwNCjAJc3RyaW5nCTwhRE9DVFlQRVxcIAlbZmlkPTAwMDAwMDAwMS02MC0wMDA4ODc5O2V4dD1zZ21sLHNnbTttaW1lPXRleHQvc2dtbDtdU3RhbmRhcmQgZ2VuZXJhbCBtYXJrdXAgbGFuZ3VhZ2UgZG9jdW1lbnQgKFNHTUwpDQoNCiMgTWFnaWMgSUQgZm9yIFR1cmJvIEMgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE0IGJ5IENhcmwNCjAJc3RyaW5nCVRVUkJPXFwgQ1xcIEhFTFBcXCBGSUxFXFx4MDAJW2ZpZD0wMDAwMDEwMDUtNjAtMDAwMFRDSDtleHQ9dGNoO21pbWU9O11UdXJibyBDIGhlbHAgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBUdXJibyBQYXNjYWwgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA4IGJ5IENhcmwNCjAJc3RyaW5nCVRVUkJPXFwgUEFTQ0FMXFwgSEVMUFxcIEZJTEVcXHgwMAlbZmlkPTAwMDAwMTAwNS02MC0wMDAwVFBIO2V4dD10cGg7bWltZT07XUJvcmxhbmQgUGFzY2FsIGhlbHAgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBUdXJibyBWaXNpb24gZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA4IGJ5IENhcmwNCjAJbGVsb25nCTB4NDY0ODQyNDYJW2ZpZD0wMDAwMDEwMDUtNjAtMDAwMFRWSDtleHQ9dHZoO21pbWU9O11Cb3JsYW5kIFR1cmJvIFZpc2lvbiBoZWxwIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgV29yZHBlcmZlY3QgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA4IGJ5IENhcmwNCjAJc3RyaW5nCVxceEZGV1BDCVtmaWQ9MDAwMDAxMDA4LTYwLTAwMDBXUEQ7ZXh0PXdwZCxkb2M7bWltZT1hcHBsaWNhdGlvbi92bmQud29yZHBlcmZlY3Q7XVdvcmRwZXJmZWN0IGRvY3VtZW50DQomOQlieXRlCTB4MEEJDQo+MTAJYnl0ZQl4CSwgdmVyc2lvbiAlZA0KPjExCWJ5dGUJeAkuJWQNCg0KIyBNYWdpYyBJRCBmb3IgTWljcm9zb2Z0IFdyaXRlIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0wOCBieSBDYXJsDQowCWxlc2hvcnQJMDEzNzA2MQlbZmlkPTAwMDAwMTAwMS02MC0wMDAwV1JJO2V4dD13cmk7bWltZT07XU1pY3Jvc29mdCBXcml0ZSBkb2N1bWVudA0KJjIJbGVzaG9ydAkweDAwMDAJDQoNCiMgTWFnaWMgSUQgZm9yIE1pY3Jvc29mdCBXcml0ZSBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KMAlsZXNob3J0CTAxMzcwNjIJW2ZpZD0wMDAwMDEwMDEtNjAtMDAwMFdSSTtleHQ9d3JpO21pbWU9O11NaWNyb3NvZnQgV3JpdGUgZG9jdW1lbnQNCiYyCWxlc2hvcnQJMHgwMDAwCQ0KDQojIE1hZ2ljIElEIGZvciBYLVdpbmRvd3MgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA5LTAxIGJ5IENhcmwNCjAJc3RyaW5nCVNUQVJURk9OVFxcIAlbZmlkPTAwMDAwMTAwMy03MC0wMDAwQkRGO2V4dD1iZGY7bWltZT07XUFkb2JlIGdseXBoIGJpdG1hcCBkaXN0cmlidXRpb24gZm9ybWF0IGZvbnQgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBEZWx1eGUgUGFpbnQgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA5LTAxIGJ5IENhcmwNCjAJc3RyaW5nCUNGXFx4MDFcXHgwMAlbZmlkPTAwMDAwMTAxMC03MC0wMDAwMDBDO2V4dD1jO21pbWU9O11EZWx1eGUgcGFpbnQgbXVsdGktY29sb3VyIGZvbnQgZmlsZQ0KDQojIE1hZ2ljIElEIGZvciBGaWdsZXQgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA5LTAxIGJ5IENhcmwNCjAJc3RyaW5nCWZsZjIJW2ZpZD0wMDAxMDAxMjItNzAtMDAwMEZMRjtleHQ9ZmxmO21pbWU9O11GaWdsZXQgZm9udCBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIFBDTCA1IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wOS0wMSBieSBDYXJsDQowCXN0cmluZwlcXHgwMFxceDQ0XFx4MDBcXHgwMVxceDAwXFx4MDBcXHgwMFxceDFBCVtmaWQ9MDAwMDAxMzM2LTcwLTAwMDBMSUI7ZXh0PWxpYix0eXBlO21pbWU9O11JbnRlbGxpZm9udCBTY2FsYWJsZSBUeXBlZmFjZSBGb3JtYXQgIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgRGVsdXhlIFBhaW50IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wOS0wMSBieSBDYXJsDQowCXN0cmluZwlcXHgxQlxceDI5XFx4NzNcXHgzNlxceDM0XFx4NTdcXHgwMFxceDQwCVtmaWQ9MDAwMDAxMDEwLTcwLTAwMDAwME07ZXh0PW07bWltZT07XURlbHV4ZSBwYWludCBtb25vIGNvbG91ciBmb250IGZpbGUNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNS0yMCBieSBDYXJsDQowCWJlbG9uZwkweDAwMDEwMDAwCVtmaWQ9MDAwMDAxMDAxLTcwLTAwMDBUVEY7ZXh0PW90Zix0dGY7bWltZT07XU9wZW50eXBlIGZvbnQgZmlsZQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA1LTIwIGJ5IENhcmwNCjAJc3RyaW5nCU9UVE8JW2ZpZD0wMDAwMDEwMDEtNzAtMDAwMFRURjtleHQ9b3RmLHR0ZjttaW1lPTtdT3BlbnR5cGUgZm9udCBmaWxlLCBDRkYgdHlwZQ0KDQojIE1hZ2ljIElEIGZvciBYLVdpbmRvd3MgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA5LTAxIGJ5IENhcmwNCjAJYmVsb25nCTB4MDE2NjYzNzAJW2ZpZD0wMDAwMDAwMDAtNzAtMDAwMFBDRjtleHQ9cGNmO21pbWU9O11Qb3J0YWJsZSBjb21waWxlZCBmb3JtYXQgKFBDRikgZm9udCBmaWxlDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDUtMjAgYnkgQ2FybA0KMAlzdHJpbmcJJSFGb250VHlwZTEJW2ZpZD0wMDAwMDAwMDEtNzAtMDAwOTU0MTtleHQ9cGZhO21pbWU9O11UeXBlIDEgZm9udCBmaWxlDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDUtMjAgYnkgQ2FybA0KMAlzdHJpbmcJJSFQUy1BZG9iZUZvbnQtMS4wCVtmaWQ9MDAwMDAwMDAxLTcwLTAwMDk1NDE7ZXh0PXBmYTttaW1lPTtdVHlwZSAxIGZvbnQgZmlsZQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA1LTIwIGJ5IENhcmwNCjYJc3RyaW5nCSUhRm9udFR5cGUxCVtmaWQ9MDAwMDAxMDAzLTcwLTAwMDBQRkI7ZXh0PXBmYjttaW1lPTtdVHlwZSAxIHByaW50ZXIgZm9udCBiaW5hcnkgZmlsZQ0KJjAJYnl0ZQkweDgwCQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA1LTIwIGJ5IENhcmwNCjYJc3RyaW5nCSUhUFMtQWRvYmVGb250LTEuMAlbZmlkPTAwMDAwMTAwMy03MC0wMDAwUEZCO2V4dD1wZmI7bWltZT07XVR5cGUgMSBwcmludGVyIGZvbnQgYmluYXJ5IGZpbGUNCiYwCWJ5dGUJMHg4MAkNCg0KIyBNYWdpYyBJRCBmb3IgWC1XaW5kb3dzLCBHZW1ET1MgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA5LTAxIGJ5IENhcmwNCjIJc3RyaW5nCVxceDJFXFx4MzBcXHgwRFxceDBBXFx4MDBcXHgwMAlbZmlkPTAwMDAwMTMzNy03MC0wMDAwU1BEO2V4dD1zcGQ7bWltZT07XUJpdHN0cmVhbSBTcGVlZG8gZm9udCBmaWxlDQomMAlzdHJpbmcJRAkNCj4yNAlzdHJpbmcJeAlbdGl0bGU9JS43MHNdDQo+MQlzdHJpbmcJeAksdmVyc2lvbiAlLjFzLjANCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNS0yMCBieSBDYXJsDQowCXN0cmluZwl0cnVlCVtmaWQ9MDAwMDAxMDAyLTcwLTAwMDBUVEY7ZXh0PXR0ZjttaW1lPTtdVHJ1ZXR5cGUgZm9udCBmaWxlDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDUtMjAgYnkgQ2FybA0KMAlzdHJpbmcJdHlwMQlbZmlkPTAwMDAwMTAwMi03MC0wMDAwVFRGO2V4dD10dGY7bWltZT07XVRydWV0eXBlIGZvbnQgZmlsZQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA1LTIwIGJ5IENhcmwNCjAJc3RyaW5nCVN0YXJ0Q29tcEZvbnRNZXRyaWNzCVtmaWQ9MDAwMDAxMDAzLTcwLTAwMDBBRk07ZXh0PWFmbTttaW1lPTtdQWRvYmUgY29tcG9zaXRlIGZvbnQgbWV0cmljcyBmaWxlDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDUtMjAgYnkgQ2FybA0KMAlzdHJpbmcJU3RhcnRGb250TWV0cmljcwlbZmlkPTAwMDAwMTAwMy03MC0wMDAwQUZNO2V4dD1hZm07bWltZT07XUFkb2JlIGZvbnQgbWV0cmljcyBmaWxlDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDUtMjAgYnkgQ2FybA0KMAlzdHJpbmcJU3RhcnRNYXN0ZXJGb250TWV0cmljcwlbZmlkPTAwMDAwMTAwMy03MC0wMDAwQUZNO2V4dD1hZm07bWltZT07XUFkb2JlIG1hc3RlciBmb250IG1ldHJpY3MgZmlsZQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA1LTIwIGJ5IENhcmwNCjAJbGVzaG9ydAkweDAxMDAJW2ZpZD0wMDAwMDEwMDEtNzAtMDAwMFBGTTtleHQ9cGZtO21pbWU9O11QcmludGVyIEZvbnQgTWV0cmljcyBmaWxlIGZvciBUeXBlIDEgZm9udHMNCiY2NglsZXNob3J0CTB4MDA4MQkNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0wOCBieSBDYXJsDQowCWxlbG9uZwkweDc1QjIyNjMwCVtmaWQ9MDAwMDAxMDAxLTgxLTAwMDBBU0Y7ZXh0PWFzZix3bWEsd212O21pbWU9O11NaWNyb3NvZnQgQWR2YW5jZWQgU3RyZWFtaW5nIGZvcm1hdCBtdWx0aW1lZGlhIGZpbGUNCiY2CWxlc2hvcnQJMHgxMUNGCQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA4IGJ5IENhcmwNCjAJc3RyaW5nCVJJRkYJW2ZpZD0wMDAwMDEwMDEtODEtMDAwMEFWSTtleHQ9YXZpO21pbWU9O11BdWRpby12aWRlbyBpbnRlcmxlYXZlZCBtb3ZpZSwgbGl0dGxlLWVuZGlhbg0KJjgJc3RyaW5nCUFWSVxcIAkNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMyBieSBDYXJsDQowCXN0cmluZwlSSUZYCVtmaWQ9MDAwMDAxMDAxLTgxLTAwMDBBVkk7ZXh0PWF2aTttaW1lPTtdQXVkaW8tdmlkZW8gaW50ZXJsZWF2ZWQgbW92aWUsIGJpZy1lbmRpYW4NCiY4CXN0cmluZwlBVklcXCAJDQoNCiMgTWFnaWMgSUQgZm9yIFF1aWNrdGltZSBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KNAlzdHJpbmcJbWRhdAlbZmlkPTAwMDAwMTAwMi04MS0wMDAwTU9WO2V4dD1tb3YscXQ7bWltZT12aWRlby9xdWlja3RpbWU7XUFwcGxlIFF1aWNrVGltZSBtb3ZpZSBkYXRhIChtZGF0KQ0KDQojIE1hZ2ljIElEIGZvciBRdWlja3RpbWUgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA4IGJ5IENhcmwNCjQJc3RyaW5nCW1vb3YJW2ZpZD0wMDAwMDEwMDItODEtMDAwME1PVjtleHQ9bW92LHF0O21pbWU9dmlkZW8vcXVpY2t0aW1lO11BcHBsZSBRdWlja1RpbWUgbW92aWUgcmVzb3VyY2UgKG1vb3YpDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDUtMjAgYnkgQ2FybA0KMAliZWxvbmcJMHgxQjMJW2ZpZD0wMDAwMDAwMDEtODEtMDAwTVBFRztleHQ9bXBlLG1wZWcsbXBnO21pbWU9dmlkZW8vbXBlZztdTVBFRyBtdWx0aW1lZGlhIChhdWRpby92aWRlbykgc3RyZWFtIGZpbGUNCiZaNAliZWxvbmcJMHgwMUI5CQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA1LTIwIGJ5IENhcmwNCjAJYmVsb25nCTB4MUJBCVtmaWQ9MDAwMDAwMDAxLTgxLTAwME1QRUc7ZXh0PW1wZSxtcGVnLG1wZzttaW1lPXZpZGVvL21wZWc7XU1QRUcgbXVsdGltZWRpYSAoYXVkaW8vdmlkZW8pIHN0cmVhbSBmaWxlDQomWjQJYmVsb25nCTB4MDFCOQkNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNS0yMCBieSBDYXJsDQowCWJlbG9uZwkweDFFMAlbZmlkPTAwMDAwMDAwMS04MS0wMDBNUEVHO2V4dD1tcGUsbXBlZyxtcGc7bWltZT12aWRlby9tcGVnO11NUEVHIG11bHRpbWVkaWEgKGF1ZGlvL3ZpZGVvKSBzdHJlYW0gZmlsZQ0KJlo0CWJlbG9uZwkweDAxQjkJDQoNCiMgTWFnaWMgSUQgZm9yIEFsaWFzL1dhdmVmcm9udCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KMAlzdHJpbmcJTU9WSQlbZmlkPTAwMDAwMTAwNC04MS0wMDAwME1WO2V4dD1tdjttaW1lPTtdQWxpYXMvV2F2ZWZyb250IG1vdmllIGZpbGUNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNS0xOCBieSBDYXJsDQowCXN0cmluZwlPZ2dTCVtmaWQ9MDAwMDAwMDAwLTgxLTAwMDBPR0c7ZXh0PW9nZzttaW1lPWFwcGxpY2F0aW9uL29nZztdT0dHIE11bHRpbWVkaWEgY29udGFpbmVyIHN0cmVhbSBmaWxlDQoNCiMgTWFnaWMgSUQgZm9yIFJlYWxwbGF5ZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA1LTE5IGJ5IENhcmwNCjAJc3RyaW5nCS5STUYJW2ZpZD0wMDAwMDEwMjctODEtMDAwMDBSTTtleHQ9cm0scmEscnQscnAscnBhO21pbWU9O11SZWFsTWVkaWEgbXVsdGltZWRpYSBjb250YWluZXIgc3RyZWFtIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgTWFjcm9tZWRpYSBGbGFzaCBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KMAlzdHJpbmcJRldTCVtmaWQ9MDAwMDAxMjU5LTgxLTAwMDBTV0Y7ZXh0PXN3ZjttaW1lPTtdU2hvY2t3YXZlIE1hY3JvbWVkaWEgYW5pbWF0aW9uDQo+MwlieXRlCXgJLCB2ZXJzaW9uICVkLjANCg0KIyBNYWdpYyBJRCBmb3IgVml2byBwbGF5ZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA1LTIwIGJ5IENhcmwNCjUJc3RyaW5nCVZlcnNpb246Vml2bwlbZmlkPTAwMDAwMDAwMC04MS0wMDBWSVZPO2V4dD12aXYsdml2bzttaW1lPXZpZGVvL3ZuZC52aXZvO11WaXZvIG11bHRpbWVkaWEgc3RyZWFtIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgQWVnaXMgQW5pbWF0b3IgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA4IGJ5IENhcmwNCjAJc3RyaW5nCUZPUk0JW2ZpZD0wMDAwMDEyNjEtODItMDAwQU5JTTtleHQ9YW5pbTttaW1lPTtdQW1pZ2EgLyBTcGFydGEgc29mdHdhcmUgYW5pbWF0aW9uDQomOAlzdHJpbmcJQU5JTQkNCg0KIyBNYWdpYyBJRCBmb3IgRmFudGF2aXNpb24gbW92aWUgbWFrZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA4IGJ5IENhcmwNCjAJc3RyaW5nCUZPUk0JW2ZpZD0wMDAwMDEyNjAtODItMDAwRkFOVDtleHQ9ZmFudDttaW1lPTtdRmFudGF2aXNpb24gbW92aWUNCiY4CXN0cmluZwlGQU5UCQ0KDQojIE1hZ2ljIElEIGZvciBBdXRvZGVzayBBbmltYXRvciBQcm8gZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTA4IGJ5IENhcmwNCjQJbGVzaG9ydAkweEFGMTIJW2ZpZD0wMDAwMDEyNTQtODItMDAwMEZMQztleHQ9ZmxjO21pbWU9O11BdXRvZGVzayBBbmltYXRvciBQcm8gYW5pbWF0aW9uDQomMTIJbGVzaG9ydAkweDA4CQ0KPjgJbGVzaG9ydAl4CVtyZXM9JWR4DQo+MTAJbGVzaG9ydAl4CSVkDQo+MTIJbGVzaG9ydAl4CXg4YnBwXQ0KDQojIE1hZ2ljIElEIGZvciBBdXRvZGVzayBBbmltYXRvciBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMDggYnkgQ2FybA0KNAlsZXNob3J0CTB4QUYxMQlbZmlkPTAwMDAwMTI1NC04Mi0wMDAwRkxJO2V4dD1mbGk7bWltZT07XUF1dG9kZXNrIEFuaW1hdG9yIGFuaW1hdGlvbg0KJjEyCWxlc2hvcnQJMHgwOAkNCj44CWxlc2hvcnQJeAlbcmVzPSVkeA0KPjEwCWxlc2hvcnQJeAklZA0KPjEyCWxlc2hvcnQJeAl4OGJwcF0NCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0xMyBieSBDYXJsDQowCXN0cmluZwlcXHg4QU1OR1xceDBkXFx4MEFcXHgxQVxceDBBCVtmaWQ9MDAwMDAwMDAwLTgyLTAwMDBNTkc7ZXh0PW1uZzttaW1lPTtdTXVsdGktaW1hZ2UgbmV0d29yayBncmFwaGljcyBhbmltYXRpb24gZmlsZQ0KPjB4MTAJYmVsb25nCXgJW3Jlcz0lZHgNCj4weDE0CWJlbG9uZwl4CSVkXQ0KDQojIE1hZ2ljIElEIGZvciBDeWJlcnBhaW50IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0wOCBieSBDYXJsDQowCWJlc2hvcnQJMHhGRURCCVtmaWQ9MDAwMDAwMDAwLTgyLTAwMDBTRVE7ZXh0PXNlcTttaW1lPTtdQ3liZXJwYWludCBBbmltYXRpb24gU2VxdWVuY2UNCiYyCWJlc2hvcnQJMHgwMDAwCQ0KDQojIE1hZ2ljIElEIGZvciBRdWlja2VuLE1vbmV5IGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wOC0wMSBieSBDYXJsDQowCXN0cmluZwlPRlhIRUFERVI6CVtmaWQ9MDAwMDAwMDA4LTkxLTAwMDBRRlg7ZXh0PXFmeDttaW1lPTtdT3BlbiBmaW5hbmNpYWwgZXhjaGFuZ2UgZmlsZSAoU0dNTCkNCg0KIyBNYWdpYyBJRCBmb3IgUXVpY2tlbiBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDgtMDEgYnkgQ2FybA0KMQlzdHJpbmcJQWNjb3VudAlbZmlkPTAwMDAwMTMzNS05MS0wMDAwUUlGO2V4dD1xaWY7bWltZT07XVF1aWNrZW4gaW50ZXJjaGFuZ2UgZmlsZQ0KJjAJYnl0ZQkzMwkNCg0KIyBNYWdpYyBJRCBmb3IgUXVpY2tlbiBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDgtMDEgYnkgQ2FybA0KMQlzdHJpbmcJVHlwZTpCYW5rCVtmaWQ9MDAwMDAxMzM1LTkxLTAwMDBRSUY7ZXh0PXFpZjttaW1lPTtdUXVpY2tlbiBpbnRlcmNoYW5nZSBmaWxlDQomMAlieXRlCTMzCQ0KDQojIE1hZ2ljIElEIGZvciBRdWlja2VuIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wOC0wMSBieSBDYXJsDQoxCXN0cmluZwlUeXBlOkNhc2gJW2ZpZD0wMDAwMDEzMzUtOTEtMDAwMFFJRjtleHQ9cWlmO21pbWU9O11RdWlja2VuIGludGVyY2hhbmdlIGZpbGUNCiYwCWJ5dGUJMzMJDQoNCiMgTWFnaWMgSUQgZm9yIFF1aWNrZW4gZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA4LTAxIGJ5IENhcmwNCjEJc3RyaW5nCVR5cGU6Q2F0CVtmaWQ9MDAwMDAxMzM1LTkxLTAwMDBRSUY7ZXh0PXFpZjttaW1lPTtdUXVpY2tlbiBpbnRlcmNoYW5nZSBmaWxlDQomMAlieXRlCTMzCQ0KDQojIE1hZ2ljIElEIGZvciBRdWlja2VuIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wOC0wMSBieSBDYXJsDQoxCXN0cmluZwlUeXBlOkNDYXJkCVtmaWQ9MDAwMDAxMzM1LTkxLTAwMDBRSUY7ZXh0PXFpZjttaW1lPTtdUXVpY2tlbiBpbnRlcmNoYW5nZSBmaWxlDQomMAlieXRlCTMzCQ0KDQojIE1hZ2ljIElEIGZvciBRdWlja2VuIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wOC0wMSBieSBDYXJsDQoxCXN0cmluZwlUeXBlOkNsYXNzCVtmaWQ9MDAwMDAxMzM1LTkxLTAwMDBRSUY7ZXh0PXFpZjttaW1lPTtdUXVpY2tlbiBpbnRlcmNoYW5nZSBmaWxlDQomMAlieXRlCTMzCQ0KDQojIE1hZ2ljIElEIGZvciBRdWlja2VuIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wOC0wMSBieSBDYXJsDQoxCXN0cmluZwlUeXBlOkludnN0CVtmaWQ9MDAwMDAxMzM1LTkxLTAwMDBRSUY7ZXh0PXFpZjttaW1lPTtdUXVpY2tlbiBpbnRlcmNoYW5nZSBmaWxlDQomMAlieXRlCTMzCQ0KDQojIE1hZ2ljIElEIGZvciBRdWlja2VuIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wOC0wMSBieSBDYXJsDQoxCXN0cmluZwlUeXBlOk1lbW9yaXplZAlbZmlkPTAwMDAwMTMzNS05MS0wMDAwUUlGO2V4dD1xaWY7bWltZT07XVF1aWNrZW4gaW50ZXJjaGFuZ2UgZmlsZQ0KJjAJYnl0ZQkzMwkNCg0KIyBNYWdpYyBJRCBmb3IgUXVpY2tlbiBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDgtMDEgYnkgQ2FybA0KMQlzdHJpbmcJVHlwZTpPdGggQQlbZmlkPTAwMDAwMTMzNS05MS0wMDAwUUlGO2V4dD1xaWY7bWltZT07XVF1aWNrZW4gaW50ZXJjaGFuZ2UgZmlsZQ0KJjAJYnl0ZQkzMwkNCg0KIyBNYWdpYyBJRCBmb3IgUXVpY2tlbiBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMDgtMDEgYnkgQ2FybA0KMQlzdHJpbmcJVHlwZTpPdGggTAlbZmlkPTAwMDAwMTMzNS05MS0wMDAwUUlGO2V4dD1xaWY7bWltZT07XVF1aWNrZW4gaW50ZXJjaGFuZ2UgZmlsZQ0KJjAJYnl0ZQkzMwkNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xMSBieSBDYXJsDQowCXN0cmluZwlSUkcJW2ZpZD0wMDAwMDEwMDEtQjAtMDAwMENSRDtleHQ9Y3JkO21pbWU9O11XaW5kb3dzIDMueCBjYXJkZmlsZQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTExIGJ5IENhcmwNCjAJc3RyaW5nCU1HQwlbZmlkPTAwMDAwMTAwMS1CMC0wMDAwQ1JEO2V4dD1jcmQ7bWltZT07XVdpbmRvd3MgTlQgMy41MSBjYXJkIGZpbGUNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wMi0xNCBieSBDYXJsDQowCXN0cmluZwlCRUdJTjpWQ0FSRAlbZmlkPTAwMDAwMTAxNS1CMC0wMDAwVkNGO2V4dD12Y2Y7bWltZT07XXZDYXJkIEJ1c2luZXNzIENhcmQgZmlsZQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTAyLTE0IGJ5IENhcmwNCjAJc3RyaW5nCVxceGI1XFx4YTJcXHhiMFxceGIzXFx4YjNcXHhiMFxceGEyXFx4YjUJW2ZpZD0wMDAwMDEwMDEtQjEtMDAwMENBTDtleHQ9Y2FsO21pbWU9O11NaWNyb3NvZnQgd2luZG93cyBjYWxlbmRhciBmaWxlDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDItMTQgYnkgQ2FybA0KMAlzdHJpbmcJQkVHSU46VkNBTEVOREFSCVtmaWQ9MDAwMDAxMDE2LUIxLTAwMDBWQ1M7ZXh0PXZjczttaW1lPTtddkNhbGVuZGFyL2lDYWxlbmRhciBBZ2VuZGEgZmlsZQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA1LTE3IGJ5IENhcmwNCjAJc3RyaW5nCVxceDAwXFx4MDBcXHgwMFxceDNDXFx4MDBcXHgwMFxceDAwXFx4M0YJW2ZpZD0wMDAwMDAwMDctRjMtMDAwMFhNTDtleHQ9eG1sO21pbWU9dGV4dC94bWw7XUV4dGVuc2libGUgTWFya3VwIGxhbmd1YWdlIChYTUwpIGZpbGUsIFVURi0zMkJFIGVuY29kZWQNCiY4CWJlbG9uZwkweDAwMDAwMDc4CQ0KJjEyCWJlbG9uZwkweDAwMDAwMDZkCQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA1LTE3IGJ5IENhcmwNCjAJc3RyaW5nCVxceDAwXFx4MDBcXHhmZVxceGZmXFx4MDBcXHgwMFxceDAwXFx4M0MJW2ZpZD0wMDAwMDAwMDctRjMtMDAwMFhNTDtleHQ9eG1sO21pbWU9dGV4dC94bWw7XUV4dGVuc2libGUgTWFya3VwIGxhbmd1YWdlIChYTUwpIGZpbGUsIFVURi0zMkJFIGVuY29kZWQNCiY4CWJlbG9uZwkweDAwMDAwMDNGCQ0KJjEyCWJlbG9uZwkweDAwMDAwMDc4CQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA1LTE3IGJ5IENhcmwNCjAJc3RyaW5nCVxceDAwXFx4M0NcXHgwMFxceDNGXFx4MDBcXHg3OFxceDAwXFx4NkRcXHgwMFxceDZjCVtmaWQ9MDAwMDAwMDA3LUYzLTAwMDBYTUw7ZXh0PXhtbDttaW1lPXRleHQveG1sO11FeHRlbnNpYmxlIE1hcmt1cCBsYW5ndWFnZSAoWE1MKSBmaWxlLCBVVEYtMTZCRSBlbmNvZGVkDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDUtMTcgYnkgQ2FybA0KMAlzdHJpbmcJXFx4M0NcXHgwMFxceDAwXFx4MDBcXHgzRlxceDAwXFx4MDBcXHgwMAlbZmlkPTAwMDAwMDAwNy1GMy0wMDAwWE1MO2V4dD14bWw7bWltZT10ZXh0L3htbDtdRXh0ZW5zaWJsZSBNYXJrdXAgbGFuZ3VhZ2UgKFhNTCkgZmlsZSwgVVRGLTMyTEUgZW5jb2RlZA0KJjgJYmVzaG9ydAkweDAwMDAwMDc4CQ0KJjEyCWJlc2hvcnQJMHgwMDAwMDA2ZAkNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNS0xNyBieSBDYXJsDQowCXN0cmluZwlcXHgzQ1xceDAwXFx4M0ZcXHgwMFxceDc4XFx4MDBcXHg2RFxceDAwXFx4NmNcXHgwMAlbZmlkPTAwMDAwMDAwNy1GMy0wMDAwWE1MO2V4dD14bWw7bWltZT10ZXh0L3htbDtdRXh0ZW5zaWJsZSBNYXJrdXAgbGFuZ3VhZ2UgKFhNTCkgZmlsZSwgVVRGLTE2TEUgZW5jb2RlZA0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA1LTE3IGJ5IENhcmwNCjAJc3RyaW5nCVxceGVmXFx4YmJcXHhiZjw/eG1sCVtmaWQ9MDAwMDAwMDA3LUYzLTAwMDBYTUw7ZXh0PXhtbDttaW1lPXRleHQveG1sO11FeHRlbnNpYmxlIE1hcmt1cCBsYW5ndWFnZSAoWE1MKSBmaWxlLCBVVEYtOCBlbmNvZGVkDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDUtMTcgYnkgQ2FybA0KMAlzdHJpbmcJXFx4ZmVcXHhmZlxceDAwXFx4M0NcXHgwMFxceDNGXFx4MDBcXHg3OFxceDAwXFx4NkQJW2ZpZD0wMDAwMDAwMDctRjMtMDAwMFhNTDtleHQ9eG1sO21pbWU9dGV4dC94bWw7XUV4dGVuc2libGUgTWFya3VwIGxhbmd1YWdlIChYTUwpIGZpbGUsIFVURi0xNkJFIGVuY29kZWQNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNS0xNyBieSBDYXJsDQowCXN0cmluZwlcXHhmZlxceGZlXFx4MDBcXHgwMFxceDNDXFx4MDBcXHgwMFxceDAwCVtmaWQ9MDAwMDAwMDA3LUYzLTAwMDBYTUw7ZXh0PXhtbDttaW1lPXRleHQveG1sO11FeHRlbnNpYmxlIE1hcmt1cCBsYW5ndWFnZSAoWE1MKSBmaWxlLCBVVEYtMzJMRSBlbmNvZGVkDQomOAliZXNob3J0CTB4M0YwMDAwMDAJDQomMTIJYmVzaG9ydAkweDc4MDAwMDAwCQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTA1LTE3IGJ5IENhcmwNCjAJc3RyaW5nCVxceGZmXFx4ZmVcXHgzQ1xceDAwXFx4M0ZcXHgwMFxceDc4XFx4MDBcXHg2RFxceDAwCVtmaWQ9MDAwMDAwMDA3LUYzLTAwMDBYTUw7ZXh0PXhtbDttaW1lPXRleHQveG1sO11FeHRlbnNpYmxlIE1hcmt1cCBsYW5ndWFnZSAoWE1MKSBmaWxlLCBVVEYtMTZMRSBlbmNvZGVkDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDUtMTcgYnkgQ2FybA0KMAlzdHJpbmcJPD94bWwJW2ZpZD0wMDAwMDAwMDctRjMtMDAwMFhNTDtleHQ9eG1sO21pbWU9dGV4dC94bWw7XUV4dGVuc2libGUgTWFya3VwIGxhbmd1YWdlIChYTUwpIGZpbGUNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0wNC0yMCBieSBDYXJsDQowCXN0cmluZwlcXHhkMFxceGNmXFx4MTFcXHhlMFxceGExXFx4YjFcXHgxYVxceGUxCVtmaWQ9MDAwMDAxMDAxLUY0LTAwMDBPTEU7ZXh0PW9sZTttaW1lPTtdTWljcm9zb2Z0IE9MRSBDb21wb3VuZCBmaWxlLCBiaWctZW5kaWFuDQomMHgxQwlsZXNob3J0CSEweEZGRkUJDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMDQtMjAgYnkgQ2FybA0KMAlzdHJpbmcJXFx4ZDBcXHhjZlxceDExXFx4ZTBcXHhhMVxceGIxXFx4MWFcXHhlMQlbZmlkPTAwMDAwMTAwMS1GNC0wMDAwT0xFO2V4dD1vbGU7bWltZT07XU1pY3Jvc29mdCBPTEUgQ29tcG91bmQgZmlsZSwgbGl0dGxlLWVuZGlhbg0KJjB4MUMJbGVzaG9ydAkweEZGRkUJDQo+MHgxQQlsZXNob3J0CXgJLCB2ZXJzaW9uICVkDQo+MHgxOAlsZXNob3J0CXgJLiVkDQoNCiMgTWFnaWMgSUQgZm9yIEZyZWVwYXNjYWwgY29tcGlsZXIgZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTEwLTI0IGJ5IENhcmwNCjAJc3RyaW5nCVBQVTAJW2ZpZD0wMDAxMDAxMjAtMTEtMDAwMFBQVTtleHQ9cHB1LHBwbCxwcG8scHB3LHBwYSxwcHQ7bWltZT07XUZyZWVwYXNjYWwgdW5pdCBmaWxlDQo+MHgwNAlzdHJpbmcJeAksIHZlcnNpb24gJS4ycw0KDQojIE1hZ2ljIElEIGZvciBTbWFydGNhcmRzIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0xMC0yOSBieSBDYXJsDQowCWJlbG9uZwkweDAwRkFDQURFCVtmaWQ9MDAwMDAxMDExLTEwLTAwMDBFWFA7ZXh0PWV4cDttaW1lPTtdSmF2YWNhcmQgQVBJIGV4cG9ydCBmaWxlDQo+MHgwNQlieXRlCXgJLCB2ZXJzaW9uICVkDQo+NAlieXRlCXgJLiVkDQoNCiMgU3VibWl0dGVkIG9uIDIwMDQtMTAtMjkgYnkgQ2FybA0KMAlzdHJpbmcJLXJvbTFmcy0JW2ZpZD0wMDAxMDAxMjEtMEYtMDAwMElNRztleHQ9aW1nO21pbWU9O11TaW1wbGUgUk9NIGZpbGVzeXN0ZW0gKFJPTUZTKQ0KPjE2CXN0cmluZwl4CVt0aXRsZT0lc10NCg0KIyBNYWdpYyBJRCBmb3IgVmlydHVhbCBQQyBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMTAtMjkgYnkgQ2FybA0KMAlzdHJpbmcJY29uZWN0aXgJW2ZpZD0wMDAwMDEwMDEtMEYtMDAwMFZIRDtleHQ9dmhkO21pbWU9O11WaXJ0dWFsIFBDIEhhcmQgZHJpdmUNCg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0xMS0xMiBieSBDYXJsIEVyaWMgQ29kZXJlDQowCXN0cmluZwklIVBTLUFkb2JlLQlbZmlkPTAwMDAwMTAwMy0zMy0wMDAwMFBTO2V4dD1wcyxlcHM7bWltZT1hcHBsaWNhdGlvbi9wb3N0c2NyaXB0O11Qb3N0c2NyaXB0IGZpbGUNCj4xMQlzdHJpbmcJeAksIGxldmVsICUuMXMNCj4xMwlzdHJpbmcJeAkuJS4xcw0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTExLTEyIGJ5IENhcmwgRXJpYyBDb2RlcmUNCjAJbGVsb25nCTB4NTI2ZjZkMmUJW2ZpZD0wMDAwMDEzMzgtMEYtMDAwMFJPTTtleHQ9cm9tLGZzO21pbWU9O11lQ29zIFJPTSBGaWxlc3lzdGVtIGltYWdlIChST01GUykNCj4xNglzdHJpbmcJeAlbdGl0bGU9JS4xNnNdDQoNCiMgTWFnaWMgSUQgZm9yIFBBREdlbiBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDQtMTEtMjYgYnkgQ2FybCBFcmljIENvZGVyZQ0KMHgyOQlzdHJpbmcJPFhNTF9ESVpfSU5GTz4JW2ZpZD0wMDAwMDEzMzktQTAtMDAwMFhNTDtleHQ9eG1sO21pbWU9dGV4dC94bWw7XVBvcnRhYmxlIGFwcGxpY2F0aW9uIGRlc2NyaXB0aW9uIGZpbGUgKFhNTCkNCiYwCXN0cmluZwk8P3htbAkNCg0KIyBNYWdpYyBJRCBmb3IgUEFER2VuIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0xMS0yNiBieSBDYXJsIEVyaWMgQ29kZXJlDQoweDI4CXN0cmluZwk8WE1MX0RJWl9JTkZPPglbZmlkPTAwMDAwMTMzOS1BMC0wMDAwWE1MO2V4dD14bWw7bWltZT10ZXh0L3htbDtdUG9ydGFibGUgYXBwbGljYXRpb24gZGVzY3JpcHRpb24gZmlsZSAoWE1MKQ0KJjAJc3RyaW5nCTw/eG1sCQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTExLTI2IGJ5IENhcmwgRXJpYyBDb2RlcmUNCjB4MjkJc3RyaW5nCTx4OnhtcG1ldGFcXCAJW2ZpZD0wMDAwMDEwMDMtQTAtMDAwMFhNUDtleHQ9eG1sLHhtcDttaW1lPXRleHQveG1sO11FeHRlbnNpYmxlIG1ldGFkYXRhIHBsYXRmb3JtIHNpZGVjYXIgZmlsZSAoWE1MKQ0KJjAJc3RyaW5nCTw/eG1sCQ0KDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTExLTI2IGJ5IENhcmwgRXJpYyBDb2RlcmUNCjB4MjgJc3RyaW5nCTx4OnhtcG1ldGFcXCAJW2ZpZD0wMDAwMDEwMDMtQTAtMDAwMFhNUDtleHQ9eG1sLHhtcDttaW1lPXRleHQveG1sO11FeHRlbnNpYmxlIG1ldGFkYXRhIHBsYXRmb3JtIHNpZGVjYXIgZmlsZSAoWE1MKQ0KJjAJc3RyaW5nCTw/eG1sCQ0KDQojIE1hZ2ljIElEIGZvciBUZXhpbmZvIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0xMS0yNiBieSBDYXJsIEVyaWMgQ29kZXJlDQoxCXN0cmluZwlpbnB1dCB0ZXhpbmZvCVtmaWQ9MDAwMDAxMzQwLTAwLTAwMFRFWEk7ZXh0PXRleGk7bWltZT07XVRleGluZm8gc291cmNlIGZpbGUNCg0KIyBNYWdpYyBJRCBmb3IgTVMtRE9TIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNC0xMS0yNiBieSBDYXJsIEVyaWMgQ29kZXJlDQowCXN0cmluZwlcXHhGRkZPTlQJW2ZpZD0wMDAwMDEwMDEtNzAtMDAwMENQSTtleHQ9Y3BpO21pbWU9O11NUy1ET1MgY29kZSBwYWdlIHJhc3RlciBmb250DQoNCiMgTWFnaWMgSUQgZm9yIFVOSVggZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA0LTExLTI2IGJ5IENhcmwgRXJpYyBDb2RlcmUNCjAJc3RyaW5nCVRaaWYJW2ZpZD0wMDAwMDAwMDAtOTAtMDAwMDAwMDtleHQ9O21pbWU9O11UaW1lem9uZSBpbmZvcm1hdGlvbiBkYXRhYmFzZSBmaWxlIChjb21waWxlZCkNCg0KIyBNYWdpYyBJRCBmb3IgVGVsaXggZmlsZXMuDQojIFN1Ym1pdHRlZCBvbiAyMDA1LTAzLTA0IGJ5IENhcmwgRXJpYyBDb2RlcmUNCjAJbGVsb25nCTB4MmUyYjI5MWEJW2ZpZD0wMDAxMDAxMjYtQjAtMDAwMEZPTjtleHQ9Zm9uO21pbWU9O11UZWxpeCBwaG9uZSBib29rDQomNAlsZXNob3J0CTEJDQoNCiMgTWFnaWMgSUQgZm9yIE1pY3Jvc29mdCBWaXN1YWwgQysrIGZpbGVzLg0KIyBTdWJtaXR0ZWQgb24gMjAwNS0wMy0wNCBieSBDYXJsIEVyaWMgQ29kZXJlDQowCXN0cmluZwlWQ1BDSDBcXHgwMFxceDAwCVtmaWQ9MDAwMDAxMDAxLTkwLTAwMDBQQ0g7ZXh0PXBjaDttaW1lPTtdTWljcm9zb2Z0IFZpc3VhbCBDKysgcHJlLWNvbXBpbGVkIGhlYWRlcihzKQ0KDQojIE1hZ2ljIElEIGZvciBNaWNyb3NvZnQgVmlzdWFsIEMrKyBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDUtMDMtMDQgYnkgQ2FybCBFcmljIENvZGVyZQ0KMAlzdHJpbmcJTWljcm9zb2Z0XFwgQy9DKytcXCBwcm9ncmFtXFwgZGF0YWJhc2UJW2ZpZD0wMDAwMDEwMDEtOTAtMDAwMFBEQjtleHQ9cGRiO21pbWU9O11NaWNyb3NvZnQgVmlzdWFsIEMrKyBkZWJ1ZyBpbmZvcm1hdGlvbiBkYXRhYmFzZQ0KJjB4MjUJc3RyaW5nCVxceDBEXFx4MEFcXHgxQQkNCiYweDI4CXN0cmluZwlKR1xceDAwCQ0KDQojIE1hZ2ljIElEIGZvciBNaWNyb3NvZnQgVmlzdWFsIEMrKyBmaWxlcy4NCiMgU3VibWl0dGVkIG9uIDIwMDUtMDMtMDQgYnkgQ2FybCBFcmljIENvZGVyZQ0KMAlzdHJpbmcJTWljcm9zb2Z0XFwgTGlua2VyXFwgRGF0YWJhc2VcXHgwQVxceDA3XFx4MUEJW2ZpZD0wMDAwMDEwMDEtOTAtMDAwMElMSztleHQ9aWxrO21pbWU9O11NaWNyb3NvZnQgVmlzdWFsIEMrKyBsaW5rZXIgZGF0YWJhc2UNCg0KDQojIENSQzMyOjhCQzNCQTQ2DQo=' diff --git a/cake/tests/cases/libs/model/behaviors/acl.test.php b/cake/tests/cases/libs/model/behaviors/acl.test.php index 8846d4f03..cd97d901d 100644 --- a/cake/tests/cases/libs/model/behaviors/acl.test.php +++ b/cake/tests/cases/libs/model/behaviors/acl.test.php @@ -36,7 +36,7 @@ class AclPerson extends CakeTestModel { * @var string * @access public */ - var $name = 'AclPerson'; + public $name = 'AclPerson'; /** * useTable property @@ -44,7 +44,7 @@ class AclPerson extends CakeTestModel { * @var string * @access public */ - var $useTable = 'people'; + public $useTable = 'people'; /** * actsAs property @@ -52,7 +52,7 @@ class AclPerson extends CakeTestModel { * @var array * @access public */ - var $actsAs = array('Acl' => 'requester'); + public $actsAs = array('Acl' => 'requester'); /** * belongsTo property @@ -60,7 +60,7 @@ class AclPerson extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array( + public $belongsTo = array( 'Mother' => array( 'className' => 'AclPerson', 'foreignKey' => 'mother_id', @@ -73,7 +73,7 @@ class AclPerson extends CakeTestModel { * @var array * @access public */ - var $hasMany = array( + public $hasMany = array( 'Child' => array( 'className' => 'AclPerson', 'foreignKey' => 'mother_id' @@ -116,7 +116,7 @@ class AclUser extends CakeTestModel { * @var string * @access public */ - var $name = 'User'; + public $name = 'User'; /** * useTable property @@ -124,7 +124,7 @@ class AclUser extends CakeTestModel { * @var string * @access public */ - var $useTable = 'users'; + public $useTable = 'users'; /** * actsAs property @@ -132,7 +132,7 @@ class AclUser extends CakeTestModel { * @var array * @access public */ - var $actsAs = array('Acl'); + public $actsAs = array('Acl'); /** * parentNode @@ -158,7 +158,7 @@ class AclPost extends CakeTestModel { * @var string * @access public */ - var $name = 'Post'; + public $name = 'Post'; /** * useTable property @@ -166,7 +166,7 @@ class AclPost extends CakeTestModel { * @var string * @access public */ - var $useTable = 'posts'; + public $useTable = 'posts'; /** * actsAs property @@ -174,7 +174,7 @@ class AclPost extends CakeTestModel { * @var array * @access public */ - var $actsAs = array('Acl' => 'controlled'); + public $actsAs = array('Acl' => 'controlled'); /** * parentNode @@ -200,7 +200,7 @@ class AclBehaviorTestCase extends CakeTestCase { * @var Aco * @access public */ - var $Aco; + public $Aco; /** * Aro property @@ -208,7 +208,7 @@ class AclBehaviorTestCase extends CakeTestCase { * @var Aro * @access public */ - var $Aro; + public $Aro; /** * fixtures property @@ -216,7 +216,7 @@ class AclBehaviorTestCase extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.person', 'core.user', 'core.post', 'core.aco', 'core.aro', 'core.aros_aco'); + public $fixtures = array('core.person', 'core.user', 'core.post', 'core.aco', 'core.aro', 'core.aros_aco'); /** * Set up the test diff --git a/cake/tests/cases/libs/model/behaviors/containable.test.php b/cake/tests/cases/libs/model/behaviors/containable.test.php index 898747b02..ab5ecbf9f 100644 --- a/cake/tests/cases/libs/model/behaviors/containable.test.php +++ b/cake/tests/cases/libs/model/behaviors/containable.test.php @@ -34,7 +34,7 @@ class ContainableBehaviorTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array( + public $fixtures = array( 'core.article', 'core.article_featured', 'core.article_featureds_tags', 'core.articles_tag', 'core.attachment', 'core.category', 'core.comment', 'core.featured', 'core.tag', 'core.user' ); diff --git a/cake/tests/cases/libs/model/behaviors/translate.test.php b/cake/tests/cases/libs/model/behaviors/translate.test.php index 425bacb57..37de7ee7b 100644 --- a/cake/tests/cases/libs/model/behaviors/translate.test.php +++ b/cake/tests/cases/libs/model/behaviors/translate.test.php @@ -38,7 +38,7 @@ class TranslateBehaviorTest extends CakeTestCase { * @var bool false * @access public */ - var $autoFixtures = false; + public $autoFixtures = false; /** * fixtures property @@ -46,7 +46,7 @@ class TranslateBehaviorTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array( + public $fixtures = array( 'core.translated_item', 'core.translate', 'core.translate_table', 'core.translated_article', 'core.translate_article', 'core.user', 'core.comment', 'core.tag', 'core.articles_tag', 'core.translate_with_prefix' diff --git a/cake/tests/cases/libs/model/behaviors/tree.test.php b/cake/tests/cases/libs/model/behaviors/tree.test.php index 53f6e029a..b39c957fe 100644 --- a/cake/tests/cases/libs/model/behaviors/tree.test.php +++ b/cake/tests/cases/libs/model/behaviors/tree.test.php @@ -36,7 +36,7 @@ class NumberTreeTest extends CakeTestCase { * @var array * @access public */ - var $settings = array( + public $settings = array( 'modelClass' => 'NumberTree', 'leftField' => 'lft', 'rightField' => 'rght', @@ -49,7 +49,7 @@ class NumberTreeTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.number_tree'); + public $fixtures = array('core.number_tree'); /** * testInitialize method @@ -1281,7 +1281,7 @@ class ScopedTreeTest extends NumberTreeTest { * @var array * @access public */ - var $settings = array( + public $settings = array( 'modelClass' => 'FlagTree', 'leftField' => 'lft', 'rightField' => 'rght', @@ -1294,7 +1294,7 @@ class ScopedTreeTest extends NumberTreeTest { * @var array * @access public */ - var $fixtures = array('core.flag_tree', 'core.ad', 'core.campaign', 'core.translate', 'core.number_tree_two'); + public $fixtures = array('core.flag_tree', 'core.ad', 'core.campaign', 'core.translate', 'core.number_tree_two'); /** * testStringScope method @@ -1575,7 +1575,7 @@ class AfterTreeTest extends NumberTreeTest { * @var array * @access public */ - var $settings = array( + public $settings = array( 'modelClass' => 'AfterTree', 'leftField' => 'lft', 'rightField' => 'rght', @@ -1588,7 +1588,7 @@ class AfterTreeTest extends NumberTreeTest { * @var array * @access public */ - var $fixtures = array('core.after_tree'); + public $fixtures = array('core.after_tree'); /** * Tests the afterSave callback in the model @@ -1623,7 +1623,7 @@ class UnconventionalTreeTest extends NumberTreeTest { * @var array * @access public */ - var $settings = array( + public $settings = array( 'modelClass' => 'UnconventionalTree', 'leftField' => 'left', 'rightField' => 'right', @@ -1636,7 +1636,7 @@ class UnconventionalTreeTest extends NumberTreeTest { * @var array * @access public */ - var $fixtures = array('core.unconventional_tree'); + public $fixtures = array('core.unconventional_tree'); } /** @@ -1653,7 +1653,7 @@ class UuidTreeTest extends NumberTreeTest { * @var array * @access public */ - var $settings = array( + public $settings = array( 'modelClass' => 'UuidTree', 'leftField' => 'lft', 'rightField' => 'rght', @@ -1666,7 +1666,7 @@ class UuidTreeTest extends NumberTreeTest { * @var array * @access public */ - var $fixtures = array('core.uuid_tree'); + public $fixtures = array('core.uuid_tree'); /** * testMovePromote method diff --git a/cake/tests/cases/libs/model/cake_schema.test.php b/cake/tests/cases/libs/model/cake_schema.test.php index cb6e2cb1a..20831732a 100644 --- a/cake/tests/cases/libs/model/cake_schema.test.php +++ b/cake/tests/cases/libs/model/cake_schema.test.php @@ -34,7 +34,7 @@ class MyAppSchema extends CakeSchema { * @var string 'MyApp' * @access public */ - var $name = 'MyApp'; + public $name = 'MyApp'; /** * connection property @@ -42,7 +42,7 @@ class MyAppSchema extends CakeSchema { * @var string 'test_suite' * @access public */ - var $connection = 'test_suite'; + public $connection = 'test_suite'; /** * comments property @@ -50,7 +50,7 @@ class MyAppSchema extends CakeSchema { * @var array * @access public */ - var $comments = array( + public $comments = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => 0, 'key' => 'primary'), 'post_id' => array('type' => 'integer', 'null' => false, 'default' => 0), 'user_id' => array('type' => 'integer', 'null' => false), @@ -68,7 +68,7 @@ class MyAppSchema extends CakeSchema { * @var array * @access public */ - var $posts = array( + public $posts = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => 0, 'key' => 'primary'), 'author_id' => array('type' => 'integer', 'null' => true, 'default' => ''), 'title' => array('type' => 'string', 'null' => false, 'default' => 'Title'), @@ -115,7 +115,7 @@ class TestAppSchema extends CakeSchema { * @var string 'MyApp' * @access public */ - var $name = 'MyApp'; + public $name = 'MyApp'; /** * comments property @@ -123,7 +123,7 @@ class TestAppSchema extends CakeSchema { * @var array * @access public */ - var $comments = array( + public $comments = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => 0,'key' => 'primary'), 'article_id' => array('type' => 'integer', 'null' => false), 'user_id' => array('type' => 'integer', 'null' => false), @@ -141,7 +141,7 @@ class TestAppSchema extends CakeSchema { * @var array * @access public */ - var $posts = array( + public $posts = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => 0, 'key' => 'primary'), 'author_id' => array('type' => 'integer', 'null' => false), 'title' => array('type' => 'string', 'null' => false), @@ -159,7 +159,7 @@ class TestAppSchema extends CakeSchema { * @var array * @access public */ - var $posts_tags = array( + public $posts_tags = array( 'post_id' => array('type' => 'integer', 'null' => false, 'key' => 'primary'), 'tag_id' => array('type' => 'string', 'null' => false, 'key' => 'primary'), 'indexes' => array('posts_tag' => array('column' => array('tag_id', 'post_id'), 'unique' => 1)), @@ -172,7 +172,7 @@ class TestAppSchema extends CakeSchema { * @var array * @access public */ - var $tags = array( + public $tags = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => 0, 'key' => 'primary'), 'tag' => array('type' => 'string', 'null' => false), 'created' => array('type' => 'datetime', 'null' => true, 'default' => null), @@ -187,7 +187,7 @@ class TestAppSchema extends CakeSchema { * @var array * @access public */ - var $datatypes = array( + public $datatypes = array( 'id' => array('type' => 'integer', 'null' => false, 'default' => 0, 'key' => 'primary'), 'float_field' => array('type' => 'float', 'null' => false, 'length' => '5,2', 'default' => ''), 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => true)), @@ -229,7 +229,7 @@ class SchemaPost extends CakeTestModel { * @var string 'SchemaPost' * @access public */ - var $name = 'SchemaPost'; + public $name = 'SchemaPost'; /** * useTable property @@ -237,7 +237,7 @@ class SchemaPost extends CakeTestModel { * @var string 'posts' * @access public */ - var $useTable = 'posts'; + public $useTable = 'posts'; /** * hasMany property @@ -245,7 +245,7 @@ class SchemaPost extends CakeTestModel { * @var array * @access public */ - var $hasMany = array('SchemaComment'); + public $hasMany = array('SchemaComment'); /** * hasAndBelongsToMany property @@ -253,7 +253,7 @@ class SchemaPost extends CakeTestModel { * @var array * @access public */ - var $hasAndBelongsToMany = array('SchemaTag'); + public $hasAndBelongsToMany = array('SchemaTag'); } /** @@ -270,7 +270,7 @@ class SchemaComment extends CakeTestModel { * @var string 'SchemaComment' * @access public */ - var $name = 'SchemaComment'; + public $name = 'SchemaComment'; /** * useTable property @@ -278,7 +278,7 @@ class SchemaComment extends CakeTestModel { * @var string 'comments' * @access public */ - var $useTable = 'comments'; + public $useTable = 'comments'; /** * belongsTo property @@ -286,7 +286,7 @@ class SchemaComment extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('SchemaPost'); + public $belongsTo = array('SchemaPost'); } /** @@ -303,7 +303,7 @@ class SchemaTag extends CakeTestModel { * @var string 'SchemaTag' * @access public */ - var $name = 'SchemaTag'; + public $name = 'SchemaTag'; /** * useTable property @@ -311,7 +311,7 @@ class SchemaTag extends CakeTestModel { * @var string 'tags' * @access public */ - var $useTable = 'tags'; + public $useTable = 'tags'; /** * hasAndBelongsToMany property @@ -319,7 +319,7 @@ class SchemaTag extends CakeTestModel { * @var array * @access public */ - var $hasAndBelongsToMany = array('SchemaPost'); + public $hasAndBelongsToMany = array('SchemaPost'); } /** @@ -336,7 +336,7 @@ class SchemaDatatype extends CakeTestModel { * @var string 'SchemaDatatype' * @access public */ - var $name = 'SchemaDatatype'; + public $name = 'SchemaDatatype'; /** * useTable property @@ -344,7 +344,7 @@ class SchemaDatatype extends CakeTestModel { * @var string 'datatypes' * @access public */ - var $useTable = 'datatypes'; + public $useTable = 'datatypes'; } /** @@ -366,7 +366,7 @@ class Testdescribe extends CakeTestModel { * @var string 'Testdescribe' * @access public */ - var $name = 'Testdescribe'; + public $name = 'Testdescribe'; } /** @@ -383,7 +383,7 @@ class SchemaCrossDatabase extends CakeTestModel { * @var string 'SchemaCrossDatabase' * @access public */ - var $name = 'SchemaCrossDatabase'; + public $name = 'SchemaCrossDatabase'; /** * useTable property @@ -391,7 +391,7 @@ class SchemaCrossDatabase extends CakeTestModel { * @var string 'posts' * @access public */ - var $useTable = 'cross_database'; + public $useTable = 'cross_database'; /** * useDbConfig property @@ -399,7 +399,7 @@ class SchemaCrossDatabase extends CakeTestModel { * @var string 'test2' * @access public */ - var $useDbConfig = 'test2'; + public $useDbConfig = 'test2'; } /** @@ -416,14 +416,14 @@ class SchemaCrossDatabaseFixture extends CakeTestFixture { * @var string 'CrossDatabase' * @access public */ - var $name = 'CrossDatabase'; + public $name = 'CrossDatabase'; /** * table property * * @access public */ - var $table = 'cross_database'; + public $table = 'cross_database'; /** * fields property @@ -431,7 +431,7 @@ class SchemaCrossDatabaseFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => 'string' ); @@ -442,7 +442,7 @@ class SchemaCrossDatabaseFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => 1, 'name' => 'First'), array('id' => 2, 'name' => 'Second'), ); @@ -462,7 +462,7 @@ class CakeSchemaTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array( + public $fixtures = array( 'core.post', 'core.tag', 'core.posts_tag', 'core.test_plugin_comment', 'core.datatype', 'core.auth_user', 'core.author', 'core.test_plugin_article', 'core.user', 'core.comment' diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php index 8c28bc05c..b4c6aa456 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php @@ -39,7 +39,7 @@ class DboMssqlTestDb extends DboMssql { * @var array * @access public */ - var $simulated = array(); + public $simulated = array(); /** * simalate property @@ -47,14 +47,14 @@ class DboMssqlTestDb extends DboMssql { * @var array * @access public */ - var $simulate = true; + public $simulate = true; /** * fetchAllResultsStack * * @var array * @access public */ - var $fetchAllResultsStack = array(); + public $fetchAllResultsStack = array(); /** * execute method @@ -143,7 +143,7 @@ class MssqlTestModel extends Model { * @var string 'MssqlTestModel' * @access public */ - var $name = 'MssqlTestModel'; + public $name = 'MssqlTestModel'; /** * useTable property @@ -151,7 +151,7 @@ class MssqlTestModel extends Model { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * _schema property @@ -186,7 +186,7 @@ class MssqlTestModel extends Model { * @var array * @access public */ - var $belongsTo = array( + public $belongsTo = array( 'MssqlClientTestModel' => array( 'foreignKey' => 'client_id' ) @@ -244,14 +244,14 @@ class MssqlClientTestModel extends Model { * @var string 'MssqlAssociatedTestModel' * @access public */ - var $name = 'MssqlClientTestModel'; + public $name = 'MssqlClientTestModel'; /** * useTable property * * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * _schema property * @@ -280,7 +280,7 @@ class DboMssqlTest extends CakeTestCase { * @var DboSource * @access public */ - var $db = null; + public $db = null; /** * autoFixtures property @@ -288,14 +288,14 @@ class DboMssqlTest extends CakeTestCase { * @var bool false * @access public */ - var $autoFixtures = false; + public $autoFixtures = false; /** * fixtures property * * @var array * @access public */ - var $fixtures = array('core.category'); + public $fixtures = array('core.category'); /** * Skip if cannot connect to mssql * diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php index 1c31c6e30..580a31ee0 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php @@ -35,7 +35,7 @@ class DboMysqlTestDb extends DboMysql { * @var array * @access public */ - var $simulated = array(); + public $simulated = array(); /** * testing property @@ -43,7 +43,7 @@ class DboMysqlTestDb extends DboMysql { * @var bool true * @access public */ - var $testing = true; + public $testing = true; /** * execute method @@ -85,7 +85,7 @@ class MysqlTestModel extends Model { * @var string 'MysqlTestModel' * @access public */ - var $name = 'MysqlTestModel'; + public $name = 'MysqlTestModel'; /** * useTable property @@ -93,7 +93,7 @@ class MysqlTestModel extends Model { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * find method @@ -160,14 +160,14 @@ function schema() { * @subpackage cake.tests.cases.libs.model.datasources.dbo */ class DboMysqlTest extends CakeTestCase { - var $fixtures = array('core.binary_test'); + public $fixtures = array('core.binary_test'); /** * The Dbo instance to be tested * * @var DboSource * @access public */ - var $Db = null; + public $Db = null; /** * Skip if cannot connect to mysql diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php index 358845a12..6f2163e02 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php @@ -36,7 +36,7 @@ class DboMysqliTestDb extends DboMysqli { * @var array * @access public */ - var $simulated = array(); + public $simulated = array(); /** * testing property @@ -44,7 +44,7 @@ class DboMysqliTestDb extends DboMysqli { * @var bool true * @access public */ - var $testing = true; + public $testing = true; /** * execute method @@ -86,7 +86,7 @@ class MysqliTestModel extends Model { * @var string 'MysqlTestModel' * @access public */ - var $name = 'MysqliTestModel'; + public $name = 'MysqliTestModel'; /** * useTable property @@ -94,7 +94,7 @@ class MysqliTestModel extends Model { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * schema method @@ -133,14 +133,14 @@ function schema() { * @subpackage cake.tests.cases.libs.model.datasources.dbo */ class DboMysqliTest extends CakeTestCase { - var $fixtures = array('core.datatype'); + public $fixtures = array('core.datatype'); /** * The Dbo instance to be tested * * @var DboSource * @access public */ - var $Db = null; + public $Db = null; /** * Skip if cannot connect to mysqli diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php index f879d3bab..121d0b2c5 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php @@ -34,7 +34,7 @@ class DboOracleTest extends CakeTestCase { /** * fixtures property */ - var $fixtures = array('core.oracle_user'); + public $fixtures = array('core.oracle_user'); /** * setup method diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php index 89be2bfa4..cbabaf5ab 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php @@ -35,7 +35,7 @@ class DboPostgresTestDb extends DboPostgres { * @var array * @access public */ - var $simulated = array(); + public $simulated = array(); /** * execute method @@ -74,7 +74,7 @@ class PostgresTestModel extends Model { * @var string 'PostgresTestModel' * @access public */ - var $name = 'PostgresTestModel'; + public $name = 'PostgresTestModel'; /** * useTable property @@ -82,7 +82,7 @@ class PostgresTestModel extends Model { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * belongsTo property @@ -90,7 +90,7 @@ class PostgresTestModel extends Model { * @var array * @access public */ - var $belongsTo = array( + public $belongsTo = array( 'PostgresClientTestModel' => array( 'foreignKey' => 'client_id' ) @@ -168,7 +168,7 @@ class PostgresClientTestModel extends Model { * @var string 'PostgresClientTestModel' * @access public */ - var $name = 'PostgresClientTestModel'; + public $name = 'PostgresClientTestModel'; /** * useTable property @@ -176,7 +176,7 @@ class PostgresClientTestModel extends Model { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * schema method @@ -210,7 +210,7 @@ class DboPostgresTest extends CakeTestCase { * @var boolean * @access public */ - var $autoFixtures = false; + public $autoFixtures = false; /** * Fixtures @@ -218,7 +218,7 @@ class DboPostgresTest extends CakeTestCase { * @var object * @access public */ - var $fixtures = array('core.user', 'core.binary_test', 'core.comment', 'core.article', + public $fixtures = array('core.user', 'core.binary_test', 'core.comment', 'core.article', 'core.tag', 'core.articles_tag', 'core.attachment', 'core.person', 'core.post', 'core.author', ); /** @@ -227,7 +227,7 @@ class DboPostgresTest extends CakeTestCase { * @var DboSource * @access public */ - var $db = null; + public $db = null; /** * Simulated DB connection used in testing @@ -235,7 +235,7 @@ class DboPostgresTest extends CakeTestCase { * @var DboSource * @access public */ - var $db2 = null; + public $db2 = null; /** * Skip if cannot connect to postgres diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php index f5522b973..db77fdf24 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php @@ -33,7 +33,7 @@ class DboSqliteTestDb extends DboSqlite { * @var array * @access public */ - var $simulated = array(); + public $simulated = array(); /** * execute method @@ -72,7 +72,7 @@ class DboSqliteTest extends CakeTestCase { * @var boolean * @access public */ - var $autoFixtures = false; + public $autoFixtures = false; /** * Fixtures @@ -80,7 +80,7 @@ class DboSqliteTest extends CakeTestCase { * @var object * @access public */ - var $fixtures = array('core.user'); + public $fixtures = array('core.user'); /** * Actual DB connection used in testing @@ -88,7 +88,7 @@ class DboSqliteTest extends CakeTestCase { * @var DboSource * @access public */ - var $db = null; + public $db = null; /** * Simulated DB connection used in testing @@ -96,7 +96,7 @@ class DboSqliteTest extends CakeTestCase { * @var DboSource * @access public */ - var $db2 = null; + public $db2 = null; /** * Skip if cannot connect to SQLite diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index f5aafa3a0..bee5967a5 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -37,7 +37,7 @@ class TestModel extends CakeTestModel { * @var string 'TestModel' * @access public */ - var $name = 'TestModel'; + public $name = 'TestModel'; /** * useTable property @@ -45,7 +45,7 @@ class TestModel extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * schema property @@ -117,7 +117,7 @@ class TestModel2 extends CakeTestModel { * @var string 'TestModel2' * @access public */ - var $name = 'TestModel2'; + public $name = 'TestModel2'; /** * useTable property @@ -125,7 +125,7 @@ class TestModel2 extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; } /** @@ -142,7 +142,7 @@ class TestModel3 extends CakeTestModel { * @var string 'TestModel3' * @access public */ - var $name = 'TestModel3'; + public $name = 'TestModel3'; /** * useTable property @@ -150,7 +150,7 @@ class TestModel3 extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; } /** @@ -167,7 +167,7 @@ class TestModel4 extends CakeTestModel { * @var string 'TestModel4' * @access public */ - var $name = 'TestModel4'; + public $name = 'TestModel4'; /** * table property @@ -175,7 +175,7 @@ class TestModel4 extends CakeTestModel { * @var string 'test_model4' * @access public */ - var $table = 'test_model4'; + public $table = 'test_model4'; /** * useTable property @@ -183,7 +183,7 @@ class TestModel4 extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * belongsTo property @@ -191,7 +191,7 @@ class TestModel4 extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array( + public $belongsTo = array( 'TestModel4Parent' => array( 'className' => 'TestModel4', 'foreignKey' => 'parent_id' @@ -204,7 +204,7 @@ class TestModel4 extends CakeTestModel { * @var array * @access public */ - var $hasOne = array( + public $hasOne = array( 'TestModel5' => array( 'className' => 'TestModel5', 'foreignKey' => 'test_model4_id' @@ -217,7 +217,7 @@ class TestModel4 extends CakeTestModel { * @var array * @access public */ - var $hasAndBelongsToMany = array('TestModel7' => array( + public $hasAndBelongsToMany = array('TestModel7' => array( 'className' => 'TestModel7', 'joinTable' => 'test_model4_test_model7', 'foreignKey' => 'test_model4_id', @@ -258,7 +258,7 @@ class TestModel4TestModel7 extends CakeTestModel { * @var string 'TestModel4TestModel7' * @access public */ - var $name = 'TestModel4TestModel7'; + public $name = 'TestModel4TestModel7'; /** * table property @@ -266,7 +266,7 @@ class TestModel4TestModel7 extends CakeTestModel { * @var string 'test_model4_test_model7' * @access public */ - var $table = 'test_model4_test_model7'; + public $table = 'test_model4_test_model7'; /** * useTable property @@ -274,7 +274,7 @@ class TestModel4TestModel7 extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * schema method @@ -307,7 +307,7 @@ class TestModel5 extends CakeTestModel { * @var string 'TestModel5' * @access public */ - var $name = 'TestModel5'; + public $name = 'TestModel5'; /** * table property @@ -315,7 +315,7 @@ class TestModel5 extends CakeTestModel { * @var string 'test_model5' * @access public */ - var $table = 'test_model5'; + public $table = 'test_model5'; /** * useTable property @@ -323,7 +323,7 @@ class TestModel5 extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * belongsTo property @@ -331,7 +331,7 @@ class TestModel5 extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('TestModel4' => array( + public $belongsTo = array('TestModel4' => array( 'className' => 'TestModel4', 'foreignKey' => 'test_model4_id' )); @@ -342,7 +342,7 @@ class TestModel5 extends CakeTestModel { * @var array * @access public */ - var $hasMany = array('TestModel6' => array( + public $hasMany = array('TestModel6' => array( 'className' => 'TestModel6', 'foreignKey' => 'test_model5_id' )); @@ -381,7 +381,7 @@ class TestModel6 extends CakeTestModel { * @var string 'TestModel6' * @access public */ - var $name = 'TestModel6'; + public $name = 'TestModel6'; /** * table property @@ -389,7 +389,7 @@ class TestModel6 extends CakeTestModel { * @var string 'test_model6' * @access public */ - var $table = 'test_model6'; + public $table = 'test_model6'; /** * useTable property @@ -397,7 +397,7 @@ class TestModel6 extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * belongsTo property @@ -405,7 +405,7 @@ class TestModel6 extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('TestModel5' => array( + public $belongsTo = array('TestModel5' => array( 'className' => 'TestModel5', 'foreignKey' => 'test_model5_id' )); @@ -444,7 +444,7 @@ class TestModel7 extends CakeTestModel { * @var string 'TestModel7' * @access public */ - var $name = 'TestModel7'; + public $name = 'TestModel7'; /** * table property @@ -452,7 +452,7 @@ class TestModel7 extends CakeTestModel { * @var string 'test_model7' * @access public */ - var $table = 'test_model7'; + public $table = 'test_model7'; /** * useTable property @@ -460,7 +460,7 @@ class TestModel7 extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * schema method @@ -495,7 +495,7 @@ class TestModel8 extends CakeTestModel { * @var string 'TestModel8' * @access public */ - var $name = 'TestModel8'; + public $name = 'TestModel8'; /** * table property @@ -503,7 +503,7 @@ class TestModel8 extends CakeTestModel { * @var string 'test_model8' * @access public */ - var $table = 'test_model8'; + public $table = 'test_model8'; /** * useTable property @@ -511,7 +511,7 @@ class TestModel8 extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * hasOne property @@ -519,7 +519,7 @@ class TestModel8 extends CakeTestModel { * @var array * @access public */ - var $hasOne = array( + public $hasOne = array( 'TestModel9' => array( 'className' => 'TestModel9', 'foreignKey' => 'test_model8_id', @@ -561,7 +561,7 @@ class TestModel9 extends CakeTestModel { * @var string 'TestModel9' * @access public */ - var $name = 'TestModel9'; + public $name = 'TestModel9'; /** * table property @@ -569,7 +569,7 @@ class TestModel9 extends CakeTestModel { * @var string 'test_model9' * @access public */ - var $table = 'test_model9'; + public $table = 'test_model9'; /** * useTable property @@ -577,7 +577,7 @@ class TestModel9 extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * belongsTo property @@ -585,7 +585,7 @@ class TestModel9 extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('TestModel8' => array( + public $belongsTo = array('TestModel8' => array( 'className' => 'TestModel8', 'foreignKey' => 'test_model8_id', 'conditions' => 'TestModel8.name != \'larry\'' @@ -625,7 +625,7 @@ class Level extends CakeTestModel { * @var string 'Level' * @access public */ - var $name = 'Level'; + public $name = 'Level'; /** * table property @@ -633,7 +633,7 @@ class Level extends CakeTestModel { * @var string 'level' * @access public */ - var $table = 'level'; + public $table = 'level'; /** * useTable property @@ -641,7 +641,7 @@ class Level extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * hasMany property @@ -649,7 +649,7 @@ class Level extends CakeTestModel { * @var array * @access public */ - var $hasMany = array( + public $hasMany = array( 'Group'=> array( 'className' => 'Group' ), @@ -689,7 +689,7 @@ class Group extends CakeTestModel { * @var string 'Group' * @access public */ - var $name = 'Group'; + public $name = 'Group'; /** * table property @@ -697,7 +697,7 @@ class Group extends CakeTestModel { * @var string 'group' * @access public */ - var $table = 'group'; + public $table = 'group'; /** * useTable property @@ -705,7 +705,7 @@ class Group extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * belongsTo property @@ -713,7 +713,7 @@ class Group extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('Level'); + public $belongsTo = array('Level'); /** * hasMany property @@ -721,7 +721,7 @@ class Group extends CakeTestModel { * @var array * @access public */ - var $hasMany = array('Category2', 'User2'); + public $hasMany = array('Category2', 'User2'); /** * schema method @@ -756,7 +756,7 @@ class User2 extends CakeTestModel { * @var string 'User2' * @access public */ - var $name = 'User2'; + public $name = 'User2'; /** * table property @@ -764,7 +764,7 @@ class User2 extends CakeTestModel { * @var string 'user' * @access public */ - var $table = 'user'; + public $table = 'user'; /** * useTable property @@ -772,7 +772,7 @@ class User2 extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * belongsTo property @@ -780,7 +780,7 @@ class User2 extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array( + public $belongsTo = array( 'Group' => array( 'className' => 'Group' ), @@ -795,7 +795,7 @@ class User2 extends CakeTestModel { * @var array * @access public */ - var $hasMany = array( + public $hasMany = array( 'Article2' => array( 'className' => 'Article2' ), @@ -834,7 +834,7 @@ class Category2 extends CakeTestModel { * @var string 'Category2' * @access public */ - var $name = 'Category2'; + public $name = 'Category2'; /** * table property @@ -842,7 +842,7 @@ class Category2 extends CakeTestModel { * @var string 'category' * @access public */ - var $table = 'category'; + public $table = 'category'; /** * useTable property @@ -850,7 +850,7 @@ class Category2 extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * belongsTo property @@ -858,7 +858,7 @@ class Category2 extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array( + public $belongsTo = array( 'Group' => array( 'className' => 'Group', 'foreignKey' => 'group_id' @@ -875,7 +875,7 @@ class Category2 extends CakeTestModel { * @var array * @access public */ - var $hasMany = array( + public $hasMany = array( 'ChildCat' => array( 'className' => 'Category2', 'foreignKey' => 'parent_id' @@ -923,7 +923,7 @@ class Article2 extends CakeTestModel { * @var string 'Article2' * @access public */ - var $name = 'Article2'; + public $name = 'Article2'; /** * table property @@ -931,7 +931,7 @@ class Article2 extends CakeTestModel { * @var string 'article' * @access public */ - var $table = 'article'; + public $table = 'article'; /** * useTable property @@ -939,7 +939,7 @@ class Article2 extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * belongsTo property @@ -947,7 +947,7 @@ class Article2 extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array( + public $belongsTo = array( 'Category2' => array('className' => 'Category2'), 'User2' => array('className' => 'User2') ); @@ -1000,7 +1000,7 @@ class CategoryFeatured2 extends CakeTestModel { * @var string 'CategoryFeatured2' * @access public */ - var $name = 'CategoryFeatured2'; + public $name = 'CategoryFeatured2'; /** * table property @@ -1008,7 +1008,7 @@ class CategoryFeatured2 extends CakeTestModel { * @var string 'category_featured' * @access public */ - var $table = 'category_featured'; + public $table = 'category_featured'; /** * useTable property @@ -1016,7 +1016,7 @@ class CategoryFeatured2 extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * schema method @@ -1052,7 +1052,7 @@ class Featured2 extends CakeTestModel { * @var string 'Featured2' * @access public */ - var $name = 'Featured2'; + public $name = 'Featured2'; /** * table property @@ -1060,7 +1060,7 @@ class Featured2 extends CakeTestModel { * @var string 'featured2' * @access public */ - var $table = 'featured2'; + public $table = 'featured2'; /** * useTable property @@ -1068,7 +1068,7 @@ class Featured2 extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * belongsTo property @@ -1076,7 +1076,7 @@ class Featured2 extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array( + public $belongsTo = array( 'CategoryFeatured2' => array( 'className' => 'CategoryFeatured2' ) @@ -1115,7 +1115,7 @@ class Comment2 extends CakeTestModel { * @var string 'Comment2' * @access public */ - var $name = 'Comment2'; + public $name = 'Comment2'; /** * table property @@ -1123,7 +1123,7 @@ class Comment2 extends CakeTestModel { * @var string 'comment' * @access public */ - var $table = 'comment'; + public $table = 'comment'; /** * belongsTo property @@ -1131,7 +1131,7 @@ class Comment2 extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('ArticleFeatured2', 'User2'); + public $belongsTo = array('ArticleFeatured2', 'User2'); /** * useTable property @@ -1139,7 +1139,7 @@ class Comment2 extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * schema method @@ -1174,7 +1174,7 @@ class ArticleFeatured2 extends CakeTestModel { * @var string 'ArticleFeatured2' * @access public */ - var $name = 'ArticleFeatured2'; + public $name = 'ArticleFeatured2'; /** * table property @@ -1182,7 +1182,7 @@ class ArticleFeatured2 extends CakeTestModel { * @var string 'article_featured' * @access public */ - var $table = 'article_featured'; + public $table = 'article_featured'; /** * useTable property @@ -1190,7 +1190,7 @@ class ArticleFeatured2 extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * belongsTo property @@ -1198,7 +1198,7 @@ class ArticleFeatured2 extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array( + public $belongsTo = array( 'CategoryFeatured2' => array('className' => 'CategoryFeatured2'), 'User2' => array('className' => 'User2') ); @@ -1209,7 +1209,7 @@ class ArticleFeatured2 extends CakeTestModel { * @var array * @access public */ - var $hasOne = array( + public $hasOne = array( 'Featured2' => array('className' => 'Featured2') ); @@ -1219,7 +1219,7 @@ class ArticleFeatured2 extends CakeTestModel { * @var array * @access public */ - var $hasMany = array( + public $hasMany = array( 'Comment2' => array('className'=>'Comment2', 'dependent' => true) ); @@ -1261,7 +1261,7 @@ class DboSourceTest extends CakeTestCase { * @var mixed null * @access public */ - var $debug = null; + public $debug = null; /** * autoFixtures property @@ -1269,7 +1269,7 @@ class DboSourceTest extends CakeTestCase { * @var bool false * @access public */ - var $autoFixtures = false; + public $autoFixtures = false; /** * fixtures property @@ -1277,7 +1277,7 @@ class DboSourceTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array( + public $fixtures = array( 'core.apple', 'core.article', 'core.articles_tag', 'core.attachment', 'core.comment', 'core.sample', 'core.tag', 'core.user', 'core.post', 'core.author' ); diff --git a/cake/tests/cases/libs/model/db_acl.test.php b/cake/tests/cases/libs/model/db_acl.test.php index 432bf94b3..18a9f8cf1 100644 --- a/cake/tests/cases/libs/model/db_acl.test.php +++ b/cake/tests/cases/libs/model/db_acl.test.php @@ -37,7 +37,7 @@ class DbAclNodeTestBase extends AclNode { * @var string 'test_suite' * @access public */ - var $useDbConfig = 'test_suite'; + public $useDbConfig = 'test_suite'; /** * cacheSources property @@ -45,7 +45,7 @@ class DbAclNodeTestBase extends AclNode { * @var bool false * @access public */ - var $cacheSources = false; + public $cacheSources = false; } /** @@ -62,7 +62,7 @@ class DbAroTest extends DbAclNodeTestBase { * @var string 'DbAroTest' * @access public */ - var $name = 'DbAroTest'; + public $name = 'DbAroTest'; /** * useTable property @@ -70,7 +70,7 @@ class DbAroTest extends DbAclNodeTestBase { * @var string 'aros' * @access public */ - var $useTable = 'aros'; + public $useTable = 'aros'; /** * hasAndBelongsToMany property @@ -78,7 +78,7 @@ class DbAroTest extends DbAclNodeTestBase { * @var array * @access public */ - var $hasAndBelongsToMany = array('DbAcoTest' => array('with' => 'DbPermissionTest')); + public $hasAndBelongsToMany = array('DbAcoTest' => array('with' => 'DbPermissionTest')); } /** @@ -95,7 +95,7 @@ class DbAcoTest extends DbAclNodeTestBase { * @var string 'DbAcoTest' * @access public */ - var $name = 'DbAcoTest'; + public $name = 'DbAcoTest'; /** * useTable property @@ -103,7 +103,7 @@ class DbAcoTest extends DbAclNodeTestBase { * @var string 'acos' * @access public */ - var $useTable = 'acos'; + public $useTable = 'acos'; /** * hasAndBelongsToMany property @@ -111,7 +111,7 @@ class DbAcoTest extends DbAclNodeTestBase { * @var array * @access public */ - var $hasAndBelongsToMany = array('DbAroTest' => array('with' => 'DbPermissionTest')); + public $hasAndBelongsToMany = array('DbAroTest' => array('with' => 'DbPermissionTest')); } /** @@ -128,7 +128,7 @@ class DbPermissionTest extends CakeTestModel { * @var string 'DbPermissionTest' * @access public */ - var $name = 'DbPermissionTest'; + public $name = 'DbPermissionTest'; /** * useTable property @@ -136,7 +136,7 @@ class DbPermissionTest extends CakeTestModel { * @var string 'aros_acos' * @access public */ - var $useTable = 'aros_acos'; + public $useTable = 'aros_acos'; /** * cacheQueries property @@ -144,7 +144,7 @@ class DbPermissionTest extends CakeTestModel { * @var bool false * @access public */ - var $cacheQueries = false; + public $cacheQueries = false; /** * belongsTo property @@ -152,7 +152,7 @@ class DbPermissionTest extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('DbAroTest' => array('foreignKey' => 'aro_id'), 'DbAcoTest' => array('foreignKey' => 'aco_id')); + public $belongsTo = array('DbAroTest' => array('foreignKey' => 'aro_id'), 'DbAcoTest' => array('foreignKey' => 'aco_id')); } /** @@ -169,7 +169,7 @@ class DbAcoActionTest extends CakeTestModel { * @var string 'DbAcoActionTest' * @access public */ - var $name = 'DbAcoActionTest'; + public $name = 'DbAcoActionTest'; /** * useTable property @@ -177,7 +177,7 @@ class DbAcoActionTest extends CakeTestModel { * @var string 'aco_actions' * @access public */ - var $useTable = 'aco_actions'; + public $useTable = 'aco_actions'; /** * belongsTo property @@ -185,7 +185,7 @@ class DbAcoActionTest extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('DbAcoTest' => array('foreignKey' => 'aco_id')); + public $belongsTo = array('DbAcoTest' => array('foreignKey' => 'aco_id')); } /** @@ -202,7 +202,7 @@ class DbAroUserTest extends CakeTestModel { * @var string 'AuthUser' * @access public */ - var $name = 'AuthUser'; + public $name = 'AuthUser'; /** * useTable property @@ -210,7 +210,7 @@ class DbAroUserTest extends CakeTestModel { * @var string 'auth_users' * @access public */ - var $useTable = 'auth_users'; + public $useTable = 'auth_users'; /** * bindNode method * @@ -263,7 +263,7 @@ class AclNodeTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.aro', 'core.aco', 'core.aros_aco', 'core.aco_action', 'core.auth_user'); + public $fixtures = array('core.aro', 'core.aco', 'core.aros_aco', 'core.aco_action', 'core.auth_user'); /** * setUp method diff --git a/cake/tests/cases/libs/model/model.test.php b/cake/tests/cases/libs/model/model.test.php index 016be5b73..b65c5c02e 100644 --- a/cake/tests/cases/libs/model/model.test.php +++ b/cake/tests/cases/libs/model/model.test.php @@ -36,7 +36,7 @@ class BaseModelTest extends CakeTestCase { * @var bool false * @access public */ - var $autoFixtures = false; + public $autoFixtures = false; /** * fixtures property @@ -44,7 +44,7 @@ class BaseModelTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array( + public $fixtures = array( 'core.category', 'core.category_thread', 'core.user', 'core.my_category', 'core.my_product', 'core.my_user', 'core.my_categories_my_users', 'core.my_categories_my_products', 'core.article', 'core.featured', 'core.article_featureds_tags', 'core.article_featured', diff --git a/cake/tests/cases/libs/model/model_behavior.test.php b/cake/tests/cases/libs/model/model_behavior.test.php index 95daf2ddb..89adf248f 100644 --- a/cake/tests/cases/libs/model/model_behavior.test.php +++ b/cake/tests/cases/libs/model/model_behavior.test.php @@ -38,7 +38,7 @@ class TestBehavior extends ModelBehavior { * @var array * @access public */ - var $mapMethods = array('/test(\w+)/' => 'testMethod', '/look for\s+(.+)/' => 'speakEnglish'); + public $mapMethods = array('/test(\w+)/' => 'testMethod', '/look for\s+(.+)/' => 'speakEnglish'); /** * setup method @@ -423,7 +423,7 @@ class BehaviorTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array( + public $fixtures = array( 'core.apple', 'core.sample', 'core.article', 'core.user', 'core.comment', 'core.attachment', 'core.tag', 'core.articles_tag' ); diff --git a/cake/tests/cases/libs/model/models.php b/cake/tests/cases/libs/model/models.php index a324d30e5..d2b4f03bb 100644 --- a/cake/tests/cases/libs/model/models.php +++ b/cake/tests/cases/libs/model/models.php @@ -37,7 +37,7 @@ class Test extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * name property @@ -45,7 +45,7 @@ class Test extends CakeTestModel { * @var string 'Test' * @access public */ - var $name = 'Test'; + public $name = 'Test'; /** * schema property @@ -77,7 +77,7 @@ class TestAlias extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * name property @@ -85,7 +85,7 @@ class TestAlias extends CakeTestModel { * @var string 'TestAlias' * @access public */ - var $name = 'TestAlias'; + public $name = 'TestAlias'; /** * alias property @@ -93,7 +93,7 @@ class TestAlias extends CakeTestModel { * @var string 'TestAlias' * @access public */ - var $alias = 'TestAlias'; + public $alias = 'TestAlias'; /** * schema property @@ -125,7 +125,7 @@ class TestValidate extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * name property @@ -133,7 +133,7 @@ class TestValidate extends CakeTestModel { * @var string 'TestValidate' * @access public */ - var $name = 'TestValidate'; + public $name = 'TestValidate'; /** * schema property @@ -190,7 +190,7 @@ class User extends CakeTestModel { * @var string 'User' * @access public */ - var $name = 'User'; + public $name = 'User'; /** * validate property @@ -198,7 +198,7 @@ class User extends CakeTestModel { * @var array * @access public */ - var $validate = array('user' => 'notEmpty', 'password' => 'notEmpty'); + public $validate = array('user' => 'notEmpty', 'password' => 'notEmpty'); } /** @@ -215,7 +215,7 @@ class Article extends CakeTestModel { * @var string 'Article' * @access public */ - var $name = 'Article'; + public $name = 'Article'; /** * belongsTo property @@ -223,7 +223,7 @@ class Article extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('User'); + public $belongsTo = array('User'); /** * hasMany property @@ -231,7 +231,7 @@ class Article extends CakeTestModel { * @var array * @access public */ - var $hasMany = array('Comment' => array('dependent' => true)); + public $hasMany = array('Comment' => array('dependent' => true)); /** * hasAndBelongsToMany property @@ -239,7 +239,7 @@ class Article extends CakeTestModel { * @var array * @access public */ - var $hasAndBelongsToMany = array('Tag'); + public $hasAndBelongsToMany = array('Tag'); /** * validate property @@ -247,7 +247,7 @@ class Article extends CakeTestModel { * @var array * @access public */ - var $validate = array('user_id' => 'numeric', 'title' => array('allowEmpty' => false, 'rule' => 'notEmpty'), 'body' => 'notEmpty'); + public $validate = array('user_id' => 'numeric', 'title' => array('allowEmpty' => false, 'rule' => 'notEmpty'), 'body' => 'notEmpty'); /** * beforeSaveReturn property @@ -255,7 +255,7 @@ class Article extends CakeTestModel { * @var bool true * @access public */ - var $beforeSaveReturn = true; + public $beforeSaveReturn = true; /** * beforeSave method @@ -296,7 +296,7 @@ class NumericArticle extends CakeTestModel { * @var string 'NumericArticle' * @access public */ - var $name = 'NumericArticle'; + public $name = 'NumericArticle'; /** * useTable property @@ -304,7 +304,7 @@ class NumericArticle extends CakeTestModel { * @var string 'numeric_articles' * @access public */ - var $useTable = 'numeric_articles'; + public $useTable = 'numeric_articles'; } /** @@ -321,7 +321,7 @@ class Article10 extends CakeTestModel { * @var string 'Article10' * @access public */ - var $name = 'Article10'; + public $name = 'Article10'; /** * useTable property @@ -329,7 +329,7 @@ class Article10 extends CakeTestModel { * @var string 'articles' * @access public */ - var $useTable = 'articles'; + public $useTable = 'articles'; /** * hasMany property @@ -337,7 +337,7 @@ class Article10 extends CakeTestModel { * @var array * @access public */ - var $hasMany = array('Comment' => array('dependent' => true, 'exclusive' => true)); + public $hasMany = array('Comment' => array('dependent' => true, 'exclusive' => true)); } /** @@ -354,7 +354,7 @@ class ArticleFeatured extends CakeTestModel { * @var string 'ArticleFeatured' * @access public */ - var $name = 'ArticleFeatured'; + public $name = 'ArticleFeatured'; /** * belongsTo property @@ -362,7 +362,7 @@ class ArticleFeatured extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('User', 'Category'); + public $belongsTo = array('User', 'Category'); /** * hasOne property @@ -370,7 +370,7 @@ class ArticleFeatured extends CakeTestModel { * @var array * @access public */ - var $hasOne = array('Featured'); + public $hasOne = array('Featured'); /** * hasMany property @@ -378,7 +378,7 @@ class ArticleFeatured extends CakeTestModel { * @var array * @access public */ - var $hasMany = array('Comment' => array('className' => 'Comment', 'dependent' => true)); + public $hasMany = array('Comment' => array('className' => 'Comment', 'dependent' => true)); /** * hasAndBelongsToMany property @@ -386,7 +386,7 @@ class ArticleFeatured extends CakeTestModel { * @var array * @access public */ - var $hasAndBelongsToMany = array('Tag'); + public $hasAndBelongsToMany = array('Tag'); /** * validate property @@ -394,7 +394,7 @@ class ArticleFeatured extends CakeTestModel { * @var array * @access public */ - var $validate = array('user_id' => 'numeric', 'title' => 'notEmpty', 'body' => 'notEmpty'); + public $validate = array('user_id' => 'numeric', 'title' => 'notEmpty', 'body' => 'notEmpty'); } /** @@ -411,7 +411,7 @@ class Featured extends CakeTestModel { * @var string 'Featured' * @access public */ - var $name = 'Featured'; + public $name = 'Featured'; /** * belongsTo property @@ -419,7 +419,7 @@ class Featured extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('ArticleFeatured', 'Category'); + public $belongsTo = array('ArticleFeatured', 'Category'); } /** @@ -436,7 +436,7 @@ class Tag extends CakeTestModel { * @var string 'Tag' * @access public */ - var $name = 'Tag'; + public $name = 'Tag'; } /** @@ -453,7 +453,7 @@ class ArticlesTag extends CakeTestModel { * @var string 'ArticlesTag' * @access public */ - var $name = 'ArticlesTag'; + public $name = 'ArticlesTag'; } /** @@ -470,7 +470,7 @@ class ArticleFeaturedsTag extends CakeTestModel { * @var string 'ArticleFeaturedsTag' * @access public */ - var $name = 'ArticleFeaturedsTag'; + public $name = 'ArticleFeaturedsTag'; } /** @@ -487,7 +487,7 @@ class Comment extends CakeTestModel { * @var string 'Comment' * @access public */ - var $name = 'Comment'; + public $name = 'Comment'; /** * belongsTo property @@ -495,7 +495,7 @@ class Comment extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('Article', 'User'); + public $belongsTo = array('Article', 'User'); /** * hasOne property @@ -503,7 +503,7 @@ class Comment extends CakeTestModel { * @var array * @access public */ - var $hasOne = array('Attachment' => array('dependent' => true)); + public $hasOne = array('Attachment' => array('dependent' => true)); } /** @@ -520,7 +520,7 @@ class ModifiedComment extends CakeTestModel { * @var string 'Comment' * @access public */ - var $name = 'Comment'; + public $name = 'Comment'; /** * useTable property @@ -528,7 +528,7 @@ class ModifiedComment extends CakeTestModel { * @var string 'comments' * @access public */ - var $useTable = 'comments'; + public $useTable = 'comments'; /** * belongsTo property @@ -536,7 +536,7 @@ class ModifiedComment extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('Article'); + public $belongsTo = array('Article'); /** * afterFind callback @@ -565,7 +565,7 @@ class AgainModifiedComment extends CakeTestModel { * @var string 'Comment' * @access public */ - var $name = 'Comment'; + public $name = 'Comment'; /** * useTable property @@ -573,7 +573,7 @@ class AgainModifiedComment extends CakeTestModel { * @var string 'comments' * @access public */ - var $useTable = 'comments'; + public $useTable = 'comments'; /** * belongsTo property @@ -581,7 +581,7 @@ class AgainModifiedComment extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('Article'); + public $belongsTo = array('Article'); /** * afterFind callback @@ -609,7 +609,7 @@ class MergeVarPluginAppModel extends AppModel { * * @var array */ - var $actsAs = array( + public $actsAs = array( 'Containable' ); } @@ -627,7 +627,7 @@ class MergeVarPluginPost extends MergeVarPluginAppModel { * * @var array */ - var $actsAs = array( + public $actsAs = array( 'Tree' ); @@ -636,7 +636,7 @@ class MergeVarPluginPost extends MergeVarPluginAppModel { * * @var string */ - var $useTable = 'posts'; + public $useTable = 'posts'; } /** @@ -652,7 +652,7 @@ class MergeVarPluginComment extends MergeVarPluginAppModel { * * @var array */ - var $actsAs = array( + public $actsAs = array( 'Containable' => array('some_settings') ); @@ -661,7 +661,7 @@ class MergeVarPluginComment extends MergeVarPluginAppModel { * * @var string */ - var $useTable = 'comments'; + public $useTable = 'comments'; } @@ -679,7 +679,7 @@ class Attachment extends CakeTestModel { * @var string 'Attachment' * @access public */ - var $name = 'Attachment'; + public $name = 'Attachment'; } /** @@ -696,7 +696,7 @@ class Category extends CakeTestModel { * @var string 'Category' * @access public */ - var $name = 'Category'; + public $name = 'Category'; } /** @@ -713,7 +713,7 @@ class CategoryThread extends CakeTestModel { * @var string 'CategoryThread' * @access public */ - var $name = 'CategoryThread'; + public $name = 'CategoryThread'; /** * belongsTo property @@ -721,7 +721,7 @@ class CategoryThread extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('ParentCategory' => array('className' => 'CategoryThread', 'foreignKey' => 'parent_id')); + public $belongsTo = array('ParentCategory' => array('className' => 'CategoryThread', 'foreignKey' => 'parent_id')); } /** @@ -738,7 +738,7 @@ class Apple extends CakeTestModel { * @var string 'Apple' * @access public */ - var $name = 'Apple'; + public $name = 'Apple'; /** * validate property @@ -746,7 +746,7 @@ class Apple extends CakeTestModel { * @var array * @access public */ - var $validate = array('name' => 'notEmpty'); + public $validate = array('name' => 'notEmpty'); /** * hasOne property @@ -754,7 +754,7 @@ class Apple extends CakeTestModel { * @var array * @access public */ - var $hasOne = array('Sample'); + public $hasOne = array('Sample'); /** * hasMany property @@ -762,7 +762,7 @@ class Apple extends CakeTestModel { * @var array * @access public */ - var $hasMany = array('Child' => array('className' => 'Apple', 'dependent' => true)); + public $hasMany = array('Child' => array('className' => 'Apple', 'dependent' => true)); /** * belongsTo property @@ -770,7 +770,7 @@ class Apple extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('Parent' => array('className' => 'Apple', 'foreignKey' => 'apple_id')); + public $belongsTo = array('Parent' => array('className' => 'Apple', 'foreignKey' => 'apple_id')); } /** @@ -787,7 +787,7 @@ class Sample extends CakeTestModel { * @var string 'Sample' * @access public */ - var $name = 'Sample'; + public $name = 'Sample'; /** * belongsTo property @@ -795,7 +795,7 @@ class Sample extends CakeTestModel { * @var string 'Apple' * @access public */ - var $belongsTo = 'Apple'; + public $belongsTo = 'Apple'; } /** @@ -812,7 +812,7 @@ class AnotherArticle extends CakeTestModel { * @var string 'AnotherArticle' * @access public */ - var $name = 'AnotherArticle'; + public $name = 'AnotherArticle'; /** * hasMany property @@ -820,7 +820,7 @@ class AnotherArticle extends CakeTestModel { * @var string 'Home' * @access public */ - var $hasMany = 'Home'; + public $hasMany = 'Home'; } /** @@ -837,7 +837,7 @@ class Advertisement extends CakeTestModel { * @var string 'Advertisement' * @access public */ - var $name = 'Advertisement'; + public $name = 'Advertisement'; /** * hasMany property @@ -845,7 +845,7 @@ class Advertisement extends CakeTestModel { * @var string 'Home' * @access public */ - var $hasMany = 'Home'; + public $hasMany = 'Home'; } /** @@ -862,7 +862,7 @@ class Home extends CakeTestModel { * @var string 'Home' * @access public */ - var $name = 'Home'; + public $name = 'Home'; /** * belongsTo property @@ -870,7 +870,7 @@ class Home extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('AnotherArticle', 'Advertisement'); + public $belongsTo = array('AnotherArticle', 'Advertisement'); } /** @@ -887,7 +887,7 @@ class Post extends CakeTestModel { * @var string 'Post' * @access public */ - var $name = 'Post'; + public $name = 'Post'; /** * belongsTo property @@ -895,7 +895,7 @@ class Post extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('Author'); + public $belongsTo = array('Author'); function beforeFind($queryData) { if (isset($queryData['connection'])) { @@ -924,7 +924,7 @@ class Author extends CakeTestModel { * @var string 'Author' * @access public */ - var $name = 'Author'; + public $name = 'Author'; /** * hasMany property @@ -932,7 +932,7 @@ class Author extends CakeTestModel { * @var array * @access public */ - var $hasMany = array('Post'); + public $hasMany = array('Post'); /** * afterFind method @@ -961,7 +961,7 @@ class ModifiedAuthor extends Author { * @var string 'Author' * @access public */ - var $name = 'Author'; + public $name = 'Author'; /** * afterFind method @@ -992,7 +992,7 @@ class Project extends CakeTestModel { * @var string 'Project' * @access public */ - var $name = 'Project'; + public $name = 'Project'; /** * hasMany property @@ -1000,7 +1000,7 @@ class Project extends CakeTestModel { * @var array * @access public */ - var $hasMany = array('Thread'); + public $hasMany = array('Thread'); } /** @@ -1017,7 +1017,7 @@ class Thread extends CakeTestModel { * @var string 'Thread' * @access public */ - var $name = 'Thread'; + public $name = 'Thread'; /** * hasMany property @@ -1025,7 +1025,7 @@ class Thread extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('Project'); + public $belongsTo = array('Project'); /** * hasMany property @@ -1033,7 +1033,7 @@ class Thread extends CakeTestModel { * @var array * @access public */ - var $hasMany = array('Message'); + public $hasMany = array('Message'); } /** @@ -1050,7 +1050,7 @@ class Message extends CakeTestModel { * @var string 'Message' * @access public */ - var $name = 'Message'; + public $name = 'Message'; /** * hasOne property @@ -1058,7 +1058,7 @@ class Message extends CakeTestModel { * @var array * @access public */ - var $hasOne = array('Bid'); + public $hasOne = array('Bid'); } /** @@ -1075,7 +1075,7 @@ class Bid extends CakeTestModel { * @var string 'Bid' * @access public */ - var $name = 'Bid'; + public $name = 'Bid'; /** * belongsTo property @@ -1083,7 +1083,7 @@ class Bid extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('Message'); + public $belongsTo = array('Message'); } /** @@ -1100,7 +1100,7 @@ class NodeAfterFind extends CakeTestModel { * @var string 'NodeAfterFind' * @access public */ - var $name = 'NodeAfterFind'; + public $name = 'NodeAfterFind'; /** * validate property @@ -1108,7 +1108,7 @@ class NodeAfterFind extends CakeTestModel { * @var array * @access public */ - var $validate = array('name' => 'notEmpty'); + public $validate = array('name' => 'notEmpty'); /** * useTable property @@ -1116,7 +1116,7 @@ class NodeAfterFind extends CakeTestModel { * @var string 'apples' * @access public */ - var $useTable = 'apples'; + public $useTable = 'apples'; /** * hasOne property @@ -1124,7 +1124,7 @@ class NodeAfterFind extends CakeTestModel { * @var array * @access public */ - var $hasOne = array('Sample' => array('className' => 'NodeAfterFindSample')); + public $hasOne = array('Sample' => array('className' => 'NodeAfterFindSample')); /** * hasMany property @@ -1132,7 +1132,7 @@ class NodeAfterFind extends CakeTestModel { * @var array * @access public */ - var $hasMany = array('Child' => array('className' => 'NodeAfterFind', 'dependent' => true)); + public $hasMany = array('Child' => array('className' => 'NodeAfterFind', 'dependent' => true)); /** * belongsTo property @@ -1140,7 +1140,7 @@ class NodeAfterFind extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('Parent' => array('className' => 'NodeAfterFind', 'foreignKey' => 'apple_id')); + public $belongsTo = array('Parent' => array('className' => 'NodeAfterFind', 'foreignKey' => 'apple_id')); /** * afterFind method @@ -1168,7 +1168,7 @@ class NodeAfterFindSample extends CakeTestModel { * @var string 'NodeAfterFindSample' * @access public */ - var $name = 'NodeAfterFindSample'; + public $name = 'NodeAfterFindSample'; /** * useTable property @@ -1176,7 +1176,7 @@ class NodeAfterFindSample extends CakeTestModel { * @var string 'samples' * @access public */ - var $useTable = 'samples'; + public $useTable = 'samples'; /** * belongsTo property @@ -1184,7 +1184,7 @@ class NodeAfterFindSample extends CakeTestModel { * @var string 'NodeAfterFind' * @access public */ - var $belongsTo = 'NodeAfterFind'; + public $belongsTo = 'NodeAfterFind'; } /** @@ -1201,7 +1201,7 @@ class NodeNoAfterFind extends CakeTestModel { * @var string 'NodeAfterFind' * @access public */ - var $name = 'NodeAfterFind'; + public $name = 'NodeAfterFind'; /** * validate property @@ -1209,7 +1209,7 @@ class NodeNoAfterFind extends CakeTestModel { * @var array * @access public */ - var $validate = array('name' => 'notEmpty'); + public $validate = array('name' => 'notEmpty'); /** * useTable property @@ -1217,7 +1217,7 @@ class NodeNoAfterFind extends CakeTestModel { * @var string 'apples' * @access public */ - var $useTable = 'apples'; + public $useTable = 'apples'; /** * hasOne property @@ -1225,7 +1225,7 @@ class NodeNoAfterFind extends CakeTestModel { * @var array * @access public */ - var $hasOne = array('Sample' => array('className' => 'NodeAfterFindSample')); + public $hasOne = array('Sample' => array('className' => 'NodeAfterFindSample')); /** * hasMany property @@ -1233,7 +1233,7 @@ class NodeNoAfterFind extends CakeTestModel { * @var array * @access public */ - var $hasMany = array('Child' => array('className' => 'NodeAfterFind', 'dependent' => true)); + public $hasMany = array('Child' => array('className' => 'NodeAfterFind', 'dependent' => true)); /** * belongsTo property @@ -1241,7 +1241,7 @@ class NodeNoAfterFind extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('Parent' => array('className' => 'NodeAfterFind', 'foreignKey' => 'apple_id')); + public $belongsTo = array('Parent' => array('className' => 'NodeAfterFind', 'foreignKey' => 'apple_id')); } /** @@ -1258,7 +1258,7 @@ class Node extends CakeTestModel{ * @var string 'Node' * @access public */ - var $name = 'Node'; + public $name = 'Node'; /** * hasAndBelongsToMany property @@ -1266,7 +1266,7 @@ class Node extends CakeTestModel{ * @var array * @access public */ - var $hasAndBelongsToMany = array( + public $hasAndBelongsToMany = array( 'ParentNode' => array( 'className' => 'Node', 'joinTable' => 'dependency', @@ -1291,7 +1291,7 @@ class Dependency extends CakeTestModel { * @var string 'Dependency' * @access public */ - var $name = 'Dependency'; + public $name = 'Dependency'; } /** @@ -1308,7 +1308,7 @@ class ModelA extends CakeTestModel { * @var string 'ModelA' * @access public */ - var $name = 'ModelA'; + public $name = 'ModelA'; /** * useTable property @@ -1316,7 +1316,7 @@ class ModelA extends CakeTestModel { * @var string 'apples' * @access public */ - var $useTable = 'apples'; + public $useTable = 'apples'; /** * hasMany property @@ -1324,7 +1324,7 @@ class ModelA extends CakeTestModel { * @var array * @access public */ - var $hasMany = array('ModelB', 'ModelC'); + public $hasMany = array('ModelB', 'ModelC'); } /** @@ -1341,7 +1341,7 @@ class ModelB extends CakeTestModel { * @var string 'ModelB' * @access public */ - var $name = 'ModelB'; + public $name = 'ModelB'; /** * useTable property @@ -1349,7 +1349,7 @@ class ModelB extends CakeTestModel { * @var string 'messages' * @access public */ - var $useTable = 'messages'; + public $useTable = 'messages'; /** * hasMany property @@ -1357,7 +1357,7 @@ class ModelB extends CakeTestModel { * @var array * @access public */ - var $hasMany = array('ModelD'); + public $hasMany = array('ModelD'); } /** @@ -1374,7 +1374,7 @@ class ModelC extends CakeTestModel { * @var string 'ModelC' * @access public */ - var $name = 'ModelC'; + public $name = 'ModelC'; /** * useTable property @@ -1382,7 +1382,7 @@ class ModelC extends CakeTestModel { * @var string 'bids' * @access public */ - var $useTable = 'bids'; + public $useTable = 'bids'; /** * hasMany property @@ -1390,7 +1390,7 @@ class ModelC extends CakeTestModel { * @var array * @access public */ - var $hasMany = array('ModelD'); + public $hasMany = array('ModelD'); } /** @@ -1407,7 +1407,7 @@ class ModelD extends CakeTestModel { * @var string 'ModelD' * @access public */ - var $name = 'ModelD'; + public $name = 'ModelD'; /** * useTable property @@ -1415,7 +1415,7 @@ class ModelD extends CakeTestModel { * @var string 'threads' * @access public */ - var $useTable = 'threads'; + public $useTable = 'threads'; } /** @@ -1432,7 +1432,7 @@ class Something extends CakeTestModel { * @var string 'Something' * @access public */ - var $name = 'Something'; + public $name = 'Something'; /** * hasAndBelongsToMany property @@ -1440,7 +1440,7 @@ class Something extends CakeTestModel { * @var array * @access public */ - var $hasAndBelongsToMany = array('SomethingElse' => array('with' => array('JoinThing' => array('doomed')))); + public $hasAndBelongsToMany = array('SomethingElse' => array('with' => array('JoinThing' => array('doomed')))); } /** @@ -1457,7 +1457,7 @@ class SomethingElse extends CakeTestModel { * @var string 'SomethingElse' * @access public */ - var $name = 'SomethingElse'; + public $name = 'SomethingElse'; /** * hasAndBelongsToMany property @@ -1465,7 +1465,7 @@ class SomethingElse extends CakeTestModel { * @var array * @access public */ - var $hasAndBelongsToMany = array('Something' => array('with' => 'JoinThing')); + public $hasAndBelongsToMany = array('Something' => array('with' => 'JoinThing')); } /** @@ -1482,7 +1482,7 @@ class JoinThing extends CakeTestModel { * @var string 'JoinThing' * @access public */ - var $name = 'JoinThing'; + public $name = 'JoinThing'; /** * belongsTo property @@ -1490,7 +1490,7 @@ class JoinThing extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('Something', 'SomethingElse'); + public $belongsTo = array('Something', 'SomethingElse'); } /** @@ -1507,7 +1507,7 @@ class Portfolio extends CakeTestModel { * @var string 'Portfolio' * @access public */ - var $name = 'Portfolio'; + public $name = 'Portfolio'; /** * hasAndBelongsToMany property @@ -1515,7 +1515,7 @@ class Portfolio extends CakeTestModel { * @var array * @access public */ - var $hasAndBelongsToMany = array('Item'); + public $hasAndBelongsToMany = array('Item'); } /** @@ -1532,7 +1532,7 @@ class Item extends CakeTestModel { * @var string 'Item' * @access public */ - var $name = 'Item'; + public $name = 'Item'; /** * belongsTo property @@ -1540,7 +1540,7 @@ class Item extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('Syfile' => array('counterCache' => true)); + public $belongsTo = array('Syfile' => array('counterCache' => true)); /** * hasAndBelongsToMany property @@ -1548,7 +1548,7 @@ class Item extends CakeTestModel { * @var array * @access public */ - var $hasAndBelongsToMany = array('Portfolio' => array('unique' => false)); + public $hasAndBelongsToMany = array('Portfolio' => array('unique' => false)); } /** @@ -1565,7 +1565,7 @@ class ItemsPortfolio extends CakeTestModel { * @var string 'ItemsPortfolio' * @access public */ - var $name = 'ItemsPortfolio'; + public $name = 'ItemsPortfolio'; } /** @@ -1582,7 +1582,7 @@ class Syfile extends CakeTestModel { * @var string 'Syfile' * @access public */ - var $name = 'Syfile'; + public $name = 'Syfile'; /** * belongsTo property @@ -1590,7 +1590,7 @@ class Syfile extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('Image'); + public $belongsTo = array('Image'); } /** @@ -1607,7 +1607,7 @@ class Image extends CakeTestModel { * @var string 'Image' * @access public */ - var $name = 'Image'; + public $name = 'Image'; } /** @@ -1624,7 +1624,7 @@ class DeviceType extends CakeTestModel { * @var string 'DeviceType' * @access public */ - var $name = 'DeviceType'; + public $name = 'DeviceType'; /** * order property @@ -1632,7 +1632,7 @@ class DeviceType extends CakeTestModel { * @var array * @access public */ - var $order = array('DeviceType.order' => 'ASC'); + public $order = array('DeviceType.order' => 'ASC'); /** * belongsTo property @@ -1640,7 +1640,7 @@ class DeviceType extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array( + public $belongsTo = array( 'DeviceTypeCategory', 'FeatureSet', 'ExteriorTypeCategory', 'Image' => array('className' => 'Document'), 'Extra1' => array('className' => 'Document'), @@ -1652,7 +1652,7 @@ class DeviceType extends CakeTestModel { * @var array * @access public */ - var $hasMany = array('Device' => array('order' => array('Device.id' => 'ASC'))); + public $hasMany = array('Device' => array('order' => array('Device.id' => 'ASC'))); } /** @@ -1669,7 +1669,7 @@ class DeviceTypeCategory extends CakeTestModel { * @var string 'DeviceTypeCategory' * @access public */ - var $name = 'DeviceTypeCategory'; + public $name = 'DeviceTypeCategory'; } /** @@ -1686,7 +1686,7 @@ class FeatureSet extends CakeTestModel { * @var string 'FeatureSet' * @access public */ - var $name = 'FeatureSet'; + public $name = 'FeatureSet'; } /** @@ -1703,7 +1703,7 @@ class ExteriorTypeCategory extends CakeTestModel { * @var string 'ExteriorTypeCategory' * @access public */ - var $name = 'ExteriorTypeCategory'; + public $name = 'ExteriorTypeCategory'; /** * belongsTo property @@ -1711,7 +1711,7 @@ class ExteriorTypeCategory extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('Image' => array('className' => 'Device')); + public $belongsTo = array('Image' => array('className' => 'Device')); } /** @@ -1728,7 +1728,7 @@ class Document extends CakeTestModel { * @var string 'Document' * @access public */ - var $name = 'Document'; + public $name = 'Document'; /** * belongsTo property @@ -1736,7 +1736,7 @@ class Document extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('DocumentDirectory'); + public $belongsTo = array('DocumentDirectory'); } /** @@ -1753,7 +1753,7 @@ class Device extends CakeTestModel { * @var string 'Device' * @access public */ - var $name = 'Device'; + public $name = 'Device'; } /** @@ -1770,7 +1770,7 @@ class DocumentDirectory extends CakeTestModel { * @var string 'DocumentDirectory' * @access public */ - var $name = 'DocumentDirectory'; + public $name = 'DocumentDirectory'; } /** @@ -1787,7 +1787,7 @@ class PrimaryModel extends CakeTestModel { * @var string 'PrimaryModel' * @access public */ - var $name = 'PrimaryModel'; + public $name = 'PrimaryModel'; } /** @@ -1804,7 +1804,7 @@ class SecondaryModel extends CakeTestModel { * @var string 'SecondaryModel' * @access public */ - var $name = 'SecondaryModel'; + public $name = 'SecondaryModel'; } /** @@ -1821,7 +1821,7 @@ class JoinA extends CakeTestModel { * @var string 'JoinA' * @access public */ - var $name = 'JoinA'; + public $name = 'JoinA'; /** * hasAndBelongsToMany property @@ -1829,7 +1829,7 @@ class JoinA extends CakeTestModel { * @var array * @access public */ - var $hasAndBelongsToMany = array('JoinB', 'JoinC'); + public $hasAndBelongsToMany = array('JoinB', 'JoinC'); } /** @@ -1846,7 +1846,7 @@ class JoinB extends CakeTestModel { * @var string 'JoinB' * @access public */ - var $name = 'JoinB'; + public $name = 'JoinB'; /** * hasAndBelongsToMany property @@ -1854,7 +1854,7 @@ class JoinB extends CakeTestModel { * @var array * @access public */ - var $hasAndBelongsToMany = array('JoinA'); + public $hasAndBelongsToMany = array('JoinA'); } /** @@ -1871,7 +1871,7 @@ class JoinC extends CakeTestModel { * @var string 'JoinC' * @access public */ - var $name = 'JoinC'; + public $name = 'JoinC'; /** * hasAndBelongsToMany property @@ -1879,7 +1879,7 @@ class JoinC extends CakeTestModel { * @var array * @access public */ - var $hasAndBelongsToMany = array('JoinA'); + public $hasAndBelongsToMany = array('JoinA'); } /** @@ -1896,7 +1896,7 @@ class ThePaper extends CakeTestModel { * @var string 'ThePaper' * @access public */ - var $name = 'ThePaper'; + public $name = 'ThePaper'; /** * useTable property @@ -1904,7 +1904,7 @@ class ThePaper extends CakeTestModel { * @var string 'apples' * @access public */ - var $useTable = 'apples'; + public $useTable = 'apples'; /** * hasOne property @@ -1912,7 +1912,7 @@ class ThePaper extends CakeTestModel { * @var array * @access public */ - var $hasOne = array('Itself' => array('className' => 'ThePaper', 'foreignKey' => 'apple_id')); + public $hasOne = array('Itself' => array('className' => 'ThePaper', 'foreignKey' => 'apple_id')); /** * hasAndBelongsToMany property @@ -1920,7 +1920,7 @@ class ThePaper extends CakeTestModel { * @var array * @access public */ - var $hasAndBelongsToMany = array('Monkey' => array('joinTable' => 'the_paper_monkies', 'order' => 'id')); + public $hasAndBelongsToMany = array('Monkey' => array('joinTable' => 'the_paper_monkies', 'order' => 'id')); } /** @@ -1937,7 +1937,7 @@ class Monkey extends CakeTestModel { * @var string 'Monkey' * @access public */ - var $name = 'Monkey'; + public $name = 'Monkey'; /** * useTable property @@ -1945,7 +1945,7 @@ class Monkey extends CakeTestModel { * @var string 'devices' * @access public */ - var $useTable = 'devices'; + public $useTable = 'devices'; } /** @@ -1962,7 +1962,7 @@ class AssociationTest1 extends CakeTestModel { * @var string 'join_as' * @access public */ - var $useTable = 'join_as'; + public $useTable = 'join_as'; /** * name property @@ -1970,7 +1970,7 @@ class AssociationTest1 extends CakeTestModel { * @var string 'AssociationTest1' * @access public */ - var $name = 'AssociationTest1'; + public $name = 'AssociationTest1'; /** * hasAndBelongsToMany property @@ -1978,7 +1978,7 @@ class AssociationTest1 extends CakeTestModel { * @var array * @access public */ - var $hasAndBelongsToMany = array('AssociationTest2' => array( + public $hasAndBelongsToMany = array('AssociationTest2' => array( 'unique' => false, 'joinTable' => 'join_as_join_bs', 'foreignKey' => false )); } @@ -1997,7 +1997,7 @@ class AssociationTest2 extends CakeTestModel { * @var string 'join_bs' * @access public */ - var $useTable = 'join_bs'; + public $useTable = 'join_bs'; /** * name property @@ -2005,7 +2005,7 @@ class AssociationTest2 extends CakeTestModel { * @var string 'AssociationTest2' * @access public */ - var $name = 'AssociationTest2'; + public $name = 'AssociationTest2'; /** * hasAndBelongsToMany property @@ -2013,7 +2013,7 @@ class AssociationTest2 extends CakeTestModel { * @var array * @access public */ - var $hasAndBelongsToMany = array('AssociationTest1' => array( + public $hasAndBelongsToMany = array('AssociationTest1' => array( 'unique' => false, 'joinTable' => 'join_as_join_bs' )); } @@ -2034,25 +2034,25 @@ class Callback extends CakeTestModel { * @subpackage cake.tests.cases.libs.model */ class CallbackPostTestModel extends CakeTestModel { - var $useTable = 'posts'; + public $useTable = 'posts'; /** * variable to control return of beforeValidate * * @var string */ - var $beforeValidateReturn = true; + public $beforeValidateReturn = true; /** * variable to control return of beforeSave * * @var string */ - var $beforeSaveReturn = true; + public $beforeSaveReturn = true; /** * variable to control return of beforeDelete * * @var string */ - var $beforeDeleteReturn = true; + public $beforeDeleteReturn = true; /** * beforeSave callback * @@ -2093,7 +2093,7 @@ class Uuid extends CakeTestModel { * @var string 'Uuid' * @access public */ - var $name = 'Uuid'; + public $name = 'Uuid'; } /** @@ -2110,7 +2110,7 @@ class DataTest extends CakeTestModel { * @var string 'DataTest' * @access public */ - var $name = 'DataTest'; + public $name = 'DataTest'; } /** @@ -2127,7 +2127,7 @@ class TheVoid extends CakeTestModel { * @var string 'TheVoid' * @access public */ - var $name = 'TheVoid'; + public $name = 'TheVoid'; /** * useTable property @@ -2135,7 +2135,7 @@ class TheVoid extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; } /** @@ -2152,7 +2152,7 @@ class ValidationTest1 extends CakeTestModel { * @var string 'ValidationTest' * @access public */ - var $name = 'ValidationTest1'; + public $name = 'ValidationTest1'; /** * useTable property @@ -2160,7 +2160,7 @@ class ValidationTest1 extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * schema property @@ -2176,7 +2176,7 @@ class ValidationTest1 extends CakeTestModel { * @var array * @access public */ - var $validate = array( + public $validate = array( 'title' => 'notEmpty', 'published' => 'customValidationMethod', 'body' => array( @@ -2244,7 +2244,7 @@ class ValidationTest2 extends CakeTestModel { * @var string 'ValidationTest2' * @access public */ - var $name = 'ValidationTest2'; + public $name = 'ValidationTest2'; /** * useTable property @@ -2252,7 +2252,7 @@ class ValidationTest2 extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * validate property @@ -2260,7 +2260,7 @@ class ValidationTest2 extends CakeTestModel { * @var array * @access public */ - var $validate = array( + public $validate = array( 'title' => 'notEmpty', 'published' => 'customValidationMethod', 'body' => array( @@ -2306,7 +2306,7 @@ class Person extends CakeTestModel { * @var string 'Person' * @access public */ - var $name = 'Person'; + public $name = 'Person'; /** * belongsTo property @@ -2314,7 +2314,7 @@ class Person extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array( + public $belongsTo = array( 'Mother' => array( 'className' => 'Person', 'foreignKey' => 'mother_id'), @@ -2337,7 +2337,7 @@ class UnderscoreField extends CakeTestModel { * @var string 'UnderscoreField' * @access public */ - var $name = 'UnderscoreField'; + public $name = 'UnderscoreField'; } /** @@ -2354,7 +2354,7 @@ class Product extends CakeTestModel { * @var string 'Product' * @access public */ - var $name = 'Product'; + public $name = 'Product'; } /** @@ -2371,7 +2371,7 @@ class Story extends CakeTestModel { * @var string 'Story' * @access public */ - var $name = 'Story'; + public $name = 'Story'; /** * primaryKey property @@ -2379,7 +2379,7 @@ class Story extends CakeTestModel { * @var string 'story' * @access public */ - var $primaryKey = 'story'; + public $primaryKey = 'story'; /** * hasAndBelongsToMany property @@ -2387,7 +2387,7 @@ class Story extends CakeTestModel { * @var array * @access public */ - var $hasAndBelongsToMany = array('Tag' => array('foreignKey' => 'story')); + public $hasAndBelongsToMany = array('Tag' => array('foreignKey' => 'story')); /** * validate property @@ -2395,7 +2395,7 @@ class Story extends CakeTestModel { * @var array * @access public */ - var $validate = array('title' => 'notEmpty'); + public $validate = array('title' => 'notEmpty'); } /** @@ -2412,7 +2412,7 @@ class Cd extends CakeTestModel { * @var string 'Cd' * @access public */ - var $name = 'Cd'; + public $name = 'Cd'; /** * hasOne property @@ -2420,7 +2420,7 @@ class Cd extends CakeTestModel { * @var array * @access public */ - var $hasOne = array('OverallFavorite' => array('foreignKey' => 'model_id', 'dependent' => true, 'conditions' => array('model_type' => 'Cd'))); + public $hasOne = array('OverallFavorite' => array('foreignKey' => 'model_id', 'dependent' => true, 'conditions' => array('model_type' => 'Cd'))); } /** @@ -2437,7 +2437,7 @@ class Book extends CakeTestModel { * @var string 'Book' * @access public */ - var $name = 'Book'; + public $name = 'Book'; /** * hasOne property @@ -2445,7 +2445,7 @@ class Book extends CakeTestModel { * @var array * @access public */ - var $hasOne = array('OverallFavorite' => array('foreignKey' => 'model_id', 'dependent' => true, 'conditions' => 'OverallFavorite.model_type = \'Book\'')); + public $hasOne = array('OverallFavorite' => array('foreignKey' => 'model_id', 'dependent' => true, 'conditions' => 'OverallFavorite.model_type = \'Book\'')); } /** @@ -2462,7 +2462,7 @@ class OverallFavorite extends CakeTestModel { * @var string 'OverallFavorite' * @access public */ - var $name = 'OverallFavorite'; + public $name = 'OverallFavorite'; } /** @@ -2479,7 +2479,7 @@ class MyUser extends CakeTestModel { * @var string 'MyUser' * @access public */ - var $name = 'MyUser'; + public $name = 'MyUser'; /** * undocumented variable @@ -2487,7 +2487,7 @@ class MyUser extends CakeTestModel { * @var string * @access public */ - var $hasAndBelongsToMany = array('MyCategory'); + public $hasAndBelongsToMany = array('MyCategory'); } /** @@ -2504,7 +2504,7 @@ class MyCategory extends CakeTestModel { * @var string 'MyCategory' * @access public */ - var $name = 'MyCategory'; + public $name = 'MyCategory'; /** * undocumented variable @@ -2512,7 +2512,7 @@ class MyCategory extends CakeTestModel { * @var string * @access public */ - var $hasAndBelongsToMany = array('MyProduct', 'MyUser'); + public $hasAndBelongsToMany = array('MyProduct', 'MyUser'); } /** @@ -2529,7 +2529,7 @@ class MyProduct extends CakeTestModel { * @var string 'MyProduct' * @access public */ - var $name = 'MyProduct'; + public $name = 'MyProduct'; /** * undocumented variable @@ -2537,7 +2537,7 @@ class MyProduct extends CakeTestModel { * @var string * @access public */ - var $hasAndBelongsToMany = array('MyCategory'); + public $hasAndBelongsToMany = array('MyCategory'); } /** @@ -2554,7 +2554,7 @@ class MyCategoriesMyUser extends CakeTestModel { * @var string 'MyCategoriesMyUser' * @access public */ - var $name = 'MyCategoriesMyUser'; + public $name = 'MyCategoriesMyUser'; } /** @@ -2571,7 +2571,7 @@ class MyCategoriesMyProduct extends CakeTestModel { * @var string 'MyCategoriesMyProduct' * @access public */ - var $name = 'MyCategoriesMyProduct'; + public $name = 'MyCategoriesMyProduct'; } /** @@ -2588,7 +2588,7 @@ class I18nModel extends CakeTestModel { * @var string 'I18nModel' * @access public */ - var $name = 'I18nModel'; + public $name = 'I18nModel'; /** * useTable property @@ -2596,7 +2596,7 @@ class I18nModel extends CakeTestModel { * @var string 'i18n' * @access public */ - var $useTable = 'i18n'; + public $useTable = 'i18n'; /** * displayField property @@ -2604,7 +2604,7 @@ class I18nModel extends CakeTestModel { * @var string 'field' * @access public */ - var $displayField = 'field'; + public $displayField = 'field'; } /** @@ -2621,7 +2621,7 @@ class NumberTree extends CakeTestModel { * @var string 'NumberTree' * @access public */ - var $name = 'NumberTree'; + public $name = 'NumberTree'; /** * actsAs property @@ -2629,7 +2629,7 @@ class NumberTree extends CakeTestModel { * @var array * @access public */ - var $actsAs = array('Tree'); + public $actsAs = array('Tree'); /** * initialize method @@ -2688,7 +2688,7 @@ class NumberTreeTwo extends NumberTree { * @var string 'NumberTree' * @access public */ - var $name = 'NumberTreeTwo'; + public $name = 'NumberTreeTwo'; /** * actsAs property @@ -2696,7 +2696,7 @@ class NumberTreeTwo extends NumberTree { * @var array * @access public */ - var $actsAs = array(); + public $actsAs = array(); } /** @@ -2713,7 +2713,7 @@ class FlagTree extends NumberTree { * @var string 'FlagTree' * @access public */ - var $name = 'FlagTree'; + public $name = 'FlagTree'; } /** @@ -2730,8 +2730,8 @@ class UnconventionalTree extends NumberTree { * @var string 'FlagTree' * @access public */ - var $name = 'UnconventionalTree'; - var $actsAs = array( + public $name = 'UnconventionalTree'; + public $actsAs = array( 'Tree' => array( 'parent' => 'join', 'left' => 'left', @@ -2754,7 +2754,7 @@ class UuidTree extends NumberTree { * @var string 'FlagTree' * @access public */ - var $name = 'UuidTree'; + public $name = 'UuidTree'; } /** @@ -2771,7 +2771,7 @@ class Campaign extends CakeTestModel { * @var string 'Campaign' * @access public */ - var $name = 'Campaign'; + public $name = 'Campaign'; /** * hasMany property @@ -2779,7 +2779,7 @@ class Campaign extends CakeTestModel { * @var array * @access public */ - var $hasMany = array('Ad' => array('fields' => array('id','campaign_id','name'))); + public $hasMany = array('Ad' => array('fields' => array('id','campaign_id','name'))); } /** @@ -2796,7 +2796,7 @@ class Ad extends CakeTestModel { * @var string 'Ad' * @access public */ - var $name = 'Ad'; + public $name = 'Ad'; /** * actsAs property @@ -2804,7 +2804,7 @@ class Ad extends CakeTestModel { * @var array * @access public */ - var $actsAs = array('Tree'); + public $actsAs = array('Tree'); /** * belongsTo property @@ -2812,7 +2812,7 @@ class Ad extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('Campaign'); + public $belongsTo = array('Campaign'); } /** @@ -2829,7 +2829,7 @@ class AfterTree extends NumberTree { * @var string 'AfterTree' * @access public */ - var $name = 'AfterTree'; + public $name = 'AfterTree'; /** * actsAs property @@ -2837,7 +2837,7 @@ class AfterTree extends NumberTree { * @var array * @access public */ - var $actsAs = array('Tree'); + public $actsAs = array('Tree'); function afterSave($created) { if ($created && isset($this->data['AfterTree'])) { @@ -2860,7 +2860,7 @@ class Content extends CakeTestModel { * @var string 'Content' * @access public */ - var $name = 'Content'; + public $name = 'Content'; /** * useTable property @@ -2868,7 +2868,7 @@ class Content extends CakeTestModel { * @var string 'Content' * @access public */ - var $useTable = 'Content'; + public $useTable = 'Content'; /** * primaryKey property @@ -2876,7 +2876,7 @@ class Content extends CakeTestModel { * @var string 'iContentId' * @access public */ - var $primaryKey = 'iContentId'; + public $primaryKey = 'iContentId'; /** * hasAndBelongsToMany property @@ -2884,7 +2884,7 @@ class Content extends CakeTestModel { * @var array * @access public */ - var $hasAndBelongsToMany = array('Account' => array('className' => 'Account', 'with' => 'ContentAccount', 'joinTable' => 'ContentAccounts', 'foreignKey' => 'iContentId', 'associationForeignKey', 'iAccountId')); + public $hasAndBelongsToMany = array('Account' => array('className' => 'Account', 'with' => 'ContentAccount', 'joinTable' => 'ContentAccounts', 'foreignKey' => 'iContentId', 'associationForeignKey', 'iAccountId')); } /** @@ -2901,7 +2901,7 @@ class Account extends CakeTestModel { * @var string 'Account' * @access public */ - var $name = 'Account'; + public $name = 'Account'; /** * useTable property @@ -2909,7 +2909,7 @@ class Account extends CakeTestModel { * @var string 'Account' * @access public */ - var $useTable = 'Accounts'; + public $useTable = 'Accounts'; /** * primaryKey property @@ -2917,7 +2917,7 @@ class Account extends CakeTestModel { * @var string 'iAccountId' * @access public */ - var $primaryKey = 'iAccountId'; + public $primaryKey = 'iAccountId'; } /** @@ -2934,7 +2934,7 @@ class ContentAccount extends CakeTestModel { * @var string 'Account' * @access public */ - var $name = 'ContentAccount'; + public $name = 'ContentAccount'; /** * useTable property @@ -2942,7 +2942,7 @@ class ContentAccount extends CakeTestModel { * @var string 'Account' * @access public */ - var $useTable = 'ContentAccounts'; + public $useTable = 'ContentAccounts'; /** * primaryKey property @@ -2950,7 +2950,7 @@ class ContentAccount extends CakeTestModel { * @var string 'iAccountId' * @access public */ - var $primaryKey = 'iContentAccountsId'; + public $primaryKey = 'iContentAccountsId'; } /** @@ -2960,7 +2960,7 @@ class ContentAccount extends CakeTestModel { * @subpackage cake.tests.cases.libs.model */ class FilmFile extends CakeTestModel { - var $name = 'FilmFile'; + public $name = 'FilmFile'; } /** @@ -2970,9 +2970,9 @@ class FilmFile extends CakeTestModel { * @subpackage cake.tests.cases.libs.model */ class Basket extends CakeTestModel { - var $name = 'Basket'; + public $name = 'Basket'; - var $belongsTo = array( + public $belongsTo = array( 'FilmFile' => array( 'className' => 'FilmFile', 'foreignKey' => 'object_id', @@ -2997,7 +2997,7 @@ class TestPluginArticle extends CakeTestModel { * @var string 'TestPluginArticle' * @access public */ - var $name = 'TestPluginArticle'; + public $name = 'TestPluginArticle'; /** * belongsTo property @@ -3005,7 +3005,7 @@ class TestPluginArticle extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('User'); + public $belongsTo = array('User'); /** * hasMany property @@ -3013,7 +3013,7 @@ class TestPluginArticle extends CakeTestModel { * @var array * @access public */ - var $hasMany = array( + public $hasMany = array( 'TestPluginComment' => array( 'className' => 'TestPlugin.TestPluginComment', 'foreignKey' => 'article_id', @@ -3036,7 +3036,7 @@ class TestPluginComment extends CakeTestModel { * @var string 'TestPluginComment' * @access public */ - var $name = 'TestPluginComment'; + public $name = 'TestPluginComment'; /** * belongsTo property @@ -3044,7 +3044,7 @@ class TestPluginComment extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array( + public $belongsTo = array( 'TestPluginArticle' => array( 'className' => 'TestPlugin.TestPluginArticle', 'foreignKey' => 'article_id', @@ -3067,7 +3067,7 @@ class Uuidportfolio extends CakeTestModel { * @var string 'Uuidportfolio' * @access public */ - var $name = 'Uuidportfolio'; + public $name = 'Uuidportfolio'; /** * hasAndBelongsToMany property @@ -3075,7 +3075,7 @@ class Uuidportfolio extends CakeTestModel { * @var array * @access public */ - var $hasAndBelongsToMany = array('Uuiditem'); + public $hasAndBelongsToMany = array('Uuiditem'); } /** @@ -3092,7 +3092,7 @@ class Uuiditem extends CakeTestModel { * @var string 'Item' * @access public */ - var $name = 'Uuiditem'; + public $name = 'Uuiditem'; /** * hasAndBelongsToMany property @@ -3100,7 +3100,7 @@ class Uuiditem extends CakeTestModel { * @var array * @access public */ - var $hasAndBelongsToMany = array('Uuidportfolio' => array('with' => 'UuiditemsUuidportfolioNumericid')); + public $hasAndBelongsToMany = array('Uuidportfolio' => array('with' => 'UuiditemsUuidportfolioNumericid')); } @@ -3118,7 +3118,7 @@ class UuiditemsUuidportfolio extends CakeTestModel { * @var string 'ItemsPortfolio' * @access public */ - var $name = 'UuiditemsUuidportfolio'; + public $name = 'UuiditemsUuidportfolio'; } /** @@ -3135,7 +3135,7 @@ class UuiditemsUuidportfolioNumericid extends CakeTestModel { * @var string * @access public */ - var $name = 'UuiditemsUuidportfolioNumericid'; + public $name = 'UuiditemsUuidportfolioNumericid'; } /** @@ -3152,7 +3152,7 @@ class TranslateTestModel extends CakeTestModel { * @var string 'TranslateTestModel' * @access public */ - var $name = 'TranslateTestModel'; + public $name = 'TranslateTestModel'; /** * useTable property @@ -3160,7 +3160,7 @@ class TranslateTestModel extends CakeTestModel { * @var string 'i18n' * @access public */ - var $useTable = 'i18n'; + public $useTable = 'i18n'; /** * displayField property @@ -3168,7 +3168,7 @@ class TranslateTestModel extends CakeTestModel { * @var string 'field' * @access public */ - var $displayField = 'field'; + public $displayField = 'field'; } /** @@ -3184,21 +3184,21 @@ class TranslateWithPrefix extends CakeTestModel { * @var string 'TranslateTestModel' * @access public */ - var $name = 'TranslateWithPrefix'; + public $name = 'TranslateWithPrefix'; /** * tablePrefix property * * @var string 'i18n' * @access public */ - var $tablePrefix = 'i18n_'; + public $tablePrefix = 'i18n_'; /** * displayField property * * @var string 'field' * @access public */ - var $displayField = 'field'; + public $displayField = 'field'; } /** * TranslatedItem class. @@ -3214,7 +3214,7 @@ class TranslatedItem extends CakeTestModel { * @var string 'TranslatedItem' * @access public */ - var $name = 'TranslatedItem'; + public $name = 'TranslatedItem'; /** * cacheQueries property @@ -3222,7 +3222,7 @@ class TranslatedItem extends CakeTestModel { * @var bool false * @access public */ - var $cacheQueries = false; + public $cacheQueries = false; /** * actsAs property @@ -3230,7 +3230,7 @@ class TranslatedItem extends CakeTestModel { * @var array * @access public */ - var $actsAs = array('Translate' => array('content', 'title')); + public $actsAs = array('Translate' => array('content', 'title')); /** * translateModel property @@ -3238,7 +3238,7 @@ class TranslatedItem extends CakeTestModel { * @var string 'TranslateTestModel' * @access public */ - var $translateModel = 'TranslateTestModel'; + public $translateModel = 'TranslateTestModel'; } /** @@ -3254,28 +3254,28 @@ class TranslatedItem2 extends CakeTestModel { * @var string 'TranslatedItem' * @access public */ - var $name = 'TranslatedItem'; + public $name = 'TranslatedItem'; /** * cacheQueries property * * @var bool false * @access public */ - var $cacheQueries = false; + public $cacheQueries = false; /** * actsAs property * * @var array * @access public */ - var $actsAs = array('Translate' => array('content', 'title')); + public $actsAs = array('Translate' => array('content', 'title')); /** * translateModel property * * @var string 'TranslateTestModel' * @access public */ - var $translateModel = 'TranslateWithPrefix'; + public $translateModel = 'TranslateWithPrefix'; } /** * TranslatedItemWithTable class. @@ -3291,7 +3291,7 @@ class TranslatedItemWithTable extends CakeTestModel { * @var string 'TranslatedItemWithTable' * @access public */ - var $name = 'TranslatedItemWithTable'; + public $name = 'TranslatedItemWithTable'; /** * useTable property @@ -3299,7 +3299,7 @@ class TranslatedItemWithTable extends CakeTestModel { * @var string 'translated_items' * @access public */ - var $useTable = 'translated_items'; + public $useTable = 'translated_items'; /** * cacheQueries property @@ -3307,7 +3307,7 @@ class TranslatedItemWithTable extends CakeTestModel { * @var bool false * @access public */ - var $cacheQueries = false; + public $cacheQueries = false; /** * actsAs property @@ -3315,7 +3315,7 @@ class TranslatedItemWithTable extends CakeTestModel { * @var array * @access public */ - var $actsAs = array('Translate' => array('content', 'title')); + public $actsAs = array('Translate' => array('content', 'title')); /** * translateModel property @@ -3323,7 +3323,7 @@ class TranslatedItemWithTable extends CakeTestModel { * @var string 'TranslateTestModel' * @access public */ - var $translateModel = 'TranslateTestModel'; + public $translateModel = 'TranslateTestModel'; /** * translateTable property @@ -3331,7 +3331,7 @@ class TranslatedItemWithTable extends CakeTestModel { * @var string 'another_i18n' * @access public */ - var $translateTable = 'another_i18n'; + public $translateTable = 'another_i18n'; } /** @@ -3348,7 +3348,7 @@ class TranslateArticleModel extends CakeTestModel { * @var string 'TranslateArticleModel' * @access public */ - var $name = 'TranslateArticleModel'; + public $name = 'TranslateArticleModel'; /** * useTable property @@ -3356,7 +3356,7 @@ class TranslateArticleModel extends CakeTestModel { * @var string 'article_i18n' * @access public */ - var $useTable = 'article_i18n'; + public $useTable = 'article_i18n'; /** * displayField property @@ -3364,7 +3364,7 @@ class TranslateArticleModel extends CakeTestModel { * @var string 'field' * @access public */ - var $displayField = 'field'; + public $displayField = 'field'; } /** @@ -3381,7 +3381,7 @@ class TranslatedArticle extends CakeTestModel { * @var string 'TranslatedArticle' * @access public */ - var $name = 'TranslatedArticle'; + public $name = 'TranslatedArticle'; /** * cacheQueries property @@ -3389,7 +3389,7 @@ class TranslatedArticle extends CakeTestModel { * @var bool false * @access public */ - var $cacheQueries = false; + public $cacheQueries = false; /** * actsAs property @@ -3397,7 +3397,7 @@ class TranslatedArticle extends CakeTestModel { * @var array * @access public */ - var $actsAs = array('Translate' => array('title', 'body')); + public $actsAs = array('Translate' => array('title', 'body')); /** * translateModel property @@ -3405,7 +3405,7 @@ class TranslatedArticle extends CakeTestModel { * @var string 'TranslateArticleModel' * @access public */ - var $translateModel = 'TranslateArticleModel'; + public $translateModel = 'TranslateArticleModel'; /** * belongsTo property @@ -3413,24 +3413,24 @@ class TranslatedArticle extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('User'); + public $belongsTo = array('User'); } class CounterCacheUser extends CakeTestModel { - var $name = 'CounterCacheUser'; - var $alias = 'User'; + public $name = 'CounterCacheUser'; + public $alias = 'User'; - var $hasMany = array('Post' => array( + public $hasMany = array('Post' => array( 'className' => 'CounterCachePost', 'foreignKey' => 'user_id' )); } class CounterCachePost extends CakeTestModel { - var $name = 'CounterCachePost'; - var $alias = 'Post'; + public $name = 'CounterCachePost'; + public $alias = 'Post'; - var $belongsTo = array('User' => array( + public $belongsTo = array('User' => array( 'className' => 'CounterCacheUser', 'foreignKey' => 'user_id', 'counterCache' => true @@ -3438,22 +3438,22 @@ class CounterCachePost extends CakeTestModel { } class CounterCacheUserNonstandardPrimaryKey extends CakeTestModel { - var $name = 'CounterCacheUserNonstandardPrimaryKey'; - var $alias = 'User'; - var $primaryKey = 'uid'; + public $name = 'CounterCacheUserNonstandardPrimaryKey'; + public $alias = 'User'; + public $primaryKey = 'uid'; - var $hasMany = array('Post' => array( + public $hasMany = array('Post' => array( 'className' => 'CounterCachePostNonstandardPrimaryKey', 'foreignKey' => 'uid' )); } class CounterCachePostNonstandardPrimaryKey extends CakeTestModel { - var $name = 'CounterCachePostNonstandardPrimaryKey'; - var $alias = 'Post'; - var $primaryKey = 'pid'; + public $name = 'CounterCachePostNonstandardPrimaryKey'; + public $alias = 'Post'; + public $primaryKey = 'pid'; - var $belongsTo = array('User' => array( + public $belongsTo = array('User' => array( 'className' => 'CounterCacheUserNonstandardPrimaryKey', 'foreignKey' => 'uid', 'counterCache' => true @@ -3461,9 +3461,9 @@ class CounterCachePostNonstandardPrimaryKey extends CakeTestModel { } class ArticleB extends CakeTestModel { - var $name = 'ArticleB'; - var $useTable = 'articles'; - var $hasAndBelongsToMany = array( + public $name = 'ArticleB'; + public $useTable = 'articles'; + public $hasAndBelongsToMany = array( 'TagB' => array( 'className' => 'TagB', 'joinTable' => 'articles_tags', @@ -3474,9 +3474,9 @@ class ArticleB extends CakeTestModel { } class TagB extends CakeTestModel { - var $name = 'TagB'; - var $useTable = 'tags'; - var $hasAndBelongsToMany = array( + public $name = 'TagB'; + public $useTable = 'tags'; + public $hasAndBelongsToMany = array( 'ArticleB' => array( 'className' => 'ArticleB', 'joinTable' => 'articles_tags', @@ -3487,8 +3487,8 @@ class TagB extends CakeTestModel { } class Fruit extends CakeTestModel { - var $name = 'Fruit'; - var $hasAndBelongsToMany = array( + public $name = 'Fruit'; + public $hasAndBelongsToMany = array( 'UuidTag' => array( 'className' => 'UuidTag', 'joinTable' => 'fruits_uuid_tags', @@ -3500,9 +3500,9 @@ class Fruit extends CakeTestModel { } class FruitsUuidTag extends CakeTestModel { - var $name = 'FruitsUuidTag'; - var $primaryKey = false; - var $belongsTo = array( + public $name = 'FruitsUuidTag'; + public $primaryKey = false; + public $belongsTo = array( 'UuidTag' => array( 'className' => 'UuidTag', 'foreignKey' => 'uuid_tag_id', @@ -3515,8 +3515,8 @@ class FruitsUuidTag extends CakeTestModel { } class UuidTag extends CakeTestModel { - var $name = 'UuidTag'; - var $hasAndBelongsToMany = array( + public $name = 'UuidTag'; + public $hasAndBelongsToMany = array( 'Fruit' => array( 'className' => 'Fruit', 'joinTable' => 'fruits_uuid_tags', @@ -3528,9 +3528,9 @@ class UuidTag extends CakeTestModel { } class FruitNoWith extends CakeTestModel { - var $name = 'Fruit'; - var $useTable = 'fruits'; - var $hasAndBelongsToMany = array( + public $name = 'Fruit'; + public $useTable = 'fruits'; + public $hasAndBelongsToMany = array( 'UuidTag' => array( 'className' => 'UuidTagNoWith', 'joinTable' => 'fruits_uuid_tags', @@ -3540,9 +3540,9 @@ class FruitNoWith extends CakeTestModel { ); } class UuidTagNoWith extends CakeTestModel { - var $name = 'UuidTag'; - var $useTable = 'uuid_tags'; - var $hasAndBelongsToMany = array( + public $name = 'UuidTag'; + public $useTable = 'uuid_tags'; + public $hasAndBelongsToMany = array( 'Fruit' => array( 'className' => 'FruitNoWith', 'joinTable' => 'fruits_uuid_tags', @@ -3553,14 +3553,14 @@ class UuidTagNoWith extends CakeTestModel { } class ProductUpdateAll extends CakeTestModel { - var $name = 'ProductUpdateAll'; - var $useTable = 'product_update_all'; + public $name = 'ProductUpdateAll'; + public $useTable = 'product_update_all'; } class GroupUpdateAll extends CakeTestModel { - var $name = 'GroupUpdateAll'; - var $useTable = 'group_update_all'; + public $name = 'GroupUpdateAll'; + public $useTable = 'group_update_all'; } diff --git a/cake/tests/cases/libs/object.test.php b/cake/tests/cases/libs/object.test.php index 384bf2bc9..7e4a54907 100644 --- a/cake/tests/cases/libs/object.test.php +++ b/cake/tests/cases/libs/object.test.php @@ -33,7 +33,7 @@ class RequestActionPost extends CakeTestModel { * @var string 'ControllerPost' * @access public */ - var $name = 'RequestActionPost'; + public $name = 'RequestActionPost'; /** * useTable property @@ -41,7 +41,7 @@ class RequestActionPost extends CakeTestModel { * @var string 'posts' * @access public */ - var $useTable = 'posts'; + public $useTable = 'posts'; } /** @@ -58,7 +58,7 @@ class RequestActionController extends Controller { * @var array * @access public */ - var $uses = array('RequestActionPost'); + public $uses = array('RequestActionPost'); /** * test_request_action method @@ -136,7 +136,7 @@ class RequestActionPersistentController extends Controller { * @var array * @access public */ - var $uses = array('PersisterOne'); + public $uses = array('PersisterOne'); /** * persistModel property @@ -144,7 +144,7 @@ class RequestActionPersistentController extends Controller { * @var array * @access public */ - var $persistModel = true; + public $persistModel = true; /** * post pass, testing post passing @@ -170,7 +170,7 @@ class TestObject extends Object { * @var string 'Joel' * @access public */ - var $firstName = 'Joel'; + public $firstName = 'Joel'; /** * lastName property @@ -178,7 +178,7 @@ class TestObject extends Object { * @var string 'Moss' * @access public */ - var $lastName = 'Moss'; + public $lastName = 'Moss'; /** * methodCalls property @@ -186,7 +186,7 @@ class TestObject extends Object { * @var array * @access public */ - var $methodCalls = array(); + public $methodCalls = array(); /** * emptyMethod method @@ -306,8 +306,8 @@ function testPersist($name, $return = null, &$object, $type = null) { * @subpackage cake.tests.cases.libs */ class ObjectTestModel extends CakeTestModel { - var $useTable = false; - var $name = 'ObjectTestModel'; + public $useTable = false; + public $name = 'ObjectTestModel'; } /** @@ -323,7 +323,7 @@ class ObjectTest extends CakeTestCase { * * @var string */ - var $fixtures = array('core.post', 'core.test_plugin_comment', 'core.comment'); + public $fixtures = array('core.post', 'core.test_plugin_comment', 'core.comment'); /** * setUp method diff --git a/cake/tests/cases/libs/sanitize.test.php b/cake/tests/cases/libs/sanitize.test.php index b3f472c5b..796b998e6 100644 --- a/cake/tests/cases/libs/sanitize.test.php +++ b/cake/tests/cases/libs/sanitize.test.php @@ -33,7 +33,7 @@ class SanitizeDataTest extends CakeTestModel { * @var string 'SanitizeDataTest' * @access public */ - var $name = 'SanitizeDataTest'; + public $name = 'SanitizeDataTest'; /** * useTable property @@ -41,7 +41,7 @@ class SanitizeDataTest extends CakeTestModel { * @var string 'data_tests' * @access public */ - var $useTable = 'data_tests'; + public $useTable = 'data_tests'; } /** @@ -58,7 +58,7 @@ class SanitizeArticle extends CakeTestModel { * @var string 'Article' * @access public */ - var $name = 'SanitizeArticle'; + public $name = 'SanitizeArticle'; /** * useTable property @@ -66,7 +66,7 @@ class SanitizeArticle extends CakeTestModel { * @var string 'articles' * @access public */ - var $useTable = 'articles'; + public $useTable = 'articles'; } /** @@ -83,7 +83,7 @@ class SanitizeTest extends CakeTestCase { * @var bool false * @access public */ - var $autoFixtures = false; + public $autoFixtures = false; /** * fixtures property @@ -91,7 +91,7 @@ class SanitizeTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array('core.data_test', 'core.article'); + public $fixtures = array('core.data_test', 'core.article'); /** * startTest method diff --git a/cake/tests/cases/libs/security.test.php b/cake/tests/cases/libs/security.test.php index 34d1569da..434bdf8b2 100644 --- a/cake/tests/cases/libs/security.test.php +++ b/cake/tests/cases/libs/security.test.php @@ -33,7 +33,7 @@ class SecurityTest extends CakeTestCase { * @var mixed null * @access public */ - var $sut = null; + public $sut = null; /** * setUp method diff --git a/cake/tests/cases/libs/validation.test.php b/cake/tests/cases/libs/validation.test.php index 7f51544e3..f96abe139 100644 --- a/cake/tests/cases/libs/validation.test.php +++ b/cake/tests/cases/libs/validation.test.php @@ -99,7 +99,7 @@ class ValidationTest extends CakeTestCase { * @var mixed null * @access public */ - var $Validation = null; + public $Validation = null; /** * setup method diff --git a/cake/tests/cases/libs/view/helper.test.php b/cake/tests/cases/libs/view/helper.test.php index 804f325c5..e75ba753e 100644 --- a/cake/tests/cases/libs/view/helper.test.php +++ b/cake/tests/cases/libs/view/helper.test.php @@ -33,7 +33,7 @@ class HelperTestPost extends Model { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * schema method @@ -60,7 +60,7 @@ function schema() { * @var array * @access public */ - var $hasAndBelongsToMany = array('HelperTestTag'=> array('with' => 'HelperTestPostsTag')); + public $hasAndBelongsToMany = array('HelperTestTag'=> array('with' => 'HelperTestPostsTag')); } /** @@ -77,7 +77,7 @@ class HelperTestComment extends Model { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * schema method @@ -112,7 +112,7 @@ class HelperTestTag extends Model { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * schema method @@ -145,7 +145,7 @@ class HelperTestPostsTag extends Model { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * schema method diff --git a/cake/tests/cases/libs/view/helpers/ajax.test.php b/cake/tests/cases/libs/view/helpers/ajax.test.php index 1ed79f567..cc1fb9321 100644 --- a/cake/tests/cases/libs/view/helpers/ajax.test.php +++ b/cake/tests/cases/libs/view/helpers/ajax.test.php @@ -34,14 +34,14 @@ class AjaxTestController extends Controller { * @var string 'AjaxTest' * @access public */ - var $name = 'AjaxTest'; + public $name = 'AjaxTest'; /** * uses property * * @var mixed null * @access public */ - var $uses = null; + public $uses = null; } /** * PostAjaxTest class @@ -56,14 +56,14 @@ class PostAjaxTest extends Model { * @var string 'id' * @access public */ - var $primaryKey = 'id'; + public $primaryKey = 'id'; /** * useTable property * * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * schema method * @@ -108,7 +108,7 @@ class TestJavascriptHelper extends JavascriptHelper { * @var mixed * @access public */ - var $codeBlocks; + public $codeBlocks; /** * codeBlock method * @@ -135,13 +135,13 @@ class AjaxHelperTest extends CakeTestCase { * * @var string */ - var $cDataStart = 'preg:/^\/\/<!\[CDATA\[[\n\r]*/'; + public $cDataStart = 'preg:/^\/\/<!\[CDATA\[[\n\r]*/'; /** * Regexp for CDATA end block * * @var string */ - var $cDataEnd = 'preg:/[^\]]*\]\]\>[\s\r\n]*/'; + public $cDataEnd = 'preg:/[^\]]*\]\]\>[\s\r\n]*/'; /** * setUp method * diff --git a/cake/tests/cases/libs/view/helpers/cache.test.php b/cake/tests/cases/libs/view/helpers/cache.test.php index c2ae94ae1..b8dfdc376 100644 --- a/cake/tests/cases/libs/view/helpers/cache.test.php +++ b/cake/tests/cases/libs/view/helpers/cache.test.php @@ -34,7 +34,7 @@ class CacheTestController extends Controller { * @var array * @access public */ - var $helpers = array('Html', 'Cache'); + public $helpers = array('Html', 'Cache'); /** * cache_parsing method diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 58885fbc7..829e24a3a 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -35,7 +35,7 @@ class ContactTestController extends Controller { * @var string 'ContactTest' * @access public */ - var $name = 'ContactTest'; + public $name = 'ContactTest'; /** * uses property @@ -43,7 +43,7 @@ class ContactTestController extends Controller { * @var mixed null * @access public */ - var $uses = null; + public $uses = null; } /** @@ -60,7 +60,7 @@ class Contact extends CakeTestModel { * @var string 'id' * @access public */ - var $primaryKey = 'id'; + public $primaryKey = 'id'; /** * useTable property @@ -68,7 +68,7 @@ class Contact extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * name property @@ -76,7 +76,7 @@ class Contact extends CakeTestModel { * @var string 'Contact' * @access public */ - var $name = 'Contact'; + public $name = 'Contact'; /** * Default schema @@ -101,7 +101,7 @@ class Contact extends CakeTestModel { * @var array * @access public */ - var $validate = array( + public $validate = array( 'non_existing' => array(), 'idontexist' => array(), 'imrequired' => array('rule' => array('between', 5, 30), 'allowEmpty' => false), @@ -128,7 +128,7 @@ function setSchema($schema) { * @var array * @access public */ - var $hasAndBelongsToMany = array('ContactTag' => array('with' => 'ContactTagsContact')); + public $hasAndBelongsToMany = array('ContactTag' => array('with' => 'ContactTagsContact')); } /** @@ -145,7 +145,7 @@ class ContactTagsContact extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * name property @@ -153,7 +153,7 @@ class ContactTagsContact extends CakeTestModel { * @var string 'Contact' * @access public */ - var $name = 'ContactTagsContact'; + public $name = 'ContactTagsContact'; /** * Default schema @@ -193,7 +193,7 @@ class ContactNonStandardPk extends Contact { * @var string 'pk' * @access public */ - var $primaryKey = 'pk'; + public $primaryKey = 'pk'; /** * name property @@ -201,7 +201,7 @@ class ContactNonStandardPk extends Contact { * @var string 'ContactNonStandardPk' * @access public */ - var $name = 'ContactNonStandardPk'; + public $name = 'ContactNonStandardPk'; /** * schema method @@ -231,7 +231,7 @@ class ContactTag extends Model { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * schema definition @@ -261,7 +261,7 @@ class UserForm extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * primaryKey property @@ -269,7 +269,7 @@ class UserForm extends CakeTestModel { * @var string 'id' * @access public */ - var $primaryKey = 'id'; + public $primaryKey = 'id'; /** * name property @@ -277,7 +277,7 @@ class UserForm extends CakeTestModel { * @var string 'UserForm' * @access public */ - var $name = 'UserForm'; + public $name = 'UserForm'; /** * hasMany property @@ -285,7 +285,7 @@ class UserForm extends CakeTestModel { * @var array * @access public */ - var $hasMany = array( + public $hasMany = array( 'OpenidUrl' => array('className' => 'OpenidUrl', 'foreignKey' => 'user_form_id' )); @@ -320,7 +320,7 @@ class OpenidUrl extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * primaryKey property @@ -328,7 +328,7 @@ class OpenidUrl extends CakeTestModel { * @var string 'id' * @access public */ - var $primaryKey = 'id'; + public $primaryKey = 'id'; /** * name property @@ -336,7 +336,7 @@ class OpenidUrl extends CakeTestModel { * @var string 'OpenidUrl' * @access public */ - var $name = 'OpenidUrl'; + public $name = 'OpenidUrl'; /** * belongsTo property @@ -344,7 +344,7 @@ class OpenidUrl extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('UserForm' => array( + public $belongsTo = array('UserForm' => array( 'className' => 'UserForm', 'foreignKey' => 'user_form_id' )); @@ -354,7 +354,7 @@ class OpenidUrl extends CakeTestModel { * @var array * @access public */ - var $validate = array('openid_not_registered' => array()); + public $validate = array('openid_not_registered' => array()); /** * schema method @@ -396,7 +396,7 @@ class ValidateUser extends CakeTestModel { * @var string 'id' * @access public */ - var $primaryKey = 'id'; + public $primaryKey = 'id'; /** * useTable property @@ -404,7 +404,7 @@ class ValidateUser extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * name property @@ -412,7 +412,7 @@ class ValidateUser extends CakeTestModel { * @var string 'ValidateUser' * @access public */ - var $name = 'ValidateUser'; + public $name = 'ValidateUser'; /** * hasOne property @@ -420,7 +420,7 @@ class ValidateUser extends CakeTestModel { * @var array * @access public */ - var $hasOne = array('ValidateProfile' => array( + public $hasOne = array('ValidateProfile' => array( 'className' => 'ValidateProfile', 'foreignKey' => 'user_id' )); @@ -465,7 +465,7 @@ class ValidateProfile extends CakeTestModel { * @var string 'id' * @access public */ - var $primaryKey = 'id'; + public $primaryKey = 'id'; /** * useTable property @@ -473,7 +473,7 @@ class ValidateProfile extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * schema property @@ -496,7 +496,7 @@ class ValidateProfile extends CakeTestModel { * @var string 'ValidateProfile' * @access public */ - var $name = 'ValidateProfile'; + public $name = 'ValidateProfile'; /** * hasOne property @@ -504,7 +504,7 @@ class ValidateProfile extends CakeTestModel { * @var array * @access public */ - var $hasOne = array('ValidateItem' => array( + public $hasOne = array('ValidateItem' => array( 'className' => 'ValidateItem', 'foreignKey' => 'profile_id' )); @@ -514,7 +514,7 @@ class ValidateProfile extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('ValidateUser' => array( + public $belongsTo = array('ValidateUser' => array( 'className' => 'ValidateUser', 'foreignKey' => 'user_id' )); @@ -545,7 +545,7 @@ class ValidateItem extends CakeTestModel { * @var string 'id' * @access public */ - var $primaryKey = 'id'; + public $primaryKey = 'id'; /** * useTable property @@ -553,7 +553,7 @@ class ValidateItem extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * name property @@ -561,7 +561,7 @@ class ValidateItem extends CakeTestModel { * @var string 'ValidateItem' * @access public */ - var $name = 'ValidateItem'; + public $name = 'ValidateItem'; /** * schema property @@ -586,7 +586,7 @@ class ValidateItem extends CakeTestModel { * @var array * @access public */ - var $belongsTo = array('ValidateProfile' => array('foreignKey' => 'profile_id')); + public $belongsTo = array('ValidateProfile' => array('foreignKey' => 'profile_id')); /** * beforeValidate method @@ -614,7 +614,7 @@ class TestMail extends CakeTestModel { * @var string 'id' * @access public */ - var $primaryKey = 'id'; + public $primaryKey = 'id'; /** * useTable property @@ -622,7 +622,7 @@ class TestMail extends CakeTestModel { * @var bool false * @access public */ - var $useTable = false; + public $useTable = false; /** * name property @@ -630,7 +630,7 @@ class TestMail extends CakeTestModel { * @var string 'TestMail' * @access public */ - var $name = 'TestMail'; + public $name = 'TestMail'; } /** @@ -647,7 +647,7 @@ class FormHelperTest extends CakeTestCase { * @var array * @access public */ - var $fixtures = array(null); + public $fixtures = array(null); /** * setUp method diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/cake/tests/cases/libs/view/helpers/html.test.php index 6d5283409..055345391 100644 --- a/cake/tests/cases/libs/view/helpers/html.test.php +++ b/cake/tests/cases/libs/view/helpers/html.test.php @@ -34,7 +34,7 @@ class TheHtmlTestController extends Controller { * @var string 'TheTest' * @access public */ - var $name = 'TheTest'; + public $name = 'TheTest'; /** * uses property @@ -42,7 +42,7 @@ class TheHtmlTestController extends Controller { * @var mixed null * @access public */ - var $uses = null; + public $uses = null; } Mock::generate('View', 'HtmlHelperMockView'); @@ -60,20 +60,20 @@ class HtmlHelperTest extends CakeTestCase { * * @var string */ - var $cDataStart = 'preg:/^\/\/<!\[CDATA\[[\n\r]*/'; + public $cDataStart = 'preg:/^\/\/<!\[CDATA\[[\n\r]*/'; /** * Regexp for CDATA end block * * @var string */ - var $cDataEnd = 'preg:/[^\]]*\]\]\>[\s\r\n]*/'; + public $cDataEnd = 'preg:/[^\]]*\]\]\>[\s\r\n]*/'; /** * html property * * @var object * @access public */ - var $Html = null; + public $Html = null; /** * Backup of app encoding configuration setting diff --git a/cake/tests/cases/libs/view/helpers/javascript.test.php b/cake/tests/cases/libs/view/helpers/javascript.test.php index 22b570b8c..5768f28d0 100644 --- a/cake/tests/cases/libs/view/helpers/javascript.test.php +++ b/cake/tests/cases/libs/view/helpers/javascript.test.php @@ -34,7 +34,7 @@ class TheJsTestController extends Controller { * @var string 'TheTest' * @access public */ - var $name = 'TheTest'; + public $name = 'TheTest'; /** * uses property @@ -42,7 +42,7 @@ class TheJsTestController extends Controller { * @var mixed null * @access public */ - var $uses = null; + public $uses = null; } /** @@ -78,7 +78,7 @@ class TestJavascriptObject { * @var string 'value1' * @access public */ - var $property1 = 'value1'; + public $property1 = 'value1'; /** * property2 property @@ -86,7 +86,7 @@ class TestJavascriptObject { * @var int 2 * @access public */ - var $property2 = 2; + public $property2 = 2; } /** @@ -103,14 +103,14 @@ class JavascriptTest extends CakeTestCase { * * @var string */ - var $cDataStart = 'preg:/^\/\/<!\[CDATA\[[\n\r]*/'; + public $cDataStart = 'preg:/^\/\/<!\[CDATA\[[\n\r]*/'; /** * Regexp for CDATA end block * * @var string */ - var $cDataEnd = 'preg:/[^\]]*\]\]\>[\s\r\n]*/'; + public $cDataEnd = 'preg:/[^\]]*\]\]\>[\s\r\n]*/'; /** * setUp method diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index ab31eab2c..d7d5c6c38 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -64,14 +64,14 @@ class JsHelperTestCase extends CakeTestCase { * * @var string */ - var $cDataStart = 'preg:/^\/\/<!\[CDATA\[[\n\r]*/'; + public $cDataStart = 'preg:/^\/\/<!\[CDATA\[[\n\r]*/'; /** * Regexp for CDATA end block * * @var string */ - var $cDataEnd = 'preg:/[^\]]*\]\]\>[\s\r\n]*/'; + public $cDataEnd = 'preg:/[^\]]*\]\]\>[\s\r\n]*/'; /** * startTest method diff --git a/cake/tests/cases/libs/view/helpers/number.test.php b/cake/tests/cases/libs/view/helpers/number.test.php index fe0e65816..972830d8c 100644 --- a/cake/tests/cases/libs/view/helpers/number.test.php +++ b/cake/tests/cases/libs/view/helpers/number.test.php @@ -33,7 +33,7 @@ class NumberHelperTest extends CakeTestCase { * @var mixed null * @access public */ - var $helper = null; + public $helper = null; /** * setUp method diff --git a/cake/tests/cases/libs/view/helpers/text.test.php b/cake/tests/cases/libs/view/helpers/text.test.php index 042cce533..1bcbee60f 100644 --- a/cake/tests/cases/libs/view/helpers/text.test.php +++ b/cake/tests/cases/libs/view/helpers/text.test.php @@ -33,7 +33,7 @@ class TextHelperTest extends CakeTestCase { * @var mixed null * @access public */ - var $helper = null; + public $helper = null; /** * setUp method diff --git a/cake/tests/cases/libs/view/helpers/xml.test.php b/cake/tests/cases/libs/view/helpers/xml.test.php index 7b4c03ece..2e3e06d63 100644 --- a/cake/tests/cases/libs/view/helpers/xml.test.php +++ b/cake/tests/cases/libs/view/helpers/xml.test.php @@ -36,7 +36,7 @@ class TestXml extends Object { * @var string '' * @access public */ - var $content = ''; + public $content = ''; /** * construct method diff --git a/cake/tests/cases/libs/view/theme.test.php b/cake/tests/cases/libs/view/theme.test.php index 8146c6561..2541fbbb9 100644 --- a/cake/tests/cases/libs/view/theme.test.php +++ b/cake/tests/cases/libs/view/theme.test.php @@ -40,7 +40,7 @@ class ThemePostsController extends Controller { * @var string 'ThemePosts' * @access public */ - var $name = 'ThemePosts'; + public $name = 'ThemePosts'; /** * index method diff --git a/cake/tests/cases/libs/view/view.test.php b/cake/tests/cases/libs/view/view.test.php index 44b750b07..887e67cd5 100644 --- a/cake/tests/cases/libs/view/view.test.php +++ b/cake/tests/cases/libs/view/view.test.php @@ -41,7 +41,7 @@ class ViewPostsController extends Controller { * @var string 'Posts' * @access public */ - var $name = 'Posts'; + public $name = 'Posts'; /** * uses property @@ -49,7 +49,7 @@ class ViewPostsController extends Controller { * @var mixed null * @access public */ - var $uses = null; + public $uses = null; /** * index method @@ -178,7 +178,7 @@ class TestAfterHelper extends Helper { * @var string '' * @access public */ - var $property = ''; + public $property = ''; /** * beforeLayout method diff --git a/cake/tests/fixtures/account_fixture.php b/cake/tests/fixtures/account_fixture.php index c5c0a60a4..cc7d49442 100644 --- a/cake/tests/fixtures/account_fixture.php +++ b/cake/tests/fixtures/account_fixture.php @@ -32,8 +32,8 @@ class AccountFixture extends CakeTestFixture { * @var string 'Aco' * @access public */ - var $name = 'Account'; - var $table = 'Accounts'; + public $name = 'Account'; + public $table = 'Accounts'; /** * fields property @@ -41,7 +41,7 @@ class AccountFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'iAccountId' => array('type' => 'integer', 'key' => 'primary'), 'cDescription' => array('type' => 'string', 'length' => 10, 'null' => true) ); @@ -52,7 +52,7 @@ class AccountFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('cDescription' => 'gwoo'), array('cDescription' => 'phpnut'), array('cDescription' => 'schreck'), diff --git a/cake/tests/fixtures/aco_action_fixture.php b/cake/tests/fixtures/aco_action_fixture.php index 18272396c..78b8fb2ad 100644 --- a/cake/tests/fixtures/aco_action_fixture.php +++ b/cake/tests/fixtures/aco_action_fixture.php @@ -32,7 +32,7 @@ class AcoActionFixture extends CakeTestFixture { * @var string 'AcoAction' * @access public */ - var $name = 'AcoAction'; + public $name = 'AcoAction'; /** * fields property @@ -40,7 +40,7 @@ class AcoActionFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'parent_id' => array('type' => 'integer', 'length' => 10, 'null' => true), 'model' => array('type' => 'string', 'default' => ''), @@ -56,7 +56,7 @@ class AcoActionFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array(); + public $records = array(); } ?> \ No newline at end of file diff --git a/cake/tests/fixtures/aco_fixture.php b/cake/tests/fixtures/aco_fixture.php index 248b16157..ce87b7516 100644 --- a/cake/tests/fixtures/aco_fixture.php +++ b/cake/tests/fixtures/aco_fixture.php @@ -32,7 +32,7 @@ class AcoFixture extends CakeTestFixture { * @var string 'Aco' * @access public */ - var $name = 'Aco'; + public $name = 'Aco'; /** * fields property @@ -40,7 +40,7 @@ class AcoFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'parent_id' => array('type' => 'integer', 'length' => 10, 'null' => true), 'model' => array('type' => 'string', 'null' => true), @@ -56,7 +56,7 @@ class AcoFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'ROOT', 'lft' => 1, 'rght' => 24), array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'Controller1', 'lft' => 2, 'rght' => 9), array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'action1', 'lft' => 3, 'rght' => 6), diff --git a/cake/tests/fixtures/aco_two_fixture.php b/cake/tests/fixtures/aco_two_fixture.php index 78129bbd3..fc113d080 100644 --- a/cake/tests/fixtures/aco_two_fixture.php +++ b/cake/tests/fixtures/aco_two_fixture.php @@ -32,7 +32,7 @@ class AcoTwoFixture extends CakeTestFixture { * @var string 'AcoTwo' * @access public */ - var $name = 'AcoTwo'; + public $name = 'AcoTwo'; /** * fields property @@ -40,7 +40,7 @@ class AcoTwoFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'parent_id' => array('type' => 'integer', 'length' => 10, 'null' => true), 'model' => array('type' => 'string', 'null' => true), @@ -56,7 +56,7 @@ class AcoTwoFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'ROOT', 'lft' => 1, 'rght' => 20), array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'tpsReports', 'lft' => 2, 'rght' => 9), array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'view', 'lft' => 3, 'rght' => 6), diff --git a/cake/tests/fixtures/ad_fixture.php b/cake/tests/fixtures/ad_fixture.php index e4d339150..21ce7f195 100644 --- a/cake/tests/fixtures/ad_fixture.php +++ b/cake/tests/fixtures/ad_fixture.php @@ -33,7 +33,7 @@ class AdFixture extends CakeTestFixture { * @var string 'Ad' * @access public */ - var $name = 'Ad'; + public $name = 'Ad'; /** * fields property @@ -41,7 +41,7 @@ class AdFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'campaign_id' => array('type' => 'integer'), 'parent_id' => array('type' => 'integer'), @@ -56,7 +56,7 @@ class AdFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('parent_id' => null, 'lft' => 1, 'rght' => 2, 'campaign_id' => 1, 'name' => 'Nordover'), array('parent_id' => null, 'lft' => 3, 'rght' => 4, 'campaign_id' => 1, 'name' => 'Statbergen'), array('parent_id' => null, 'lft' => 5, 'rght' => 6, 'campaign_id' => 1, 'name' => 'Feroy'), diff --git a/cake/tests/fixtures/advertisement_fixture.php b/cake/tests/fixtures/advertisement_fixture.php index 7c7de708b..2a75eeb73 100644 --- a/cake/tests/fixtures/advertisement_fixture.php +++ b/cake/tests/fixtures/advertisement_fixture.php @@ -32,7 +32,7 @@ class AdvertisementFixture extends CakeTestFixture { * @var string 'Advertisement' * @access public */ - var $name = 'Advertisement'; + public $name = 'Advertisement'; /** * fields property @@ -40,7 +40,7 @@ class AdvertisementFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'title' => array('type' => 'string', 'null' => false), 'created' => 'datetime', @@ -53,7 +53,7 @@ class AdvertisementFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('title' => 'First Ad', 'created' => '2007-03-18 10:39:23', 'updated' => '2007-03-18 10:41:31'), array('title' => 'Second Ad', 'created' => '2007-03-18 10:41:23', 'updated' => '2007-03-18 10:43:31') ); diff --git a/cake/tests/fixtures/after_tree_fixture.php b/cake/tests/fixtures/after_tree_fixture.php index 06440fb5e..5d6ad0ef8 100644 --- a/cake/tests/fixtures/after_tree_fixture.php +++ b/cake/tests/fixtures/after_tree_fixture.php @@ -33,7 +33,7 @@ class AfterTreeFixture extends CakeTestFixture { * @var string 'AfterTree' * @access public */ - var $name = 'AfterTree'; + public $name = 'AfterTree'; /** * fields property @@ -41,7 +41,7 @@ class AfterTreeFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'parent_id' => array('type' => 'integer'), 'lft' => array('type' => 'integer'), @@ -55,7 +55,7 @@ class AfterTreeFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('parent_id' => null, 'lft' => 1, 'rght' => 2, 'name' => 'One'), array('parent_id' => null, 'lft' => 3, 'rght' => 4, 'name' => 'Two'), array('parent_id' => null, 'lft' => 5, 'rght' => 6, 'name' => 'Three'), diff --git a/cake/tests/fixtures/another_article_fixture.php b/cake/tests/fixtures/another_article_fixture.php index 3f8ab6bf9..ea87b3798 100644 --- a/cake/tests/fixtures/another_article_fixture.php +++ b/cake/tests/fixtures/another_article_fixture.php @@ -32,7 +32,7 @@ class AnotherArticleFixture extends CakeTestFixture { * @var string 'AnotherArticle' * @access public */ - var $name = 'AnotherArticle'; + public $name = 'AnotherArticle'; /** * fields property @@ -40,7 +40,7 @@ class AnotherArticleFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'title' => array('type' => 'string', 'null' => false), 'created' => 'datetime', @@ -53,7 +53,7 @@ class AnotherArticleFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('title' => 'First Article', 'created' => '2007-03-18 10:39:23', 'updated' => '2007-03-18 10:41:31'), array('title' => 'Second Article', 'created' => '2007-03-18 10:41:23', 'updated' => '2007-03-18 10:43:31'), array('title' => 'Third Article', 'created' => '2007-03-18 10:43:23', 'updated' => '2007-03-18 10:45:31') diff --git a/cake/tests/fixtures/apple_fixture.php b/cake/tests/fixtures/apple_fixture.php index a49cf34f6..70f6c1440 100644 --- a/cake/tests/fixtures/apple_fixture.php +++ b/cake/tests/fixtures/apple_fixture.php @@ -32,7 +32,7 @@ class AppleFixture extends CakeTestFixture { * @var string 'Apple' * @access public */ - var $name = 'Apple'; + public $name = 'Apple'; /** * fields property @@ -40,7 +40,7 @@ class AppleFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'apple_id' => array('type' => 'integer', 'null' => true), 'color' => array('type' => 'string', 'length' => 40, 'null' => false), @@ -57,7 +57,7 @@ class AppleFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('apple_id' => 2, 'color' => 'Red 1', 'name' => 'Red Apple 1', 'created' => '2006-11-22 10:38:58', 'date' => '1951-01-04', 'modified' => '2006-12-01 13:31:26', 'mytime' => '22:57:17'), array('apple_id' => 1, 'color' => 'Bright Red 1', 'name' => 'Bright Red Apple', 'created' => '2006-11-22 10:43:13', 'date' => '2014-01-01', 'modified' => '2006-11-30 18:38:10', 'mytime' => '22:57:17'), array('apple_id' => 2, 'color' => 'blue green', 'name' => 'green blue', 'created' => '2006-12-25 05:13:36', 'date' => '2006-12-25', 'modified' => '2006-12-25 05:23:24', 'mytime' => '22:57:17'), diff --git a/cake/tests/fixtures/aro_fixture.php b/cake/tests/fixtures/aro_fixture.php index 49b2e6401..8ab796c9a 100644 --- a/cake/tests/fixtures/aro_fixture.php +++ b/cake/tests/fixtures/aro_fixture.php @@ -32,7 +32,7 @@ class AroFixture extends CakeTestFixture { * @var string 'Aro' * @access public */ - var $name = 'Aro'; + public $name = 'Aro'; /** * fields property @@ -40,7 +40,7 @@ class AroFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'parent_id' => array('type' => 'integer', 'length' => 10, 'null' => true), 'model' => array('type' => 'string', 'null' => true), @@ -56,7 +56,7 @@ class AroFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'ROOT', 'lft' => 1, 'rght' => 8), array('parent_id' => '1', 'model' => 'Group', 'foreign_key' => '1', 'alias' => 'admins', 'lft' => 2, 'rght' => 7), array('parent_id' => '2', 'model' => 'AuthUser', 'foreign_key' => '1', 'alias' => 'Gandalf', 'lft' => 3, 'rght' => 4), diff --git a/cake/tests/fixtures/aro_two_fixture.php b/cake/tests/fixtures/aro_two_fixture.php index 214c32d0a..d23dc0f73 100644 --- a/cake/tests/fixtures/aro_two_fixture.php +++ b/cake/tests/fixtures/aro_two_fixture.php @@ -32,7 +32,7 @@ class AroTwoFixture extends CakeTestFixture { * @var string 'AroTwo' * @access public */ - var $name = 'AroTwo'; + public $name = 'AroTwo'; /** * fields property @@ -40,7 +40,7 @@ class AroTwoFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'parent_id' => array('type' => 'integer', 'length' => 10, 'null' => true), 'model' => array('type' => 'string', 'null' => true), @@ -56,7 +56,7 @@ class AroTwoFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => 1, 'parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'root', 'lft' => '1', 'rght' => '20'), array('id' => 2, 'parent_id' => 1, 'model' => 'Group', 'foreign_key' => '1', 'alias' => 'admin', 'lft' => '2', 'rght' => '5'), array('id' => 3, 'parent_id' => 1, 'model' => 'Group', 'foreign_key' => '2', 'alias' => 'managers', 'lft' => '6', 'rght' => '9'), diff --git a/cake/tests/fixtures/aros_aco_fixture.php b/cake/tests/fixtures/aros_aco_fixture.php index 4b123c462..efd66183e 100644 --- a/cake/tests/fixtures/aros_aco_fixture.php +++ b/cake/tests/fixtures/aros_aco_fixture.php @@ -32,7 +32,7 @@ class ArosAcoFixture extends CakeTestFixture { * @var string 'ArosAco' * @access public */ - var $name = 'ArosAco'; + public $name = 'ArosAco'; /** * fields property @@ -40,7 +40,7 @@ class ArosAcoFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'aro_id' => array('type' => 'integer', 'length' => 10, 'null' => false), 'aco_id' => array('type' => 'integer', 'length' => 10, 'null' => false), @@ -56,7 +56,7 @@ class ArosAcoFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array(); + public $records = array(); } ?> \ No newline at end of file diff --git a/cake/tests/fixtures/aros_aco_two_fixture.php b/cake/tests/fixtures/aros_aco_two_fixture.php index eed28cc4a..308d97007 100644 --- a/cake/tests/fixtures/aros_aco_two_fixture.php +++ b/cake/tests/fixtures/aros_aco_two_fixture.php @@ -32,7 +32,7 @@ class ArosAcoTwoFixture extends CakeTestFixture { * @var string 'ArosAcoTwo' * @access public */ - var $name = 'ArosAcoTwo'; + public $name = 'ArosAcoTwo'; /** * fields property @@ -40,7 +40,7 @@ class ArosAcoTwoFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'aro_id' => array('type' => 'integer', 'length' => 10, 'null' => false), 'aco_id' => array('type' => 'integer', 'length' => 10, 'null' => false), @@ -56,7 +56,7 @@ class ArosAcoTwoFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => 1, 'aro_id' => '1', 'aco_id' => '1', '_create' => '-1', '_read' => '-1', '_update' => '-1', '_delete' => '-1'), array('id' => 2, 'aro_id' => '2', 'aco_id' => '1', '_create' => '0', '_read' => '1', '_update' => '1', '_delete' => '1'), array('id' => 3, 'aro_id' => '3', 'aco_id' => '2', '_create' => '0', '_read' => '1', '_update' => '0', '_delete' => '0'), diff --git a/cake/tests/fixtures/article_featured_fixture.php b/cake/tests/fixtures/article_featured_fixture.php index 811df9b44..d3bdc3528 100644 --- a/cake/tests/fixtures/article_featured_fixture.php +++ b/cake/tests/fixtures/article_featured_fixture.php @@ -32,7 +32,7 @@ class ArticleFeaturedFixture extends CakeTestFixture { * @var string 'ArticleFeatured' * @access public */ - var $name = 'ArticleFeatured'; + public $name = 'ArticleFeatured'; /** * fields property @@ -40,7 +40,7 @@ class ArticleFeaturedFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'user_id' => array('type' => 'integer', 'null' => false), 'title' => array('type' => 'string', 'null' => false), @@ -56,7 +56,7 @@ class ArticleFeaturedFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('user_id' => 1, 'title' => 'First Article', 'body' => 'First Article Body', 'published' => 'Y', 'created' => '2007-03-18 10:39:23', 'updated' => '2007-03-18 10:41:31'), array('user_id' => 3, 'title' => 'Second Article', 'body' => 'Second Article Body', 'published' => 'Y', 'created' => '2007-03-18 10:41:23', 'updated' => '2007-03-18 10:43:31'), array('user_id' => 1, 'title' => 'Third Article', 'body' => 'Third Article Body', 'published' => 'Y', 'created' => '2007-03-18 10:43:23', 'updated' => '2007-03-18 10:45:31') diff --git a/cake/tests/fixtures/article_featureds_tags_fixture.php b/cake/tests/fixtures/article_featureds_tags_fixture.php index 6fcda75a3..f8ee48c5a 100644 --- a/cake/tests/fixtures/article_featureds_tags_fixture.php +++ b/cake/tests/fixtures/article_featureds_tags_fixture.php @@ -32,7 +32,7 @@ class ArticleFeaturedsTagsFixture extends CakeTestFixture { * @var string 'ArticleFeaturedsTags' * @access public */ - var $name = 'ArticleFeaturedsTags'; + public $name = 'ArticleFeaturedsTags'; /** * fields property @@ -40,7 +40,7 @@ class ArticleFeaturedsTagsFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'article_featured_id' => array('type' => 'integer', 'null' => false), 'tag_id' => array('type' => 'integer', 'null' => false), 'indexes' => array('UNIQUE_FEATURED' => array('column'=> array('article_featured_id', 'tag_id'), 'unique'=> 1)) diff --git a/cake/tests/fixtures/article_fixture.php b/cake/tests/fixtures/article_fixture.php index b16189509..a904812da 100644 --- a/cake/tests/fixtures/article_fixture.php +++ b/cake/tests/fixtures/article_fixture.php @@ -32,7 +32,7 @@ class ArticleFixture extends CakeTestFixture { * @var string 'Article' * @access public */ - var $name = 'Article'; + public $name = 'Article'; /** * fields property @@ -40,7 +40,7 @@ class ArticleFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'user_id' => array('type' => 'integer', 'null' => false), 'title' => array('type' => 'string', 'null' => false), @@ -56,7 +56,7 @@ class ArticleFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('user_id' => 1, 'title' => 'First Article', 'body' => 'First Article Body', 'published' => 'Y', 'created' => '2007-03-18 10:39:23', 'updated' => '2007-03-18 10:41:31'), array('user_id' => 3, 'title' => 'Second Article', 'body' => 'Second Article Body', 'published' => 'Y', 'created' => '2007-03-18 10:41:23', 'updated' => '2007-03-18 10:43:31'), array('user_id' => 1, 'title' => 'Third Article', 'body' => 'Third Article Body', 'published' => 'Y', 'created' => '2007-03-18 10:43:23', 'updated' => '2007-03-18 10:45:31') diff --git a/cake/tests/fixtures/articles_tag_fixture.php b/cake/tests/fixtures/articles_tag_fixture.php index 9c899c9fd..43ae18907 100644 --- a/cake/tests/fixtures/articles_tag_fixture.php +++ b/cake/tests/fixtures/articles_tag_fixture.php @@ -32,7 +32,7 @@ class ArticlesTagFixture extends CakeTestFixture { * @var string 'ArticlesTag' * @access public */ - var $name = 'ArticlesTag'; + public $name = 'ArticlesTag'; /** * fields property @@ -40,7 +40,7 @@ class ArticlesTagFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'article_id' => array('type' => 'integer', 'null' => false), 'tag_id' => array('type' => 'integer', 'null' => false), 'indexes' => array('UNIQUE_TAG' => array('column'=> array('article_id', 'tag_id'), 'unique'=>1)) @@ -52,7 +52,7 @@ class ArticlesTagFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('article_id' => 1, 'tag_id' => 1), array('article_id' => 1, 'tag_id' => 2), array('article_id' => 2, 'tag_id' => 1), diff --git a/cake/tests/fixtures/attachment_fixture.php b/cake/tests/fixtures/attachment_fixture.php index 537bf575f..50a6079bc 100644 --- a/cake/tests/fixtures/attachment_fixture.php +++ b/cake/tests/fixtures/attachment_fixture.php @@ -32,7 +32,7 @@ class AttachmentFixture extends CakeTestFixture { * @var string 'Attachment' * @access public */ - var $name = 'Attachment'; + public $name = 'Attachment'; /** * fields property @@ -40,7 +40,7 @@ class AttachmentFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'comment_id' => array('type' => 'integer', 'null' => false), 'attachment' => array('type' => 'string', 'null' => false), @@ -54,7 +54,7 @@ class AttachmentFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('comment_id' => 5, 'attachment' => 'attachment.zip', 'created' => '2007-03-18 10:51:23', 'updated' => '2007-03-18 10:53:31') ); } diff --git a/cake/tests/fixtures/auth_user_custom_field_fixture.php b/cake/tests/fixtures/auth_user_custom_field_fixture.php index 7b9d7b670..71b4f541e 100644 --- a/cake/tests/fixtures/auth_user_custom_field_fixture.php +++ b/cake/tests/fixtures/auth_user_custom_field_fixture.php @@ -32,7 +32,7 @@ class AuthUserCustomFieldFixture extends CakeTestFixture { * @var string 'AuthUser' * @access public */ - var $name = 'AuthUserCustomField'; + public $name = 'AuthUserCustomField'; /** * fields property @@ -40,7 +40,7 @@ class AuthUserCustomFieldFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'email' => array('type' => 'string', 'null' => false), 'password' => array('type' => 'string', 'null' => false), @@ -54,7 +54,7 @@ class AuthUserCustomFieldFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('email' => 'mariano@example.com', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99', 'created' => '2007-03-17 01:16:23', 'updated' => '2007-03-17 01:18:31'), array('email' => 'nate@example.com', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99', 'created' => '2007-03-17 01:18:23', 'updated' => '2007-03-17 01:20:31'), array('email' => 'larry@example.com', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99', 'created' => '2007-03-17 01:20:23', 'updated' => '2007-03-17 01:22:31'), diff --git a/cake/tests/fixtures/auth_user_fixture.php b/cake/tests/fixtures/auth_user_fixture.php index db37065a9..7595308d8 100644 --- a/cake/tests/fixtures/auth_user_fixture.php +++ b/cake/tests/fixtures/auth_user_fixture.php @@ -32,7 +32,7 @@ class AuthUserFixture extends CakeTestFixture { * @var string 'AuthUser' * @access public */ - var $name = 'AuthUser'; + public $name = 'AuthUser'; /** * fields property @@ -40,7 +40,7 @@ class AuthUserFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'username' => array('type' => 'string', 'null' => false), 'password' => array('type' => 'string', 'null' => false), @@ -54,7 +54,7 @@ class AuthUserFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('username' => 'mariano', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99', 'created' => '2007-03-17 01:16:23', 'updated' => '2007-03-17 01:18:31'), array('username' => 'nate', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99', 'created' => '2007-03-17 01:18:23', 'updated' => '2007-03-17 01:20:31'), array('username' => 'larry', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99', 'created' => '2007-03-17 01:20:23', 'updated' => '2007-03-17 01:22:31'), diff --git a/cake/tests/fixtures/author_fixture.php b/cake/tests/fixtures/author_fixture.php index c975b11b9..9916b60fc 100644 --- a/cake/tests/fixtures/author_fixture.php +++ b/cake/tests/fixtures/author_fixture.php @@ -32,7 +32,7 @@ class AuthorFixture extends CakeTestFixture { * @var string 'Author' * @access public */ - var $name = 'Author'; + public $name = 'Author'; /** * fields property @@ -40,7 +40,7 @@ class AuthorFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'user' => array('type' => 'string', 'default' => null), 'password' => array('type' => 'string', 'default' => null), @@ -54,7 +54,7 @@ class AuthorFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('user' => 'mariano', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99', 'created' => '2007-03-17 01:16:23', 'updated' => '2007-03-17 01:18:31'), array('user' => 'nate', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99', 'created' => '2007-03-17 01:18:23', 'updated' => '2007-03-17 01:20:31'), array('user' => 'larry', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99', 'created' => '2007-03-17 01:20:23', 'updated' => '2007-03-17 01:22:31'), diff --git a/cake/tests/fixtures/basket_fixture.php b/cake/tests/fixtures/basket_fixture.php index 7d2994c04..617f3f5bb 100644 --- a/cake/tests/fixtures/basket_fixture.php +++ b/cake/tests/fixtures/basket_fixture.php @@ -32,7 +32,7 @@ class BasketFixture extends CakeTestFixture { * @var string 'Basket' * @access public */ - var $name = 'Basket'; + public $name = 'Basket'; /** * fields property @@ -40,7 +40,7 @@ class BasketFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'type' => array('type' => 'string', 'length' => 255), 'name' => array('type' => 'string', 'length' => 255), @@ -54,7 +54,7 @@ class BasketFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => 1, 'type' => 'nonfile', 'name' => 'basket1', 'object_id' => 1, 'user_id' => 1), array('id' => 2, 'type' => 'file', 'name' => 'basket2', 'object_id' => 2, 'user_id' => 1), ); diff --git a/cake/tests/fixtures/bid_fixture.php b/cake/tests/fixtures/bid_fixture.php index 1d06678da..f743ea711 100644 --- a/cake/tests/fixtures/bid_fixture.php +++ b/cake/tests/fixtures/bid_fixture.php @@ -32,7 +32,7 @@ class BidFixture extends CakeTestFixture { * @var string 'Bid' * @access public */ - var $name = 'Bid'; + public $name = 'Bid'; /** * fields property @@ -40,7 +40,7 @@ class BidFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'message_id' => array('type' => 'integer', 'null' => false), 'name' => array('type' => 'string', 'null' => false) @@ -52,7 +52,7 @@ class BidFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('message_id' => 1, 'name' => 'Bid 1.1'), array('message_id' => 1, 'name' => 'Bid 1.2'), array('message_id' => 3, 'name' => 'Bid 3.1'), diff --git a/cake/tests/fixtures/binary_test_fixture.php b/cake/tests/fixtures/binary_test_fixture.php index 584492b25..4c1b2d837 100644 --- a/cake/tests/fixtures/binary_test_fixture.php +++ b/cake/tests/fixtures/binary_test_fixture.php @@ -32,7 +32,7 @@ class BinaryTestFixture extends CakeTestFixture { * @var string 'BinaryTest' * @access public */ - var $name = 'BinaryTest'; + public $name = 'BinaryTest'; /** * fields property @@ -40,7 +40,7 @@ class BinaryTestFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'data' => 'binary' ); @@ -51,7 +51,7 @@ class BinaryTestFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array(); + public $records = array(); } ?> \ No newline at end of file diff --git a/cake/tests/fixtures/book_fixture.php b/cake/tests/fixtures/book_fixture.php index af4b04375..e57526074 100644 --- a/cake/tests/fixtures/book_fixture.php +++ b/cake/tests/fixtures/book_fixture.php @@ -32,7 +32,7 @@ class BookFixture extends CakeTestFixture { * @var string 'Book' * @access public */ - var $name = 'Book'; + public $name = 'Book'; /** * fields property @@ -40,7 +40,7 @@ class BookFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'isbn' => array('type' => 'string', 'length' => 13), 'title' => array('type' => 'string', 'length' => 255), @@ -55,7 +55,7 @@ class BookFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => 1, 'isbn' => '1234567890', 'title' => 'Faust', 'author' => 'Johann Wolfgang von Goethe') ); } diff --git a/cake/tests/fixtures/cache_test_model_fixture.php b/cake/tests/fixtures/cache_test_model_fixture.php index b4ed55d28..f44a4e2b7 100644 --- a/cake/tests/fixtures/cache_test_model_fixture.php +++ b/cake/tests/fixtures/cache_test_model_fixture.php @@ -32,7 +32,7 @@ class CacheTestModelFixture extends CakeTestFixture { * @var string 'CacheTestModel' * @access public */ - var $name = 'CacheTestModel'; + public $name = 'CacheTestModel'; /** * fields property @@ -40,7 +40,7 @@ class CacheTestModelFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'string', 'length' => 255, 'key' => 'primary'), 'data' => array('type' => 'string', 'length' => 255, 'default' => ''), 'expires' => array('type' => 'integer', 'length' => 10, 'default' => '0'), diff --git a/cake/tests/fixtures/callback_fixture.php b/cake/tests/fixtures/callback_fixture.php index 5029c4291..7a339f204 100644 --- a/cake/tests/fixtures/callback_fixture.php +++ b/cake/tests/fixtures/callback_fixture.php @@ -32,7 +32,7 @@ class CallbackFixture extends CakeTestFixture { * @var string 'Callback' * @access public */ - var $name = 'Callback'; + public $name = 'Callback'; /** * fields property @@ -40,7 +40,7 @@ class CallbackFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'user' => array('type' => 'string', 'null' => false), 'password' => array('type' => 'string', 'null' => false), @@ -54,7 +54,7 @@ class CallbackFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('user' => 'user1', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99', 'created' => '2007-03-17 01:18:23', 'updated' => '2007-03-17 01:20:31'), array('user' => 'user2', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99', 'created' => '2007-03-17 01:20:23', 'updated' => '2007-03-17 01:22:31'), array('user' => 'user3', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99', 'created' => '2007-03-17 01:22:23', 'updated' => '2007-03-17 01:24:31'), diff --git a/cake/tests/fixtures/campaign_fixture.php b/cake/tests/fixtures/campaign_fixture.php index f546fde22..8809360eb 100644 --- a/cake/tests/fixtures/campaign_fixture.php +++ b/cake/tests/fixtures/campaign_fixture.php @@ -33,7 +33,7 @@ class CampaignFixture extends CakeTestFixture { * @var string 'Campaign' * @access public */ - var $name = 'Campaign'; + public $name = 'Campaign'; /** * fields property @@ -41,7 +41,7 @@ class CampaignFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'length' => 255, 'null' => false), ); @@ -52,7 +52,7 @@ class CampaignFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('name' => 'Hurtigruten'), array('name' => 'Colorline'), array('name' => 'Queen of Scandinavia') diff --git a/cake/tests/fixtures/category_fixture.php b/cake/tests/fixtures/category_fixture.php index aa16acb0c..318cb27e1 100644 --- a/cake/tests/fixtures/category_fixture.php +++ b/cake/tests/fixtures/category_fixture.php @@ -32,7 +32,7 @@ class CategoryFixture extends CakeTestFixture { * @var string 'Category' * @access public */ - var $name = 'Category'; + public $name = 'Category'; /** * fields property @@ -40,7 +40,7 @@ class CategoryFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'parent_id' => array('type' => 'integer', 'null' => false), 'name' => array('type' => 'string', 'null' => false), @@ -54,7 +54,7 @@ class CategoryFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('parent_id' => 0, 'name' => 'Category 1', 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'), array('parent_id' => 1, 'name' => 'Category 1.1', 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'), array('parent_id' => 1, 'name' => 'Category 1.2', 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'), diff --git a/cake/tests/fixtures/category_thread_fixture.php b/cake/tests/fixtures/category_thread_fixture.php index c9894ca3e..26064247a 100644 --- a/cake/tests/fixtures/category_thread_fixture.php +++ b/cake/tests/fixtures/category_thread_fixture.php @@ -32,7 +32,7 @@ class CategoryThreadFixture extends CakeTestFixture { * @var string 'CategoryThread' * @access public */ - var $name = 'CategoryThread'; + public $name = 'CategoryThread'; /** * fields property @@ -40,7 +40,7 @@ class CategoryThreadFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'parent_id' => array('type' => 'integer', 'null' => false), 'name' => array('type' => 'string', 'null' => false), @@ -54,7 +54,7 @@ class CategoryThreadFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('parent_id' => 0, 'name' => 'Category 1', 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'), array('parent_id' => 1, 'name' => 'Category 1.1', 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'), array('parent_id' => 2, 'name' => 'Category 1.1.1', 'created' => '2007-03-18 15:30:23', 'updated' => '2007-03-18 15:32:31'), diff --git a/cake/tests/fixtures/cd_fixture.php b/cake/tests/fixtures/cd_fixture.php index 80d3384eb..8bce17ef5 100644 --- a/cake/tests/fixtures/cd_fixture.php +++ b/cake/tests/fixtures/cd_fixture.php @@ -32,7 +32,7 @@ class CdFixture extends CakeTestFixture { * @var string 'Cd' * @access public */ - var $name = 'Cd'; + public $name = 'Cd'; /** * fields property @@ -40,7 +40,7 @@ class CdFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'title' => array('type' => 'string', 'length' => 255), 'artist' => array('type' => 'string', 'length' => 255, 'null' => true), @@ -53,7 +53,7 @@ class CdFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => 1, 'title' => 'Grace', 'artist' => 'Jeff Buckley', 'genre' => 'awesome') ); } diff --git a/cake/tests/fixtures/comment_fixture.php b/cake/tests/fixtures/comment_fixture.php index 2a4d84175..4b0aeb814 100644 --- a/cake/tests/fixtures/comment_fixture.php +++ b/cake/tests/fixtures/comment_fixture.php @@ -32,7 +32,7 @@ class CommentFixture extends CakeTestFixture { * @var string 'Comment' * @access public */ - var $name = 'Comment'; + public $name = 'Comment'; /** * fields property @@ -40,7 +40,7 @@ class CommentFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'article_id' => array('type' => 'integer', 'null'=>false), 'user_id' => array('type' => 'integer', 'null'=>false), @@ -56,7 +56,7 @@ class CommentFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('article_id' => 1, 'user_id' => 2, 'comment' => 'First Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:45:23', 'updated' => '2007-03-18 10:47:31'), array('article_id' => 1, 'user_id' => 4, 'comment' => 'Second Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:47:23', 'updated' => '2007-03-18 10:49:31'), array('article_id' => 1, 'user_id' => 1, 'comment' => 'Third Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:49:23', 'updated' => '2007-03-18 10:51:31'), diff --git a/cake/tests/fixtures/content_account_fixture.php b/cake/tests/fixtures/content_account_fixture.php index 7699f86c9..ec5c99ac3 100644 --- a/cake/tests/fixtures/content_account_fixture.php +++ b/cake/tests/fixtures/content_account_fixture.php @@ -32,8 +32,8 @@ class ContentAccountFixture extends CakeTestFixture { * @var string 'Aco' * @access public */ - var $name = 'ContentAccount'; - var $table = 'ContentAccounts'; + public $name = 'ContentAccount'; + public $table = 'ContentAccounts'; /** * fields property @@ -41,7 +41,7 @@ class ContentAccountFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'iContentAccountsId' => array('type' => 'integer', 'key' => 'primary'), 'iContentId' => array('type' => 'integer'), 'iAccountId' => array('type' => 'integer') @@ -53,7 +53,7 @@ class ContentAccountFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('iContentId' => 1, 'iAccountId' => 1), array('iContentId' => 2, 'iAccountId' => 2), array('iContentId' => 3, 'iAccountId' => 3), diff --git a/cake/tests/fixtures/content_fixture.php b/cake/tests/fixtures/content_fixture.php index ea75c59fa..e5e841d22 100644 --- a/cake/tests/fixtures/content_fixture.php +++ b/cake/tests/fixtures/content_fixture.php @@ -32,8 +32,8 @@ class ContentFixture extends CakeTestFixture { * @var string 'Aco' * @access public */ - var $name = 'Content'; - var $table = 'Content'; + public $name = 'Content'; + public $table = 'Content'; /** * fields property @@ -41,7 +41,7 @@ class ContentFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'iContentId' => array('type' => 'integer', 'key' => 'primary'), 'cDescription' => array('type' => 'string', 'length' => 50, 'null' => true) ); @@ -52,7 +52,7 @@ class ContentFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('cDescription' => 'Test Content 1'), array('cDescription' => 'Test Content 2'), array('cDescription' => 'Test Content 3'), diff --git a/cake/tests/fixtures/counter_cache_post_fixture.php b/cake/tests/fixtures/counter_cache_post_fixture.php index f765a96fd..b2b29d5ff 100644 --- a/cake/tests/fixtures/counter_cache_post_fixture.php +++ b/cake/tests/fixtures/counter_cache_post_fixture.php @@ -26,15 +26,15 @@ */ class CounterCachePostFixture extends CakeTestFixture { - var $name = 'CounterCachePost'; + public $name = 'CounterCachePost'; - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'title' => array('type' => 'string', 'length' => 255, 'null' => false), 'user_id' => array('type' => 'integer', 'null' => true), ); - var $records = array( + public $records = array( array('id' => 1, 'title' => 'Rock and Roll', 'user_id' => 66), array('id' => 2, 'title' => 'Music', 'user_id' => 66), array('id' => 3, 'title' => 'Food', 'user_id' => 301), diff --git a/cake/tests/fixtures/counter_cache_post_nonstandard_primary_key_fixture.php b/cake/tests/fixtures/counter_cache_post_nonstandard_primary_key_fixture.php index a72ba6c25..59e2ee029 100644 --- a/cake/tests/fixtures/counter_cache_post_nonstandard_primary_key_fixture.php +++ b/cake/tests/fixtures/counter_cache_post_nonstandard_primary_key_fixture.php @@ -26,15 +26,15 @@ */ class CounterCachePostNonstandardPrimaryKeyFixture extends CakeTestFixture { - var $name = 'CounterCachePostNonstandardPrimaryKey'; + public $name = 'CounterCachePostNonstandardPrimaryKey'; - var $fields = array( + public $fields = array( 'pid' => array('type' => 'integer', 'key' => 'primary'), 'title' => array('type' => 'string', 'length' => 255, 'null' => false), 'uid' => array('type' => 'integer', 'null' => true), ); - var $records = array( + public $records = array( array('pid' => 1, 'title' => 'Rock and Roll', 'uid' => 66), array('pid' => 2, 'title' => 'Music', 'uid' => 66), array('pid' => 3, 'title' => 'Food', 'uid' => 301), diff --git a/cake/tests/fixtures/counter_cache_user_fixture.php b/cake/tests/fixtures/counter_cache_user_fixture.php index 4eb1e1427..35f110d8e 100644 --- a/cake/tests/fixtures/counter_cache_user_fixture.php +++ b/cake/tests/fixtures/counter_cache_user_fixture.php @@ -26,15 +26,15 @@ */ class CounterCacheUserFixture extends CakeTestFixture { - var $name = 'CounterCacheUser'; + public $name = 'CounterCacheUser'; - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'length' => 255, 'null' => false), 'post_count' => array('type' => 'integer', 'null' => true) ); - var $records = array( + public $records = array( array('id' => 66, 'name' => 'Alexander','post_count' => 2), array('id' => 301, 'name' => 'Steven','post_count' => 1), ); diff --git a/cake/tests/fixtures/counter_cache_user_nonstandard_primary_key_fixture.php b/cake/tests/fixtures/counter_cache_user_nonstandard_primary_key_fixture.php index 790c3a0cc..cdf25c4e8 100644 --- a/cake/tests/fixtures/counter_cache_user_nonstandard_primary_key_fixture.php +++ b/cake/tests/fixtures/counter_cache_user_nonstandard_primary_key_fixture.php @@ -26,15 +26,15 @@ */ class CounterCacheUserNonstandardPrimaryKeyFixture extends CakeTestFixture { - var $name = 'CounterCacheUserNonstandardPrimaryKey'; + public $name = 'CounterCacheUserNonstandardPrimaryKey'; - var $fields = array( + public $fields = array( 'uid' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'length' => 255, 'null' => false), 'post_count' => array('type' => 'integer', 'null' => true) ); - var $records = array( + public $records = array( array('uid' => 66, 'name' => 'Alexander','post_count' => 2), array('uid' => 301, 'name' => 'Steven','post_count' => 1), ); diff --git a/cake/tests/fixtures/data_test_fixture.php b/cake/tests/fixtures/data_test_fixture.php index f775b4366..8c9ded874 100644 --- a/cake/tests/fixtures/data_test_fixture.php +++ b/cake/tests/fixtures/data_test_fixture.php @@ -32,7 +32,7 @@ class DataTestFixture extends CakeTestFixture { * @var string 'DataTest' * @access public */ - var $name = 'DataTest'; + public $name = 'DataTest'; /** * fields property @@ -40,7 +40,7 @@ class DataTestFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'count' => array('type' => 'integer', 'default' => 0), 'float' => array('type' => 'float', 'default' => 0), @@ -55,7 +55,7 @@ class DataTestFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array(); + public $records = array(); } ?> \ No newline at end of file diff --git a/cake/tests/fixtures/datatype_fixture.php b/cake/tests/fixtures/datatype_fixture.php index 350f283fe..bf45f1efc 100644 --- a/cake/tests/fixtures/datatype_fixture.php +++ b/cake/tests/fixtures/datatype_fixture.php @@ -32,7 +32,7 @@ class DatatypeFixture extends CakeTestFixture { * @var string 'Datatype' * @access public */ - var $name = 'Datatype'; + public $name = 'Datatype'; /** * fields property @@ -40,7 +40,7 @@ class DatatypeFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'null'=> false, 'default'=> 0, 'key' => 'primary'), 'float_field' => array('type' => 'float', 'length' => '5,2', 'null' => false, 'default' => null), ); @@ -51,7 +51,7 @@ class DatatypeFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => 1, 'float_field' => 42.23), ); } diff --git a/cake/tests/fixtures/dependency_fixture.php b/cake/tests/fixtures/dependency_fixture.php index 4464e32a7..48c642d66 100644 --- a/cake/tests/fixtures/dependency_fixture.php +++ b/cake/tests/fixtures/dependency_fixture.php @@ -33,7 +33,7 @@ class DependencyFixture extends CakeTestFixture { * @var string 'Dependency' * @access public */ - var $name = 'Dependency'; + public $name = 'Dependency'; /** * fields property @@ -41,7 +41,7 @@ class DependencyFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'child_id' => 'integer', 'parent_id' => 'integer' ); @@ -52,7 +52,7 @@ class DependencyFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('child_id' => 1, 'parent_id' => 2), ); } diff --git a/cake/tests/fixtures/device_fixture.php b/cake/tests/fixtures/device_fixture.php index 2260d7bfc..4e499f0ed 100644 --- a/cake/tests/fixtures/device_fixture.php +++ b/cake/tests/fixtures/device_fixture.php @@ -32,7 +32,7 @@ class DeviceFixture extends CakeTestFixture { * @var string 'Device' * @access public */ - var $name = 'Device'; + public $name = 'Device'; /** * fields property @@ -40,7 +40,7 @@ class DeviceFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'device_type_id' => array('type' => 'integer', 'null' => false), 'name' => array('type' => 'string', 'null' => false), @@ -53,7 +53,7 @@ class DeviceFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('device_type_id' => 1, 'name' => 'Device 1', 'typ' => 1), array('device_type_id' => 1, 'name' => 'Device 2', 'typ' => 1), array('device_type_id' => 1, 'name' => 'Device 3', 'typ' => 2) diff --git a/cake/tests/fixtures/device_type_category_fixture.php b/cake/tests/fixtures/device_type_category_fixture.php index cb43b16d5..768449087 100644 --- a/cake/tests/fixtures/device_type_category_fixture.php +++ b/cake/tests/fixtures/device_type_category_fixture.php @@ -32,7 +32,7 @@ class DeviceTypeCategoryFixture extends CakeTestFixture { * @var string 'DeviceTypeCategory' * @access public */ - var $name = 'DeviceTypeCategory'; + public $name = 'DeviceTypeCategory'; /** * fields property @@ -40,7 +40,7 @@ class DeviceTypeCategoryFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'null' => false) ); @@ -51,7 +51,7 @@ class DeviceTypeCategoryFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('name' => 'DeviceTypeCategory 1') ); } diff --git a/cake/tests/fixtures/device_type_fixture.php b/cake/tests/fixtures/device_type_fixture.php index ecd910c91..ad3a76388 100644 --- a/cake/tests/fixtures/device_type_fixture.php +++ b/cake/tests/fixtures/device_type_fixture.php @@ -32,7 +32,7 @@ class DeviceTypeFixture extends CakeTestFixture { * @var string 'DeviceType' * @access public */ - var $name = 'DeviceType'; + public $name = 'DeviceType'; /** * fields property @@ -40,7 +40,7 @@ class DeviceTypeFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'device_type_category_id' => array('type' => 'integer', 'null' => false), 'feature_set_id' => array('type' => 'integer', 'null' => false), @@ -58,7 +58,7 @@ class DeviceTypeFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('device_type_category_id' => 1, 'feature_set_id' => 1, 'exterior_type_category_id' => 1, 'image_id' => 1, 'extra1_id' => 1, 'extra2_id' => 1, 'name' => 'DeviceType 1', 'order' => 0) ); } diff --git a/cake/tests/fixtures/document_directory_fixture.php b/cake/tests/fixtures/document_directory_fixture.php index 71eaf5962..8296ba1e4 100644 --- a/cake/tests/fixtures/document_directory_fixture.php +++ b/cake/tests/fixtures/document_directory_fixture.php @@ -32,7 +32,7 @@ class DocumentDirectoryFixture extends CakeTestFixture { * @var string 'DocumentDirectory' * @access public */ - var $name = 'DocumentDirectory'; + public $name = 'DocumentDirectory'; /** * fields property @@ -40,7 +40,7 @@ class DocumentDirectoryFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'null' => false) ); @@ -51,7 +51,7 @@ class DocumentDirectoryFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('name' => 'DocumentDirectory 1') ); } diff --git a/cake/tests/fixtures/document_fixture.php b/cake/tests/fixtures/document_fixture.php index d4706ae14..a6dce7a5a 100644 --- a/cake/tests/fixtures/document_fixture.php +++ b/cake/tests/fixtures/document_fixture.php @@ -32,7 +32,7 @@ class DocumentFixture extends CakeTestFixture { * @var string 'Document' * @access public */ - var $name = 'Document'; + public $name = 'Document'; /** * fields property @@ -40,7 +40,7 @@ class DocumentFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'document_directory_id' => array('type' => 'integer', 'null' => false), 'name' => array('type' => 'string', 'null' => false) @@ -52,7 +52,7 @@ class DocumentFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('document_directory_id' => 1, 'name' => 'Document 1') ); } diff --git a/cake/tests/fixtures/exterior_type_category_fixture.php b/cake/tests/fixtures/exterior_type_category_fixture.php index 9271393eb..4b712bbfc 100644 --- a/cake/tests/fixtures/exterior_type_category_fixture.php +++ b/cake/tests/fixtures/exterior_type_category_fixture.php @@ -32,7 +32,7 @@ class ExteriorTypeCategoryFixture extends CakeTestFixture { * @var string 'ExteriorTypeCategory' * @access public */ - var $name = 'ExteriorTypeCategory'; + public $name = 'ExteriorTypeCategory'; /** * fields property @@ -40,7 +40,7 @@ class ExteriorTypeCategoryFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'image_id' => array('type' => 'integer', 'null' => false), 'name' => array('type' => 'string', 'null' => false) @@ -52,7 +52,7 @@ class ExteriorTypeCategoryFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('image_id' => 1, 'name' => 'ExteriorTypeCategory 1') ); } diff --git a/cake/tests/fixtures/feature_set_fixture.php b/cake/tests/fixtures/feature_set_fixture.php index 564155cdd..083fc0354 100644 --- a/cake/tests/fixtures/feature_set_fixture.php +++ b/cake/tests/fixtures/feature_set_fixture.php @@ -32,7 +32,7 @@ class FeatureSetFixture extends CakeTestFixture { * @var string 'FeatureSet' * @access public */ - var $name = 'FeatureSet'; + public $name = 'FeatureSet'; /** * fields property @@ -40,7 +40,7 @@ class FeatureSetFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'null' => false) ); @@ -51,7 +51,7 @@ class FeatureSetFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('name' => 'FeatureSet 1') ); } diff --git a/cake/tests/fixtures/featured_fixture.php b/cake/tests/fixtures/featured_fixture.php index 3b3c81834..89a21e20f 100644 --- a/cake/tests/fixtures/featured_fixture.php +++ b/cake/tests/fixtures/featured_fixture.php @@ -32,7 +32,7 @@ class FeaturedFixture extends CakeTestFixture { * @var string 'Featured' * @access public */ - var $name = 'Featured'; + public $name = 'Featured'; /** * fields property @@ -40,7 +40,7 @@ class FeaturedFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'article_featured_id' => array('type' => 'integer', 'null' => false), 'category_id' => array('type' => 'integer', 'null' => false), @@ -56,7 +56,7 @@ class FeaturedFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('article_featured_id' => 1, 'category_id' => 1, 'published_date' => '2007-03-31 10:39:23', 'end_date' => '2007-05-15 10:39:23', 'created' => '2007-03-18 10:39:23', 'updated' => '2007-03-18 10:41:31'), array('article_featured_id' => 2, 'category_id' => 1, 'published_date' => '2007-03-31 10:39:23', 'end_date' => '2007-05-15 10:39:23', 'created' => '2007-03-18 10:39:23', 'updated' => '2007-03-18 10:41:31'), ); diff --git a/cake/tests/fixtures/film_file_fixture.php b/cake/tests/fixtures/film_file_fixture.php index 1b3795fed..80d1eb8d1 100644 --- a/cake/tests/fixtures/film_file_fixture.php +++ b/cake/tests/fixtures/film_file_fixture.php @@ -32,7 +32,7 @@ class FilmFileFixture extends CakeTestFixture { * @var string 'FilmFile' * @access public */ - var $name = 'FilmFile'; + public $name = 'FilmFile'; /** * fields property @@ -40,7 +40,7 @@ class FilmFileFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'length' => 255) ); @@ -51,7 +51,7 @@ class FilmFileFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => 1, 'name' => 'one'), array('id' => 2, 'name' => 'two') ); diff --git a/cake/tests/fixtures/flag_tree_fixture.php b/cake/tests/fixtures/flag_tree_fixture.php index d5c415800..5751c0e98 100644 --- a/cake/tests/fixtures/flag_tree_fixture.php +++ b/cake/tests/fixtures/flag_tree_fixture.php @@ -36,7 +36,7 @@ class FlagTreeFixture extends CakeTestFixture { * @var string 'FlagTree' * @access public */ - var $name = 'FlagTree'; + public $name = 'FlagTree'; /** * fields property @@ -44,7 +44,7 @@ class FlagTreeFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer','key' => 'primary'), 'name' => array('type' => 'string','null' => false), 'parent_id' => 'integer', diff --git a/cake/tests/fixtures/fruit_fixture.php b/cake/tests/fixtures/fruit_fixture.php index c593c722e..275c30795 100644 --- a/cake/tests/fixtures/fruit_fixture.php +++ b/cake/tests/fixtures/fruit_fixture.php @@ -32,7 +32,7 @@ class FruitFixture extends CakeTestFixture { * @var string 'Fruit' * @access public */ - var $name = 'Fruit'; + public $name = 'Fruit'; /** * fields property @@ -40,7 +40,7 @@ class FruitFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'string', 'length' => 36, 'key' => 'primary'), 'name' => array('type' => 'string', 'length' => 255), 'color' => array('type' => 'string', 'length' => 13), @@ -54,7 +54,7 @@ class FruitFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array( 'id' => '481fc6d0-b920-43e0-a40d-6d1740cf8569', 'name' => 'Orange', 'color' => 'orange', 'shape' => 'Spherical', 'taste' => 'Tangy & Sweet' diff --git a/cake/tests/fixtures/fruits_uuid_tag_fixture.php b/cake/tests/fixtures/fruits_uuid_tag_fixture.php index 0008898bd..72c6a6e10 100644 --- a/cake/tests/fixtures/fruits_uuid_tag_fixture.php +++ b/cake/tests/fixtures/fruits_uuid_tag_fixture.php @@ -32,7 +32,7 @@ class FruitsUuidTagFixture extends CakeTestFixture { * @var string 'FruitsUuidTag' * @access public */ - var $name = 'FruitsUuidTag'; + public $name = 'FruitsUuidTag'; /** * fields property @@ -40,7 +40,7 @@ class FruitsUuidTagFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'fruit_id' => array('type' => 'string', 'null' => false, 'length' => 36, 'key' => 'primary'), 'uuid_tag_id' => array('type' => 'string', 'null' => false, 'length' => 36, 'key' => 'primary'), 'indexes' => array( @@ -54,7 +54,7 @@ class FruitsUuidTagFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('fruit_id' => '481fc6d0-b920-43e0-a40d-6d1740cf8569', 'uuid_tag_id' => '481fc6d0-b920-43e0-e50f-6d1740cf8569') ); } diff --git a/cake/tests/fixtures/group_update_all_fixture.php b/cake/tests/fixtures/group_update_all_fixture.php index b3a7be1aa..b900360a8 100644 --- a/cake/tests/fixtures/group_update_all_fixture.php +++ b/cake/tests/fixtures/group_update_all_fixture.php @@ -25,16 +25,16 @@ * @subpackage cake.tests.fixtures */ class GroupUpdateAllFixture extends CakeTestFixture { - var $name = 'GroupUpdateAll'; - var $table = 'group_update_all'; + public $name = 'GroupUpdateAll'; + public $table = 'group_update_all'; - var $fields = array( + public $fields = array( 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'), 'name' => array('type'=>'string', 'null' => false, 'length' => 29), 'code' => array('type'=>'integer', 'null' => false, 'length' => 4), 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) ); - var $records = array( + public $records = array( array( 'id' => 1, 'name' => 'group one', diff --git a/cake/tests/fixtures/home_fixture.php b/cake/tests/fixtures/home_fixture.php index cc6d8d637..54026b553 100644 --- a/cake/tests/fixtures/home_fixture.php +++ b/cake/tests/fixtures/home_fixture.php @@ -32,7 +32,7 @@ class HomeFixture extends CakeTestFixture { * @var string 'Home' * @access public */ - var $name = 'Home'; + public $name = 'Home'; /** * fields property @@ -40,7 +40,7 @@ class HomeFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'another_article_id' => array('type' => 'integer', 'null' => false), 'advertisement_id' => array('type' => 'integer', 'null' => false), @@ -55,7 +55,7 @@ class HomeFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('another_article_id' => 1, 'advertisement_id' => 1, 'title' => 'First Home', 'created' => '2007-03-18 10:39:23', 'updated' => '2007-03-18 10:41:31'), array('another_article_id' => 3, 'advertisement_id' => 1, 'title' => 'Second Home', 'created' => '2007-03-18 10:41:23', 'updated' => '2007-03-18 10:43:31') ); diff --git a/cake/tests/fixtures/image_fixture.php b/cake/tests/fixtures/image_fixture.php index 3e7859674..dddcd2e12 100644 --- a/cake/tests/fixtures/image_fixture.php +++ b/cake/tests/fixtures/image_fixture.php @@ -32,7 +32,7 @@ class ImageFixture extends CakeTestFixture { * @var string 'Image' * @access public */ - var $name = 'Image'; + public $name = 'Image'; /** * fields property @@ -40,7 +40,7 @@ class ImageFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'null' => false) ); @@ -51,7 +51,7 @@ class ImageFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('name' => 'Image 1'), array('name' => 'Image 2'), array('name' => 'Image 3'), diff --git a/cake/tests/fixtures/item_fixture.php b/cake/tests/fixtures/item_fixture.php index e1988a5df..21f7cf1b1 100644 --- a/cake/tests/fixtures/item_fixture.php +++ b/cake/tests/fixtures/item_fixture.php @@ -32,7 +32,7 @@ class ItemFixture extends CakeTestFixture { * @var string 'Item' * @access public */ - var $name = 'Item'; + public $name = 'Item'; /** * fields property @@ -40,7 +40,7 @@ class ItemFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'syfile_id' => array('type' => 'integer', 'null' => false), 'published' => array('type' => 'boolean', 'null' => false), @@ -53,7 +53,7 @@ class ItemFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('syfile_id' => 1, 'published' => 0, 'name' => 'Item 1'), array('syfile_id' => 2, 'published' => 0, 'name' => 'Item 2'), array('syfile_id' => 3, 'published' => 0, 'name' => 'Item 3'), diff --git a/cake/tests/fixtures/items_portfolio_fixture.php b/cake/tests/fixtures/items_portfolio_fixture.php index 2f7804952..c14b3467f 100644 --- a/cake/tests/fixtures/items_portfolio_fixture.php +++ b/cake/tests/fixtures/items_portfolio_fixture.php @@ -32,7 +32,7 @@ class ItemsPortfolioFixture extends CakeTestFixture { * @var string 'ItemsPortfolio' * @access public */ - var $name = 'ItemsPortfolio'; + public $name = 'ItemsPortfolio'; /** * fields property @@ -40,7 +40,7 @@ class ItemsPortfolioFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'item_id' => array('type' => 'integer', 'null' => false), 'portfolio_id' => array('type' => 'integer', 'null' => false) @@ -52,7 +52,7 @@ class ItemsPortfolioFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('item_id' => 1, 'portfolio_id' => 1), array('item_id' => 2, 'portfolio_id' => 2), array('item_id' => 3, 'portfolio_id' => 1), diff --git a/cake/tests/fixtures/join_a_b_fixture.php b/cake/tests/fixtures/join_a_b_fixture.php index b4047b49d..2c62bc02a 100644 --- a/cake/tests/fixtures/join_a_b_fixture.php +++ b/cake/tests/fixtures/join_a_b_fixture.php @@ -32,7 +32,7 @@ class JoinABFixture extends CakeTestFixture { * @var string 'JoinAsJoinB' * @access public */ - var $name = 'JoinAsJoinB'; + public $name = 'JoinAsJoinB'; /** * fields property @@ -40,7 +40,7 @@ class JoinABFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'join_a_id' => array('type' => 'integer', 'length' => 10, 'null' => true), 'join_b_id' => array('type' => 'integer', 'default' => null), @@ -55,7 +55,7 @@ class JoinABFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('join_a_id' => 1, 'join_b_id' => 2, 'other' => 'Data for Join A 1 Join B 2', 'created' => '2008-01-03 10:56:33', 'updated' => '2008-01-03 10:56:33'), array('join_a_id' => 2, 'join_b_id' => 3, 'other' => 'Data for Join A 2 Join B 3', 'created' => '2008-01-03 10:56:34', 'updated' => '2008-01-03 10:56:34'), array('join_a_id' => 3, 'join_b_id' => 1, 'other' => 'Data for Join A 3 Join B 1', 'created' => '2008-01-03 10:56:35', 'updated' => '2008-01-03 10:56:35') diff --git a/cake/tests/fixtures/join_a_c_fixture.php b/cake/tests/fixtures/join_a_c_fixture.php index 7bc80cff5..a50d18766 100644 --- a/cake/tests/fixtures/join_a_c_fixture.php +++ b/cake/tests/fixtures/join_a_c_fixture.php @@ -32,7 +32,7 @@ class JoinACFixture extends CakeTestFixture { * @var string 'JoinAsJoinC' * @access public */ - var $name = 'JoinAsJoinC'; + public $name = 'JoinAsJoinC'; /** * fields property @@ -40,7 +40,7 @@ class JoinACFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'join_a_id' => array('type' => 'integer', 'length' => 10, 'null' => true), 'join_c_id' => array('type' => 'integer', 'default' => null), @@ -55,7 +55,7 @@ class JoinACFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('join_a_id' => 1, 'join_c_id' => 2, 'other' => 'Data for Join A 1 Join C 2', 'created' => '2008-01-03 10:57:22', 'updated' => '2008-01-03 10:57:22'), array('join_a_id' => 2, 'join_c_id' => 3, 'other' => 'Data for Join A 2 Join C 3', 'created' => '2008-01-03 10:57:23', 'updated' => '2008-01-03 10:57:23'), array('join_a_id' => 3, 'join_c_id' => 1, 'other' => 'Data for Join A 3 Join C 1', 'created' => '2008-01-03 10:57:24', 'updated' => '2008-01-03 10:57:24') diff --git a/cake/tests/fixtures/join_a_fixture.php b/cake/tests/fixtures/join_a_fixture.php index f400ba852..fe2784251 100644 --- a/cake/tests/fixtures/join_a_fixture.php +++ b/cake/tests/fixtures/join_a_fixture.php @@ -32,7 +32,7 @@ class JoinAFixture extends CakeTestFixture { * @var string 'JoinA' * @access public */ - var $name = 'JoinA'; + public $name = 'JoinA'; /** * fields property @@ -40,7 +40,7 @@ class JoinAFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'default' => ''), 'body' => array('type' => 'text'), @@ -54,7 +54,7 @@ class JoinAFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('name' => 'Join A 1', 'body' => 'Join A 1 Body', 'created' => '2008-01-03 10:54:23', 'updated' => '2008-01-03 10:54:23'), array('name' => 'Join A 2', 'body' => 'Join A 2 Body', 'created' => '2008-01-03 10:54:24', 'updated' => '2008-01-03 10:54:24'), array('name' => 'Join A 3', 'body' => 'Join A 2 Body', 'created' => '2008-01-03 10:54:25', 'updated' => '2008-01-03 10:54:24') diff --git a/cake/tests/fixtures/join_b_fixture.php b/cake/tests/fixtures/join_b_fixture.php index 8afa7132d..4e61a387b 100644 --- a/cake/tests/fixtures/join_b_fixture.php +++ b/cake/tests/fixtures/join_b_fixture.php @@ -32,7 +32,7 @@ class JoinBFixture extends CakeTestFixture { * @var string 'JoinB' * @access public */ - var $name = 'JoinB'; + public $name = 'JoinB'; /** * fields property @@ -40,7 +40,7 @@ class JoinBFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'default' => ''), 'created' => array('type' => 'datetime', 'null' => true), @@ -53,7 +53,7 @@ class JoinBFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('name' => 'Join B 1', 'created' => '2008-01-03 10:55:01', 'updated' => '2008-01-03 10:55:01'), array('name' => 'Join B 2', 'created' => '2008-01-03 10:55:02', 'updated' => '2008-01-03 10:55:02'), array('name' => 'Join B 3', 'created' => '2008-01-03 10:55:03', 'updated' => '2008-01-03 10:55:03') diff --git a/cake/tests/fixtures/join_c_fixture.php b/cake/tests/fixtures/join_c_fixture.php index 316520188..d0cb61a8f 100644 --- a/cake/tests/fixtures/join_c_fixture.php +++ b/cake/tests/fixtures/join_c_fixture.php @@ -32,7 +32,7 @@ class JoinCFixture extends CakeTestFixture { * @var string 'JoinC' * @access public */ - var $name = 'JoinC'; + public $name = 'JoinC'; /** * fields property @@ -40,7 +40,7 @@ class JoinCFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'default' => ''), 'created' => array('type' => 'datetime', 'null' => true), @@ -53,7 +53,7 @@ class JoinCFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('name' => 'Join C 1', 'created' => '2008-01-03 10:56:11', 'updated' => '2008-01-03 10:56:11'), array('name' => 'Join C 2', 'created' => '2008-01-03 10:56:12', 'updated' => '2008-01-03 10:56:12'), array('name' => 'Join C 3', 'created' => '2008-01-03 10:56:13', 'updated' => '2008-01-03 10:56:13') diff --git a/cake/tests/fixtures/join_thing_fixture.php b/cake/tests/fixtures/join_thing_fixture.php index 572465aab..20eb76419 100644 --- a/cake/tests/fixtures/join_thing_fixture.php +++ b/cake/tests/fixtures/join_thing_fixture.php @@ -32,7 +32,7 @@ class JoinThingFixture extends CakeTestFixture { * @var string 'JoinThing' * @access public */ - var $name = 'JoinThing'; + public $name = 'JoinThing'; /** * fields property @@ -40,7 +40,7 @@ class JoinThingFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'something_id' => array('type' => 'integer', 'length' => 10, 'null' => true), 'something_else_id' => array('type' => 'integer', 'default' => null), @@ -55,7 +55,7 @@ class JoinThingFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('something_id' => 1, 'something_else_id' => 2, 'doomed' => '1', 'created' => '2007-03-18 10:39:23', 'updated' => '2007-03-18 10:41:31'), array('something_id' => 2, 'something_else_id' => 3, 'doomed' => '0', 'created' => '2007-03-18 10:41:23', 'updated' => '2007-03-18 10:43:31'), array('something_id' => 3, 'something_else_id' => 1, 'doomed' => '1', 'created' => '2007-03-18 10:43:23', 'updated' => '2007-03-18 10:45:31') diff --git a/cake/tests/fixtures/message_fixture.php b/cake/tests/fixtures/message_fixture.php index 0a07e1082..b56480e1b 100644 --- a/cake/tests/fixtures/message_fixture.php +++ b/cake/tests/fixtures/message_fixture.php @@ -32,7 +32,7 @@ class MessageFixture extends CakeTestFixture { * @var string 'Message' * @access public */ - var $name = 'Message'; + public $name = 'Message'; /** * fields property @@ -40,7 +40,7 @@ class MessageFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'thread_id' => array('type' => 'integer', 'null' => false), 'name' => array('type' => 'string', 'null' => false) @@ -52,7 +52,7 @@ class MessageFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('thread_id' => 1, 'name' => 'Thread 1, Message 1'), array('thread_id' => 2, 'name' => 'Thread 2, Message 1'), array('thread_id' => 3, 'name' => 'Thread 3, Message 1') diff --git a/cake/tests/fixtures/my_categories_my_products_fixture.php b/cake/tests/fixtures/my_categories_my_products_fixture.php index 06e052cd5..aae3c9058 100644 --- a/cake/tests/fixtures/my_categories_my_products_fixture.php +++ b/cake/tests/fixtures/my_categories_my_products_fixture.php @@ -32,7 +32,7 @@ class MyCategoriesMyProductsFixture extends CakeTestFixture { * @var string 'MyCategoriesMyProducts' * @access public */ - var $name = 'MyCategoriesMyProducts'; + public $name = 'MyCategoriesMyProducts'; /** * fields property @@ -40,7 +40,7 @@ class MyCategoriesMyProductsFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'my_category_id' => array('type' => 'integer'), 'my_product_id' => array('type' => 'integer'), ); @@ -51,7 +51,7 @@ class MyCategoriesMyProductsFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('my_category_id' => 1, 'my_product_id' => 1), array('my_category_id' => 2, 'my_product_id' => 1), array('my_category_id' => 2, 'my_product_id' => 2), diff --git a/cake/tests/fixtures/my_categories_my_users_fixture.php b/cake/tests/fixtures/my_categories_my_users_fixture.php index fb7eafb4c..e43e3a76e 100644 --- a/cake/tests/fixtures/my_categories_my_users_fixture.php +++ b/cake/tests/fixtures/my_categories_my_users_fixture.php @@ -32,7 +32,7 @@ class MyCategoriesMyUsersFixture extends CakeTestFixture { * @var string 'MyCategoriesMyUsers' * @access public */ - var $name = 'MyCategoriesMyUsers'; + public $name = 'MyCategoriesMyUsers'; /** * fields property @@ -40,7 +40,7 @@ class MyCategoriesMyUsersFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'my_category_id' => array('type' => 'integer'), 'my_user_id' => array('type' => 'integer'), ); @@ -51,7 +51,7 @@ class MyCategoriesMyUsersFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('my_category_id' => 1, 'my_user_id' => 1), array('my_category_id' => 3, 'my_user_id' => 1), array('my_category_id' => 1, 'my_user_id' => 2), diff --git a/cake/tests/fixtures/my_category_fixture.php b/cake/tests/fixtures/my_category_fixture.php index 54a686f59..199bb31bc 100644 --- a/cake/tests/fixtures/my_category_fixture.php +++ b/cake/tests/fixtures/my_category_fixture.php @@ -32,7 +32,7 @@ class MyCategoryFixture extends CakeTestFixture { * @var string 'MyCategory' * @access public */ - var $name = 'MyCategory'; + public $name = 'MyCategory'; /** * fields property @@ -40,7 +40,7 @@ class MyCategoryFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'null' => false), ); @@ -51,7 +51,7 @@ class MyCategoryFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => 1, 'name' => 'A'), array('id' => 2, 'name' => 'B'), array('id' => 3, 'name' => 'C'), diff --git a/cake/tests/fixtures/my_product_fixture.php b/cake/tests/fixtures/my_product_fixture.php index 7f5d0030a..05450e60f 100644 --- a/cake/tests/fixtures/my_product_fixture.php +++ b/cake/tests/fixtures/my_product_fixture.php @@ -32,7 +32,7 @@ class MyProductFixture extends CakeTestFixture { * @var string 'MyProduct' * @access public */ - var $name = 'MyProduct'; + public $name = 'MyProduct'; /** * fields property @@ -40,7 +40,7 @@ class MyProductFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'null' => false), ); @@ -51,7 +51,7 @@ class MyProductFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => 1, 'name' => 'book'), array('id' => 2, 'name' => 'computer'), ); diff --git a/cake/tests/fixtures/my_user_fixture.php b/cake/tests/fixtures/my_user_fixture.php index 5b475ae4e..9856379ef 100644 --- a/cake/tests/fixtures/my_user_fixture.php +++ b/cake/tests/fixtures/my_user_fixture.php @@ -32,7 +32,7 @@ class MyUserFixture extends CakeTestFixture { * @var string 'MyUser' * @access public */ - var $name = 'MyUser'; + public $name = 'MyUser'; /** * fields property @@ -40,7 +40,7 @@ class MyUserFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'firstname' => array('type' => 'string', 'null' => false), ); @@ -51,7 +51,7 @@ class MyUserFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => 1, 'firstname' => 'userA'), array('id' => 2, 'firstname' => 'userB') ); diff --git a/cake/tests/fixtures/node_fixture.php b/cake/tests/fixtures/node_fixture.php index 1dc66ef43..d28854fca 100644 --- a/cake/tests/fixtures/node_fixture.php +++ b/cake/tests/fixtures/node_fixture.php @@ -33,7 +33,7 @@ class NodeFixture extends CakeTestFixture { * @var string 'Node' * @access public */ - var $name = 'Node'; + public $name = 'Node'; /** * fields property @@ -41,7 +41,7 @@ class NodeFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => 'string', 'state' => 'integer' @@ -53,7 +53,7 @@ class NodeFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => 1, 'name' => 'First', 'state' => 50), array('id' => 2, 'name' => 'Second', 'state' => 60), ); diff --git a/cake/tests/fixtures/number_tree_fixture.php b/cake/tests/fixtures/number_tree_fixture.php index 53a9806ae..0a43f24ca 100644 --- a/cake/tests/fixtures/number_tree_fixture.php +++ b/cake/tests/fixtures/number_tree_fixture.php @@ -36,7 +36,7 @@ class NumberTreeFixture extends CakeTestFixture { * @var string 'NumberTree' * @access public */ - var $name = 'NumberTree'; + public $name = 'NumberTree'; /** * fields property @@ -44,7 +44,7 @@ class NumberTreeFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer','key' => 'primary'), 'name' => array('type' => 'string','null' => false), 'parent_id' => 'integer', diff --git a/cake/tests/fixtures/number_tree_two_fixture.php b/cake/tests/fixtures/number_tree_two_fixture.php index 6a274ed8e..0593d6f0f 100644 --- a/cake/tests/fixtures/number_tree_two_fixture.php +++ b/cake/tests/fixtures/number_tree_two_fixture.php @@ -36,7 +36,7 @@ class NumberTreeTwoFixture extends CakeTestFixture { * @var string 'NumberTree' * @access public */ - var $name = 'NumberTreeTwo'; + public $name = 'NumberTreeTwo'; /** * fields property @@ -44,7 +44,7 @@ class NumberTreeTwoFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer','key' => 'primary'), 'name' => array('type' => 'string','null' => false), 'number_tree_id' => array('type' => 'integer', 'null' => false), diff --git a/cake/tests/fixtures/numeric_article_fixture.php b/cake/tests/fixtures/numeric_article_fixture.php index 67d3e1dbe..34df773fa 100644 --- a/cake/tests/fixtures/numeric_article_fixture.php +++ b/cake/tests/fixtures/numeric_article_fixture.php @@ -32,7 +32,7 @@ class NumericArticleFixture extends CakeTestFixture { * @var string 'NumericArticle' * @access public */ - var $name = 'NumericArticle'; + public $name = 'NumericArticle'; /** * fields property @@ -40,7 +40,7 @@ class NumericArticleFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'title' => array('type' => 'string', 'null' => false), 'created' => 'datetime', @@ -53,7 +53,7 @@ class NumericArticleFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('title' => 'First Article', 'created' => '2007-03-18 10:39:23', 'updated' => '2007-03-18 10:41:31'), array('title' => '12345abcde', 'created' => '2007-03-18 10:41:23', 'updated' => '2007-03-18 10:43:31'), ); diff --git a/cake/tests/fixtures/overall_favorite_fixture.php b/cake/tests/fixtures/overall_favorite_fixture.php index 289dfce49..092ab6a83 100644 --- a/cake/tests/fixtures/overall_favorite_fixture.php +++ b/cake/tests/fixtures/overall_favorite_fixture.php @@ -32,7 +32,7 @@ class OverallFavoriteFixture extends CakeTestFixture { * @var string 'OverallFavorite' * @access public */ - var $name = 'OverallFavorite'; + public $name = 'OverallFavorite'; /** * fields property @@ -40,7 +40,7 @@ class OverallFavoriteFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'model_type' => array('type' => 'string', 'length' => 255), 'model_id' => array('type' => 'integer'), @@ -53,7 +53,7 @@ class OverallFavoriteFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => 1, 'model_type' => 'Cd', 'model_id' => '1', 'priority' => '1'), array('id' => 2, 'model_type' => 'Book', 'model_id' => '1', 'priority' => '2') ); diff --git a/cake/tests/fixtures/person_fixture.php b/cake/tests/fixtures/person_fixture.php index f502a6616..fdd44697c 100644 --- a/cake/tests/fixtures/person_fixture.php +++ b/cake/tests/fixtures/person_fixture.php @@ -32,7 +32,7 @@ class PersonFixture extends CakeTestFixture { * @var string 'Person' * @access public */ - var $name = 'Person'; + public $name = 'Person'; /** * fields property @@ -40,7 +40,7 @@ class PersonFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'null' => false, 'key' => 'primary'), 'name' => array('type' => 'string', 'null' => false, 'length' => 32), 'mother_id' => array('type' => 'integer', 'null' => false, 'key' => 'index'), @@ -57,7 +57,7 @@ class PersonFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('name' => 'person', 'mother_id' => 2, 'father_id' => 3), array('name' => 'mother', 'mother_id' => 4, 'father_id' => 5), array('name' => 'father', 'mother_id' => 6, 'father_id' => 7), diff --git a/cake/tests/fixtures/portfolio_fixture.php b/cake/tests/fixtures/portfolio_fixture.php index f709f32f1..152e6b68f 100644 --- a/cake/tests/fixtures/portfolio_fixture.php +++ b/cake/tests/fixtures/portfolio_fixture.php @@ -32,7 +32,7 @@ class PortfolioFixture extends CakeTestFixture { * @var string 'Portfolio' * @access public */ - var $name = 'Portfolio'; + public $name = 'Portfolio'; /** * fields property @@ -40,7 +40,7 @@ class PortfolioFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'seller_id' => array('type' => 'integer', 'null' => false), 'name' => array('type' => 'string', 'null' => false) @@ -52,7 +52,7 @@ class PortfolioFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('seller_id' => 1, 'name' => 'Portfolio 1'), array('seller_id' => 1, 'name' => 'Portfolio 2'), array('seller_id' => 2, 'name' => 'Portfolio 1') diff --git a/cake/tests/fixtures/post_fixture.php b/cake/tests/fixtures/post_fixture.php index aad254a61..1f4a5f6d5 100644 --- a/cake/tests/fixtures/post_fixture.php +++ b/cake/tests/fixtures/post_fixture.php @@ -32,7 +32,7 @@ class PostFixture extends CakeTestFixture { * @var string 'Post' * @access public */ - var $name = 'Post'; + public $name = 'Post'; /** * fields property @@ -40,7 +40,7 @@ class PostFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'author_id' => array('type' => 'integer', 'null' => false), 'title' => array('type' => 'string', 'null' => false), @@ -56,7 +56,7 @@ class PostFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('author_id' => 1, 'title' => 'First Post', 'body' => 'First Post Body', 'published' => 'Y', 'created' => '2007-03-18 10:39:23', 'updated' => '2007-03-18 10:41:31'), array('author_id' => 3, 'title' => 'Second Post', 'body' => 'Second Post Body', 'published' => 'Y', 'created' => '2007-03-18 10:41:23', 'updated' => '2007-03-18 10:43:31'), array('author_id' => 1, 'title' => 'Third Post', 'body' => 'Third Post Body', 'published' => 'Y', 'created' => '2007-03-18 10:43:23', 'updated' => '2007-03-18 10:45:31') diff --git a/cake/tests/fixtures/posts_tag_fixture.php b/cake/tests/fixtures/posts_tag_fixture.php index a875bb0a2..940fbf428 100644 --- a/cake/tests/fixtures/posts_tag_fixture.php +++ b/cake/tests/fixtures/posts_tag_fixture.php @@ -32,7 +32,7 @@ class PostsTagFixture extends CakeTestFixture { * @var string 'PostsTag' * @access public */ - var $name = 'PostsTag'; + public $name = 'PostsTag'; /** * fields property @@ -40,7 +40,7 @@ class PostsTagFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'post_id' => array('type' => 'integer', 'null' => false), 'tag_id' => array('type' => 'string', 'null' => false), 'indexes' => array('posts_tag' => array('column' => array('tag_id', 'post_id'), 'unique' => 1)) @@ -52,7 +52,7 @@ class PostsTagFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('post_id' => 1, 'tag_id' => 'tag1'), array('post_id' => 1, 'tag_id' => 'tag2'), array('post_id' => 2, 'tag_id' => 'tag1'), diff --git a/cake/tests/fixtures/primary_model_fixture.php b/cake/tests/fixtures/primary_model_fixture.php index 2a267faa9..603dfe931 100644 --- a/cake/tests/fixtures/primary_model_fixture.php +++ b/cake/tests/fixtures/primary_model_fixture.php @@ -32,7 +32,7 @@ class PrimaryModelFixture extends CakeTestFixture { * @var string 'PrimaryModel' * @access public */ - var $name = 'PrimaryModel'; + public $name = 'PrimaryModel'; /** * fields property @@ -40,7 +40,7 @@ class PrimaryModelFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'primary_name' => array('type' => 'string', 'null' => false) ); @@ -51,7 +51,7 @@ class PrimaryModelFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('primary_name' => 'Primary Name Existing') ); } diff --git a/cake/tests/fixtures/product_fixture.php b/cake/tests/fixtures/product_fixture.php index 9ef962c9f..4d564b052 100644 --- a/cake/tests/fixtures/product_fixture.php +++ b/cake/tests/fixtures/product_fixture.php @@ -32,7 +32,7 @@ class ProductFixture extends CakeTestFixture { * @var string 'Product' * @access public */ - var $name = 'Product'; + public $name = 'Product'; /** * fields property @@ -40,7 +40,7 @@ class ProductFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'length' => 255, 'null' => false), 'type' => array('type' => 'string', 'length' => 255, 'null' => false), @@ -53,7 +53,7 @@ class ProductFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('name' => 'Park\'s Great Hits', 'type' => 'Music', 'price' => 19), array('name' => 'Silly Puddy', 'type' => 'Toy', 'price' => 3), array('name' => 'Playstation', 'type' => 'Toy', 'price' => 89), diff --git a/cake/tests/fixtures/product_update_all_fixture.php b/cake/tests/fixtures/product_update_all_fixture.php index b9e48db82..77b97afa2 100644 --- a/cake/tests/fixtures/product_update_all_fixture.php +++ b/cake/tests/fixtures/product_update_all_fixture.php @@ -25,17 +25,17 @@ * @subpackage cake.tests.fixtures */ class ProductUpdateAllFixture extends CakeTestFixture { - var $name = 'ProductUpdateAll'; - var $table = 'product_update_all'; + public $name = 'ProductUpdateAll'; + public $table = 'product_update_all'; - var $fields = array( + public $fields = array( 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'), 'name' => array('type'=>'string', 'null' => false, 'length' => 29), 'groupcode' => array('type'=>'integer', 'null' => false, 'length' => 4), 'group_id' => array('type'=>'integer', 'null' => false, 'length' => 8), 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) ); - var $records = array( + public $records = array( array( 'id' => 1, 'name' => 'product one', diff --git a/cake/tests/fixtures/project_fixture.php b/cake/tests/fixtures/project_fixture.php index 724d032d7..9daf91179 100644 --- a/cake/tests/fixtures/project_fixture.php +++ b/cake/tests/fixtures/project_fixture.php @@ -32,7 +32,7 @@ class ProjectFixture extends CakeTestFixture { * @var string 'Project' * @access public */ - var $name = 'Project'; + public $name = 'Project'; /** * fields property @@ -40,7 +40,7 @@ class ProjectFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'null' => false) ); @@ -51,7 +51,7 @@ class ProjectFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('name' => 'Project 1'), array('name' => 'Project 2'), array('name' => 'Project 3') diff --git a/cake/tests/fixtures/sample_fixture.php b/cake/tests/fixtures/sample_fixture.php index f2ed850dd..da30f657c 100644 --- a/cake/tests/fixtures/sample_fixture.php +++ b/cake/tests/fixtures/sample_fixture.php @@ -32,7 +32,7 @@ class SampleFixture extends CakeTestFixture { * @var string 'Sample' * @access public */ - var $name = 'Sample'; + public $name = 'Sample'; /** * fields property @@ -40,7 +40,7 @@ class SampleFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'apple_id' => array('type' => 'integer', 'null' => false), 'name' => array('type' => 'string', 'length' => 40, 'null' => false) @@ -52,7 +52,7 @@ class SampleFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('apple_id' => 3, 'name' => 'sample1'), array('apple_id' => 2, 'name' => 'sample2'), array('apple_id' => 4, 'name' => 'sample3'), diff --git a/cake/tests/fixtures/secondary_model_fixture.php b/cake/tests/fixtures/secondary_model_fixture.php index 47a39de4a..02b6290ef 100644 --- a/cake/tests/fixtures/secondary_model_fixture.php +++ b/cake/tests/fixtures/secondary_model_fixture.php @@ -32,7 +32,7 @@ class SecondaryModelFixture extends CakeTestFixture { * @var string 'SecondaryModel' * @access public */ - var $name = 'SecondaryModel'; + public $name = 'SecondaryModel'; /** * fields property @@ -40,7 +40,7 @@ class SecondaryModelFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'secondary_name' => array('type' => 'string', 'null' => false) ); @@ -51,7 +51,7 @@ class SecondaryModelFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('secondary_name' => 'Secondary Name Existing') ); } diff --git a/cake/tests/fixtures/session_fixture.php b/cake/tests/fixtures/session_fixture.php index ca19e6654..1fe1e177e 100644 --- a/cake/tests/fixtures/session_fixture.php +++ b/cake/tests/fixtures/session_fixture.php @@ -32,14 +32,14 @@ class SessionFixture extends CakeTestFixture { * @var string 'Session' * @access public */ - var $name = 'Session'; + public $name = 'Session'; /** * table property. * * @var string */ - // var $table = 'sessions'; + // public $table = 'sessions'; /** * fields property @@ -47,7 +47,7 @@ class SessionFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'string', 'length' => 255, 'key' => 'primary'), 'data' => array('type' => 'text','null' => true), 'expires' => array('type' => 'integer', 'length' => 11, 'null' => true) @@ -59,6 +59,6 @@ class SessionFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array(); + public $records = array(); } ?> \ No newline at end of file diff --git a/cake/tests/fixtures/something_else_fixture.php b/cake/tests/fixtures/something_else_fixture.php index 39982b89e..c89c46df3 100644 --- a/cake/tests/fixtures/something_else_fixture.php +++ b/cake/tests/fixtures/something_else_fixture.php @@ -32,7 +32,7 @@ class SomethingElseFixture extends CakeTestFixture { * @var string 'SomethingElse' * @access public */ - var $name = 'SomethingElse'; + public $name = 'SomethingElse'; /** * fields property @@ -40,7 +40,7 @@ class SomethingElseFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'title' => array('type' => 'string', 'default' => ''), 'body' => array('type' => 'text'), @@ -55,7 +55,7 @@ class SomethingElseFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('title' => 'First Post', 'body' => 'First Post Body', 'published' => 'Y', 'created' => '2007-03-18 10:39:23', 'updated' => '2007-03-18 10:41:31'), array('title' => 'Second Post', 'body' => 'Second Post Body', 'published' => 'Y', 'created' => '2007-03-18 10:41:23', 'updated' => '2007-03-18 10:43:31'), array('title' => 'Third Post', 'body' => 'Third Post Body', 'published' => 'Y', 'created' => '2007-03-18 10:43:23', 'updated' => '2007-03-18 10:45:31') diff --git a/cake/tests/fixtures/something_fixture.php b/cake/tests/fixtures/something_fixture.php index 16a25b7be..4f366dbc4 100644 --- a/cake/tests/fixtures/something_fixture.php +++ b/cake/tests/fixtures/something_fixture.php @@ -32,7 +32,7 @@ class SomethingFixture extends CakeTestFixture { * @var string 'Something' * @access public */ - var $name = 'Something'; + public $name = 'Something'; /** * fields property @@ -40,7 +40,7 @@ class SomethingFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'title' => array('type' => 'string', 'default' => ''), 'body' => array('type' => 'text'), @@ -55,7 +55,7 @@ class SomethingFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('title' => 'First Post', 'body' => 'First Post Body', 'published' => 'Y', 'created' => '2007-03-18 10:39:23', 'updated' => '2007-03-18 10:41:31'), array('title' => 'Second Post', 'body' => 'Second Post Body', 'published' => 'Y', 'created' => '2007-03-18 10:41:23', 'updated' => '2007-03-18 10:43:31'), array('title' => 'Third Post', 'body' => 'Third Post Body', 'published' => 'Y', 'created' => '2007-03-18 10:43:23', 'updated' => '2007-03-18 10:45:31') diff --git a/cake/tests/fixtures/stories_tag_fixture.php b/cake/tests/fixtures/stories_tag_fixture.php index e152a0697..45c7b1f85 100644 --- a/cake/tests/fixtures/stories_tag_fixture.php +++ b/cake/tests/fixtures/stories_tag_fixture.php @@ -32,7 +32,7 @@ class StoriesTagFixture extends CakeTestFixture { * @var string 'StoriesTag' * @access public */ - var $name = 'StoriesTag'; + public $name = 'StoriesTag'; /** * fields property @@ -40,7 +40,7 @@ class StoriesTagFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'story' => array('type' => 'integer', 'null' => false), 'tag_id' => array('type' => 'integer', 'null' => false), 'indexes' => array('UNIQUE_STORY_TAG' => array('column'=> array('story', 'tag_id'), 'unique'=>1)) @@ -52,7 +52,7 @@ class StoriesTagFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('story' => 1, 'tag_id' => 1) ); } diff --git a/cake/tests/fixtures/story_fixture.php b/cake/tests/fixtures/story_fixture.php index f7bc60f6b..510dd9dba 100644 --- a/cake/tests/fixtures/story_fixture.php +++ b/cake/tests/fixtures/story_fixture.php @@ -32,7 +32,7 @@ class StoryFixture extends CakeTestFixture { * @var string 'Story' * @access public */ - var $name = 'Story'; + public $name = 'Story'; /** * fields property @@ -40,7 +40,7 @@ class StoryFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'story' => array('type' => 'integer', 'key' => 'primary'), 'title' => array('type' => 'string', 'null' => false) ); @@ -51,7 +51,7 @@ class StoryFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('title' => 'First Story'), array('title' => 'Second Story') ); diff --git a/cake/tests/fixtures/syfile_fixture.php b/cake/tests/fixtures/syfile_fixture.php index ca9c6bbbd..af569bad7 100644 --- a/cake/tests/fixtures/syfile_fixture.php +++ b/cake/tests/fixtures/syfile_fixture.php @@ -32,7 +32,7 @@ class SyfileFixture extends CakeTestFixture { * @var string 'Syfile' * @access public */ - var $name = 'Syfile'; + public $name = 'Syfile'; /** * fields property @@ -40,7 +40,7 @@ class SyfileFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'image_id' => array('type' => 'integer', 'null' => true), 'name' => array('type' => 'string', 'null' => false), @@ -53,7 +53,7 @@ class SyfileFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('image_id' => 1, 'name' => 'Syfile 1'), array('image_id' => 2, 'name' => 'Syfile 2'), array('image_id' => 5, 'name' => 'Syfile 3'), diff --git a/cake/tests/fixtures/tag_fixture.php b/cake/tests/fixtures/tag_fixture.php index d8be43215..0eac0893a 100644 --- a/cake/tests/fixtures/tag_fixture.php +++ b/cake/tests/fixtures/tag_fixture.php @@ -32,7 +32,7 @@ class TagFixture extends CakeTestFixture { * @var string 'Tag' * @access public */ - var $name = 'Tag'; + public $name = 'Tag'; /** * fields property @@ -40,7 +40,7 @@ class TagFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'tag' => array('type' => 'string', 'null' => false), 'created' => 'datetime', @@ -53,7 +53,7 @@ class TagFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('tag' => 'tag1', 'created' => '2007-03-18 12:22:23', 'updated' => '2007-03-18 12:24:31'), array('tag' => 'tag2', 'created' => '2007-03-18 12:24:23', 'updated' => '2007-03-18 12:26:31'), array('tag' => 'tag3', 'created' => '2007-03-18 12:26:23', 'updated' => '2007-03-18 12:28:31') diff --git a/cake/tests/fixtures/test_plugin_article_fixture.php b/cake/tests/fixtures/test_plugin_article_fixture.php index 936ab241a..8360fb34c 100644 --- a/cake/tests/fixtures/test_plugin_article_fixture.php +++ b/cake/tests/fixtures/test_plugin_article_fixture.php @@ -32,7 +32,7 @@ class TestPluginArticleFixture extends CakeTestFixture { * @var string 'Article' * @access public */ - var $name = 'TestPluginArticle'; + public $name = 'TestPluginArticle'; /** * fields property @@ -40,7 +40,7 @@ class TestPluginArticleFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'user_id' => array('type' => 'integer', 'null' => false), 'title' => array('type' => 'string', 'null' => false), @@ -56,7 +56,7 @@ class TestPluginArticleFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('user_id' => 1, 'title' => 'First Plugin Article', 'body' => 'First Plugin Article Body', 'published' => 'Y', 'created' => '2008-09-24 10:39:23', 'updated' => '2008-09-24 10:41:31'), array('user_id' => 3, 'title' => 'Second Plugin Article', 'body' => 'Second Plugin Article Body', 'published' => 'Y', 'created' => '2008-09-24 10:41:23', 'updated' => '2008-09-24 10:43:31'), array('user_id' => 1, 'title' => 'Third Plugin Article', 'body' => 'Third Plugin Article Body', 'published' => 'Y', 'created' => '2008-09-24 10:43:23', 'updated' => '2008-09-24 10:45:31') diff --git a/cake/tests/fixtures/test_plugin_comment_fixture.php b/cake/tests/fixtures/test_plugin_comment_fixture.php index fdcaefc3a..2ce7bcd73 100644 --- a/cake/tests/fixtures/test_plugin_comment_fixture.php +++ b/cake/tests/fixtures/test_plugin_comment_fixture.php @@ -32,7 +32,7 @@ class TestPluginCommentFixture extends CakeTestFixture { * @var string 'Comment' * @access public */ - var $name = 'TestPluginComment'; + public $name = 'TestPluginComment'; /** * fields property @@ -40,7 +40,7 @@ class TestPluginCommentFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'article_id' => array('type' => 'integer', 'null'=>false), 'user_id' => array('type' => 'integer', 'null'=>false), @@ -56,7 +56,7 @@ class TestPluginCommentFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => 1, 'article_id' => 1, 'user_id' => 2, 'comment' => 'First Comment for First Plugin Article', 'published' => 'Y', 'created' => '2008-09-24 10:45:23', 'updated' => '2008-09-24 10:47:31'), array('id' => 2, 'article_id' => 1, 'user_id' => 4, 'comment' => 'Second Comment for First Plugin Article', 'published' => 'Y', 'created' => '2008-09-24 10:47:23', 'updated' => '2008-09-24 10:49:31'), array('id' => 3, 'article_id' => 1, 'user_id' => 1, 'comment' => 'Third Comment for First Plugin Article', 'published' => 'Y', 'created' => '2008-09-24 10:49:23', 'updated' => '2008-09-24 10:51:31'), diff --git a/cake/tests/fixtures/the_paper_monkies_fixture.php b/cake/tests/fixtures/the_paper_monkies_fixture.php index d3eb52b66..ac3b725e5 100644 --- a/cake/tests/fixtures/the_paper_monkies_fixture.php +++ b/cake/tests/fixtures/the_paper_monkies_fixture.php @@ -32,7 +32,7 @@ class ThePaperMonkiesFixture extends CakeTestFixture { * @var string 'ThePaperMonkies' * @access public */ - var $name = 'ThePaperMonkies'; + public $name = 'ThePaperMonkies'; /** * fields property @@ -40,7 +40,7 @@ class ThePaperMonkiesFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'apple_id' => array('type' => 'integer', 'length' => 10, 'null' => true), 'device_id' => array('type' => 'integer', 'length' => 10, 'null' => true) ); @@ -51,7 +51,7 @@ class ThePaperMonkiesFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array(); + public $records = array(); } ?> \ No newline at end of file diff --git a/cake/tests/fixtures/thread_fixture.php b/cake/tests/fixtures/thread_fixture.php index 32c2406f3..603505e4c 100644 --- a/cake/tests/fixtures/thread_fixture.php +++ b/cake/tests/fixtures/thread_fixture.php @@ -32,7 +32,7 @@ class ThreadFixture extends CakeTestFixture { * @var string 'Thread' * @access public */ - var $name = 'Thread'; + public $name = 'Thread'; /** * fields property @@ -40,7 +40,7 @@ class ThreadFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'project_id' => array('type' => 'integer', 'null' => false), 'name' => array('type' => 'string', 'null' => false) @@ -52,7 +52,7 @@ class ThreadFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('project_id' => 1, 'name' => 'Project 1, Thread 1'), array('project_id' => 1, 'name' => 'Project 1, Thread 2'), array('project_id' => 2, 'name' => 'Project 2, Thread 1') diff --git a/cake/tests/fixtures/translate_article_fixture.php b/cake/tests/fixtures/translate_article_fixture.php index 6818215f4..ffebf8111 100644 --- a/cake/tests/fixtures/translate_article_fixture.php +++ b/cake/tests/fixtures/translate_article_fixture.php @@ -32,7 +32,7 @@ class TranslateArticleFixture extends CakeTestFixture { * @var string 'Translate' * @access public */ - var $name = 'TranslateArticle'; + public $name = 'TranslateArticle'; /** * table property @@ -40,7 +40,7 @@ class TranslateArticleFixture extends CakeTestFixture { * @var string 'i18n' * @access public */ - var $table = 'article_i18n'; + public $table = 'article_i18n'; /** * fields property @@ -48,7 +48,7 @@ class TranslateArticleFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'locale' => array('type' => 'string', 'length' => 6, 'null' => false), 'model' => array('type' => 'string', 'null' => false), @@ -63,7 +63,7 @@ class TranslateArticleFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => 1, 'locale' => 'eng', 'model' => 'TranslatedArticle', 'foreign_key' => 1, 'field' => 'title', 'content' => 'Title (eng) #1'), array('id' => 2, 'locale' => 'eng', 'model' => 'TranslatedArticle', 'foreign_key' => 1, 'field' => 'body', 'content' => 'Body (eng) #1'), array('id' => 3, 'locale' => 'deu', 'model' => 'TranslatedArticle', 'foreign_key' => 1, 'field' => 'title', 'content' => 'Title (deu) #1'), diff --git a/cake/tests/fixtures/translate_fixture.php b/cake/tests/fixtures/translate_fixture.php index bc154112c..41fc8aff3 100644 --- a/cake/tests/fixtures/translate_fixture.php +++ b/cake/tests/fixtures/translate_fixture.php @@ -32,7 +32,7 @@ class TranslateFixture extends CakeTestFixture { * @var string 'Translate' * @access public */ - var $name = 'Translate'; + public $name = 'Translate'; /** * table property @@ -40,7 +40,7 @@ class TranslateFixture extends CakeTestFixture { * @var string 'i18n' * @access public */ - var $table = 'i18n'; + public $table = 'i18n'; /** * fields property @@ -48,7 +48,7 @@ class TranslateFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'locale' => array('type' => 'string', 'length' => 6, 'null' => false), 'model' => array('type' => 'string', 'null' => false), @@ -63,7 +63,7 @@ class TranslateFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => 1, 'locale' => 'eng', 'model' => 'TranslatedItem', 'foreign_key' => 1, 'field' => 'title', 'content' => 'Title #1'), array('id' => 2, 'locale' => 'eng', 'model' => 'TranslatedItem', 'foreign_key' => 1, 'field' => 'content', 'content' => 'Content #1'), array('id' => 3, 'locale' => 'deu', 'model' => 'TranslatedItem', 'foreign_key' => 1, 'field' => 'title', 'content' => 'Titel #1'), diff --git a/cake/tests/fixtures/translate_table_fixture.php b/cake/tests/fixtures/translate_table_fixture.php index 4c8543a61..022c54ae2 100644 --- a/cake/tests/fixtures/translate_table_fixture.php +++ b/cake/tests/fixtures/translate_table_fixture.php @@ -32,7 +32,7 @@ class TranslateTableFixture extends CakeTestFixture { * @var string 'TranslateTable' * @access public */ - var $name = 'TranslateTable'; + public $name = 'TranslateTable'; /** * table property @@ -40,7 +40,7 @@ class TranslateTableFixture extends CakeTestFixture { * @var string 'another_i18n' * @access public */ - var $table = 'another_i18n'; + public $table = 'another_i18n'; /** * fields property @@ -48,7 +48,7 @@ class TranslateTableFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'locale' => array('type' => 'string', 'length' => 6, 'null' => false), 'model' => array('type' => 'string', 'null' => false), @@ -62,7 +62,7 @@ class TranslateTableFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('locale' => 'eng', 'model' => 'TranslatedItemWithTable', 'foreign_key' => 1, 'field' => 'title', 'content' => 'Another Title #1'), array('locale' => 'eng', 'model' => 'TranslatedItemWithTable', 'foreign_key' => 1, 'field' => 'content', 'content' => 'Another Content #1') ); diff --git a/cake/tests/fixtures/translate_with_prefix_fixture.php b/cake/tests/fixtures/translate_with_prefix_fixture.php index a26e1e7f0..8eb0b666e 100644 --- a/cake/tests/fixtures/translate_with_prefix_fixture.php +++ b/cake/tests/fixtures/translate_with_prefix_fixture.php @@ -36,21 +36,21 @@ class TranslateWithPrefixFixture extends CakeTestFixture { * @var string 'Translate' * @access public */ - var $name = 'TranslateWithPrefix'; + public $name = 'TranslateWithPrefix'; /** * table property * * @var string 'i18n' * @access public */ - var $table = 'i18n_translate_with_prefixes'; + public $table = 'i18n_translate_with_prefixes'; /** * fields property * * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'locale' => array('type' => 'string', 'length' => 6, 'null' => false), 'model' => array('type' => 'string', 'null' => false), @@ -64,7 +64,7 @@ class TranslateWithPrefixFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => 1, 'locale' => 'eng', 'model' => 'TranslatedItem', 'foreign_key' => 1, 'field' => 'title', 'content' => 'Title #1'), array('id' => 2, 'locale' => 'eng', 'model' => 'TranslatedItem', 'foreign_key' => 1, 'field' => 'content', 'content' => 'Content #1'), array('id' => 3, 'locale' => 'deu', 'model' => 'TranslatedItem', 'foreign_key' => 1, 'field' => 'title', 'content' => 'Titel #1'), diff --git a/cake/tests/fixtures/translated_article_fixture.php b/cake/tests/fixtures/translated_article_fixture.php index e937be316..6783276cc 100644 --- a/cake/tests/fixtures/translated_article_fixture.php +++ b/cake/tests/fixtures/translated_article_fixture.php @@ -32,7 +32,7 @@ class TranslatedArticleFixture extends CakeTestFixture { * @var string 'TranslatedItem' * @access public */ - var $name = 'TranslatedArticle'; + public $name = 'TranslatedArticle'; /** * fields property @@ -40,7 +40,7 @@ class TranslatedArticleFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'user_id' => array('type' => 'integer', 'null' => false), 'published' => array('type' => 'string', 'length' => 1, 'default' => 'N'), @@ -54,7 +54,7 @@ class TranslatedArticleFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => 1, 'user_id' => 1, 'published' => 'Y', 'created' => '2007-03-18 10:39:23', 'updated' => '2007-03-18 10:41:31'), array('id' => 2, 'user_id' => 3, 'published' => 'Y', 'created' => '2007-03-18 10:41:23', 'updated' => '2007-03-18 10:43:31'), array('id' => 3, 'user_id' => 1, 'published' => 'Y', 'created' => '2007-03-18 10:43:23', 'updated' => '2007-03-18 10:45:31') diff --git a/cake/tests/fixtures/translated_item_fixture.php b/cake/tests/fixtures/translated_item_fixture.php index 44df51549..0c3e47bb2 100644 --- a/cake/tests/fixtures/translated_item_fixture.php +++ b/cake/tests/fixtures/translated_item_fixture.php @@ -32,7 +32,7 @@ class TranslatedItemFixture extends CakeTestFixture { * @var string 'TranslatedItem' * @access public */ - var $name = 'TranslatedItem'; + public $name = 'TranslatedItem'; /** * fields property @@ -40,7 +40,7 @@ class TranslatedItemFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'slug' => array('type' => 'string', 'null' => false) ); @@ -51,7 +51,7 @@ class TranslatedItemFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('slug' => 'first_translated'), array('slug' => 'second_translated'), array('slug' => 'third_translated') diff --git a/cake/tests/fixtures/unconventional_tree_fixture.php b/cake/tests/fixtures/unconventional_tree_fixture.php index 42bccd5b7..d968cc83c 100644 --- a/cake/tests/fixtures/unconventional_tree_fixture.php +++ b/cake/tests/fixtures/unconventional_tree_fixture.php @@ -35,7 +35,7 @@ class UnconventionalTreeFixture extends CakeTestFixture { * @var string 'FlagTree' * @access public */ - var $name = 'UnconventionalTree'; + public $name = 'UnconventionalTree'; /** * fields property @@ -43,7 +43,7 @@ class UnconventionalTreeFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer','key' => 'primary'), 'name' => array('type' => 'string','null' => false), 'join' => 'integer', diff --git a/cake/tests/fixtures/underscore_field_fixture.php b/cake/tests/fixtures/underscore_field_fixture.php index 37e0f96dd..7b5c54954 100644 --- a/cake/tests/fixtures/underscore_field_fixture.php +++ b/cake/tests/fixtures/underscore_field_fixture.php @@ -32,14 +32,14 @@ class UnderscoreFieldFixture extends CakeTestFixture { * @var string 'UnderscoreField' * @access public */ - var $name = 'UnderscoreField'; + public $name = 'UnderscoreField'; /** * fields property * * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'user_id' => array('type' => 'integer', 'null' => false), 'my_model_has_a_field' => array('type' => 'string', 'null' => false), @@ -53,7 +53,7 @@ class UnderscoreFieldFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('user_id' => 1, 'my_model_has_a_field' => 'First Article', 'body_field' => 'First Article Body', 'published' => 'Y', 'another_field' => 2), array('user_id' => 3, 'my_model_has_a_field' => 'Second Article', 'body_field' => 'Second Article Body', 'published' => 'Y', 'another_field' => 3), array('user_id' => 1, 'my_model_has_a_field' => 'Third Article', 'body_field' => 'Third Article Body', 'published' => 'Y', 'another_field' => 5), diff --git a/cake/tests/fixtures/user_fixture.php b/cake/tests/fixtures/user_fixture.php index 6f845ef7e..3e350c1fa 100644 --- a/cake/tests/fixtures/user_fixture.php +++ b/cake/tests/fixtures/user_fixture.php @@ -32,7 +32,7 @@ class UserFixture extends CakeTestFixture { * @var string 'User' * @access public */ - var $name = 'User'; + public $name = 'User'; /** * fields property @@ -40,7 +40,7 @@ class UserFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'user' => array('type' => 'string', 'null' => false), 'password' => array('type' => 'string', 'null' => false), @@ -54,7 +54,7 @@ class UserFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('user' => 'mariano', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99', 'created' => '2007-03-17 01:16:23', 'updated' => '2007-03-17 01:18:31'), array('user' => 'nate', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99', 'created' => '2007-03-17 01:18:23', 'updated' => '2007-03-17 01:20:31'), array('user' => 'larry', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99', 'created' => '2007-03-17 01:20:23', 'updated' => '2007-03-17 01:22:31'), diff --git a/cake/tests/fixtures/uuid_fixture.php b/cake/tests/fixtures/uuid_fixture.php index 919a48260..6d9618d4b 100644 --- a/cake/tests/fixtures/uuid_fixture.php +++ b/cake/tests/fixtures/uuid_fixture.php @@ -32,7 +32,7 @@ class UuidFixture extends CakeTestFixture { * @var string 'Uuid' * @access public */ - var $name = 'Uuid'; + public $name = 'Uuid'; /** * fields property @@ -40,7 +40,7 @@ class UuidFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'string', 'length' => 36, 'key' => 'primary'), 'title' => 'string', 'count' => array('type' => 'integer', 'default' => 0), @@ -54,7 +54,7 @@ class UuidFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => '47c36f9c-bc00-4d17-9626-4e183ca6822b', 'title' => 'Unique record 1', 'count' => 2, 'created' => '2008-03-13 01:16:23', 'updated' => '2008-03-13 01:18:31'), array('id' => '47c36f9c-f2b0-43f5-b3f7-4e183ca6822b', 'title' => 'Unique record 2', 'count' => 4, 'created' => '2008-03-13 01:18:24', 'updated' => '2008-03-13 01:20:32'), array('id' => '47c36f9c-0ffc-4084-9b03-4e183ca6822b', 'title' => 'Unique record 3', 'count' => 5, 'created' => '2008-03-13 01:20:25', 'updated' => '2008-03-13 01:22:33'), diff --git a/cake/tests/fixtures/uuid_tag_fixture.php b/cake/tests/fixtures/uuid_tag_fixture.php index e30653b5b..178daeda7 100644 --- a/cake/tests/fixtures/uuid_tag_fixture.php +++ b/cake/tests/fixtures/uuid_tag_fixture.php @@ -32,7 +32,7 @@ class UuidTagFixture extends CakeTestFixture { * @var string 'UuidTag' * @access public */ - var $name = 'UuidTag'; + public $name = 'UuidTag'; /** * fields property @@ -40,7 +40,7 @@ class UuidTagFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'string', 'length' => 36, 'key' => 'primary'), 'name' => array('type' => 'string', 'length' => 255), 'created' => array('type' => 'datetime') @@ -52,7 +52,7 @@ class UuidTagFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => '481fc6d0-b920-43e0-e50f-6d1740cf8569', 'name' => 'MyTag', 'created' => '2009-12-09 12:30:00') ); } diff --git a/cake/tests/fixtures/uuid_tree_fixture.php b/cake/tests/fixtures/uuid_tree_fixture.php index 36481721e..426ed0a22 100644 --- a/cake/tests/fixtures/uuid_tree_fixture.php +++ b/cake/tests/fixtures/uuid_tree_fixture.php @@ -33,7 +33,7 @@ class UuidTreeFixture extends CakeTestFixture { * @var string 'UuidTree' * @access public */ - var $name = 'UuidTree'; + public $name = 'UuidTree'; /** * fields property @@ -41,7 +41,7 @@ class UuidTreeFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'string', 'length' => 36, 'key' => 'primary'), 'name' => array('type' => 'string','null' => false), 'parent_id' => array('type' => 'string', 'length' => 36, 'null' => true), diff --git a/cake/tests/fixtures/uuiditem_fixture.php b/cake/tests/fixtures/uuiditem_fixture.php index 730c382d4..fb508d942 100644 --- a/cake/tests/fixtures/uuiditem_fixture.php +++ b/cake/tests/fixtures/uuiditem_fixture.php @@ -32,7 +32,7 @@ class UuiditemFixture extends CakeTestFixture { * @var string 'Uuiditem' * @access public */ - var $name = 'Uuiditem'; + public $name = 'Uuiditem'; /** * fields property @@ -40,7 +40,7 @@ class UuiditemFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'string', 'length' => 36, 'key' => 'primary'), 'published' => array('type' => 'boolean', 'null' => false), 'name' => array('type' => 'string', 'null' => false) @@ -52,7 +52,7 @@ class UuiditemFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => '481fc6d0-b920-43e0-a40d-6d1740cf8569', 'published' => 0, 'name' => 'Item 1'), array('id' => '48298a29-81c0-4c26-a7fb-413140cf8569', 'published' => 0, 'name' => 'Item 2'), array('id' => '482b7756-8da0-419a-b21f-27da40cf8569', 'published' => 0, 'name' => 'Item 3'), diff --git a/cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php b/cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php index 948cbc878..8d3a18ff2 100644 --- a/cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php +++ b/cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php @@ -32,7 +32,7 @@ class UuiditemsUuidportfolioFixture extends CakeTestFixture { * @var string 'UuiditemsUuidportfolio' * @access public */ - var $name = 'UuiditemsUuidportfolio'; + public $name = 'UuiditemsUuidportfolio'; /** * fields property @@ -40,7 +40,7 @@ class UuiditemsUuidportfolioFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'string', 'length' => 36, 'key' => 'primary'), 'uuiditem_id' => array('type' => 'string', 'length' => 36, 'null' => false), 'uuidportfolio_id' => array('type' => 'string', 'length' => 36, 'null' => false) @@ -52,7 +52,7 @@ class UuiditemsUuidportfolioFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => '4850fd8f-cc5c-449f-bf34-0c5240cf8569', 'uuiditem_id' => '481fc6d0-b920-43e0-a40d-6d1740cf8569', 'uuidportfolio_id' => '4806e091-6940-4d2b-b227-303740cf8569'), array('id' => '4850fee5-d24c-4ea0-9759-0c2e40cf8569', 'uuiditem_id' => '48298a29-81c0-4c26-a7fb-413140cf8569', 'uuidportfolio_id' => '480af662-eb8c-47d3-886b-230540cf8569'), array('id' => '4851af6e-fa18-403d-b57e-437d40cf8569', 'uuiditem_id' => '482b7756-8da0-419a-b21f-27da40cf8569', 'uuidportfolio_id' => '4806e091-6940-4d2b-b227-303740cf8569'), diff --git a/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php b/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php index 93e5cedcd..2e5473362 100644 --- a/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php +++ b/cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php @@ -32,7 +32,7 @@ class UuiditemsUuidportfolioNumericidFixture extends CakeTestFixture { * @var string 'UuiditemsUuidportfolioNumericid' * @access public */ - var $name = 'UuiditemsUuidportfolioNumericid'; + public $name = 'UuiditemsUuidportfolioNumericid'; /** * fields property @@ -40,7 +40,7 @@ class UuiditemsUuidportfolioNumericidFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'integer', 'length' => 10, 'key' => 'primary'), 'uuiditem_id' => array('type' => 'string', 'length' => 36, 'null' => false), 'uuidportfolio_id' => array('type' => 'string', 'length' => 36, 'null' => false) @@ -52,7 +52,7 @@ class UuiditemsUuidportfolioNumericidFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('uuiditem_id' => '481fc6d0-b920-43e0-a40d-6d1740cf8569', 'uuidportfolio_id' => '4806e091-6940-4d2b-b227-303740cf8569'), array('uuiditem_id' => '48298a29-81c0-4c26-a7fb-413140cf8569', 'uuidportfolio_id' => '480af662-eb8c-47d3-886b-230540cf8569'), array('uuiditem_id' => '482b7756-8da0-419a-b21f-27da40cf8569', 'uuidportfolio_id' => '4806e091-6940-4d2b-b227-303740cf8569'), diff --git a/cake/tests/fixtures/uuidportfolio_fixture.php b/cake/tests/fixtures/uuidportfolio_fixture.php index a94366ee8..c535962d7 100644 --- a/cake/tests/fixtures/uuidportfolio_fixture.php +++ b/cake/tests/fixtures/uuidportfolio_fixture.php @@ -32,7 +32,7 @@ class UuidportfolioFixture extends CakeTestFixture { * @var string 'Uuidportfolio' * @access public */ - var $name = 'Uuidportfolio'; + public $name = 'Uuidportfolio'; /** * fields property @@ -40,7 +40,7 @@ class UuidportfolioFixture extends CakeTestFixture { * @var array * @access public */ - var $fields = array( + public $fields = array( 'id' => array('type' => 'string', 'length' => 36, 'key' => 'primary'), 'name' => array('type' => 'string', 'null' => false) ); @@ -51,7 +51,7 @@ class UuidportfolioFixture extends CakeTestFixture { * @var array * @access public */ - var $records = array( + public $records = array( array('id' => '4806e091-6940-4d2b-b227-303740cf8569', 'name' => 'Portfolio 1'), array('id' => '480af662-eb8c-47d3-886b-230540cf8569', 'name' => 'Portfolio 2'), ); diff --git a/cake/tests/groups/acl.group.php b/cake/tests/groups/acl.group.php index 412254f08..3016509b9 100644 --- a/cake/tests/groups/acl.group.php +++ b/cake/tests/groups/acl.group.php @@ -34,7 +34,7 @@ class AclAndAuthGroupTest extends TestSuite { * @var string 'Acl and Auth Tests' * @access public */ - var $label = 'Acl and Auth'; + public $label = 'Acl and Auth'; /** * AclAndAuthGroupTest method diff --git a/cake/tests/groups/bake.group.php b/cake/tests/groups/bake.group.php index 5134f43f6..b4651c871 100644 --- a/cake/tests/groups/bake.group.php +++ b/cake/tests/groups/bake.group.php @@ -36,7 +36,7 @@ class BakeGroupTest extends TestSuite { * @var string 'All core cache engines' * @access public */ - var $label = 'All Tasks related to bake.'; + public $label = 'All Tasks related to bake.'; /** * BakeGroupTest method diff --git a/cake/tests/groups/behaviors.group.php b/cake/tests/groups/behaviors.group.php index f8bb3f508..f3095fb08 100644 --- a/cake/tests/groups/behaviors.group.php +++ b/cake/tests/groups/behaviors.group.php @@ -34,7 +34,7 @@ class BehaviorsGroupTest extends TestSuite { * @var string * @access public */ - var $label = 'All core behavior test cases.'; + public $label = 'All core behavior test cases.'; /** * BehaviorsGroupTest method diff --git a/cake/tests/groups/cache.group.php b/cake/tests/groups/cache.group.php index 27f303a8e..c30aea4d0 100644 --- a/cake/tests/groups/cache.group.php +++ b/cake/tests/groups/cache.group.php @@ -34,7 +34,7 @@ class CacheGroupTest extends TestSuite { * @var string 'All core cache engines' * @access public */ - var $label = 'Cache and all CacheEngines'; + public $label = 'Cache and all CacheEngines'; /** * CacheGroupTest method diff --git a/cake/tests/groups/components.group.php b/cake/tests/groups/components.group.php index 1613333c1..ef2e8dcf7 100644 --- a/cake/tests/groups/components.group.php +++ b/cake/tests/groups/components.group.php @@ -34,7 +34,7 @@ class ComponentsGroupTest extends TestSuite { * @var string 'All core components' * @access public */ - var $label = 'All Components'; + public $label = 'All Components'; /** * CoreComponentsGroupTest method diff --git a/cake/tests/groups/configure.group.php b/cake/tests/groups/configure.group.php index c853fd5b6..507e461b7 100644 --- a/cake/tests/groups/configure.group.php +++ b/cake/tests/groups/configure.group.php @@ -34,7 +34,7 @@ class ConfigureGroupTest extends TestSuite { * @var string 'Configure, Loader, ClassRegistry Tests' * @access public */ - var $label = 'Configure, App and ClassRegistry'; + public $label = 'Configure, App and ClassRegistry'; /** * ConfigureGroupTest method diff --git a/cake/tests/groups/console.group.php b/cake/tests/groups/console.group.php index adeff2722..93afa8c5e 100644 --- a/cake/tests/groups/console.group.php +++ b/cake/tests/groups/console.group.php @@ -34,7 +34,7 @@ class ConsoleGroupTest extends TestSuite { * @var string 'All core cache engines' * @access public */ - var $label = 'ShellDispatcher, Shell and all Tasks'; + public $label = 'ShellDispatcher, Shell and all Tasks'; /** * ConsoleGroupTest method diff --git a/cake/tests/groups/controller.group.php b/cake/tests/groups/controller.group.php index 9c097cea8..302ef85fe 100644 --- a/cake/tests/groups/controller.group.php +++ b/cake/tests/groups/controller.group.php @@ -32,7 +32,7 @@ class ControllerGroupTest extends TestSuite { * @var string 'All cake/libs/controller/* (Not yet implemented)' * @access public */ - var $label = 'Component, Controllers, Scaffold test cases.'; + public $label = 'Component, Controllers, Scaffold test cases.'; /** * LibControllerGroupTest method * diff --git a/cake/tests/groups/database.group.php b/cake/tests/groups/database.group.php index 5dfe69916..15a9a84cd 100644 --- a/cake/tests/groups/database.group.php +++ b/cake/tests/groups/database.group.php @@ -35,7 +35,7 @@ class DatabaseGroupTest extends TestSuite { * @var string 'All model tests' * @access public */ - var $label = 'Datasources, Schema and DbAcl tests'; + public $label = 'Datasources, Schema and DbAcl tests'; /** * ModelGroupTest method diff --git a/cake/tests/groups/helpers.group.php b/cake/tests/groups/helpers.group.php index 7093dfadf..a8a34174f 100644 --- a/cake/tests/groups/helpers.group.php +++ b/cake/tests/groups/helpers.group.php @@ -34,7 +34,7 @@ class HelpersGroupTest extends TestSuite { * @var string 'All core helpers' * @access public */ - var $label = 'All Helpers'; + public $label = 'All Helpers'; /** * HelpersGroupTest method diff --git a/cake/tests/groups/i18n.group.php b/cake/tests/groups/i18n.group.php index 03f7f6518..b6b725099 100644 --- a/cake/tests/groups/i18n.group.php +++ b/cake/tests/groups/i18n.group.php @@ -34,7 +34,7 @@ class i18nGroupTest extends TestSuite { * @var string * @access public */ - var $label = 'i18n, l10n and multibyte tests'; + public $label = 'i18n, l10n and multibyte tests'; /** * LibGroupTest method diff --git a/cake/tests/groups/javascript.group.php b/cake/tests/groups/javascript.group.php index 5dbc25bd1..96ee26643 100644 --- a/cake/tests/groups/javascript.group.php +++ b/cake/tests/groups/javascript.group.php @@ -34,7 +34,7 @@ class AllCoreJavascriptHelpersGroupTest extends TestSuite { * @var string 'All core helpers' * @access public */ - var $label = 'Js Helper and all Engine Helpers'; + public $label = 'Js Helper and all Engine Helpers'; /** * AllCoreHelpersGroupTest method * diff --git a/cake/tests/groups/lib.group.php b/cake/tests/groups/lib.group.php index 7306bb210..c2776a44c 100644 --- a/cake/tests/groups/lib.group.php +++ b/cake/tests/groups/lib.group.php @@ -34,7 +34,7 @@ class LibGroupTest extends TestSuite { * @var string * @access public */ - var $label = 'All core, non MVC element libs'; + public $label = 'All core, non MVC element libs'; /** * LibGroupTest method diff --git a/cake/tests/groups/model.group.php b/cake/tests/groups/model.group.php index 9af275d36..a0e12497a 100644 --- a/cake/tests/groups/model.group.php +++ b/cake/tests/groups/model.group.php @@ -35,7 +35,7 @@ class ModelGroupTest extends TestSuite { * @var string * @access public */ - var $label = 'All Model tests'; + public $label = 'All Model tests'; /** * ModelGroupTest method diff --git a/cake/tests/groups/no_cross_contamination.group.php b/cake/tests/groups/no_cross_contamination.group.php index 4423a74e1..8e5cf63af 100644 --- a/cake/tests/groups/no_cross_contamination.group.php +++ b/cake/tests/groups/no_cross_contamination.group.php @@ -36,7 +36,7 @@ class NoCrossContaminationGroupTest extends TestSuite { * @var string * @access public */ - var $label = 'No Cross Contamination'; + public $label = 'No Cross Contamination'; /** * blacklist property @@ -44,7 +44,7 @@ class NoCrossContaminationGroupTest extends TestSuite { * @var string * @access public */ - var $blacklist = array('cake_test_case.test.php', 'object.test.php'); + public $blacklist = array('cake_test_case.test.php', 'object.test.php'); /** * NoCrossContaminationGroupTest method diff --git a/cake/tests/groups/routing_system.group.php b/cake/tests/groups/routing_system.group.php index ccbdb4c88..542002dc9 100644 --- a/cake/tests/groups/routing_system.group.php +++ b/cake/tests/groups/routing_system.group.php @@ -34,7 +34,7 @@ class RoutingSystemGroupTest extends TestSuite { * @var string 'Routing system' * @access public */ - var $label = 'Router and Dispatcher'; + public $label = 'Router and Dispatcher'; /** * RoutingSystemGroupTest method diff --git a/cake/tests/groups/socket.group.php b/cake/tests/groups/socket.group.php index 4df351096..63b7b7d34 100644 --- a/cake/tests/groups/socket.group.php +++ b/cake/tests/groups/socket.group.php @@ -40,7 +40,7 @@ class SocketGroupTest extends TestSuite { * @var string 'Socket and HttpSocket tests' * @access public */ - var $label = 'CakeSocket and HttpSocket tests'; + public $label = 'CakeSocket and HttpSocket tests'; /** * SocketGroupTest method diff --git a/cake/tests/groups/test_suite.group.php b/cake/tests/groups/test_suite.group.php index bc0f8bdd0..ba2dd433e 100644 --- a/cake/tests/groups/test_suite.group.php +++ b/cake/tests/groups/test_suite.group.php @@ -34,7 +34,7 @@ class TestSuiteGroupTest extends TestSuite { * @var string 'Socket and HttpSocket tests' * @access public */ - var $label = 'TestSuite'; + public $label = 'TestSuite'; /** * TestSuiteGroupTest method diff --git a/cake/tests/groups/view.group.php b/cake/tests/groups/view.group.php index c61706bde..139e12e8f 100644 --- a/cake/tests/groups/view.group.php +++ b/cake/tests/groups/view.group.php @@ -34,7 +34,7 @@ class ViewsGroupTest extends TestSuite { * @var string 'All core views' * @access public */ - var $label = 'View and ThemeView'; + public $label = 'View and ThemeView'; /** * ViewsGroupTest method diff --git a/cake/tests/groups/xml.group.php b/cake/tests/groups/xml.group.php index 70ed6f7e9..5025822b7 100644 --- a/cake/tests/groups/xml.group.php +++ b/cake/tests/groups/xml.group.php @@ -34,7 +34,7 @@ class XmlGroupTest extends TestSuite { * @var string 'All core views' * @access public */ - var $label = 'Xml based classes (Xml, XmlHelper and RssHelper)'; + public $label = 'Xml based classes (Xml, XmlHelper and RssHelper)'; /** * XmlGroupTest method diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index e83e9f343..d62a3a8b8 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -38,8 +38,8 @@ class CakeTestDispatcher extends Dispatcher { * @var Controller * @access public */ - var $controller; - var $testCase; + public $controller; + public $testCase; /** * testCase method @@ -92,7 +92,7 @@ class CakeTestCase extends UnitTestCase { * @var array * @access public */ - var $methods = array('start', 'end', 'startcase', 'endcase', 'starttest', 'endtest'); + public $methods = array('start', 'end', 'startcase', 'endcase', 'starttest', 'endtest'); /** * By default, all fixtures attached to this class will be truncated and reloaded after each test. @@ -101,7 +101,7 @@ class CakeTestCase extends UnitTestCase { * @var array * @access public */ - var $autoFixtures = true; + public $autoFixtures = true; /** * Set this to false to avoid tables to be dropped if they already exist @@ -109,7 +109,7 @@ class CakeTestCase extends UnitTestCase { * @var boolean * @access public */ - var $dropTables = true; + public $dropTables = true; /** * Maps fixture class names to fixture identifiers as included in CakeTestCase::$fixtures @@ -731,7 +731,7 @@ function _initDb() { } /** - * Load fixtures specified in var $fixtures. + * Load fixtures specified in public $fixtures. * * @return void * @access protected diff --git a/cake/tests/lib/cake_test_fixture.php b/cake/tests/lib/cake_test_fixture.php index f460fadd3..5e0b065af 100644 --- a/cake/tests/lib/cake_test_fixture.php +++ b/cake/tests/lib/cake_test_fixture.php @@ -31,21 +31,21 @@ class CakeTestFixture extends Object { * * @var string */ - var $name = null; + public $name = null; /** * Cake's DBO driver (e.g: DboMysql). * * @access public */ - var $db = null; + public $db = null; /** * Full Table Name * * @access public */ - var $table = null; + public $table = null; /** * Instantiate the fixture. diff --git a/cake/tests/lib/cake_test_model.php b/cake/tests/lib/cake_test_model.php index 46d01d973..8cd730e20 100644 --- a/cake/tests/lib/cake_test_model.php +++ b/cake/tests/lib/cake_test_model.php @@ -26,7 +26,7 @@ * @subpackage cake.cake.tests.lib */ class CakeTestModel extends Model { - var $useDbConfig = 'test_suite'; - var $cacheSources = false; + public $useDbConfig = 'test_suite'; + public $cacheSources = false; } ?> \ No newline at end of file diff --git a/cake/tests/lib/cake_test_suite_dispatcher.php b/cake/tests/lib/cake_test_suite_dispatcher.php index 27cd06be3..718ac4dd3 100644 --- a/cake/tests/lib/cake_test_suite_dispatcher.php +++ b/cake/tests/lib/cake_test_suite_dispatcher.php @@ -30,7 +30,7 @@ class CakeTestSuiteDispatcher { * * @var array */ - var $params = array( + public $params = array( 'codeCoverage' => false, 'group' => null, 'case' => null, @@ -53,7 +53,7 @@ class CakeTestSuiteDispatcher { * * @var TestManager subclass */ - var $Manager; + public $Manager; /** * Baseurl for the request diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index 3b2827ae7..18a9e08cf 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -34,14 +34,14 @@ class CodeCoverageManager { * * @var string */ - var $appTest = false; + public $appTest = false; /** * Is this an app test case? * * @var string */ - var $pluginTest = false; + public $pluginTest = false; /** * Is this a grouptest? @@ -49,28 +49,28 @@ class CodeCoverageManager { * @var string * @access public */ - var $groupTest = false; + public $groupTest = false; /** * The test case file to analyze * * @var string */ - var $testCaseFile = ''; + public $testCaseFile = ''; /** * The currently used CakeTestReporter * * @var string */ - var $reporter = ''; + public $reporter = ''; /** * undocumented variable * * @var string */ - var $numDiffContextLines = 7; + public $numDiffContextLines = 7; /** * Returns a singleton instance diff --git a/cake/tests/lib/reporter/cake_base_reporter.php b/cake/tests/lib/reporter/cake_base_reporter.php index cc4b2cd60..25760718b 100644 --- a/cake/tests/lib/reporter/cake_base_reporter.php +++ b/cake/tests/lib/reporter/cake_base_reporter.php @@ -55,7 +55,7 @@ class CakeBaseReporter extends SimpleReporter { * * @var array */ - var $params = array(); + public $params = array(); /** * Character set for the output of test reporting. diff --git a/cake/tests/lib/reporter/cake_cli_reporter.php b/cake/tests/lib/reporter/cake_cli_reporter.php index 654cfce2e..838d39d8c 100644 --- a/cake/tests/lib/reporter/cake_cli_reporter.php +++ b/cake/tests/lib/reporter/cake_cli_reporter.php @@ -39,14 +39,14 @@ class CakeCliReporter extends CakeBaseReporter { * * @var string */ - var $separator = '->'; + public $separator = '->'; /** * array of 'request' parameters * * @var array */ - var $params = array(); + public $params = array(); /** * Constructor diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index 92e6e7850..ef5470940 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -49,14 +49,14 @@ class TestManager { * * @var boolean */ - var $appTest = false; + public $appTest = false; /** * Is this test a plugin test? * * @var mixed boolean false or string name of the plugin being used. */ - var $pluginTest = false; + public $pluginTest = false; /** * Constructor for the TestManager class diff --git a/cake/tests/test_app/controllers/tests_apps_controller.php b/cake/tests/test_app/controllers/tests_apps_controller.php index 69047642c..9c753082e 100644 --- a/cake/tests/test_app/controllers/tests_apps_controller.php +++ b/cake/tests/test_app/controllers/tests_apps_controller.php @@ -18,8 +18,8 @@ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ class TestsAppsController extends AppController { - var $name = 'TestsApps'; - var $uses = array(); + public $name = 'TestsApps'; + public $uses = array(); function index() { } diff --git a/cake/tests/test_app/controllers/tests_apps_posts_controller.php b/cake/tests/test_app/controllers/tests_apps_posts_controller.php index 49f396d4d..4aafd0465 100644 --- a/cake/tests/test_app/controllers/tests_apps_posts_controller.php +++ b/cake/tests/test_app/controllers/tests_apps_posts_controller.php @@ -18,9 +18,9 @@ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ class TestsAppsPostsController extends AppController { - var $name = 'TestsAppsPosts'; - var $uses = array('Post'); - var $viewPath = 'tests_apps'; + public $name = 'TestsAppsPosts'; + public $uses = array('Post'); + public $viewPath = 'tests_apps'; function add() { $data = array( diff --git a/cake/tests/test_app/models/comment.php b/cake/tests/test_app/models/comment.php index 585e8ebfa..c392e50af 100644 --- a/cake/tests/test_app/models/comment.php +++ b/cake/tests/test_app/models/comment.php @@ -20,7 +20,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ class Comment extends AppModel { - var $useTable = 'comments'; - var $name = 'Comment'; + public $useTable = 'comments'; + public $name = 'Comment'; } ?> \ No newline at end of file diff --git a/cake/tests/test_app/models/persister_one.php b/cake/tests/test_app/models/persister_one.php index c12c0ebad..748cad86b 100644 --- a/cake/tests/test_app/models/persister_one.php +++ b/cake/tests/test_app/models/persister_one.php @@ -20,11 +20,11 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ class PersisterOne extends AppModel { - var $useTable = 'posts'; - var $name = 'PersisterOne'; + public $useTable = 'posts'; + public $name = 'PersisterOne'; - var $actsAs = array('PersisterOneBehavior', 'TestPlugin.TestPluginPersisterOne'); + public $actsAs = array('PersisterOneBehavior', 'TestPlugin.TestPluginPersisterOne'); - var $hasMany = array('Comment', 'TestPlugin.TestPluginComment'); + public $hasMany = array('Comment', 'TestPlugin.TestPluginComment'); } ?> \ No newline at end of file diff --git a/cake/tests/test_app/models/persister_two.php b/cake/tests/test_app/models/persister_two.php index 0a2916055..8e99fc8e4 100644 --- a/cake/tests/test_app/models/persister_two.php +++ b/cake/tests/test_app/models/persister_two.php @@ -20,11 +20,11 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ class PersisterTwo extends AppModel { - var $useTable = 'posts'; - var $name = 'PersisterTwo'; + public $useTable = 'posts'; + public $name = 'PersisterTwo'; - var $actsAs = array('PersisterOneBehavior', 'TestPlugin.TestPluginPersisterOne'); + public $actsAs = array('PersisterOneBehavior', 'TestPlugin.TestPluginPersisterOne'); - var $hasMany = array('Comment', 'TestPlugin.TestPluginComment'); + public $hasMany = array('Comment', 'TestPlugin.TestPluginComment'); } ?> \ No newline at end of file diff --git a/cake/tests/test_app/models/post.php b/cake/tests/test_app/models/post.php index bd9188c28..437a4d545 100644 --- a/cake/tests/test_app/models/post.php +++ b/cake/tests/test_app/models/post.php @@ -20,7 +20,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ class Post extends AppModel { - var $useTable = 'posts'; - var $name = 'Post'; + public $useTable = 'posts'; + public $name = 'Post'; } ?> \ No newline at end of file diff --git a/cake/tests/test_app/plugins/test_plugin/config/schema/schema.php b/cake/tests/test_app/plugins/test_plugin/config/schema/schema.php index dad4327c8..edf2126cc 100644 --- a/cake/tests/test_app/plugins/test_plugin/config/schema/schema.php +++ b/cake/tests/test_app/plugins/test_plugin/config/schema/schema.php @@ -21,9 +21,9 @@ */ class TestPluginAppSchema extends CakeSchema { - var $name = 'TestPluginApp'; + public $name = 'TestPluginApp'; - var $acos = array( + public $acos = array( 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), 'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), 'model' => array('type'=>'string', 'null' => true), diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php b/cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php index 7c80630d4..917bde880 100644 --- a/cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php +++ b/cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php @@ -18,6 +18,6 @@ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ class PluginsComponentComponent extends Object { - var $components = array('TestPlugin.OtherComponent'); + public $components = array('TestPlugin.OtherComponent'); } ?> \ No newline at end of file diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php b/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php index 3121c55e2..8c8f1433c 100644 --- a/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php +++ b/cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php @@ -18,6 +18,6 @@ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ class TestPluginComponentComponent extends Object { - var $components = array('TestPlugin.TestPluginOtherComponent'); + public $components = array('TestPlugin.TestPluginOtherComponent'); } ?> \ No newline at end of file diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/test_plugin_controller.php b/cake/tests/test_app/plugins/test_plugin/controllers/test_plugin_controller.php index 1259638f2..eecbc1e86 100644 --- a/cake/tests/test_app/plugins/test_plugin/controllers/test_plugin_controller.php +++ b/cake/tests/test_app/plugins/test_plugin/controllers/test_plugin_controller.php @@ -18,7 +18,7 @@ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ class TestPluginController extends TestPluginAppController { - var $uses = array(); + public $uses = array(); function index() { $this->autoRender = false; diff --git a/cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php b/cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php index 20ea25dc9..de925dfba 100644 --- a/cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php +++ b/cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php @@ -18,10 +18,10 @@ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ class TestsController extends TestPluginAppController { - var $name = 'Tests'; - var $uses = array(); - var $helpers = array('TestPlugin.OtherHelper', 'Html'); - var $components = array('TestPlugin.PluginsComponent'); + public $name = 'Tests'; + public $uses = array(); + public $helpers = array('TestPlugin.OtherHelper', 'Html'); + public $components = array('TestPlugin.PluginsComponent'); function index() { } diff --git a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_auth_user.php b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_auth_user.php index 9732b7371..3b6bb53b4 100644 --- a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_auth_user.php +++ b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_auth_user.php @@ -27,14 +27,14 @@ class TestPluginAuthUser extends TestPluginAppModel { * * @var string */ - var $name = 'TestPluginAuthUser'; + public $name = 'TestPluginAuthUser'; /** * useTable property * * @var string */ - var $useTable = 'auth_users'; + public $useTable = 'auth_users'; /** * useDbConfig property @@ -42,5 +42,5 @@ class TestPluginAuthUser extends TestPluginAppModel { * @var string 'test_suite' * @access public */ - var $useDbConfig = 'test_suite'; + public $useDbConfig = 'test_suite'; } \ No newline at end of file diff --git a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php index f447c3735..75a6b184f 100644 --- a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php +++ b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_authors.php @@ -24,7 +24,7 @@ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ class TestPluginAuthors extends TestPluginAppModel { - var $useTable = 'authors'; - var $name = 'TestPluginAuthors'; + public $useTable = 'authors'; + public $name = 'TestPluginAuthors'; } ?> \ No newline at end of file diff --git a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php index 84fbf0c98..d63ddc285 100644 --- a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php +++ b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_comment.php @@ -24,7 +24,7 @@ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ class TestPluginComment extends TestPluginAppModel { - var $useTable = 'test_plugin_comments'; - var $name = 'TestPluginComment'; + public $useTable = 'test_plugin_comments'; + public $name = 'TestPluginComment'; } ?> \ No newline at end of file diff --git a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php index fa8ec0e1c..317c582b6 100644 --- a/cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php +++ b/cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php @@ -26,12 +26,12 @@ class TestPluginPost extends TestPluginAppModel { * * @var string */ - var $name = 'Post'; + public $name = 'Post'; /** * useTable property * * @var string */ - var $useTable = 'posts'; + public $useTable = 'posts'; } \ No newline at end of file diff --git a/cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php b/cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php index e94d6810b..d4db02539 100644 --- a/cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php +++ b/cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php @@ -18,6 +18,6 @@ * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License */ class PluggedHelperHelper extends AppHelper { - var $helpers = array('TestPlugin.OtherHelper'); + public $helpers = array('TestPlugin.OtherHelper'); } ?> \ No newline at end of file From e1e96e213acae3fccfa37529986a3fbc60a163f1 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Sun, 4 Apr 2010 17:14:14 +1000 Subject: [PATCH 1874/2083] Changed public vars to use public keyword in app/ --- app/config/core.php | 4 ++-- app/config/database.php.default | 4 ++-- app/config/schema/db_acl.php | 8 ++++---- app/config/schema/i18n.php | 4 ++-- app/config/schema/sessions.php | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/config/core.php b/app/config/core.php index 66ca1b2d2..3a052a673 100644 --- a/app/config/core.php +++ b/app/config/core.php @@ -97,8 +97,8 @@ * Enable cache checking. * * If set to true, for view caching you must still use the controller - * var $cacheAction inside your controllers to define caching settings. - * You can either set it controller-wide by setting var $cacheAction = true, + * public $cacheAction inside your controllers to define caching settings. + * You can either set it controller-wide by setting public $cacheAction = true, * or in each action using $this->cacheAction = true. * */ diff --git a/app/config/database.php.default b/app/config/database.php.default index 8549025a6..cf9a6327c 100644 --- a/app/config/database.php.default +++ b/app/config/database.php.default @@ -73,7 +73,7 @@ */ class DATABASE_CONFIG { - var $default = array( + public $default = array( 'driver' => 'mysql', 'persistent' => false, 'host' => 'localhost', @@ -83,7 +83,7 @@ class DATABASE_CONFIG { 'prefix' => '', ); - var $test = array( + public $test = array( 'driver' => 'mysql', 'persistent' => false, 'host' => 'localhost', diff --git a/app/config/schema/db_acl.php b/app/config/schema/db_acl.php index 7fc92c3ed..6979d34c9 100644 --- a/app/config/schema/db_acl.php +++ b/app/config/schema/db_acl.php @@ -28,7 +28,7 @@ */ class DbAclSchema extends CakeSchema { - var $name = 'DbAcl'; + public $name = 'DbAcl'; function before($event = array()) { return true; @@ -37,7 +37,7 @@ function before($event = array()) { function after($event = array()) { } - var $acos = array( + public $acos = array( 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), 'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), 'model' => array('type'=>'string', 'null' => true), @@ -48,7 +48,7 @@ function after($event = array()) { 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) ); - var $aros = array( + public $aros = array( 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), 'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10), 'model' => array('type'=>'string', 'null' => true), @@ -59,7 +59,7 @@ function after($event = array()) { 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)) ); - var $aros_acos = array( + public $aros_acos = array( 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), 'aro_id' => array('type'=>'integer', 'null' => false, 'length' => 10, 'key' => 'index'), 'aco_id' => array('type'=>'integer', 'null' => false, 'length' => 10), diff --git a/app/config/schema/i18n.php b/app/config/schema/i18n.php index bcf133dec..dcd64bdd4 100644 --- a/app/config/schema/i18n.php +++ b/app/config/schema/i18n.php @@ -28,7 +28,7 @@ */ class i18nSchema extends CakeSchema { - var $name = 'i18n'; + public $name = 'i18n'; function before($event = array()) { return true; @@ -37,7 +37,7 @@ function before($event = array()) { function after($event = array()) { } - var $i18n = array( + public $i18n = array( 'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'), 'locale' => array('type'=>'string', 'null' => false, 'length' => 6, 'key' => 'index'), 'model' => array('type'=>'string', 'null' => false, 'key' => 'index'), diff --git a/app/config/schema/sessions.php b/app/config/schema/sessions.php index a5a0952cf..dd7880fa8 100644 --- a/app/config/schema/sessions.php +++ b/app/config/schema/sessions.php @@ -28,7 +28,7 @@ */ class SessionsSchema extends CakeSchema { - var $name = 'Sessions'; + public $name = 'Sessions'; function before($event = array()) { return true; @@ -37,7 +37,7 @@ function before($event = array()) { function after($event = array()) { } - var $cake_sessions = array( + public $cake_sessions = array( 'id' => array('type'=>'string', 'null' => false, 'key' => 'primary'), 'data' => array('type'=>'text', 'null' => true, 'default' => NULL), 'expires' => array('type'=>'integer', 'null' => true, 'default' => NULL), From 97388d2e6196139e1e8d539dc603339e2430ea2c Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Sun, 4 Apr 2010 17:21:01 +1000 Subject: [PATCH 1875/2083] Fixed access to protected property in CakeSession tests. --- cake/tests/cases/libs/cake_session.test.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cake/tests/cases/libs/cake_session.test.php b/cake/tests/cases/libs/cake_session.test.php index 3ccde6372..2730d4212 100644 --- a/cake/tests/cases/libs/cake_session.test.php +++ b/cake/tests/cases/libs/cake_session.test.php @@ -21,6 +21,12 @@ App::import('Core', 'CakeSession'); } +class TestCakeSession extends CakeSession { + public function setUserAgent($value) { + $this->_userAgent = $value; + } +} + /** * CakeSessionTest class * @@ -67,7 +73,7 @@ function endCase() { * @return void */ function setUp() { - $this->Session =& new CakeSession(); + $this->Session =& new TestCakeSession(); $this->Session->start(); $this->Session->_checkValid(); } @@ -331,7 +337,7 @@ function testReadingSavedEmpty() { */ function testCheckUserAgentFalse() { Configure::write('Session.checkAgent', false); - $this->Session->_userAgent = md5('http://randomdomainname.com' . Configure::read('Security.salt')); + $this->Session->setUserAgent(md5('http://randomdomainname.com' . Configure::read('Security.salt'))); $this->assertTrue($this->Session->valid()); } @@ -343,7 +349,7 @@ function testCheckUserAgentFalse() { */ function testCheckUserAgentTrue() { Configure::write('Session.checkAgent', true); - $this->Session->_userAgent = md5('http://randomdomainname.com' . Configure::read('Security.salt')); + $this->Session->setUserAgent(md5('http://randomdomainname.com' . Configure::read('Security.salt'))); $this->assertFalse($this->Session->valid()); } From 3c2e7a091d0a3c3ee34b2c2515b248a0bce2702e Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Sun, 4 Apr 2010 18:17:43 +1000 Subject: [PATCH 1876/2083] Changed access to private __associations on Model to associations() calls. --- cake/libs/model/datasources/datasource.php | 2 +- cake/libs/model/datasources/dbo/dbo_oracle.php | 4 ++-- cake/libs/model/datasources/dbo_source.php | 6 +++--- cake/libs/model/model.php | 10 ++++++++++ .../cases/libs/model/datasources/dbo_source.test.php | 4 ++-- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/cake/libs/model/datasources/datasource.php b/cake/libs/model/datasources/datasource.php index 7bc700c7e..c23ce9b03 100644 --- a/cake/libs/model/datasources/datasource.php +++ b/cake/libs/model/datasources/datasource.php @@ -527,7 +527,7 @@ function insertQueryData($query, $data, $association, $assocData, &$model, &$lin } break; case '{$__cakeForeignKey__$}': - foreach ($model->__associations as $id => $name) { + foreach ($model->associations() as $id => $name) { foreach ($model->$name as $assocName => $assoc) { if ($assocName === $association) { if (isset($assoc['foreignKey'])) { diff --git a/cake/libs/model/datasources/dbo/dbo_oracle.php b/cake/libs/model/datasources/dbo/dbo_oracle.php index 063dc4764..3734e4e43 100644 --- a/cake/libs/model/datasources/dbo/dbo_oracle.php +++ b/cake/libs/model/datasources/dbo/dbo_oracle.php @@ -1026,7 +1026,7 @@ function queryAssociation(&$model, &$linkModel, $type, $association, $assocData, if (!empty($fetch) && is_array($fetch)) { if ($recursive > 0) { - foreach ($linkModel->__associations as $type1) { + foreach ($linkModel->associations() as $type1) { foreach ($linkModel->{$type1} as $assoc1 => $assocData1) { $deepModel =& $linkModel->{$assoc1}; $tmpStack = $stack; @@ -1088,7 +1088,7 @@ function queryAssociation(&$model, &$linkModel, $type, $association, $assocData, if (!empty($fetch) && is_array($fetch)) { if ($recursive > 0) { - foreach ($linkModel->__associations as $type1) { + foreach ($linkModel->associations() as $type1) { foreach ($linkModel->{$type1} as $assoc1 => $assocData1) { $deepModel =& $linkModel->{$assoc1}; diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 55416c63c..e2a845f72 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -779,7 +779,7 @@ function read(&$model, $queryData = array(), $recursive = null) { $queryData['fields'] = $this->fields($model); } - $_associations = $model->__associations; + $_associations = $model->associations(); if ($model->recursive == -1) { $_associations = array(); @@ -922,7 +922,7 @@ function queryAssociation(&$model, &$linkModel, $type, $association, $assocData, if (!empty($fetch) && is_array($fetch)) { if ($recursive > 0) { - foreach ($linkModel->__associations as $type1) { + foreach ($linkModel->associations() as $type1) { foreach ($linkModel->{$type1} as $assoc1 => $assocData1) { $deepModel =& $linkModel->{$assoc1}; $tmpStack = $stack; @@ -991,7 +991,7 @@ function queryAssociation(&$model, &$linkModel, $type, $association, $assocData, if (!empty($fetch) && is_array($fetch)) { if ($recursive > 0) { - foreach ($linkModel->__associations as $type1) { + foreach ($linkModel->associations() as $type1) { foreach ($linkModel->{$type1} as $assoc1 => $assocData1) { $deepModel =& $linkModel->{$assoc1}; diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index ab26e8dae..59035bcb6 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -2814,6 +2814,16 @@ function &getDataSource() { return $db; } +/** + * Get associations + * + * @return array + * @access public + */ + function associations() { + return $this->__associations; + } + /** * Gets all the models with which this model is associated. * diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index bee5967a5..c87476e12 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -1400,7 +1400,7 @@ function testGenerateAssociationQuerySelfJoin() { $queryData = array(); - foreach ($this->Model->Category2->__associations as $type) { + foreach ($this->Model->Category2->associations() as $type) { foreach ($this->Model->Category2->{$type} as $assoc => $assocData) { $linkModel =& $this->Model->Category2->{$assoc}; $external = isset($assocData['external']); @@ -2185,7 +2185,7 @@ function testGenerateAssociationQueryHasAndBelongsToManyWithPageAndLimit() { * @return void */ function _buildRelatedModels(&$model) { - foreach ($model->__associations as $type) { + foreach ($model->associations() as $type) { foreach ($model->{$type} as $assoc => $assocData) { if (is_string($assocData)) { $className = $assocData; From 3039645a179f1de68e0479f79bec44529ef6497e Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Sun, 4 Apr 2010 18:34:49 +1000 Subject: [PATCH 1877/2083] Fix testing of protected baseConfig in CakeSocket. --- cake/tests/cases/libs/cake_socket.test.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/cake/tests/cases/libs/cake_socket.test.php b/cake/tests/cases/libs/cake_socket.test.php index 7b49d9cec..de0774ae4 100644 --- a/cake/tests/cases/libs/cake_socket.test.php +++ b/cake/tests/cases/libs/cake_socket.test.php @@ -55,29 +55,28 @@ function tearDown() { */ function testConstruct() { $this->Socket->__construct(); - $baseConfig = $this->Socket->_baseConfig; - $this->assertIdentical($baseConfig, array( + $config = $this->Socket->config; + $this->assertIdentical($config, array( 'persistent' => false, 'host' => 'localhost', - 'protocol' => 'tcp', + 'protocol' => getprotobyname('tcp'), 'port' => 80, 'timeout' => 30 )); $this->Socket->reset(); $this->Socket->__construct(array('host' => 'foo-bar')); - $baseConfig['host'] = 'foo-bar'; - $baseConfig['protocol'] = getprotobyname($baseConfig['protocol']); - $this->assertIdentical($this->Socket->config, $baseConfig); + $config['host'] = 'foo-bar'; + $this->assertIdentical($this->Socket->config, $config); $this->Socket = new CakeSocket(array('host' => 'www.cakephp.org', 'port' => 23, 'protocol' => 'udp')); - $baseConfig = $this->Socket->_baseConfig; + $config = $this->Socket->config; - $baseConfig['host'] = 'www.cakephp.org'; - $baseConfig['port'] = 23; - $baseConfig['protocol'] = 17; + $config['host'] = 'www.cakephp.org'; + $config['port'] = 23; + $config['protocol'] = 17; - $this->assertIdentical($this->Socket->config, $baseConfig); + $this->assertIdentical($this->Socket->config, $config); } /** From 45ccba5d946696b4709fc8f344f3ef46b5c835ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Sun, 4 Apr 2010 13:24:39 -0430 Subject: [PATCH 1878/2083] Improving virtual fields fetching when the field wildcard selector * in present on the fields array, closes #524 --- cake/libs/model/datasources/dbo_source.php | 1 + .../libs/model/datasources/dbo_source.test.php | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 8c3da9226..42799b1ca 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -1944,6 +1944,7 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) { $fields = String::tokenize($fields); } $fields = array_values(array_filter($fields)); + $allFields = $allFields || in_array('*', $fields) || in_array($model->alias . '.*', $fields); $virtual = array(); $virtualFields = $model->getVirtualField(); diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index 096f2eeca..fb7c34b7d 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -4267,6 +4267,24 @@ function testVirtualFields() { '(NOW()) AS `Article__this_moment`', ); $this->assertEqual($expected, $result); + + $result = $this->db->fields($Article, null, array('Article.*')); + $expected = array( + '`Article`.*', + '(NOW()) AS `Article__this_moment`', + '(1 + 1) AS `Article__two`', + '(SELECT COUNT(*) FROM comments WHERE `Article`.`id` = `comments`.`article_id`) AS `Article__comment_count`' + ); + $this->assertEqual($expected, $result); + + $result = $this->db->fields($Article, null, array('*')); + $expected = array( + '*', + '(NOW()) AS `Article__this_moment`', + '(1 + 1) AS `Article__two`', + '(SELECT COUNT(*) FROM comments WHERE `Article`.`id` = `comments`.`article_id`) AS `Article__comment_count`' + ); + $this->assertEqual($expected, $result); } /** From bdd8811924d3d0b4123bee2585439a1e0bbd7cf0 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 4 Apr 2010 16:34:07 -0400 Subject: [PATCH 1879/2083] Removing plugin shortcuts entirely. --- cake/libs/router.php | 73 +--------------- cake/tests/cases/libs/router.test.php | 118 -------------------------- 2 files changed, 2 insertions(+), 189 deletions(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index bccd2b271..e95549ddd 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -572,20 +572,14 @@ function __connectDefaultRoutes() { foreach ($plugins as $key => $value) { $plugins[$key] = Inflector::underscore($value); } - $pluginPiped = implode('|', $plugins); - $match = array('plugin' => $pluginPiped); - $shortPlugin = array('plugin' => $pluginPiped, 'routeClass' => 'PluginShortRoute'); + $match = array('plugin' => implode('|', $plugins)); foreach ($this->__prefixes as $prefix) { $params = array('prefix' => $prefix, $prefix => true); $indexParams = $params + array('action' => 'index'); - $this->connect("/{$prefix}/:plugin", $indexParams, $shortPlugin); - $this->connect("/{$prefix}/:plugin/:action/*", $params, $shortPlugin); $this->connect("/{$prefix}/:plugin/:controller", $indexParams, $match); $this->connect("/{$prefix}/:plugin/:controller/:action/*", $params, $match); } - $this->connect('/:plugin', array('action' => 'index'), $shortPlugin); - $this->connect('/:plugin/:action/*', array(), $shortPlugin); $this->connect('/:plugin/:controller', array('action' => 'index'), $match); $this->connect('/:plugin/:controller/:action/*', array(), $match); } @@ -925,7 +919,7 @@ function _handleNoRoute($url) { $urlOut = array_filter(array($url['controller'], $url['action'])); - if (isset($url['plugin']) && $url['plugin'] != $url['controller']) { + if (isset($url['plugin'])) { array_unshift($urlOut, $url['plugin']); } @@ -1550,10 +1544,6 @@ function match($url) { * @access protected */ function _writeUrl($params) { - if (isset($params['plugin'], $params['controller']) && $params['plugin'] === $params['controller']) { - unset($params['controller']); - } - if (isset($params['prefix'], $params['action'])) { $params['action'] = str_replace($params['prefix'] . '_', '', $params['action']); unset($params['prefix']); @@ -1595,63 +1585,4 @@ function _writeUrl($params) { return $out; } } - -/** - * PluginShortRoute is a specialized route class to handle routes - * where the controller and plugin are named the same. It allows you - * to omit the controller key from the template and the defaults. - * When a url is parsed, this class will attempt to import a controller - * with the same name. If that succeeds the request array will be modified. - * - * @package cake.libs - */ -class PluginShortRoute extends CakeRoute { -/** - * A cache for all the plugins in the application - * - * @var string - */ - var $_plugins = array(); -/** - * Constructor Sets up the plugin sets. - * - * @return void - */ - function PluginShortRoute($template, $defaults = array(), $options = array()) { - parent::CakeRoute($template, $defaults, $options); - $plugins = App::objects('plugin'); - foreach ($plugins as $plugin) { - $this->_plugins[Inflector::underscore($plugin)] = true; - } - } -/** - * Parses urls and creates the correct request parameter set. - * If there is no controller available in the plugin with the same - * name as the plugin, this route cannot pass. - * - * @param string $url Url string to parse. - * @return mixed False on failure, or an array of request parameters - */ - function parse($url) { - $params = parent::parse($url); - if ( - $params == false || - !isset($params['plugin']) || - (isset($params['plugin']) && !isset($this->_plugins[$params['plugin']])) - ) { - return false; - } - $pluginName = Inflector::camelize($params['plugin']); - $controllerName = $pluginName . '.' . $pluginName; - if (!App::import('Controller', $controllerName)) { - return false; - } - if (!method_exists($pluginName . 'Controller', $params['action'])) { - return false; - } - $params['controller'] = $params['plugin']; - return $params; - } - -} ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 70d384a34..4617fa244 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -745,59 +745,6 @@ function testUrlGenerationPlugins() { $this->assertEqual($result, $expected); } -/** - * test that plugin short cut routes behave properly. Parse and reverse route correctly. - * - * @return void - */ - function testPluginShortcutRoutes() { - App::build(array( - 'plugins' => array( - TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS - ) - ), true); - App::objects('plugin', null, false); - Configure::write('Routing.prefixes', array('admin')); - Router::reload(); - - $result = Router::url(array('plugin' => 'test_plugin', 'controller' => 'test_plugin', 'action' => 'index')); - $this->assertEqual($result, '/test_plugin', 'Plugin shortcut index action failed.'); - - $result = Router::url(array('plugin' => 'test_plugin', 'controller' => 'test_plugin', 'action' => 'view', 1)); - $this->assertEqual($result, '/test_plugin/view/1', 'Plugin shortcut with passed args failed.'); - - $result = Router::url(array( - 'plugin' => 'test_plugin', 'controller' => 'test_plugin', 'action' => 'view', - 1, 'sort' => 'title', 'dir' => 'asc' - )); - $this->assertEqual( - $result, '/test_plugin/view/1/sort:title/dir:asc', 'Plugin shortcut with passed + named args failed.' - ); - - $result = Router::parse('/test_plugin'); - $this->assertEqual($result['plugin'], 'test_plugin'); - $this->assertEqual($result['controller'], 'test_plugin'); - $this->assertEqual($result['action'], 'index'); - - $result = Router::parse('/test_plugin/add'); - $this->assertEqual($result['plugin'], 'test_plugin'); - $this->assertEqual($result['controller'], 'test_plugin'); - $this->assertEqual($result['action'], 'add'); - - $result = Router::parse('/admin/test_plugin'); - $this->assertEqual($result['plugin'], 'test_plugin'); - $this->assertEqual($result['controller'], 'test_plugin'); - $this->assertEqual($result['action'], 'index'); - $this->assertEqual($result['prefix'], 'admin'); - - $result = Router::parse('/admin/test_plugin/add/1'); - $this->assertEqual($result['plugin'], 'test_plugin'); - $this->assertEqual($result['controller'], 'test_plugin'); - $this->assertEqual($result['action'], 'add'); - $this->assertEqual($result['prefix'], 'admin'); - $this->assertEqual($result['pass'], array(1)); - } - /** * test that you can leave active plugin routes with plugin = null * @@ -2469,69 +2416,4 @@ function testParse() { } } -/** - * Test case for PluginShortRoute - * - * @package cake.test.cases.libs - */ -class PluginShortRouteTestCase extends CakeTestCase { -/** - * startTest method - * - * @access public - * @return void - */ - function startTest() { - $this->_routing = Configure::read('Routing'); - Configure::write('Routing', array('admin' => null, 'prefixes' => array())); - - App::build(array( - 'plugins' => array( - TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS - ) - )); - App::objects('plugin', null, false); - Router::reload(); - } - -/** - * end the test and reset the environment - * - * @return void - **/ - function endTest() { - Configure::write('Routing', $this->_routing); - App::build(); - } - -/** - * test the parsing for plugin short routes. - * - * @return void - */ - function testParsing() { - $route =& new PluginShortRoute('/:plugin', array('action' => 'index')); - - $result = $route->parse('/non_existant_plugin'); - $this->assertFalse($result, 'Route matched when it should fail.'); - - $result = $route->parse('/test_plugin'); - $this->assertEqual($result['plugin'], 'test_plugin'); - $this->assertEqual($result['controller'], 'test_plugin'); - $this->assertEqual($result['action'], 'index'); - - $route =& new PluginShortRoute('/:plugin/:action/*'); - - $result = $route->parse('/test_plugin/add'); - $this->assertEqual($result['plugin'], 'test_plugin'); - $this->assertEqual($result['controller'], 'test_plugin'); - $this->assertEqual($result['action'], 'add'); - - $result = $route->parse('/test_plugin/add/1'); - $this->assertEqual($result['plugin'], 'test_plugin'); - $this->assertEqual($result['controller'], 'test_plugin'); - $this->assertEqual($result['action'], 'add'); - $this->assertEqual($result['_args_'], '1', 'Passed args were wrong.'); - } -} ?> \ No newline at end of file From 14b6a7ac5ec6a7716d4acef6517c957edebd50b5 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Mon, 5 Apr 2010 08:57:40 +1000 Subject: [PATCH 1880/2083] Fixing access to private and protected variables in Xml class. --- cake/libs/xml.php | 26 ++++++++++++------------- cake/tests/cases/libs/xml.test.php | 31 ++++++++++++++++++++++++------ 2 files changed, 38 insertions(+), 19 deletions(-) diff --git a/cake/libs/xml.php b/cake/libs/xml.php index d4fbd1828..0c714dc44 100644 --- a/cake/libs/xml.php +++ b/cake/libs/xml.php @@ -302,10 +302,10 @@ function normalize($object, $keyName = null, $options = array()) { * @access private */ function __tagOptions($name, $option = null) { - if (isset($this->__tags[$name])) { - $tagOpts = $this->__tags[$name]; - } elseif (isset($this->__tags[strtolower($name)])) { - $tagOpts = $this->__tags[strtolower($name)]; + if (isset($this->_tags[$name])) { + $tagOpts = $this->_tags[$name]; + } elseif (isset($this->_tags[strtolower($name)])) { + $tagOpts = $this->_tags[strtolower($name)]; } else { return null; } @@ -810,18 +810,18 @@ class Xml extends XmlNode { * XML document header * * @var string - * @access private + * @access protected */ - private $__header = null; + protected $_header = null; /** * Default array keys/object properties to use as tag names when converting objects or array * structures to XML. Set by passing $options['tags'] to this object's constructor. * * @var array - * @access private + * @access protected */ - private $__tags = array(); + protected $_tags = array(); /** * XML document version @@ -868,7 +868,7 @@ function __construct($input = null, $options = array()) { foreach (array('version', 'encoding', 'namespaces') as $key) { $this->{$key} = $options[$key]; } - $this->__tags = $options['tags']; + $this->_tags = $options['tags']; parent::__construct('#document'); if ($options['root'] !== '#document') { @@ -898,7 +898,7 @@ function load($input) { return false; } $this->__rawData = null; - $this->__header = null; + $this->_header = null; if (strstr($input, "<")) { $this->__rawData = $input; @@ -926,7 +926,7 @@ function load($input) { function parse() { $this->__initParser(); $this->__rawData = trim($this->__rawData); - $this->__header = trim(str_replace( + $this->_header = trim(str_replace( array('<' . '?', '?' . '>'), array('', ''), substr($this->__rawData, 0, strpos($this->__rawData, '?' . '>')) @@ -1098,8 +1098,8 @@ function toString($options = array()) { $data = parent::toString($options, 0); if ($options['header']) { - if (!empty($this->__header)) { - return $this->header($this->__header) . "\n" . $data; + if (!empty($this->_header)) { + return $this->header($this->_header) . "\n" . $data; } return $this->header() . "\n" . $data; } diff --git a/cake/tests/cases/libs/xml.test.php b/cake/tests/cases/libs/xml.test.php index c8358210a..376a3c7b0 100644 --- a/cake/tests/cases/libs/xml.test.php +++ b/cake/tests/cases/libs/xml.test.php @@ -19,6 +19,25 @@ */ App::import('Core', 'Xml'); +/** + * Test XML Class + * + * @package cake + * @subpackage cake.tests.cases.libs + */ +class TestXml extends Xml { + +/** + * Return the protected _header instance variable + * + * @return string Header + * @access public + */ + function getHeader() { + return $this->_header; + } +} + /** * XmlTest class * @@ -488,17 +507,17 @@ function testParsingWithNonStandardWhitespace() { $raw = '<?xml version="1.0" encoding="ISO-8859-1" ?><prices><price>1.0</price></prices>'; $array = array('Prices' => array('price' => 1.0)); - $xml = new Xml($raw); + $xml = new TestXml($raw); $this->assertEqual($xml->toArray(), $array); - $this->assertEqual($xml->__header, 'xml version="1.0" encoding="ISO-8859-1"'); + $this->assertEqual($xml->getHeader(), 'xml version="1.0" encoding="ISO-8859-1"'); - $xml = new Xml(' ' . $raw); + $xml = new TestXml(' ' . $raw); $this->assertEqual($xml->toArray(), $array); - $this->assertEqual($xml->__header, 'xml version="1.0" encoding="ISO-8859-1"'); + $this->assertEqual($xml->getHeader(), 'xml version="1.0" encoding="ISO-8859-1"'); - $xml = new Xml("\n" . $raw); + $xml = new TestXml("\n" . $raw); $this->assertEqual($xml->toArray(), $array); - $this->assertEqual($xml->__header, 'xml version="1.0" encoding="ISO-8859-1"'); + $this->assertEqual($xml->getHeader(), 'xml version="1.0" encoding="ISO-8859-1"'); } /* Not implemented yet */ From d990c6ed44afa8e670f9029dde17b8117db1f501 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 4 Apr 2010 21:43:29 -0400 Subject: [PATCH 1881/2083] Adding tests for single quoted attributes to assertTags(). Because of the __array_permute works ensuring quotes match is a non-trivial problem. Fixing single quoted attributes not being matchable with assertTags(). Fixes #539 --- cake/tests/cases/libs/cake_test_case.test.php | 35 +++++++++++++++++-- cake/tests/lib/cake_test_case.php | 9 +++-- 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/cake/tests/cases/libs/cake_test_case.test.php b/cake/tests/cases/libs/cake_test_case.test.php index b138d7a76..dd11366f2 100644 --- a/cake/tests/cases/libs/cake_test_case.test.php +++ b/cake/tests/cases/libs/cake_test_case.test.php @@ -138,7 +138,7 @@ function testAssertGoodTags() { 'My link', '/a' ); - $this->assertTrue($this->Case->assertTags($input, $pattern)); + $this->assertTrue($this->Case->assertTags($input, $pattern), 'Attributes in wrong order. %s'); $input = "<a href=\"/test.html\"\t\n\tclass=\"active\"\tid=\"primary\">\t<span>My link</span></a>"; $pattern = array( @@ -148,7 +148,7 @@ function testAssertGoodTags() { '/span', '/a' ); - $this->assertTrue($this->Case->assertTags($input, $pattern)); + $this->assertTrue($this->Case->assertTags($input, $pattern), 'Whitespace consumption %s'); $input = '<p class="info"><a href="/test.html" class="active"><strong onClick="alert(\'hey\');">My link</strong></a></p>'; $pattern = array( @@ -163,6 +163,37 @@ function testAssertGoodTags() { $this->assertTrue($this->Case->assertTags($input, $pattern)); } +/** + * test that assertTags knows how to handle correct quoting. + * + * @return void + */ + function testAssertTagsQuotes() { + $input = '<a href="/test.html" class="active">My link</a>'; + $pattern = array( + 'a' => array('href' => '/test.html', 'class' => 'active'), + 'My link', + '/a' + ); + $this->assertTrue($this->Case->assertTags($input, $pattern), 'Double quoted attributes %s'); + + $input = "<a href='/test.html' class='active'>My link</a>"; + $pattern = array( + 'a' => array('href' => '/test.html', 'class' => 'active'), + 'My link', + '/a' + ); + $this->assertTrue($this->Case->assertTags($input, $pattern), 'Single quoted attributes %s'); + + $input = "<a href='/test.html' class='active'>My link</a>"; + $pattern = array( + 'a' => array('href' => 'preg:/.*\.html/', 'class' => 'active'), + 'My link', + '/a' + ); + $this->assertTrue($this->Case->assertTags($input, $pattern), 'Single quoted attributes %s'); + } + /** * testNumericValuesInExpectationForAssertTags * diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index b27636db2..5f9341387 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -631,30 +631,33 @@ function assertTags($string, $expected, $fullDebug = false) { } $attrs = array(); $explanations = array(); + $i = 1; foreach ($attributes as $attr => $val) { if (is_numeric($attr) && preg_match('/^preg\:\/(.+)\/$/i', $val, $matches)) { $attrs[] = $matches[1]; $explanations[] = sprintf('Regex "%s" matches', $matches[1]); continue; } else { - $quotes = '"'; + $quotes = '["\']'; if (is_numeric($attr)) { $attr = $val; $val = '.+?'; $explanations[] = sprintf('Attribute "%s" present', $attr); } elseif (!empty($val) && preg_match('/^preg\:\/(.+)\/$/i', $val, $matches)) { - $quotes = '"?'; + $quotes = '["\']?'; $val = $matches[1]; $explanations[] = sprintf('Attribute "%s" matches "%s"', $attr, $val); } else { $explanations[] = sprintf('Attribute "%s" == "%s"', $attr, $val); $val = preg_quote($val, '/'); } - $attrs[] = '[\s]+'.preg_quote($attr, '/').'='.$quotes.$val.$quotes; + $attrs[] = '[\s]+' . preg_quote($attr, '/') . '=' . $quotes . $val . $quotes; } + $i++; } if ($attrs) { $permutations = $this->__array_permute($attrs); + $permutationTokens = array(); foreach ($permutations as $permutation) { $permutationTokens[] = implode('', $permutation); From 91332fc64bf85b977f253daad17167dd6e293f64 Mon Sep 17 00:00:00 2001 From: Juan Basso <jrbasso@gmail.com> Date: Sun, 4 Apr 2010 18:06:31 -0300 Subject: [PATCH 1882/2083] Removing pluralize of pluralized name. Fixes #543 Signed-off-by: Mark Story <mark@mark-story.com> --- cake/console/libs/shell.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php index c4d6c212d..1d615fcca 100644 --- a/cake/console/libs/shell.php +++ b/cake/console/libs/shell.php @@ -632,7 +632,7 @@ function _singularHumanName($name) { * @access protected */ function _pluralHumanName($name) { - return Inflector::humanize(Inflector::underscore(Inflector::pluralize($name))); + return Inflector::humanize(Inflector::underscore($name)); } /** From dde52399cad6fd123ca49a138d3b81123d331f54 Mon Sep 17 00:00:00 2001 From: sdoney <sdoney@gmail.com> Date: Sun, 4 Apr 2010 21:12:13 -0400 Subject: [PATCH 1883/2083] Adding @link tags pointing to cookbook sections Signed-off-by: Mark Story <mark@mark-story.com> --- cake/libs/controller/components/acl.php | 4 +++ cake/libs/controller/components/auth.php | 25 +++++++++++++++++++ cake/libs/controller/components/cookie.php | 1 + cake/libs/controller/components/email.php | 3 +++ .../controller/components/request_handler.php | 1 + cake/libs/controller/components/security.php | 10 ++++++++ cake/libs/controller/components/session.php | 8 ++++++ cake/libs/view/helper.php | 1 + cake/libs/view/helpers/ajax.php | 15 +++++++++++ cake/libs/view/helpers/cache.php | 1 + cake/libs/view/helpers/form.php | 24 ++++++++++++++++++ cake/libs/view/helpers/html.php | 17 +++++++++++++ cake/libs/view/helpers/javascript.php | 1 + cake/libs/view/helpers/number.php | 6 +++++ cake/libs/view/helpers/paginator.php | 1 + cake/libs/view/helpers/rss.php | 1 + cake/libs/view/helpers/session.php | 6 +++++ cake/libs/view/helpers/text.php | 9 +++++++ cake/libs/view/helpers/time.php | 20 +++++++++++++++ cake/libs/view/helpers/xml.php | 4 +++ 20 files changed, 158 insertions(+) diff --git a/cake/libs/controller/components/acl.php b/cake/libs/controller/components/acl.php index 8b2d68c7d..7f992ddb0 100644 --- a/cake/libs/controller/components/acl.php +++ b/cake/libs/controller/components/acl.php @@ -29,6 +29,7 @@ * * @package cake * @subpackage cake.cake.libs.controller.components + * @link http://book.cakephp.org/view/1242/Access-Control-Lists */ class AclComponent extends Object { @@ -257,6 +258,7 @@ function initialize(&$component) { * @param string $action Action (defaults to *) * @return boolean Success (true if ARO has access to action in ACO, false otherwise) * @access public + * @link http://book.cakephp.org/view/1249/Checking-Permissions-The-ACL-Component */ function check($aro, $aco, $action = "*") { if ($aro == null || $aco == null) { @@ -348,6 +350,7 @@ function check($aro, $aco, $action = "*") { * @param integer $value Value to indicate access type (1 to give access, -1 to deny, 0 to inherit) * @return boolean Success * @access public + * @link http://book.cakephp.org/view/1248/Assigning-Permissions */ function allow($aro, $aco, $actions = "*", $value = 1) { $perms = $this->getAclLink($aro, $aco); @@ -399,6 +402,7 @@ function allow($aro, $aco, $actions = "*", $value = 1) { * @param string $actions Action (defaults to *) * @return boolean Success * @access public + * @link http://book.cakephp.org/view/1248/Assigning-Permissions */ function deny($aro, $aco, $action = "*") { return $this->allow($aro, $aco, $action, -1); diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index 4236f614d..1376b960e 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -29,6 +29,7 @@ * * @package cake * @subpackage cake.cake.libs.controller.components + * @link http://book.cakephp.org/view/1250/Authentication */ class AuthComponent extends Object { @@ -53,6 +54,7 @@ class AuthComponent extends Object { * * @var object * @access public + * @link http://book.cakephp.org/view/1278/authenticate */ var $authenticate = null; @@ -66,6 +68,7 @@ class AuthComponent extends Object { * * @var mixed * @access public + * @link http://book.cakephp.org/view/1275/authorize */ var $authorize = false; @@ -75,6 +78,7 @@ class AuthComponent extends Object { * * @var string * @access public + * @link http://book.cakephp.org/view/1277/ajaxLogin */ var $ajaxLogin = null; @@ -91,6 +95,7 @@ class AuthComponent extends Object { * * @var string * @access public + * @link http://book.cakephp.org/view/1266/userModel */ var $userModel = 'User'; @@ -100,6 +105,7 @@ class AuthComponent extends Object { * * @var array * @access public + * @link http://book.cakephp.org/view/1268/userScope */ var $userScope = array(); @@ -109,6 +115,7 @@ class AuthComponent extends Object { * * @var array * @access public + * @link http://book.cakephp.org/view/1267/fields */ var $fields = array('username' => 'username', 'password' => 'password'); @@ -118,6 +125,7 @@ class AuthComponent extends Object { * * @var string * @access public + * @link http://book.cakephp.org/view/1276/sessionKey */ var $sessionKey = null; @@ -129,6 +137,7 @@ class AuthComponent extends Object { * * @var string * @access public + * @link http://book.cakephp.org/view/1279/actionPath */ var $actionPath = null; @@ -138,6 +147,7 @@ class AuthComponent extends Object { * * @var mixed * @access public + * @link http://book.cakephp.org/view/1269/loginAction */ var $loginAction = null; @@ -149,6 +159,7 @@ class AuthComponent extends Object { * * @var mixed * @access public + * @link http://book.cakephp.org/view/1270/loginRedirect */ var $loginRedirect = null; @@ -161,6 +172,7 @@ class AuthComponent extends Object { * @access public * @see AuthComponent::$loginAction * @see AuthComponent::logout() + * @link http://book.cakephp.org/view/1271/logoutRedirect */ var $logoutRedirect = null; @@ -178,6 +190,7 @@ class AuthComponent extends Object { * * @var string * @access public + * @link http://book.cakephp.org/view/1272/loginError */ var $loginError = null; @@ -187,6 +200,7 @@ class AuthComponent extends Object { * * @var string * @access public + * @link http://book.cakephp.org/view/1273/authError */ var $authError = null; @@ -195,6 +209,7 @@ class AuthComponent extends Object { * * @var boolean * @access public + * @link http://book.cakephp.org/view/1274/autoRedirect */ var $autoRedirect = true; @@ -204,6 +219,7 @@ class AuthComponent extends Object { * @var array * @access public * @see AuthComponent::allow() + * @link http://book.cakephp.org/view/1251/Setting-Auth-Component-Variables */ var $allowedActions = array(); @@ -590,6 +606,7 @@ function __authType($auth = null) { * @param string ... etc. * @return void * @access public + * @link http://book.cakephp.org/view/1257/allow */ function allow() { $args = func_get_args(); @@ -612,6 +629,7 @@ function allow() { * @return void * @see AuthComponent::allow() * @access public + * @link http://book.cakephp.org/view/1258/deny */ function deny() { $args = func_get_args(); @@ -633,6 +651,7 @@ function deny() { * @param array $map Actions to map * @return void * @access public + * @link http://book.cakephp.org/view/1260/mapActions */ function mapActions($map = array()) { $crud = array('create', 'read', 'update', 'delete'); @@ -658,6 +677,7 @@ function mapActions($map = array()) { * @param mixed $data User object * @return boolean True on login success, false on failure * @access public + * @link http://book.cakephp.org/view/1261/login */ function login($data = null) { $this->__setDefaults(); @@ -681,6 +701,7 @@ function login($data = null) { * @return string AuthComponent::$loginAction * @see AuthComponent::$loginAction * @access public + * @link http://book.cakephp.org/view/1262/logout */ function logout() { $this->__setDefaults(); @@ -696,6 +717,7 @@ function logout() { * @param string $key field to retrive. Leave null to get entire User record * @return mixed User record. or null if no user is logged in. * @access public + * @link http://book.cakephp.org/view/1264/user */ function user($key = null) { $this->__setDefaults(); @@ -770,6 +792,7 @@ function validate($object, $user = null, $action = null) { * none is specified. * @return boolean ACO node path * @access public + * @link http://book.cakephp.org/view/1256/action */ function action($action = ':plugin/:controller/:action') { $plugin = empty($this->params['plugin']) ? null : Inflector::camelize($this->params['plugin']) . '/'; @@ -892,6 +915,7 @@ function identify($user = null, $conditions = null) { * @param array $data Set of data to look for passwords * @return array Data with passwords hashed * @access public + * @link http://book.cakephp.org/view/1259/hashPasswords */ function hashPasswords($data) { if (is_object($this->authenticate) && method_exists($this->authenticate, 'hashPasswords')) { @@ -913,6 +937,7 @@ function hashPasswords($data) { * @param string $password Password to hash * @return string Hashed password * @access public + * @link http://book.cakephp.org/view/1263/password */ function password($password) { return Security::hash($password, null, true); diff --git a/cake/libs/controller/components/cookie.php b/cake/libs/controller/components/cookie.php index 4b24d3343..6edfb298e 100644 --- a/cake/libs/controller/components/cookie.php +++ b/cake/libs/controller/components/cookie.php @@ -30,6 +30,7 @@ * * @package cake * @subpackage cake.cake.libs.controller.components + * @link http://book.cakephp.org/view/1280/Cookies * */ class CookieComponent extends Object { diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index 73de46195..b04c8343d 100755 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -27,6 +27,7 @@ * * @package cake * @subpackage cake.cake.libs.controller.components + * @link http://book.cakephp.org/view/1283/Email * */ class EmailComponent extends Object{ @@ -225,6 +226,7 @@ class EmailComponent extends Object{ * * @var array * @access public + * @link http://book.cakephp.org/view/1290/Sending-A-Message-Using-SMTP */ var $smtpOptions = array( 'port'=> 25, 'host' => 'localhost', 'timeout' => 30 @@ -390,6 +392,7 @@ function send($content = null, $template = null, $layout = null) { * Reset all EmailComponent internal variables to be able to send out a new email. * * @access public + * @link http://book.cakephp.org/view/1285/Sending-Multiple-Emails-in-a-loop */ function reset() { $this->template = null; diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php index ef166baac..6d2c1e96c 100644 --- a/cake/libs/controller/components/request_handler.php +++ b/cake/libs/controller/components/request_handler.php @@ -25,6 +25,7 @@ * * @package cake * @subpackage cake.cake.libs.controller.components + * @link http://book.cakephp.org/view/1291/Request-Handling * */ class RequestHandlerComponent extends Object { diff --git a/cake/libs/controller/components/security.php b/cake/libs/controller/components/security.php index 4c5aaeb5a..b206b0a0e 100644 --- a/cake/libs/controller/components/security.php +++ b/cake/libs/controller/components/security.php @@ -23,6 +23,7 @@ * * @package cake * @subpackage cake.cake.libs.controller.components + * @link http://book.cakephp.org/view/1296/Security-Component */ class SecurityComponent extends Object { @@ -215,6 +216,7 @@ function startup(&$controller) { * * @return void * @access public + * @link http://book.cakephp.org/view/1299/requirePost */ function requirePost() { $args = func_get_args(); @@ -259,6 +261,7 @@ function requireDelete() { * * @return void * @access public + * @link http://book.cakephp.org/view/1300/requireSecure */ function requireSecure() { $args = func_get_args(); @@ -270,6 +273,7 @@ function requireSecure() { * * @return void * @access public + * @link http://book.cakephp.org/view/1301/requireAuth */ function requireAuth() { $args = func_get_args(); @@ -281,6 +285,7 @@ function requireAuth() { * * @return void * @access public + * @link http://book.cakephp.org/view/1302/requireLogin */ function requireLogin() { $args = func_get_args(); @@ -306,6 +311,7 @@ function requireLogin() { * @param string $type Either 'basic', 'digest', or null. If null/empty, will try both. * @return mixed If successful, returns an array with login name and password, otherwise null. * @access public + * @link http://book.cakephp.org/view/1303/loginCredentials-string-type */ function loginCredentials($type = null) { switch (strtolower($type)) { @@ -345,6 +351,7 @@ function loginCredentials($type = null) { * @param array $options Set of options for header * @return string HTTP-authentication request header * @access public + * @link http://book.cakephp.org/view/1304/loginRequest-array-options */ function loginRequest($options = array()) { $options = array_merge($this->loginOptions, $options); @@ -367,6 +374,7 @@ function loginRequest($options = array()) { * @param string $digest Digest authentication response * @return array Digest authentication parameters * @access public + * @link http://book.cakephp.org/view/1305/parseDigestAuthData-string-digest */ function parseDigestAuthData($digest) { if (substr($digest, 0, 7) == 'Digest ') { @@ -395,6 +403,7 @@ function parseDigestAuthData($digest) { * @return string Digest authentication hash * @access public * @see SecurityComponent::parseDigestAuthData() + * @link http://book.cakephp.org/view/1306/generateDigestResponseHash-array-data */ function generateDigestResponseHash($data) { return md5( @@ -413,6 +422,7 @@ function generateDigestResponseHash($data) { * @return mixed If specified, controller blackHoleCallback's response, or no return otherwise * @access public * @see SecurityComponent::$blackHoleCallback + * @link http://book.cakephp.org/view/1307/blackHole-object-controller-string-error */ function blackHole(&$controller, $error = '') { if ($this->blackHoleCallback == null) { diff --git a/cake/libs/controller/components/session.php b/cake/libs/controller/components/session.php index fbe572009..3027c1441 100644 --- a/cake/libs/controller/components/session.php +++ b/cake/libs/controller/components/session.php @@ -28,6 +28,7 @@ * * @package cake * @subpackage cake.cake.libs.controller.components + * @link http://book.cakephp.org/view/1310/Sessions * */ class SessionComponent extends CakeSession { @@ -99,6 +100,7 @@ function activate($base = null) { * @param string $value The value you want to store in a session. * @return boolean Success * @access public + * @link http://book.cakephp.org/view/1312/write */ function write($name, $value = null) { if ($this->__active === true) { @@ -128,6 +130,7 @@ function write($name, $value = null) { * @param string $name the name of the session key you want to read * @return mixed value from the session vars * @access public + * @link http://book.cakephp.org/view/1314/read */ function read($name = null) { if ($this->__active === true) { @@ -145,6 +148,7 @@ function read($name = null) { * @param string $name the name of the session key you want to delete * @return boolean true is session variable is set and can be deleted, false is variable was not set. * @access public + * @link http://book.cakephp.org/view/1316/delete */ function delete($name) { if ($this->__active === true) { @@ -162,6 +166,7 @@ function delete($name) { * @param string $name the name of the session key you want to check * @return boolean true is session variable is set, false if not * @access public + * @link http://book.cakephp.org/view/1315/check */ function check($name) { if ($this->__active === true) { @@ -178,6 +183,7 @@ function check($name) { * * @return string Last session error * @access public + * @link http://book.cakephp.org/view/1318/error */ function error() { if ($this->__active === true) { @@ -199,6 +205,7 @@ function error() { * @param array $params Parameters to be sent to layout as view variables * @param string $key Message key, default is 'flash' * @access public + * @link http://book.cakephp.org/view/1313/setFlash */ function setFlash($message, $element = 'default', $params = array(), $key = 'flash') { if ($this->__active === true) { @@ -245,6 +252,7 @@ function valid() { * * @return void * @access public + * @link http://book.cakephp.org/view/1317/destroy */ function destroy() { if ($this->__active === true) { diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index c37348da7..5f8ff75c0 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -182,6 +182,7 @@ function loadConfig($name = 'tags') { * @param boolean $full If true, the full base URL will be prepended to the result * @return string Full translated URL with base path. * @access public + * @link http://book.cakephp.org/view/1448/url */ function url($url = null, $full = false) { return h(Router::url($url, $full)); diff --git a/cake/libs/view/helpers/ajax.php b/cake/libs/view/helpers/ajax.php index e84eb87a9..73c105e69 100644 --- a/cake/libs/view/helpers/ajax.php +++ b/cake/libs/view/helpers/ajax.php @@ -27,6 +27,7 @@ * * @package cake * @subpackage cake.cake.libs.view.helpers + * @link http://book.cakephp.org/view/1358/AJAX */ class AjaxHelper extends AppHelper { @@ -207,6 +208,7 @@ class AjaxHelper extends AppHelper { * @param string $confirm Confirmation message. Calls up a JavaScript confirm() message. * * @return string HTML code for link to remote action + * @link http://book.cakephp.org/view/1363/link */ function link($title, $url = null, $options = array(), $confirm = null) { if (!isset($url)) { @@ -250,6 +252,7 @@ function link($title, $url = null, $options = array(), $confirm = null) { * @param array $options options for javascript * @return string html code for link to remote action * @see AjaxHelper::link() for docs on options parameter. + * @link http://book.cakephp.org/view/1364/remoteFunction */ function remoteFunction($options) { if (isset($options['update'])) { @@ -307,6 +310,7 @@ function remoteFunction($options) { * @param array $options Callback options * @return string Javascript code * @see AjaxHelper::link() + * @link http://book.cakephp.org/view/1365/remoteTimer */ function remoteTimer($options = null) { $frequency = (isset($options['frequency'])) ? $options['frequency'] : 10; @@ -333,6 +337,7 @@ function remoteTimer($options = null) { * @param array $options Callback/HTML options * @return string JavaScript/HTML code * @see AjaxHelper::link() + * @link http://book.cakephp.org/view/1366/form */ function form($params = null, $type = 'post', $options = array()) { $model = false; @@ -372,6 +377,7 @@ function form($params = null, $type = 'post', $options = array()) { * @param array $options Callback options * @return string Ajaxed input button * @see AjaxHelper::form() + * @link http://book.cakephp.org/view/1367/submit */ function submit($title = 'Submit', $options = array()) { $htmlOptions = $this->__getHtmlOptions($options); @@ -419,6 +425,7 @@ function submit($title = 'Submit', $options = array()) { * @param string $field DOM ID of field to observe * @param array $options ajax options * @return string ajax script + * @link http://book.cakephp.org/view/1368/observeField */ function observeField($field, $options = array()) { if (!isset($options['with'])) { @@ -444,6 +451,7 @@ function observeField($field, $options = array()) { * @param string $form DOM ID of form to observe * @param array $options ajax options * @return string ajax script + * @link http://book.cakephp.org/view/1369/observeForm */ function observeForm($form, $options = array()) { if (!isset($options['with'])) { @@ -470,6 +478,7 @@ function observeForm($form, $options = array()) { * @param string $url URL for the autocomplete action * @param array $options Ajax options * @return string Ajax script + * @link http://book.cakephp.org/view/1370/autoComplete */ function autoComplete($field, $url = "", $options = array()) { $var = ''; @@ -562,6 +571,7 @@ function divEnd($id) { * Detects Ajax requests * * @return boolean True if the current request is a Prototype Ajax update call + * @link http://book.cakephp.org/view/1371/isAjax */ function isAjax() { return (isset($this->params['isAjax']) && $this->params['isAjax'] === true); @@ -574,6 +584,7 @@ function isAjax() { * @param unknown_type $id * @param array $options * @return unknown + * @link http://book.cakephp.org/view/1372/drag-drop */ function drag($id, $options = array()) { $var = ''; @@ -594,6 +605,7 @@ function drag($id, $options = array()) { * @param unknown_type $id * @param array $options * @return string + * @link http://book.cakephp.org/view/1372/drag-drop */ function drop($id, $options = array()) { $optionsString = array('overlap', 'hoverclass'); @@ -645,6 +657,7 @@ function dropRemote($id, $options = array(), $ajaxOptions = array()) { * @param string $trackId DOM ID of slider track * @param array $options Array of options to control the slider * @link http://github.com/madrobby/scriptaculous/wikis/slider + * @link http://book.cakephp.org/view/1373/slider */ function slider($id, $trackId, $options = array()) { if (isset($options['var'])) { @@ -683,6 +696,7 @@ function slider($id, $trackId, $options = array()) { * @param string $url Postback URL of saved data * @param array $options Array of options to control the editor, including ajaxOptions (see link). * @link http://github.com/madrobby/scriptaculous/wikis/ajax-inplaceeditor + * @link http://book.cakephp.org/view/1374/editor */ function editor($id, $url, $options = array()) { $url = $this->url($url); @@ -726,6 +740,7 @@ function editor($id, $url, $options = array()) { * @param string $id DOM ID of parent * @param array $options Array of options to control sort. * @link http://github.com/madrobby/scriptaculous/wikis/sortable + * @link http://book.cakephp.org/view/1375/sortable */ function sortable($id, $options = array()) { if (!empty($options['url'])) { diff --git a/cake/libs/view/helpers/cache.php b/cake/libs/view/helpers/cache.php index 35d05f80a..a4d579cd5 100644 --- a/cake/libs/view/helpers/cache.php +++ b/cake/libs/view/helpers/cache.php @@ -26,6 +26,7 @@ * * @package cake * @subpackage cake.cake.libs.view.helpers + * @link http://book.cakephp.org/view/1376/Cache */ class CacheHelper extends AppHelper { diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index c086ba777..f92197190 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -27,6 +27,7 @@ * * @package cake * @subpackage cake.cake.libs.view.helpers + * @link http://book.cakephp.org/view/1383/Form */ class FormHelper extends AppHelper { @@ -184,6 +185,7 @@ function _isRequiredField($validateProperties) { * @param string $model The model object which the form is being defined for * @param array $options An array of html attributes and options. * @return string An formatted opening FORM tag. + * @link http://book.cakephp.org/view/1384/Creating-Forms */ function create($model = null, $options = array()) { $created = $id = false; @@ -337,6 +339,7 @@ function create($model = null, $options = array()) { * @param mixed $options as a string will use $options as the value of button, * @return string a closing FORM tag optional submit button. * @access public + * @link http://book.cakephp.org/view/1389/Closing-the-Form */ function end($options = null) { if (!empty($this->params['models'])) { @@ -448,6 +451,7 @@ function __secure($field = null, $value = null) { * @param string $field This should be "Modelname.fieldname" * @return boolean If there are errors this method returns true, else false. * @access public + * @link http://book.cakephp.org/view/1426/isFieldError */ function isFieldError($field) { $this->setEntity($field); @@ -469,6 +473,7 @@ function isFieldError($field) { * @param array $options Rendering options for <div /> wrapper tag * @return string If there are errors this method returns an error message, otherwise null. * @access public + * @link http://book.cakephp.org/view/1423/error */ function error($field, $text = null, $options = array()) { $defaults = array('wrap' => true, 'class' => 'error-message', 'escape' => true); @@ -523,6 +528,7 @@ function error($field, $text = null, $options = array()) { * @param string $text Text that will appear in the label field. * @param mixed $options An array of HTML attributes, or a string, to be used as a class name. * @return string The formatted LABEL element + * @link http://book.cakephp.org/view/1427/label */ function label($fieldName = null, $text = null, $options = array()) { if (empty($fieldName)) { @@ -681,6 +687,7 @@ function inputs($fields = null, $blacklist = null) { * @param array $options Each type of input takes different options. * @return string Completed form widget. * @access public + * @link http://book.cakephp.org/view/1390/Automagic-Form-Elements */ function input($fieldName, $options = array()) { $this->setEntity($fieldName); @@ -974,6 +981,7 @@ function _inputLabel($fieldName, $label, $options) { * @param array $options Array of HTML attributes. * @return string An HTML text input element. * @access public + * @link http://book.cakephp.org/view/1414/checkbox */ function checkbox($fieldName, $options = array()) { $options = $this->_initInputField($fieldName, $options) + array('hiddenField' => true); @@ -1022,6 +1030,7 @@ function checkbox($fieldName, $options = array()) { * @param array $attributes Array of HTML attributes, and special attributes above. * @return string Completed radio widget set. * @access public + * @link http://book.cakephp.org/view/1429/radio */ function radio($fieldName, $options = array(), $attributes = array()) { $attributes = $this->_initInputField($fieldName, $attributes); @@ -1105,6 +1114,7 @@ function radio($fieldName, $options = array(), $attributes = array()) { * @param array $options Array of HTML attributes. * @return string A generated HTML text input element * @access public + * @link http://book.cakephp.org/view/1432/text */ function text($fieldName, $options = array()) { $options = $this->_initInputField($fieldName, array_merge( @@ -1124,6 +1134,7 @@ function text($fieldName, $options = array()) { * @param array $options Array of HTML attributes. * @return string A generated password input. * @access public + * @link http://book.cakephp.org/view/1428/password */ function password($fieldName, $options = array()) { $options = $this->_initInputField($fieldName, $options); @@ -1145,6 +1156,7 @@ function password($fieldName, $options = array()) { * @param array $options Array of HTML attributes, and special options above. * @return string A generated HTML text input element * @access public + * @link http://book.cakephp.org/view/1433/textarea */ function textarea($fieldName, $options = array()) { $options = $this->_initInputField($fieldName, $options); @@ -1172,6 +1184,7 @@ function textarea($fieldName, $options = array()) { * @param array $options Array of HTML attributes. * @return string A generated hidden input * @access public + * @link http://book.cakephp.org/view/1425/hidden */ function hidden($fieldName, $options = array()) { $secure = true; @@ -1203,6 +1216,7 @@ function hidden($fieldName, $options = array()) { * @param array $options Array of HTML attributes. * @return string A generated file input. * @access public + * @link http://book.cakephp.org/view/1424/file */ function file($fieldName, $options = array()) { $options = array_merge($options, array('secure' => false)); @@ -1230,6 +1244,7 @@ function file($fieldName, $options = array()) { * @param array $options Array of options and HTML attributes. * @return string A HTML button tag. * @access public + * @link http://book.cakephp.org/view/1415/button */ function button($title, $options = array()) { $options += array('type' => 'submit', 'escape' => false); @@ -1271,6 +1286,7 @@ function button($title, $options = array()) { * @param array $options Array of options. See above. * @return string A HTML submit button * @access public + * @link http://book.cakephp.org/view/1431/submit */ function submit($caption = null, $options = array()) { if (!$caption) { @@ -1382,6 +1398,7 @@ function submit($caption = null, $options = array()) { * @param array $attributes The HTML attributes of the select element. * @return string Formatted SELECT element * @access public + * @link http://book.cakephp.org/view/1430/select */ function select($fieldName, $options = array(), $selected = null, $attributes = array()) { $select = array(); @@ -1480,6 +1497,7 @@ function select($fieldName, $options = array(), $selected = null, $attributes = * @param array $attributes HTML attributes for the select element * @return string A generated day select box. * @access public + * @link http://book.cakephp.org/view/1419/day */ function day($fieldName, $selected = null, $attributes = array()) { $attributes += array('empty' => true); @@ -1510,6 +1528,7 @@ function day($fieldName, $selected = null, $attributes = array()) { * @param array $attributes Attribute array for the select elements. * @return string Completed year select input * @access public + * @link http://book.cakephp.org/view/1416/year */ function year($fieldName, $minYear = null, $maxYear = null, $selected = null, $attributes = array()) { $attributes += array('empty' => true); @@ -1562,6 +1581,7 @@ function year($fieldName, $minYear = null, $maxYear = null, $selected = null, $a * @param array $attributes Attributes for the select element * @return string A generated month select dropdown. * @access public + * @link http://book.cakephp.org/view/1417/month */ function month($fieldName, $selected = null, $attributes = array()) { $attributes += array('empty' => true); @@ -1598,6 +1618,7 @@ function month($fieldName, $selected = null, $attributes = array()) { * @param array $attributes List of HTML attributes * @return string Completed hour select input * @access public + * @link http://book.cakephp.org/view/1420/hour */ function hour($fieldName, $format24Hours = false, $selected = null, $attributes = array()) { $attributes += array('empty' => true); @@ -1632,6 +1653,7 @@ function hour($fieldName, $format24Hours = false, $selected = null, $attributes * @param string $attributes Array of Attributes * @return string Completed minute select input. * @access public + * @link http://book.cakephp.org/view/1421/minute */ function minute($fieldName, $selected = null, $attributes = array()) { $attributes += array('empty' => true); @@ -1695,6 +1717,7 @@ function __dateTimeSelected($select, $fieldName, $selected, $attributes) { * @param bool $showEmpty Show/Hide an empty option * @return string Completed meridian select input * @access public + * @link http://book.cakephp.org/view/1422/meridian */ function meridian($fieldName, $selected = null, $attributes = array()) { $attributes += array('empty' => true); @@ -1743,6 +1766,7 @@ function meridian($fieldName, $selected = null, $attributes = array()) { * @param string $attributes array of Attributes * @return string Generated set of select boxes for the date and time formats chosen. * @access public + * @link http://book.cakephp.org/view/1418/dateTime */ function dateTime($fieldName, $dateFormat = 'DMY', $timeFormat = '12', $selected = null, $attributes = array()) { $attributes += array('empty' => true); diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php index 3161a96fb..840c7f3ea 100644 --- a/cake/libs/view/helpers/html.php +++ b/cake/libs/view/helpers/html.php @@ -24,6 +24,7 @@ * * @package cake * @subpackage cake.cake.libs.view.helpers + * @link http://book.cakephp.org/view/1434/HTML */ class HtmlHelper extends AppHelper { /** @@ -159,6 +160,7 @@ function addCrumb($name, $link = null, $options = null) { * @param string $type Doctype to use. * @return string Doctype string * @access public + * @link http://book.cakephp.org/view/1439/docType */ function docType($type = 'xhtml-strict') { if (isset($this->__docTypes[$type])) { @@ -180,6 +182,7 @@ function docType($type = 'xhtml-strict') { * rss, atom, or icon, the mime-type is returned. * @return string A completed `<link />` element. * @access public + * @link http://book.cakephp.org/view/1438/meta */ function meta($type, $url = null, $options = array()) { $inline = isset($options['inline']) ? $options['inline'] : true; @@ -245,6 +248,7 @@ function meta($type, $url = null, $options = array()) { * The App.encoding value will be used. Example: "utf-8". * @return string A meta tag containing the specified character set. * @access public + * @link http://book.cakephp.org/view/1436/charset */ function charset($charset = null) { if (empty($charset)) { @@ -272,6 +276,7 @@ function charset($charset = null) { * @param string $confirmMessage JavaScript confirmation message. * @return string An `<a />` element. * @access public + * @link http://book.cakephp.org/view/1442/link */ function link($title, $url = null, $options = array(), $confirmMessage = false) { $escapeTitle = true; @@ -326,6 +331,7 @@ function link($title, $url = null, $options = array(), $confirmMessage = false) * @param array $options Array of HTML attributes. * @return string CSS <link /> or <style /> tag, depending on the type of link. * @access public + * @link http://book.cakephp.org/view/1437/css */ function css($path, $rel = null, $options = array()) { $options += array('inline' => true); @@ -398,6 +404,7 @@ function css($path, $rel = null, $options = array()) { * @return mixed String of `<script />` tags or null if $inline is false or if $once is true and the file has been * included before. * @access public + * @link http://book.cakephp.org/view/1589/script */ function script($url, $options = array()) { if (is_bool($options)) { @@ -456,6 +463,7 @@ function script($url, $options = array()) { * @param array $options The options to use. * @return mixed string or null depending on the value of `$options['inline']` * @access public + * @link http://book.cakephp.org/view/1604/scriptBlock */ function scriptBlock($script, $options = array()) { $options += array('safe' => true, 'inline' => true); @@ -487,6 +495,7 @@ function scriptBlock($script, $options = array()) { * @param array $options Options for the code block. * @return void * @access public + * @link http://book.cakephp.org/view/1605/scriptStart */ function scriptStart($options = array()) { $options += array('safe' => true, 'inline' => true); @@ -502,6 +511,7 @@ function scriptStart($options = array()) { * * @return mixed depending on the settings of scriptStart() either a script tag or null * @access public + * @link http://book.cakephp.org/view/1606/scriptEnd */ function scriptEnd() { $buffer = ob_get_clean(); @@ -526,6 +536,7 @@ function scriptEnd() { * @param boolean $oneline Whether or not the style block should be displayed on one line. * @return string CSS styling data * @access public + * @link http://book.cakephp.org/view/1440/style */ function style($data, $oneline = true) { if (!is_array($data)) { @@ -588,6 +599,7 @@ function getCrumbs($separator = '»', $startText = false) { * @param array $options Array of HTML attributes. * @return string completed img tag * @access public + * @link http://book.cakephp.org/view/1441/image */ function image($path, $options = array()) { if (is_array($path)) { @@ -625,6 +637,7 @@ function image($path, $options = array()) { * @param array $thOptions HTML options for TH elements. * @return string Completed table headers * @access public + * @link http://book.cakephp.org/view/1446/tableHeaders */ function tableHeaders($names, $trOptions = null, $thOptions = null) { $out = array(); @@ -645,6 +658,7 @@ function tableHeaders($names, $trOptions = null, $thOptions = null) { * so that the odd/even count is reset to zero just for that call. * @return string Formatted HTML * @access public + * @link http://book.cakephp.org/view/1447/tableCells */ function tableCells($data, $oddTrOptions = null, $evenTrOptions = null, $useCount = false, $continueOddEven = true) { if (empty($data[0]) || !is_array($data[0])) { @@ -701,6 +715,7 @@ function tableCells($data, $oddTrOptions = null, $evenTrOptions = null, $useCoun * @param array $options Additional HTML attributes of the DIV tag, see above. * @return string The formatted tag element * @access public + * @link http://book.cakephp.org/view/1443/tag */ function tag($name, $text = null, $options = array()) { if (is_array($options) && isset($options['escape']) && $options['escape']) { @@ -731,6 +746,7 @@ function tag($name, $text = null, $options = array()) { * @param array $options Additional HTML attributes of the DIV tag * @return string The formatted DIV element * @access public + * @link http://book.cakephp.org/view/1444/div */ function div($class = null, $text = null, $options = array()) { if (!empty($class)) { @@ -751,6 +767,7 @@ function div($class = null, $text = null, $options = array()) { * @param array $options Additional HTML attributes of the P tag * @return string The formatted P element * @access public + * @link http://book.cakephp.org/view/1445/para */ function para($class, $text, $options = array()) { if (isset($options['escape'])) { diff --git a/cake/libs/view/helpers/javascript.php b/cake/libs/view/helpers/javascript.php index 86a101b58..de42a6799 100644 --- a/cake/libs/view/helpers/javascript.php +++ b/cake/libs/view/helpers/javascript.php @@ -25,6 +25,7 @@ * * @package cake * @subpackage cake.cake.libs.view.helpers + * @link http://book.cakephp.org/view/1450/Javascript */ class JavascriptHelper extends AppHelper { diff --git a/cake/libs/view/helpers/number.php b/cake/libs/view/helpers/number.php index 77c0277f3..a8f1682ba 100644 --- a/cake/libs/view/helpers/number.php +++ b/cake/libs/view/helpers/number.php @@ -27,6 +27,7 @@ * * @package cake * @subpackage cake.cake.libs.view.helpers + * @link http://book.cakephp.org/view/1452/Number */ class NumberHelper extends AppHelper { @@ -70,6 +71,7 @@ class NumberHelper extends AppHelper { * @param integer $precision The precision of the returned number. * @return float Enter description here... * @access public + * @link http://book.cakephp.org/view/1454/precision */ function precision($number, $precision = 3) { return sprintf("%01.{$precision}f", $number); @@ -81,6 +83,7 @@ function precision($number, $precision = 3) { * @param integer $length Size in bytes * @return string Human readable size * @access public + * @link http://book.cakephp.org/view/1456/toReadableSize */ function toReadableSize($size) { switch (true) { @@ -104,6 +107,7 @@ function toReadableSize($size) { * @param integer $precision The precision of the returned number * @return string Percentage string * @access public + * @link http://book.cakephp.org/view/1455/toPercentage */ function toPercentage($number, $precision = 2) { return $this->precision($number, $precision) . '%'; @@ -117,6 +121,7 @@ function toPercentage($number, $precision = 2) { * or array with places and before keys * @return string formatted number * @access public + * @link http://book.cakephp.org/view/1457/format */ function format($number, $options = false) { $places = 0; @@ -174,6 +179,7 @@ function format($number, $options = false) { * @param array $options * @return string Number formatted as a currency. * @access public + * @link http://book.cakephp.org/view/1453/currency */ function currency($number, $currency = 'USD', $options = array()) { $default = $this->_currencyDefaults; diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index 47f0652ef..acae55ae2 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -25,6 +25,7 @@ * * @package cake * @subpackage cake.cake.libs.view.helpers + * @link http://book.cakephp.org/view/1458/Paginator */ class PaginatorHelper extends AppHelper { diff --git a/cake/libs/view/helpers/rss.php b/cake/libs/view/helpers/rss.php index 5e8da2353..4f4a3719c 100644 --- a/cake/libs/view/helpers/rss.php +++ b/cake/libs/view/helpers/rss.php @@ -26,6 +26,7 @@ * * @package cake * @subpackage cake.cake.libs.view.helpers + * @link http://book.cakephp.org/view/1460/RSS */ class RssHelper extends XmlHelper { diff --git a/cake/libs/view/helpers/session.php b/cake/libs/view/helpers/session.php index 8e9b6eada..3984f5a85 100644 --- a/cake/libs/view/helpers/session.php +++ b/cake/libs/view/helpers/session.php @@ -27,6 +27,7 @@ * * @package cake * @subpackage cake.cake.libs.view.helpers + * @link http://book.cakephp.org/view/1465/Session */ class SessionHelper extends CakeSession { @@ -78,6 +79,7 @@ function activate($base = null) { * @param string $name the name of the session key you want to read * @return values from the session vars * @access public + * @link http://book.cakephp.org/view/1466/Methods */ function read($name = null) { if ($this->__active === true && $this->__start()) { @@ -94,6 +96,7 @@ function read($name = null) { * @param string $name * @return boolean * @access public + * @link http://book.cakephp.org/view/1466/Methods */ function check($name) { if ($this->__active === true && $this->__start()) { @@ -109,6 +112,7 @@ function check($name) { * * @return string last error * @access public + * @link http://book.cakephp.org/view/1466/Methods */ function error() { if ($this->__active === true && $this->__start()) { @@ -126,6 +130,8 @@ function error() { * @param string $key The [Message.]key you are rendering in the view. * @return boolean|string Will return the value if $key is set, or false if not set. * @access public + * @link http://book.cakephp.org/view/1466/Methods + * @link http://book.cakephp.org/view/1467/flash */ function flash($key = 'flash') { $out = false; diff --git a/cake/libs/view/helpers/text.php b/cake/libs/view/helpers/text.php index e4feb4013..0e877e892 100644 --- a/cake/libs/view/helpers/text.php +++ b/cake/libs/view/helpers/text.php @@ -38,6 +38,7 @@ * * @package cake * @subpackage cake.cake.libs.view.helpers + * @link http://book.cakephp.org/view/1469/Text */ class TextHelper extends AppHelper { @@ -55,6 +56,7 @@ class TextHelper extends AppHelper { * @param array $options An array of html attributes and options. * @return string The highlighted text * @access public + * @link http://book.cakephp.org/view/1469/Text#highlight-1622 */ function highlight($text, $phrase, $options = array()) { if (empty($phrase)) { @@ -99,6 +101,7 @@ function highlight($text, $phrase, $options = array()) { * @param string $text Text * @return string The text without links * @access public + * @link http://book.cakephp.org/view/1469/Text#stripLinks-1623 */ function stripLinks($text) { return preg_replace('|<a\s+[^>]+>|im', '', preg_replace('|<\/a>|im', '', $text)); @@ -112,6 +115,7 @@ function stripLinks($text) { * @param array $options Array of HTML options. * @return string The text with links * @access public + * @link http://book.cakephp.org/view/1469/Text#autoLinkUrls-1619 */ function autoLinkUrls($text, $options = array()) { $linkOptions = 'array('; @@ -135,6 +139,7 @@ function autoLinkUrls($text, $options = array()) { * @param array $options Array of HTML options. * @return string The text with links * @access public + * @link http://book.cakephp.org/view/1469/Text#autoLinkEmails-1618 */ function autoLinkEmails($text, $options = array()) { $linkOptions = 'array('; @@ -155,6 +160,7 @@ function autoLinkEmails($text, $options = array()) { * @param array $options Array of HTML options. * @return string The text with links * @access public + * @link http://book.cakephp.org/view/1469/Text#autoLink-1620 */ function autoLink($text, $options = array()) { return $this->autoLinkEmails($this->autoLinkUrls($text, $options), $options); @@ -177,6 +183,7 @@ function autoLink($text, $options = array()) { * @param array $options An array of html attributes and options. * @return string Trimmed string. * @access public + * @link http://book.cakephp.org/view/1469/Text#truncate-1625 */ function truncate($text, $length = 100, $options = array()) { $default = array( @@ -277,6 +284,7 @@ function truncate($text, $length = 100, $options = array()) { * @param string $ending Ending that will be appended * @return string Modified string * @access public + * @link http://book.cakephp.org/view/1469/Text#excerpt-1621 */ function excerpt($text, $phrase, $radius = 100, $ending = '...') { if (empty($text) or empty($phrase)) { @@ -322,6 +330,7 @@ function excerpt($text, $phrase, $radius = 100, $ending = '...') { * @param string $separator The separator used to join all othe other items together. Defaults to ', ' * @return string The glued together string. * @access public + * @link http://book.cakephp.org/view/1469/Text#toList-1624 */ function toList($list, $and = 'and', $separator = ', ') { if (count($list) > 1) { diff --git a/cake/libs/view/helpers/time.php b/cake/libs/view/helpers/time.php index 7e1584a75..7e0c2b872 100644 --- a/cake/libs/view/helpers/time.php +++ b/cake/libs/view/helpers/time.php @@ -25,6 +25,7 @@ * * @package cake * @subpackage cake.cake.libs.view.helpers + * @link http://book.cakephp.org/view/1470/Time */ class TimeHelper extends AppHelper { @@ -167,6 +168,7 @@ function serverOffset() { * @param int $userOffset User's offset from GMT (in hours) * @return string Parsed timestamp * @access public + * @link http://book.cakephp.org/view/1471/Formatting */ function fromString($dateString, $userOffset = null) { if (empty($dateString)) { @@ -193,6 +195,7 @@ function fromString($dateString, $userOffset = null) { * @param int $userOffset User's offset from GMT (in hours) * @return string Formatted date string * @access public + * @link http://book.cakephp.org/view/1471/Formatting */ function nice($dateString = null, $userOffset = null) { if ($dateString != null) { @@ -216,6 +219,7 @@ function nice($dateString = null, $userOffset = null) { * @param int $userOffset User's offset from GMT (in hours) * @return string Described, relative date string * @access public + * @link http://book.cakephp.org/view/1471/Formatting */ function niceShort($dateString = null, $userOffset = null) { $date = $dateString ? $this->fromString($dateString, $userOffset) : time(); @@ -243,6 +247,7 @@ function niceShort($dateString = null, $userOffset = null) { * @param int $userOffset User's offset from GMT (in hours) * @return string Partial SQL string. * @access public + * @link http://book.cakephp.org/view/1471/Formatting */ function daysAsSql($begin, $end, $fieldName, $userOffset = null) { $begin = $this->fromString($begin, $userOffset); @@ -262,6 +267,7 @@ function daysAsSql($begin, $end, $fieldName, $userOffset = null) { * @param int $userOffset User's offset from GMT (in hours) * @return string Partial SQL string. * @access public + * @link http://book.cakephp.org/view/1471/Formatting */ function dayAsSql($dateString, $fieldName, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); @@ -287,6 +293,7 @@ function isToday($dateString, $userOffset = null) { * @param int $userOffset User's offset from GMT (in hours) * @return boolean True if datetime string is within current week * @access public + * @link http://book.cakephp.org/view/1472/Testing-Time */ function isThisWeek($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); @@ -299,6 +306,7 @@ function isThisWeek($dateString, $userOffset = null) { * @param int $userOffset User's offset from GMT (in hours) * @return boolean True if datetime string is within current month * @access public + * @link http://book.cakephp.org/view/1472/Testing-Time */ function isThisMonth($dateString, $userOffset = null) { $date = $this->fromString($dateString); @@ -311,6 +319,7 @@ function isThisMonth($dateString, $userOffset = null) { * @param string $dateString Datetime string or Unix timestamp * @return boolean True if datetime string is within current year * @access public + * @link http://book.cakephp.org/view/1472/Testing-Time */ function isThisYear($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); @@ -324,6 +333,8 @@ function isThisYear($dateString, $userOffset = null) { * @param int $userOffset User's offset from GMT (in hours) * @return boolean True if datetime string was yesterday * @access public + * @link http://book.cakephp.org/view/1472/Testing-Time + * */ function wasYesterday($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); @@ -337,6 +348,7 @@ function wasYesterday($dateString, $userOffset = null) { * @param int $userOffset User's offset from GMT (in hours) * @return boolean True if datetime string was yesterday * @access public + * @link http://book.cakephp.org/view/1472/Testing-Time */ function isTomorrow($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); @@ -350,6 +362,7 @@ function isTomorrow($dateString, $userOffset = null) { * @param boolean $range if true returns a range in Y-m-d format * @return boolean True if datetime string is within current week * @access public + * @link http://book.cakephp.org/view/1471/Formatting */ function toQuarter($dateString, $range = false) { $time = $this->fromString($dateString); @@ -387,6 +400,7 @@ function toQuarter($dateString, $range = false) { * @param int $userOffset User's offset from GMT (in hours) * @return integer Unix timestamp * @access public + * @link http://book.cakephp.org/view/1471/Formatting */ function toUnix($dateString, $userOffset = null) { return $this->fromString($dateString, $userOffset); @@ -399,6 +413,7 @@ function toUnix($dateString, $userOffset = null) { * @param int $userOffset User's offset from GMT (in hours) * @return string Formatted date string * @access public + * @link http://book.cakephp.org/view/1471/Formatting */ function toAtom($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); @@ -412,6 +427,7 @@ function toAtom($dateString, $userOffset = null) { * @param int $userOffset User's offset from GMT (in hours) * @return string Formatted date string * @access public + * @link http://book.cakephp.org/view/1471/Formatting */ function toRSS($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); @@ -442,6 +458,7 @@ function toRSS($dateString, $userOffset = null) { * @param array $options Default format if timestamp is used in $dateString * @return string Relative time string. * @access public + * @link http://book.cakephp.org/view/1471/Formatting */ function timeAgoInWords($dateTime, $options = array()) { $userOffset = null; @@ -609,6 +626,7 @@ function timeAgoInWords($dateTime, $options = array()) { * @see TimeHelper::timeAgoInWords * @access public * @deprecated This method alias will be removed in future versions. + * @link http://book.cakephp.org/view/1471/Formatting */ function relativeTime($dateTime, $options = array()) { return $this->timeAgoInWords($dateTime, $options); @@ -623,6 +641,7 @@ function relativeTime($dateTime, $options = array()) { * @param int $userOffset User's offset from GMT (in hours) * @return bool * @access public + * @link http://book.cakephp.org/view/1472/Testing-Time */ function wasWithinLast($timeInterval, $dateString, $userOffset = null) { $tmp = str_replace(' ', '', $timeInterval); @@ -646,6 +665,7 @@ function wasWithinLast($timeInterval, $dateString, $userOffset = null) { * @param string $dateString Datetime string * @return string Formatted date string * @access public + * @link http://book.cakephp.org/view/1471/Formatting */ function gmt($string = null) { if ($string != null) { diff --git a/cake/libs/view/helpers/xml.php b/cake/libs/view/helpers/xml.php index 6b4319134..d8cdd98d6 100644 --- a/cake/libs/view/helpers/xml.php +++ b/cake/libs/view/helpers/xml.php @@ -26,6 +26,7 @@ * * @package cake * @subpackage cake.cake.libs.view.helpers + * @link http://book.cakephp.org/view/1473/XML */ class XmlHelper extends AppHelper { @@ -54,6 +55,7 @@ function __construct() { * @param array $attrib Header tag attributes * @return string XML header * @access public + * @link http://book.cakephp.org/view/1476/header */ function header($attrib = array()) { if (Configure::read('App.encoding') !== null) { @@ -105,6 +107,7 @@ function removeNs($name) { * @param boolean $endTag Whether the end tag of the element should be printed * @return string XML * @access public + * @link http://book.cakephp.org/view/1475/elem */ function elem($name, $attrib = array(), $content = null, $endTag = true) { $namespace = null; @@ -161,6 +164,7 @@ function closeElem() { * @return string A copy of $data in XML format * @see XmlNode * @access public + * @link http://book.cakephp.org/view/1474/serialize */ function serialize($data, $options = array()) { $options += array('attributes' => false, 'format' => 'attributes'); From 1497ec391084b33d29be42437cf4d7893d33704f Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Mon, 5 Apr 2010 13:19:38 +1000 Subject: [PATCH 1884/2083] Changed all public methods to specify public access. --- cake/console/cake.php | 27 +-- cake/console/error.php | 51 ++---- cake/console/libs/acl.php | 45 ++--- cake/console/libs/api.php | 9 +- cake/console/libs/bake.php | 12 +- cake/console/libs/console.php | 9 +- cake/console/libs/i18n.php | 12 +- cake/console/libs/schema.php | 21 +-- cake/console/libs/shell.php | 33 ++-- cake/console/libs/tasks/bake.php | 3 +- cake/console/libs/tasks/controller.php | 15 +- cake/console/libs/tasks/db_config.php | 9 +- cake/console/libs/tasks/extract.php | 3 +- cake/console/libs/tasks/fixture.php | 18 +- cake/console/libs/tasks/model.php | 21 +-- cake/console/libs/tasks/plugin.php | 3 +- cake/console/libs/tasks/project.php | 26 +-- cake/console/libs/tasks/test.php | 45 ++--- cake/console/libs/tasks/view.php | 18 +- cake/console/libs/testsuite.php | 12 +- cake/dispatcher.php | 21 +-- cake/libs/cache.php | 36 ++-- cake/libs/cache/apc.php | 21 +-- cake/libs/cache/file.php | 18 +- cake/libs/cache/memcache.php | 24 +-- cake/libs/cache/xcache.php | 21 +-- cake/libs/cake_session.php | 39 ++--- cake/libs/cake_socket.php | 33 ++-- cake/libs/class_registry.php | 3 +- cake/libs/configure.php | 39 ++--- cake/libs/controller/component.php | 9 +- cake/libs/controller/components/acl.php | 60 +++---- cake/libs/controller/components/auth.php | 51 ++---- cake/libs/controller/components/cookie.php | 18 +- cake/libs/controller/components/email.php | 12 +- .../controller/components/request_handler.php | 63 +++---- cake/libs/controller/components/security.php | 36 ++-- cake/libs/controller/components/session.php | 36 ++-- cake/libs/controller/controller.php | 21 +-- cake/libs/controller/pages_controller.php | 3 +- cake/libs/debugger.php | 3 +- cake/libs/error.php | 54 ++---- cake/libs/file.php | 81 +++------ cake/libs/folder.php | 48 ++---- cake/libs/http_socket.php | 24 +-- cake/libs/i18n.php | 6 +- cake/libs/inflector.php | 3 +- cake/libs/l10n.php | 9 +- cake/libs/magic_db.php | 24 +-- cake/libs/model/behaviors/acl.php | 12 +- cake/libs/model/behaviors/containable.php | 24 +-- cake/libs/model/behaviors/translate.php | 24 +-- cake/libs/model/behaviors/tree.php | 42 ++--- cake/libs/model/cake_schema.php | 24 +-- cake/libs/model/datasources/datasource.php | 57 ++---- .../libs/model/datasources/dbo/dbo_oracle.php | 48 ++---- .../model/datasources/dbo/dbo_postgres.php | 3 +- .../libs/model/datasources/dbo/dbo_sqlite.php | 3 +- cake/libs/model/datasources/dbo_source.php | 159 ++++++----------- cake/libs/model/db_acl.php | 3 +- cake/libs/model/model.php | 81 +++------ cake/libs/model/model_behavior.php | 54 ++---- cake/libs/object.php | 18 +- cake/libs/overloadable_php4.php | 6 +- cake/libs/overloadable_php5.php | 6 +- cake/libs/router.php | 18 +- cake/libs/sanitize.php | 3 +- cake/libs/validation.php | 81 +++------ cake/libs/view/helper.php | 45 ++--- cake/libs/view/helpers/ajax.php | 3 +- cake/libs/view/helpers/form.php | 69 +++----- cake/libs/view/helpers/html.php | 57 ++---- cake/libs/view/helpers/javascript.php | 3 +- cake/libs/view/helpers/jquery_engine.php | 15 +- cake/libs/view/helpers/js.php | 81 +++------ cake/libs/view/helpers/number.php | 18 +- cake/libs/view/helpers/paginator.php | 57 ++---- cake/libs/view/helpers/prototype_engine.php | 9 +- cake/libs/view/helpers/rss.php | 12 +- cake/libs/view/helpers/session.php | 21 +-- cake/libs/view/helpers/text.php | 24 +-- cake/libs/view/helpers/time.php | 69 +++----- cake/libs/view/helpers/xml.php | 15 +- cake/libs/view/view.php | 33 ++-- cake/libs/xml.php | 78 +++------ cake/tests/cases/basics.test.php | 78 +++------ cake/tests/cases/console/cake.test.php | 48 ++---- cake/tests/cases/console/libs/acl.test.php | 45 ++--- cake/tests/cases/console/libs/api.test.php | 9 +- cake/tests/cases/console/libs/bake.test.php | 9 +- cake/tests/cases/console/libs/schema.test.php | 48 ++---- cake/tests/cases/console/libs/shell.test.php | 42 ++--- .../console/libs/tasks/controller.test.php | 57 ++---- .../console/libs/tasks/db_config.test.php | 15 +- .../cases/console/libs/tasks/extract.test.php | 9 +- .../cases/console/libs/tasks/fixture.test.php | 42 ++--- .../cases/console/libs/tasks/model.test.php | 84 +++------ .../cases/console/libs/tasks/plugin.test.php | 24 +-- .../cases/console/libs/tasks/project.test.php | 35 ++-- .../console/libs/tasks/template.test.php | 21 +-- .../cases/console/libs/tasks/test.test.php | 60 +++---- .../cases/console/libs/tasks/view.test.php | 78 +++------ cake/tests/cases/dispatcher.test.php | 162 ++++++------------ cake/tests/cases/libs/cake_test_case.test.php | 6 +- .../cases/libs/code_coverage_manager.test.php | 18 +- .../cases/libs/controller/component.test.php | 9 +- .../libs/controller/components/email.test.php | 9 +- .../components/request_handler.test.php | 3 +- .../controller/components/security.test.php | 3 +- .../controller/components/session.test.php | 6 +- .../cases/libs/controller/controller.test.php | 6 +- cake/tests/cases/libs/folder.test.php | 3 +- cake/tests/cases/libs/inflector.test.php | 3 +- cake/tests/cases/libs/magic_db.test.php | 18 +- .../cases/libs/model/behaviors/acl.test.php | 27 +-- .../libs/model/behaviors/containable.test.php | 18 +- .../cases/libs/model/behaviors/tree.test.php | 30 ++-- .../model/datasources/dbo/dbo_mssql.test.php | 30 ++-- .../model/datasources/dbo/dbo_mysql.test.php | 18 +- .../model/datasources/dbo/dbo_mysqli.test.php | 18 +- .../datasources/dbo/dbo_postgres.test.php | 18 +- .../model/datasources/dbo/dbo_sqlite.test.php | 18 +- .../model/datasources/dbo_source.test.php | 3 +- .../cases/libs/model/model_behavior.test.php | 3 +- .../cases/libs/model/model_read.test.php | 6 +- .../cases/libs/model/model_write.test.php | 6 +- cake/tests/cases/libs/router.test.php | 12 +- cake/tests/cases/libs/test_manager.test.php | 24 +-- cake/tests/cases/libs/validation.test.php | 9 +- .../cases/libs/view/helpers/cache.test.php | 3 +- cake/tests/cases/libs/xml.test.php | 3 +- cake/tests/lib/cake_test_case.php | 48 ++---- cake/tests/lib/cake_test_fixture.php | 15 +- cake/tests/lib/code_coverage_manager.php | 9 +- .../tests/lib/reporter/cake_base_reporter.php | 3 +- cake/tests/lib/reporter/cake_cli_reporter.php | 9 +- .../tests/lib/reporter/cake_html_reporter.php | 27 +-- .../tests/lib/reporter/cake_text_reporter.php | 21 +-- cake/tests/lib/test_manager.php | 18 +- 139 files changed, 1278 insertions(+), 2551 deletions(-) diff --git a/cake/console/cake.php b/cake/console/cake.php index 4428b9d82..e1f06cd5e 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -127,9 +127,8 @@ class ShellDispatcher { * * @param array $args the argv * @return void - * @access public */ - function ShellDispatcher($args = array()) { + public function ShellDispatcher($args = array()) { set_time_limit(0); $this->__initConstants(); @@ -281,9 +280,8 @@ function __bootstrap() { * Clear the console * * @return void - * @access public */ - function clear() { + public function clear() { if (empty($this->params['noclear'])) { if ( DS === '/') { passthru('clear'); @@ -297,9 +295,8 @@ function clear() { * Dispatches a CLI request * * @return boolean - * @access public */ - function dispatch() { + public function dispatch() { $arg = $this->shiftArgs(); if (!$arg) { @@ -429,9 +426,8 @@ function _getShell($plugin = null) { * @param mixed $options Array or string of options. * @param string $default Default input value. * @return Either the default value, or the user-provided input. - * @access public */ - function getInput($prompt, $options = null, $default = null) { + public function getInput($prompt, $options = null, $default = null) { if (!is_array($options)) { $printOptions = ''; } else { @@ -462,9 +458,8 @@ function getInput($prompt, $options = null, $default = null) { * @param string $string String to output. * @param boolean $newline If true, the outputs gets an added newline. * @return integer Returns the number of bytes output to stdout. - * @access public */ - function stdout($string, $newline = true) { + public function stdout($string, $newline = true) { if ($newline) { return fwrite($this->stdout, $string . "\n"); } else { @@ -476,9 +471,8 @@ function stdout($string, $newline = true) { * Outputs to the stderr filehandle. * * @param string $string Error text to output. - * @access public */ - function stderr($string) { + public function stderr($string) { fwrite($this->stderr, $string); } @@ -486,9 +480,8 @@ function stderr($string) { * Parses command line options * * @param array $params Parameters to parse - * @access public */ - function parseParams($params) { + public function parseParams($params) { $this->__parseParams($params); $defaults = array('app' => 'app', 'root' => dirname(dirname(dirname(__FILE__))), 'working' => null, 'webroot' => 'webroot'); $params = array_merge($defaults, array_intersect_key($this->params, $defaults)); @@ -562,18 +555,16 @@ function __parseParams($params) { * Removes first argument and shifts other arguments up * * @return mixed Null if there are no arguments otherwise the shifted argument - * @access public */ - function shiftArgs() { + public function shiftArgs() { return array_shift($this->args); } /** * Shows console help * - * @access public */ - function help() { + public function help() { $this->clear(); $this->stdout("\nWelcome to CakePHP v" . Configure::version() . " Console"); $this->stdout("---------------------------------------------------------------"); diff --git a/cake/console/error.php b/cake/console/error.php index f64d8d788..62e33d808 100644 --- a/cake/console/error.php +++ b/cake/console/error.php @@ -58,9 +58,8 @@ function __construct($method, $messages) { * Displays an error page (e.g. 404 Not found). * * @param array $params Parameters (code, name, and message) - * @access public */ - function error($params) { + public function error($params) { extract($params, EXTR_OVERWRITE); $this->stderr($code . $name . $message."\n"); $this->_stop(); @@ -70,9 +69,8 @@ function error($params) { * Convenience method to display a 404 page. * * @param array $params Parameters (url, message) - * @access public */ - function error404($params) { + public function error404($params) { extract($params, EXTR_OVERWRITE); $this->error(array( 'code' => '404', @@ -86,9 +84,8 @@ function error404($params) { * Renders the Missing Controller web page. * * @param array $params Parameters (className) - * @access public */ - function missingController($params) { + public function missingController($params) { extract($params, EXTR_OVERWRITE); $controllerName = str_replace('Controller', '', $className); $this->stderr(sprintf(__("Missing Controller '%s'", true), $controllerName)); @@ -99,9 +96,8 @@ function missingController($params) { * Renders the Missing Action web page. * * @param array $params Parameters (action, className) - * @access public */ - function missingAction($params) { + public function missingAction($params) { extract($params, EXTR_OVERWRITE); $this->stderr(sprintf(__("Missing Method '%s' in '%s'", true), $action, $className)); $this->_stop(); @@ -111,9 +107,8 @@ function missingAction($params) { * Renders the Private Action web page. * * @param array $params Parameters (action, className) - * @access public */ - function privateAction($params) { + public function privateAction($params) { extract($params, EXTR_OVERWRITE); $this->stderr(sprintf(__("Trying to access private method '%s' in '%s'", true), $action, $className)); $this->_stop(); @@ -123,9 +118,8 @@ function privateAction($params) { * Renders the Missing Table web page. * * @param array $params Parameters (table, className) - * @access public */ - function missingTable($params) { + public function missingTable($params) { extract($params, EXTR_OVERWRITE); $this->stderr(sprintf(__("Missing database table '%s' for model '%s'", true), $table, $className)); $this->_stop(); @@ -135,9 +129,8 @@ function missingTable($params) { * Renders the Missing Database web page. * * @param array $params Parameters - * @access public */ - function missingDatabase($params = array()) { + public function missingDatabase($params = array()) { $this->stderr(__("Missing Database", true)); $this->_stop(); } @@ -146,9 +139,8 @@ function missingDatabase($params = array()) { * Renders the Missing View web page. * * @param array $params Parameters (file, action, className) - * @access public */ - function missingView($params) { + public function missingView($params) { extract($params, EXTR_OVERWRITE); $this->stderr(sprintf(__("Missing View '%s' for '%s' in '%s'", true), $file, $action, $className)); $this->_stop(); @@ -158,9 +150,8 @@ function missingView($params) { * Renders the Missing Layout web page. * * @param array $params Parameters (file) - * @access public */ - function missingLayout($params) { + public function missingLayout($params) { extract($params, EXTR_OVERWRITE); $this->stderr(sprintf(__("Missing Layout '%s'", true), $file)); $this->_stop(); @@ -170,9 +161,8 @@ function missingLayout($params) { * Renders the Database Connection web page. * * @param array $params Parameters - * @access public */ - function missingConnection($params) { + public function missingConnection($params) { extract($params, EXTR_OVERWRITE); $this->stderr(__("Missing Database Connection. Try 'cake bake'", true)); $this->_stop(); @@ -182,9 +172,8 @@ function missingConnection($params) { * Renders the Missing Helper file web page. * * @param array $params Parameters (file, helper) - * @access public */ - function missingHelperFile($params) { + public function missingHelperFile($params) { extract($params, EXTR_OVERWRITE); $this->stderr(sprintf(__("Missing Helper file '%s' for '%s'", true), $file, Inflector::camelize($helper))); $this->_stop(); @@ -194,9 +183,8 @@ function missingHelperFile($params) { * Renders the Missing Helper class web page. * * @param array $params Parameters (file, helper) - * @access public */ - function missingHelperClass($params) { + public function missingHelperClass($params) { extract($params, EXTR_OVERWRITE); $this->stderr(sprintf(__("Missing Helper class '%s' in '%s'", true), Inflector::camelize($helper), $file)); $this->_stop(); @@ -206,9 +194,8 @@ function missingHelperClass($params) { * Renders the Missing Component file web page. * * @param array $params Parameters (file, component) - * @access public */ - function missingComponentFile($params) { + public function missingComponentFile($params) { extract($params, EXTR_OVERWRITE); $this->stderr(sprintf(__("Missing Component file '%s' for '%s'", true), $file, Inflector::camelize($component))); $this->_stop(); @@ -218,9 +205,8 @@ function missingComponentFile($params) { * Renders the Missing Component class web page. * * @param array $params Parameters (file, component) - * @access public */ - function missingComponentClass($params) { + public function missingComponentClass($params) { extract($params, EXTR_OVERWRITE); $this->stderr(sprintf(__("Missing Component class '%s' in '%s'", true), Inflector::camelize($component), $file)); $this->_stop(); @@ -230,9 +216,8 @@ function missingComponentClass($params) { * Renders the Missing Model class web page. * * @param array $params Parameters (className) - * @access public */ - function missingModel($params) { + public function missingModel($params) { extract($params, EXTR_OVERWRITE); $this->stderr(sprintf(__("Missing model '%s'", true), $className)); $this->_stop(); @@ -243,9 +228,8 @@ function missingModel($params) { * * @param string $string String to output. * @param boolean $newline If true, the outputs gets an added newline. - * @access public */ - function stdout($string, $newline = true) { + public function stdout($string, $newline = true) { if ($newline) { fwrite($this->stdout, $string . "\n"); } else { @@ -257,9 +241,8 @@ function stdout($string, $newline = true) { * Outputs to the stderr filehandle. * * @param string $string Error text to output. - * @access public */ - function stderr($string) { + public function stderr($string) { fwrite($this->stderr, "Error: ". $string . "\n"); } } diff --git a/cake/console/libs/acl.php b/cake/console/libs/acl.php index 0ab5ea6dd..2289e5f37 100644 --- a/cake/console/libs/acl.php +++ b/cake/console/libs/acl.php @@ -63,9 +63,8 @@ class AclShell extends Shell { /** * Override startup of the Shell * - * @access public */ - function startup() { + public function startup() { if (isset($this->params['connection'])) { $this->connection = $this->params['connection']; } @@ -102,9 +101,8 @@ function startup() { /** * Override main() for help message hook * - * @access public */ - function main() { + public function main() { $out = __("Available ACL commands:", true) . "\n"; $out .= "\t - create\n"; $out .= "\t - delete\n"; @@ -124,9 +122,8 @@ function main() { /** * Creates an ARO/ACO node * - * @access public */ - function create() { + public function create() { $this->_checkArgs(3, 'create'); $this->checkNodeType(); extract($this->__dataVars()); @@ -159,9 +156,8 @@ function create() { /** * Delete an ARO/ACO node. * - * @access public */ - function delete() { + public function delete() { $this->_checkArgs(2, 'delete'); $this->checkNodeType(); extract($this->__dataVars()); @@ -178,9 +174,8 @@ function delete() { /** * Set parent for an ARO/ACO node. * - * @access public */ - function setParent() { + public function setParent() { $this->_checkArgs(3, 'setParent'); $this->checkNodeType(); extract($this->__dataVars()); @@ -204,9 +199,8 @@ function setParent() { /** * Get path to specified ARO/ACO node. * - * @access public */ - function getPath() { + public function getPath() { $this->_checkArgs(2, 'getPath'); $this->checkNodeType(); extract($this->__dataVars()); @@ -250,9 +244,8 @@ function _outputNode($class, $node, $indent) { /** * Check permission for a given ARO to a given ACO. * - * @access public */ - function check() { + public function check() { $this->_checkArgs(3, 'check'); extract($this->__getParams()); @@ -266,9 +259,8 @@ function check() { /** * Grant permission for a given ARO to a given ACO. * - * @access public */ - function grant() { + public function grant() { $this->_checkArgs(3, 'grant'); extract($this->__getParams()); @@ -282,9 +274,8 @@ function grant() { /** * Deny access for an ARO to an ACO. * - * @access public */ - function deny() { + public function deny() { $this->_checkArgs(3, 'deny'); extract($this->__getParams()); @@ -298,9 +289,8 @@ function deny() { /** * Set an ARO to inhermit permission to an ACO. * - * @access public */ - function inherit() { + public function inherit() { $this->_checkArgs(3, 'inherit'); extract($this->__getParams()); @@ -314,9 +304,8 @@ function inherit() { /** * Show a specific ARO/ACO node. * - * @access public */ - function view() { + public function view() { $this->_checkArgs(1, 'view'); $this->checkNodeType(); extract($this->__dataVars()); @@ -376,9 +365,8 @@ function view() { /** * Initialize ACL database. * - * @access public */ - function initdb() { + public function initdb() { $this->Dispatch->args = array('schema', 'run', 'create', 'DbAcl'); $this->Dispatch->dispatch(); } @@ -386,9 +374,8 @@ function initdb() { /** * Show help screen. * - * @access public */ - function help() { + public function help() { $head = "-----------------------------------------------\n"; $head .= __("Usage: cake acl <command> <arg1> <arg2>...", true) . "\n"; $head .= "-----------------------------------------------\n"; @@ -482,9 +469,8 @@ function help() { /** * Check that first argument specifies a valid Node type (ARO/ACO) * - * @access public */ - function checkNodeType() { + public function checkNodeType() { if (!isset($this->args[0])) { return false; } @@ -499,9 +485,8 @@ function checkNodeType() { * @param string $type Node type (ARO/ACO) * @param integer $id Node id * @return boolean Success - * @access public */ - function nodeExists() { + public function nodeExists() { if (!$this->checkNodeType() && !isset($this->args[1])) { return false; } diff --git a/cake/console/libs/api.php b/cake/console/libs/api.php index 5b60fa04f..2aa6008e3 100644 --- a/cake/console/libs/api.php +++ b/cake/console/libs/api.php @@ -39,9 +39,8 @@ class ApiShell extends Shell { /** * Override intialize of the Shell * - * @access public */ - function initialize() { + public function initialize() { $this->paths = array_merge($this->paths, array( 'behavior' => LIBS . 'model' . DS . 'behaviors' . DS, 'cache' => LIBS . 'cache' . DS, @@ -57,9 +56,8 @@ function initialize() { /** * Override main() to handle action * - * @access public */ - function main() { + public function main() { if (empty($this->args)) { return $this->help(); } @@ -140,9 +138,8 @@ function main() { /** * Show help for this shell. * - * @access public */ - function help() { + public function help() { $head = "Usage: cake api [<type>] <className> [-m <method>]\n"; $head .= "-----------------------------------------------\n"; $head .= "Parameters:\n\n"; diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index c88f4b496..2c619838b 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -42,9 +42,8 @@ class BakeShell extends Shell { /** * Override loadTasks() to handle paths * - * @access public */ - function loadTasks() { + public function loadTasks() { parent::loadTasks(); $task = Inflector::classify($this->command); if (isset($this->{$task}) && !in_array($task, array('Project', 'DbConfig'))) { @@ -66,9 +65,8 @@ function loadTasks() { /** * Override main() to handle action * - * @access public */ - function main() { + public function main() { if (!is_dir($this->DbConfig->path)) { if ($this->Project->execute()) { $this->DbConfig->path = $this->params['working'] . DS . 'config' . DS; @@ -129,9 +127,8 @@ function main() { /** * Quickly bake the MVC * - * @access public */ - function all() { + public function all() { $this->hr(); $this->out('Bake All'); $this->hr(); @@ -199,9 +196,8 @@ function all() { /** * Displays help contents * - * @access public */ - function help() { + public function help() { $this->out('CakePHP Bake:'); $this->hr(); $this->out('The Bake script generates controllers, views and models for your application.'); diff --git a/cake/console/libs/console.php b/cake/console/libs/console.php index 94f318647..c458506fc 100644 --- a/cake/console/libs/console.php +++ b/cake/console/libs/console.php @@ -51,9 +51,8 @@ class ConsoleShell extends Shell { /** * Override intialize of the Shell * - * @access public */ - function initialize() { + public function initialize() { require_once CAKE . 'dispatcher.php'; $this->Dispatcher = new Dispatcher(); $this->models = App::objects('model'); @@ -76,9 +75,8 @@ function initialize() { /** * Prints the help message * - * @access public */ - function help() { + public function help() { $out = 'Console help:'; $out .= '-------------'; $out .= 'The interactive console is a tool for testing parts of your app before you'; @@ -139,9 +137,8 @@ function help() { /** * Override main() to handle action * - * @access public */ - function main($command = null) { + public function main($command = null) { while (true) { if (empty($command)) { $command = trim($this->in('')); diff --git a/cake/console/libs/i18n.php b/cake/console/libs/i18n.php index 5d28b16da..24e7caf89 100644 --- a/cake/console/libs/i18n.php +++ b/cake/console/libs/i18n.php @@ -45,9 +45,8 @@ class I18nShell extends Shell { /** * Override startup of the Shell * - * @access public */ - function startup() { + public function startup() { $this->_welcome(); if (isset($this->params['datasource'])) { $this->dataSource = $this->params['datasource']; @@ -64,9 +63,8 @@ function startup() { /** * Override main() for help message hook * - * @access public */ - function main() { + public function main() { $this->out(__('I18n Shell', true)); $this->hr(); $this->out(__('[E]xtract POT file from sources', true)); @@ -98,9 +96,8 @@ function main() { /** * Initialize I18N database. * - * @access public */ - function initdb() { + public function initdb() { $this->Dispatch->args = array('schema', 'create', 'i18n'); $this->Dispatch->dispatch(); } @@ -108,9 +105,8 @@ function initdb() { /** * Show help screen. * - * @access public */ - function help() { + public function help() { $this->hr(); $this->out(__('I18n Shell:', true)); $this->hr(); diff --git a/cake/console/libs/schema.php b/cake/console/libs/schema.php index 9ecd9a794..c287bc578 100644 --- a/cake/console/libs/schema.php +++ b/cake/console/libs/schema.php @@ -43,9 +43,8 @@ class SchemaShell extends Shell { /** * Override initialize * - * @access public */ - function initialize() { + public function initialize() { $this->_welcome(); $this->out('Cake Schema Shell'); $this->hr(); @@ -54,9 +53,8 @@ function initialize() { /** * Override startup * - * @access public */ - function startup() { + public function startup() { $name = $file = $path = $connection = $plugin = null; if (!empty($this->params['name'])) { $name = $this->params['name']; @@ -97,9 +95,8 @@ function startup() { /** * Override main * - * @access public */ - function main() { + public function main() { $this->help(); } @@ -107,9 +104,8 @@ function main() { * Read and output contents of schema object * path to read as second arg * - * @access public */ - function view() { + public function view() { $File = new File($this->Schema->path . DS . $this->params['file']); if ($File->exists()) { $this->out($File->read()); @@ -125,9 +121,8 @@ function view() { * Read database and Write schema object * accepts a connection as first arg or path to save as second arg * - * @access public */ - function generate() { + public function generate() { $this->out(__('Generating Schema...', true)); $options = array(); if (isset($this->params['f'])) { @@ -197,9 +192,8 @@ function generate() { * If -write contains a full path name the file will be saved there. If -write only * contains no DS, that will be used as the file name, in the same dir as the schema file. * - * @access public */ - function dump() { + public function dump() { $write = false; $Schema = $this->Schema->load(); if (!$Schema) { @@ -427,9 +421,8 @@ function __run($contents, $event, &$Schema) { /** * Displays help contents * - * @access public */ - function help() { + public function help() { $help = <<<TEXT The Schema Shell generates a schema object from the database and updates the database from the schema. diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php index 0fc16bbea..aaf3b7777 100644 --- a/cake/console/libs/shell.php +++ b/cake/console/libs/shell.php @@ -174,9 +174,8 @@ function __construct(&$dispatch) { * acts as constructor for subclasses * allows configuration of tasks prior to shell execution * - * @access public */ - function initialize() { + public function initialize() { $this->_loadModels(); } @@ -185,9 +184,8 @@ function initialize() { * allows for checking and configuring prior to command or main execution * can be overriden in subclasses * - * @access public */ - function startup() { + public function startup() { $this->_welcome(); } @@ -268,9 +266,8 @@ function _loadModels() { * Loads tasks defined in public $tasks * * @return bool - * @access public */ - function loadTasks() { + public function loadTasks() { if ($this->tasks === null || $this->tasks === false || $this->tasks === true || empty($this->tasks)) { return true; } @@ -329,9 +326,8 @@ function loadTasks() { * @param mixed $options Array or string of options. * @param string $default Default input value. * @return Either the default value, or the user-provided input. - * @access public */ - function in($prompt, $options = null, $default = null) { + public function in($prompt, $options = null, $default = null) { if (!$this->interactive) { return $default; } @@ -363,9 +359,8 @@ function in($prompt, $options = null, $default = null) { * @param mixed $message A string or a an array of strings to output * @param integer $newlines Number of newlines to append * @return integer Returns the number of bytes returned from writing to stdout. - * @access public */ - function out($message = null, $newlines = 1) { + public function out($message = null, $newlines = 1) { if (is_array($message)) { $message = implode($this->nl(), $message); } @@ -378,9 +373,8 @@ function out($message = null, $newlines = 1) { * * @param mixed $message A string or a an array of strings to output * @param integer $newlines Number of newlines to append - * @access public */ - function err($message = null, $newlines = 1) { + public function err($message = null, $newlines = 1) { if (is_array($message)) { $message = implode($this->nl(), $message); } @@ -402,9 +396,8 @@ function nl($multiplier = 1) { * Outputs a series of minus characters to the standard output, acts as a visual separator. * * @param integer $newlines Number of newlines to pre- and append - * @access public */ - function hr($newlines = 0) { + public function hr($newlines = 0) { $this->out(null, $newlines); $this->out('---------------------------------------------------------------'); $this->out(null, $newlines); @@ -416,9 +409,8 @@ function hr($newlines = 0) { * * @param string $title Title of the error * @param string $message An optional error message - * @access public */ - function error($title, $message = null) { + public function error($title, $message = null) { $this->err(sprintf(__('Error: %s', true), $title)); if (!empty($message)) { @@ -453,9 +445,8 @@ function _checkArgs($expectedNum, $command = null) { * @param string $path Where to put the file. * @param string $contents Content to put in the file. * @return boolean Success - * @access public */ - function createFile($path, $contents) { + public function createFile($path, $contents) { $path = str_replace(DS . DS, DS, $path); $this->out(); @@ -491,9 +482,8 @@ function createFile($path, $contents) { /** * Outputs usage text on the standard output. Implement it in subclasses. * - * @access public */ - function help() { + public function help() { if ($this->command != null) { $this->err("Unknown {$this->name} command `{$this->command}`."); $this->err("For usage, try `cake {$this->shell} help`.", 2); @@ -528,9 +518,8 @@ function _checkUnitTest() { * * @param string $file Absolute file path * @return sting short path - * @access public */ - function shortPath($file) { + public function shortPath($file) { $shortPath = str_replace(ROOT, null, $file); $shortPath = str_replace('..' . DS, '', $shortPath); return str_replace(DS . DS, DS, $shortPath); diff --git a/cake/console/libs/tasks/bake.php b/cake/console/libs/tasks/bake.php index 38128cfcb..08ca80728 100644 --- a/cake/console/libs/tasks/bake.php +++ b/cake/console/libs/tasks/bake.php @@ -47,9 +47,8 @@ class BakeTask extends Shell { * and returns the correct path. * * @return string Path to output. - * @access public */ - function getPath() { + public function getPath() { $path = $this->path; if (isset($this->plugin)) { $name = substr($this->name, 0, strlen($this->name) - 4); diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 444f82915..c42cdc597 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -47,17 +47,15 @@ class ControllerTask extends BakeTask { /** * Override initialize * - * @access public */ - function initialize() { + public function initialize() { } /** * Execution method always used for tasks * - * @access public */ - function execute() { + public function execute() { if (empty($this->args)) { $this->__interactive(); } @@ -382,9 +380,8 @@ function _doPropertyChoices($prompt, $example) { * @param string $useDbConfig Database configuration name * @param boolean $interactive Whether you are using listAll interactively and want options output. * @return array Set of controllers - * @access public */ - function listAll($useDbConfig = null) { + public function listAll($useDbConfig = null) { if (is_null($useDbConfig)) { $useDbConfig = $this->connection; } @@ -408,9 +405,8 @@ function listAll($useDbConfig = null) { * * @param string $useDbConfig Connection name to get a controller name for. * @return string Controller name - * @access public */ - function getName($useDbConfig = null) { + public function getName($useDbConfig = null) { $controllers = $this->listAll($useDbConfig); $enteredController = ''; @@ -439,9 +435,8 @@ function getName($useDbConfig = null) { /** * Displays help contents * - * @access public */ - function help() { + public function help() { $this->hr(); $this->out("Usage: cake bake controller <arg1> <arg2>..."); $this->hr(); diff --git a/cake/console/libs/tasks/db_config.php b/cake/console/libs/tasks/db_config.php index ee75b7819..788bdc1b5 100644 --- a/cake/console/libs/tasks/db_config.php +++ b/cake/console/libs/tasks/db_config.php @@ -58,18 +58,16 @@ class DbConfigTask extends Shell { * initialization callback * * @var string - * @access public */ - function initialize() { + public function initialize() { $this->path = $this->params['working'] . DS . 'config' . DS; } /** * Execution method always used for tasks * - * @access public */ - function execute() { + public function execute() { if (empty($this->args)) { $this->__interactive(); $this->_stop(); @@ -244,9 +242,8 @@ function __verify($config) { * * @param array $configs Configuration settings to use * @return boolean Success - * @access public */ - function bake($configs) { + public function bake($configs) { if (!is_dir($this->path)) { $this->err($this->path . ' not found'); return false; diff --git a/cake/console/libs/tasks/extract.php b/cake/console/libs/tasks/extract.php index 0c30e2909..23a0af778 100644 --- a/cake/console/libs/tasks/extract.php +++ b/cake/console/libs/tasks/extract.php @@ -186,9 +186,8 @@ function __extract() { * Show help options * * @return void - * @access public */ - function help() { + public function help() { $this->out(__('CakePHP Language String Extraction:', true)); $this->hr(); $this->out(__('The Extract script generates .pot file(s) with translations', true)); diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 87822b65c..083165da7 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -53,9 +53,8 @@ class FixtureTask extends BakeTask { /** * Override initialize * - * @access public */ - function __construct(&$dispatch) { + public function __construct(&$dispatch) { parent::__construct($dispatch); $this->path = $this->params['working'] . DS . 'tests' . DS . 'fixtures' . DS; } @@ -64,9 +63,8 @@ function __construct(&$dispatch) { * Execution method always used for tasks * Handles dispatching to interactive, named, or all processess. * - * @access public */ - function execute() { + public function execute() { if (empty($this->args)) { $this->__interactive(); } @@ -126,9 +124,8 @@ function __interactive() { * * @param string $modelName Name of model you are dealing with. * @return array Array of import options. - * @access public */ - function importOptions($modelName) { + public function importOptions($modelName) { $options = array(); $doSchema = $this->in(__('Would you like to import schema for this fixture?', true), array('y', 'n'), 'n'); if ($doSchema == 'y') { @@ -155,9 +152,8 @@ function importOptions($modelName) { * @param string $useTable Name of table to use. * @param array $importOptions Options for public $import * @return string Baked fixture content - * @access public */ - function bake($model, $useTable = false, $importOptions = array()) { + public function bake($model, $useTable = false, $importOptions = array()) { if (!class_exists('CakeSchema')) { App::import('Model', 'CakeSchema', false); } @@ -216,9 +212,8 @@ function bake($model, $useTable = false, $importOptions = array()) { * @param string $model name of the model being generated * @param string $fixture Contents of the fixture file. * @return string Content saved into fixture file. - * @access public */ - function generateFixtureFile($model, $otherVars) { + public function generateFixtureFile($model, $otherVars) { $defaults = array('table' => null, 'schema' => null, 'records' => null, 'import' => null, 'fields' => null); $vars = array_merge($defaults, $otherVars); @@ -394,9 +389,8 @@ function _getRecordsFromTable($modelName, $useTable = null) { /** * Displays help contents * - * @access public */ - function help() { + public function help() { $this->hr(); $this->out("Usage: cake bake fixture <arg1> <params>"); $this->hr(); diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 61395b9f3..e9691cd3a 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -71,9 +71,8 @@ class ModelTask extends BakeTask { /** * Execution method always used for tasks * - * @access public */ - function execute() { + public function execute() { App::import('Model', 'Model', false); if (empty($this->args)) { @@ -277,9 +276,8 @@ function _printAssociation($modelName, $type, $associations) { * * @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) { + public function findPrimaryKey($fields) { foreach ($fields as $name => $field) { if (isset($field['key']) && $field['key'] == 'primary') { break; @@ -311,9 +309,8 @@ function findDisplayField($fields) { * * @param object $model Model to have validations generated for. * @return array $validate Array of user selected validations. - * @access public */ - function doValidation(&$model) { + public function doValidation(&$model) { if (!is_object($model)) { return false; } @@ -446,9 +443,8 @@ function fieldValidation($fieldName, $metaData, $primaryKey = 'id') { * * @param object $model * @return array $assocaitons - * @access public */ - function doAssociations(&$model) { + public function doAssociations(&$model) { if (!is_object($model)) { return false; } @@ -772,9 +768,8 @@ function bakeTest($className) { * outputs the a list of possible models or controllers from database * * @param string $useDbConfig Database configuration name - * @access public */ - function listAll($useDbConfig = null) { + public function listAll($useDbConfig = null) { $this->_tables = $this->getAllTables($useDbConfig); if ($this->interactive === true) { @@ -855,9 +850,8 @@ function getAllTables($useDbConfig = null) { * Forces the user to specify the model he wants to bake, and returns the selected model name. * * @return string the model name - * @access public */ - function getName($useDbConfig = null) { + public function getName($useDbConfig = null) { $this->listAll($useDbConfig); $enteredModel = ''; @@ -886,9 +880,8 @@ function getName($useDbConfig = null) { /** * Displays help contents * - * @access public */ - function help() { + public function help() { $this->hr(); $this->out("Usage: cake bake model <arg1>"); $this->hr(); diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php index e8c5f3371..698c88583 100644 --- a/cake/console/libs/tasks/plugin.php +++ b/cake/console/libs/tasks/plugin.php @@ -222,9 +222,8 @@ function findPath($pathOptions) { * Help * * @return void - * @access public */ - function help() { + public function help() { $this->hr(); $this->out("Usage: cake bake plugin <arg1> <arg2>..."); $this->hr(); diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php index c64d65e14..661f90a80 100644 --- a/cake/console/libs/tasks/project.php +++ b/cake/console/libs/tasks/project.php @@ -38,9 +38,8 @@ class ProjectTask extends Shell { * finds the app directory in it. Then it calls bake() with that information. * * @param string $project Project path - * @access public */ - function execute($project = null) { + public function execute($project = null) { if ($project === null) { if (isset($this->args[0])) { $project = $this->args[0]; @@ -187,9 +186,8 @@ function bake($path, $skel = null, $skip = array('empty')) { * * @param string $dir Path to project * @return boolean Success - * @access public */ - function createHome($dir) { + public function createHome($dir) { $app = basename($dir); $path = $dir . 'views' . DS . 'pages' . DS; $source = CAKE . 'console' . DS . 'templates' . DS .'default' . DS . 'views' . DS . 'home.ctp'; @@ -202,9 +200,8 @@ function createHome($dir) { * * @param string $path Project path * @return boolean Success - * @access public */ - function securitySalt($path) { + public function securitySalt($path) { $File =& new File($path . 'config' . DS . 'core.php'); $contents = $File->read(); if (preg_match('/([\\t\\x20]*Configure::write\\(\\\'Security.salt\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) { @@ -226,9 +223,8 @@ function securitySalt($path) { * * @param string $path Project path * @return boolean Success - * @access public - */ - function securityCipherSeed($path) { + */ + public function securityCipherSeed($path) { $File =& new File($path . 'config' . DS . 'core.php'); $contents = $File->read(); if (preg_match('/([\\t\\x20]*Configure::write\\(\\\'Security.cipherSeed\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) { @@ -250,9 +246,8 @@ function securityCipherSeed($path) { * * @param string $path Project path * @return boolean Success - * @access public */ - function corePath($path) { + public function corePath($path) { if (dirname($path) !== CAKE_CORE_INCLUDE_PATH) { $File =& new File($path . 'webroot' . DS . 'index.php'); $contents = $File->read(); @@ -285,9 +280,8 @@ function corePath($path) { * * @param string $name Name to use as admin routing * @return boolean Success - * @access public */ - function cakeAdmin($name) { + public function cakeAdmin($name) { $path = (empty($this->configPath)) ? CONFIGS : $this->configPath; $File =& new File($path . 'core.php'); $contents = $File->read(); @@ -308,9 +302,8 @@ function cakeAdmin($name) { * Checks for Configure::read('Routing.prefixes') and forces user to input it if not enabled * * @return string Admin route to use - * @access public */ - function getPrefix() { + public function getPrefix() { $admin = ''; $prefixes = Configure::read('Routing.prefixes'); if (!empty($prefixes)) { @@ -353,9 +346,8 @@ function getPrefix() { * Help * * @return void - * @access public */ - function help() { + public function help() { $this->hr(); $this->out("Usage: cake bake project <arg1>"); $this->hr(); diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 356cf2313..74d32b7fc 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -64,9 +64,8 @@ class TestTask extends BakeTask { /** * Execution method always used for tasks * - * @access public */ - function execute() { + public function execute() { if (empty($this->args)) { $this->__interactive(); } @@ -114,9 +113,8 @@ function __interactive($type = null) { * * @param string $type Type of object to bake test case for ie. Model, Controller * @param string $className the 'cake name' for the class ie. Posts for the PostsController - * @access public */ - function bake($type, $className) { + public function bake($type, $className) { if ($this->typeCanDetectFixtures($type) && $this->isLoadableClass($type, $className)) { $this->out(__('Bake is detecting possible fixtures..', true)); $testSubject =& $this->buildTestSubject($type, $className); @@ -155,9 +153,8 @@ function bake($type, $className) { * Interact with the user and get their chosen type. Can exit the script. * * @return string Users chosen type. - * @access public */ - function getObjectType() { + public function getObjectType() { $this->hr(); $this->out(__("Select an object type:", true)); $this->hr(); @@ -180,9 +177,8 @@ function getObjectType() { * * @param string $objectType Type of object to list classes for i.e. Model, Controller. * @return string Class name the user chose. - * @access public */ - function getClassName($objectType) { + public function getClassName($objectType) { $options = App::objects(strtolower($objectType)); $this->out(sprintf(__('Choose a %s class', true), $objectType)); $keys = array(); @@ -204,9 +200,8 @@ function getClassName($objectType) { * @param string $type The Type of object you are generating tests for eg. controller * @param string $className the Classname of the class the test is being generated for. * @return boolean - * @access public */ - function typeCanDetectFixtures($type) { + public function typeCanDetectFixtures($type) { $type = strtolower($type); return ($type == 'controller' || $type == 'model'); } @@ -217,9 +212,8 @@ function typeCanDetectFixtures($type) { * @param string $type The Type of object you are generating tests for eg. controller * @param string $className the Classname of the class the test is being generated for. * @return boolean - * @access public */ - function isLoadableClass($type, $class) { + public function isLoadableClass($type, $class) { return App::import($type, $class); } @@ -230,9 +224,8 @@ function isLoadableClass($type, $class) { * @param string $type The Type of object you are generating tests for eg. controller * @param string $class the Classname of the class the test is being generated for. * @return object And instance of the class that is going to be tested. - * @access public */ - function &buildTestSubject($type, $class) { + public function &buildTestSubject($type, $class) { ClassRegistry::flush(); App::import($type, $class); $class = $this->getRealClassName($type, $class); @@ -250,9 +243,8 @@ function &buildTestSubject($type, $class) { * @param string $type The Type of object you are generating tests for eg. controller * @param string $class the Classname of the class the test is being generated for. * @return string Real classname - * @access public */ - function getRealClassName($type, $class) { + public function getRealClassName($type, $class) { if (strtolower($type) == 'model') { return $class; } @@ -265,9 +257,8 @@ function getRealClassName($type, $class) { * * @param string $className Name of class to look at. * @return array Array of method names. - * @access public */ - function getTestableMethods($className) { + public function getTestableMethods($className) { $classMethods = get_class_methods($className); $parentMethods = get_class_methods(get_parent_class($className)); $thisMethods = array_diff($classMethods, $parentMethods); @@ -286,9 +277,8 @@ function getTestableMethods($className) { * * @param object $subject The object you want to generate fixtures for. * @return array Array of fixtures to be included in the test. - * @access public */ - function generateFixtureList(&$subject) { + public function generateFixtureList(&$subject) { $this->_fixtures = array(); if (is_a($subject, 'Model')) { $this->_processModel($subject); @@ -365,9 +355,8 @@ function _addFixture($name) { * Interact with the user to get additional fixtures they want to use. * * @return array Array of fixtures the user wants to add. - * @access public */ - function getUserFixtures() { + public function getUserFixtures() { $proceed = $this->in(__('Bake could not detect fixtures, would you like to add some?', true), array('y','n'), 'n'); $fixtures = array(); if (strtolower($proceed) == 'y') { @@ -385,9 +374,8 @@ function getUserFixtures() { * * @param string $type The type of object tests are being generated for eg. controller. * @return boolean - * @access public */ - function hasMockClass($type) { + public function hasMockClass($type) { $type = strtolower($type); return $type == 'controller'; } @@ -398,9 +386,8 @@ function hasMockClass($type) { * @param string $type The Type of object you are generating tests for eg. controller * @param string $className the Classname of the class the test is being generated for. * @return string Constructor snippet for the thing you are building. - * @access public */ - function generateConstructor($type, $fullClassName) { + public function generateConstructor($type, $fullClassName) { $type = strtolower($type); if ($type == 'model') { return "ClassRegistry::init('$fullClassName');\n"; @@ -419,9 +406,8 @@ function generateConstructor($type, $fullClassName) { * @param string $type The Type of object you are generating tests for eg. controller * @param string $className the Classname of the class the test is being generated for. * @return string filename the test should be created on. - * @access public */ - function testCaseFileName($type, $className) { + public function testCaseFileName($type, $className) { $path = $this->getPath();; $path .= 'cases' . DS . Inflector::tableize($type) . DS; if (strtolower($type) == 'controller') { @@ -434,9 +420,8 @@ function testCaseFileName($type, $className) { * Show help file. * * @return void - * @access public */ - function help() { + public function help() { $this->hr(); $this->out("Usage: cake bake test <type> <class>"); $this->hr(); diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 790ab8c0c..e42e3ed8d 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -88,17 +88,15 @@ class ViewTask extends BakeTask { /** * Override initialize * - * @access public */ - function initialize() { + public function initialize() { } /** * Execution method always used for tasks * - * @access public */ - function execute() { + public function execute() { if (empty($this->args)) { $this->__interactive(); } @@ -359,9 +357,8 @@ function customAction() { * @param string $action Action to bake * @param string $content Content to write * @return boolean Success - * @access public */ - function bake($action, $content = '') { + public function bake($action, $content = '') { if ($content === true) { $content = $this->getContent($action); } @@ -376,9 +373,8 @@ function bake($action, $content = '') { * @param string $action name to generate content to * @param array $vars passed for use in templates * @return string content from template - * @access public */ - function getContent($action, $vars = null) { + public function getContent($action, $vars = null) { if (!$vars) { $vars = $this->__loadController(); } @@ -398,9 +394,8 @@ function getContent($action, $vars = null) { * * @param string $action name * @return string template name - * @access public */ - function getTemplate($action) { + public function getTemplate($action) { if ($action != $this->template && in_array($action, $this->noTemplateActions)) { return false; } @@ -425,9 +420,8 @@ function getTemplate($action) { /** * Displays help contents * - * @access public */ - function help() { + public function help() { $this->hr(); $this->out("Usage: cake bake view <arg1> <arg2>..."); $this->hr(); diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php index 4dfb1f6bf..6f4c91db8 100644 --- a/cake/console/libs/testsuite.php +++ b/cake/console/libs/testsuite.php @@ -73,9 +73,8 @@ class TestSuiteShell extends Shell { * Initialization method installs Simpletest and loads all plugins * * @return void - * @access public */ - function initialize() { + public function initialize() { $corePath = App::core('cake'); if (isset($corePath[0])) { define('TEST_CAKE_CORE_INCLUDE_PATH', rtrim($corePath[0], DS) . DS); @@ -100,9 +99,8 @@ function initialize() { * Parse the arguments given into the Shell object properties. * * @return void - * @access public */ - function parseArgs() { + public function parseArgs() { if (empty($this->args)) { return; } @@ -146,9 +144,8 @@ function getManager() { * Main entry point to this shell * * @return void - * @access public */ - function main() { + public function main() { $this->out(__('CakePHP Test Shell', true)); $this->hr(); @@ -174,9 +171,8 @@ function main() { * Help screen * * @return void - * @access public */ - function help() { + public function help() { $this->out('Usage: '); $this->out("\tcake testsuite category test_type file"); $this->out("\t\t- category - \"app\", \"core\" or name of a plugin"); diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 9e91c68e2..3762ea3da 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -92,9 +92,8 @@ function __construct($url = null, $base = false) { * @param string $url URL information to work on * @param array $additionalParams Settings array ("bare", "return") which is melded with the GET and POST params * @return boolean Success - * @access public */ - function dispatch($url = null, $additionalParams = array()) { + public function dispatch($url = null, $additionalParams = array()) { if ($this->base === false) { $this->base = $this->baseUrl(); } @@ -236,9 +235,8 @@ function __extractParams($url, $additionalParams = array()) { * * @param string $fromUrl URL to mine for parameter information. * @return array Parameters found in POST and GET. - * @access public */ - function parseParams($fromUrl) { + public function parseParams($fromUrl) { $params = array(); if (isset($_POST)) { @@ -315,9 +313,8 @@ function parseParams($fromUrl) { * Returns a base URL and sets the proper webroot * * @return string Base URL - * @access public */ - function baseUrl() { + public function baseUrl() { $dir = $webroot = null; $config = Configure::read('App'); extract($config); @@ -461,9 +458,8 @@ function __loadController($params) { * constructs a new one, using the PHP_SELF constant and other variables. * * @return string URI - * @access public */ - function uri() { + public function uri() { foreach (array('HTTP_X_REWRITE_URL', 'REQUEST_URI', 'argv') as $var) { if ($uri = env($var)) { if ($var == 'argv') { @@ -508,9 +504,8 @@ function uri() { * @param string $uri Request URI * @param string $base Base path * @return string URL - * @access public */ - function getUrl($uri = null, $base = null) { + public function getUrl($uri = null, $base = null) { if (empty($_GET['url'])) { if ($uri == null) { $uri = $this->uri(); @@ -557,9 +552,8 @@ function getUrl($uri = null, $base = null) { * Outputs cached dispatch view cache * * @param string $url Requested URL - * @access public */ - function cached($url) { + public function cached($url) { if (Configure::read('Cache.check') === true) { $path = $this->here; if ($this->here == '/') { @@ -594,9 +588,8 @@ function cached($url) { * * @param $url string $url Requested URL * @return boolean True on success if the asset file was found and sent - * @access public */ - function asset($url) { + public function asset($url) { if (strpos($url, '..') !== false || strpos($url, '.') === false) { return false; } diff --git a/cake/libs/cache.php b/cake/libs/cache.php index a3e918656..e5e2f28b6 100644 --- a/cake/libs/cache.php +++ b/cake/libs/cache.php @@ -361,9 +361,8 @@ function read($key, $config = null) { * default config will be used. * @return mixed new value, or false if the data doesn't exist, is not integer, * or if there was an error fetching it. - * @access public */ - function increment($key, $offset = 1, $config = null) { + public function increment($key, $offset = 1, $config = null) { $self =& Cache::getInstance(); if (!$config) { @@ -395,9 +394,8 @@ function increment($key, $offset = 1, $config = null) { * default config will be used. * @return mixed new value, or false if the data doesn't exist, is not integer, * or if there was an error fetching it - * @access public */ - function decrement($key, $offset = 1, $config = null) { + public function decrement($key, $offset = 1, $config = null) { $self =& Cache::getInstance(); if (!$config) { @@ -558,9 +556,8 @@ class CacheEngine { * * @param array $params Associative array of parameters for the engine * @return boolean True if the engine has been succesfully initialized, false if not - * @access public */ - function init($settings = array()) { + public function init($settings = array()) { $this->settings = array_merge( array('prefix' => 'cake_', 'duration'=> 3600, 'probability'=> 100), $this->settings, @@ -577,9 +574,8 @@ function init($settings = array()) { * * Permanently remove all expired and deleted data * - * @access public */ - function gc() { + public function gc() { } /** @@ -589,9 +585,8 @@ function gc() { * @param mixed $value Data to be cached * @param mixed $duration How long to cache the data, in seconds * @return boolean True if the data was succesfully cached, false on failure - * @access public */ - function write($key, &$value, $duration) { + public function write($key, &$value, $duration) { trigger_error(sprintf(__('Method write() not implemented in %s', true), get_class($this)), E_USER_ERROR); } @@ -600,9 +595,8 @@ function write($key, &$value, $duration) { * * @param string $key Identifier for the data * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it - * @access public */ - function read($key) { + public function read($key) { trigger_error(sprintf(__('Method read() not implemented in %s', true), get_class($this)), E_USER_ERROR); } @@ -612,9 +606,8 @@ function read($key) { * @param string $key Identifier for the data * @param integer $offset How much to add * @return New incremented value, false otherwise - * @access public */ - function increment($key, $offset = 1) { + public function increment($key, $offset = 1) { trigger_error(sprintf(__('Method increment() not implemented in %s', true), get_class($this)), E_USER_ERROR); } /** @@ -623,9 +616,8 @@ function increment($key, $offset = 1) { * @param string $key Identifier for the data * @param integer $value How much to substract * @return New incremented value, false otherwise - * @access public */ - function decrement($key, $offset = 1) { + public function decrement($key, $offset = 1) { trigger_error(sprintf(__('Method decrement() not implemented in %s', true), get_class($this)), E_USER_ERROR); } /** @@ -633,9 +625,8 @@ function decrement($key, $offset = 1) { * * @param string $key Identifier for the data * @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed - * @access public */ - function delete($key) { + public function delete($key) { } /** @@ -643,18 +634,16 @@ function delete($key) { * * @param boolean $check if true will check expiration, otherwise delete all * @return boolean True if the cache was succesfully cleared, false otherwise - * @access public */ - function clear($check) { + public function clear($check) { } /** * Cache Engine settings * * @return array settings - * @access public */ - function settings() { + public function settings() { return $this->settings; } @@ -663,9 +652,8 @@ function settings() { * * @param string $key the key passed over * @return mixed string $key or false - * @access public */ - function key($key) { + public function key($key) { if (empty($key)) { return false; } diff --git a/cake/libs/cache/apc.php b/cake/libs/cache/apc.php index 3a86e099b..2fbf08ab3 100644 --- a/cake/libs/cache/apc.php +++ b/cake/libs/cache/apc.php @@ -36,9 +36,8 @@ class ApcEngine extends CacheEngine { * @param array $setting array of setting for the engine * @return boolean True if the engine has been successfully initialized, false if not * @see CacheEngine::__defaults - * @access public */ - function init($settings = array()) { + public function init($settings = array()) { parent::init(array_merge(array('engine' => 'Apc', 'prefix' => Inflector::slug(APP_DIR) . '_'), $settings)); return function_exists('apc_cache_info'); } @@ -50,9 +49,8 @@ function init($settings = array()) { * @param mixed $value Data to be cached * @param integer $duration How long to cache the data, in seconds * @return boolean True if the data was succesfully cached, false on failure - * @access public */ - function write($key, &$value, $duration) { + public function write($key, &$value, $duration) { $expires = time() + $duration; apc_store($key.'_expires', $expires, $duration); return apc_store($key, $value, $duration); @@ -63,9 +61,8 @@ function write($key, &$value, $duration) { * * @param string $key Identifier for the data * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it - * @access public */ - function read($key) { + public function read($key) { $time = time(); $cachetime = intval(apc_fetch($key.'_expires')); if ($cachetime < $time || ($time + $this->settings['duration']) < $cachetime) { @@ -81,9 +78,8 @@ function read($key) { * @param integer $offset How much to increment * @param integer $duration How long to cache the data, in seconds * @return New incremented value, false otherwise - * @access public */ - function increment($key, $offset = 1) { + public function increment($key, $offset = 1) { return apc_inc($key, $offset); } @@ -94,9 +90,8 @@ function increment($key, $offset = 1) { * @param integer $offset How much to substract * @param integer $duration How long to cache the data, in seconds * @return New decremented value, false otherwise - * @access public */ - function decrement($key, $offset = 1) { + public function decrement($key, $offset = 1) { return apc_dec($key, $offset); } @@ -105,9 +100,8 @@ function decrement($key, $offset = 1) { * * @param string $key Identifier for the data * @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed - * @access public */ - function delete($key) { + public function delete($key) { return apc_delete($key); } @@ -115,9 +109,8 @@ function delete($key) { * Delete all keys from the cache * * @return boolean True if the cache was succesfully cleared, false otherwise - * @access public */ - function clear() { + public function clear() { return apc_clear_cache('user'); } } diff --git a/cake/libs/cache/file.php b/cake/libs/cache/file.php index 2c677f359..656e3511f 100644 --- a/cake/libs/cache/file.php +++ b/cake/libs/cache/file.php @@ -69,9 +69,8 @@ class FileEngine extends CacheEngine { * * @param array $setting array of setting for the engine * @return boolean True if the engine has been successfully initialized, false if not - * @access public */ - function init($settings = array()) { + public function init($settings = array()) { parent::init(array_merge( array( 'engine' => 'File', 'path' => CACHE, 'prefix'=> 'cake_', 'lock'=> false, @@ -98,9 +97,8 @@ function init($settings = array()) { * Garbage collection. Permanently remove all expired and deleted data * * @return boolean True if garbage collection was succesful, false on failure - * @access public */ - function gc() { + public function gc() { return $this->clear(true); } @@ -111,9 +109,8 @@ function gc() { * @param mixed $data Data to be cached * @param mixed $duration How long to cache the data, in seconds * @return boolean True if the data was succesfully cached, false on failure - * @access public */ - function write($key, &$data, $duration) { + public function write($key, &$data, $duration) { if ($data === '' || !$this->_init) { return false; } @@ -151,9 +148,8 @@ function write($key, &$data, $duration) { * * @param string $key Identifier for the data * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it - * @access public */ - function read($key) { + public function read($key) { if ($this->_setKey($key) === false || !$this->_init || !$this->_File->exists()) { return false; } @@ -184,9 +180,8 @@ function read($key) { * * @param string $key Identifier for the data * @return boolean True if the value was successfully deleted, false if it didn't exist or couldn't be removed - * @access public */ - function delete($key) { + public function delete($key) { if ($this->_setKey($key) === false || !$this->_init) { return false; } @@ -198,9 +193,8 @@ function delete($key) { * * @param boolean $check Optional - only delete expired cache items * @return boolean True if the cache was succesfully cleared, false otherwise - * @access public */ - function clear($check) { + public function clear($check) { if (!$this->_init) { return false; } diff --git a/cake/libs/cache/memcache.php b/cake/libs/cache/memcache.php index 0e54da760..30d602e2b 100644 --- a/cake/libs/cache/memcache.php +++ b/cake/libs/cache/memcache.php @@ -55,9 +55,8 @@ class MemcacheEngine extends CacheEngine { * * @param array $setting array of setting for the engine * @return boolean True if the engine has been successfully initialized, false if not - * @access public */ - function init($settings = array()) { + public function init($settings = array()) { if (!class_exists('Memcache')) { return false; } @@ -101,9 +100,8 @@ function init($settings = array()) { * @param mixed $value Data to be cached * @param integer $duration How long to cache the data, in seconds * @return boolean True if the data was succesfully cached, false on failure - * @access public */ - function write($key, &$value, $duration) { + public function write($key, &$value, $duration) { $expires = time() + $duration; $this->__Memcache->set($key . '_expires', $expires, $this->settings['compress'], $expires); return $this->__Memcache->set($key, $value, $this->settings['compress'], $expires); @@ -114,9 +112,8 @@ function write($key, &$value, $duration) { * * @param string $key Identifier for the data * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it - * @access public */ - function read($key) { + public function read($key) { $time = time(); $cachetime = intval($this->__Memcache->get($key . '_expires')); if ($cachetime < $time || ($time + $this->settings['duration']) < $cachetime) { @@ -132,9 +129,8 @@ function read($key) { * @param integer $offset How much to increment * @param integer $duration How long to cache the data, in seconds * @return New incremented value, false otherwise - * @access public */ - function increment($key, $offset = 1) { + public function increment($key, $offset = 1) { if ($this->settings['compress']) { trigger_error(sprintf(__('Method increment() not implemented for compressed cache in %s', true), get_class($this)), E_USER_ERROR); } @@ -148,9 +144,8 @@ function increment($key, $offset = 1) { * @param integer $offset How much to substract * @param integer $duration How long to cache the data, in seconds * @return New decremented value, false otherwise - * @access public */ - function decrement($key, $offset = 1) { + public function decrement($key, $offset = 1) { if ($this->settings['compress']) { trigger_error(sprintf(__('Method decrement() not implemented for compressed cache in %s', true), get_class($this)), E_USER_ERROR); } @@ -162,9 +157,8 @@ function decrement($key, $offset = 1) { * * @param string $key Identifier for the data * @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed - * @access public */ - function delete($key) { + public function delete($key) { return $this->__Memcache->delete($key); } @@ -172,9 +166,8 @@ function delete($key) { * Delete all keys from the cache * * @return boolean True if the cache was succesfully cleared, false otherwise - * @access public */ - function clear() { + public function clear() { return $this->__Memcache->flush(); } @@ -184,9 +177,8 @@ function clear() { * @param string $host host ip address or name * @param integer $port Server port * @return boolean True if memcache server was connected - * @access public */ - function connect($host, $port = 11211) { + public function connect($host, $port = 11211) { if ($this->__Memcache->getServerStatus($host, $port) === 0) { if ($this->__Memcache->connect($host, $port)) { return true; diff --git a/cake/libs/cache/xcache.php b/cake/libs/cache/xcache.php index f6e094001..ef2dca124 100644 --- a/cake/libs/cache/xcache.php +++ b/cake/libs/cache/xcache.php @@ -46,9 +46,8 @@ class XcacheEngine extends CacheEngine { * * @param array $setting array of setting for the engine * @return boolean True if the engine has been successfully initialized, false if not - * @access public */ - function init($settings) { + public function init($settings) { parent::init(array_merge(array( 'engine' => 'Xcache', 'prefix' => Inflector::slug(APP_DIR) . '_', 'PHP_AUTH_USER' => 'user', 'PHP_AUTH_PW' => 'password' ), $settings) @@ -63,9 +62,8 @@ function init($settings) { * @param mixed $value Data to be cached * @param integer $duration How long to cache the data, in seconds * @return boolean True if the data was succesfully cached, false on failure - * @access public */ - function write($key, &$value, $duration) { + public function write($key, &$value, $duration) { $expires = time() + $duration; xcache_set($key . '_expires', $expires, $duration); return xcache_set($key, $value, $duration); @@ -76,9 +74,8 @@ function write($key, &$value, $duration) { * * @param string $key Identifier for the data * @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it - * @access public */ - function read($key) { + public function read($key) { if (xcache_isset($key)) { $time = time(); $cachetime = intval(xcache_get($key . '_expires')); @@ -98,9 +95,8 @@ function read($key) { * @param integer $offset How much to increment * @param integer $duration How long to cache the data, in seconds * @return New incremented value, false otherwise - * @access public */ - function increment($key, $offset = 1) { + public function increment($key, $offset = 1) { return xcache_inc($key, $offset); } @@ -112,9 +108,8 @@ function increment($key, $offset = 1) { * @param integer $offset How much to substract * @param integer $duration How long to cache the data, in seconds * @return New decremented value, false otherwise - * @access public */ - function decrement($key, $offset = 1) { + public function decrement($key, $offset = 1) { return xcache_dec($key, $offset); } /** @@ -122,9 +117,8 @@ function decrement($key, $offset = 1) { * * @param string $key Identifier for the data * @return boolean True if the value was succesfully deleted, false if it didn't exist or couldn't be removed - * @access public */ - function delete($key) { + public function delete($key) { return xcache_unset($key); } @@ -132,9 +126,8 @@ function delete($key) { * Delete all keys from the cache * * @return boolean True if the cache was succesfully cleared, false otherwise - * @access public */ - function clear() { + public function clear() { $this->__auth(); $max = xcache_count(XC_TYPE_VAR); for ($i = 0; $i < $max; $i++) { diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index bf85595c1..a18753943 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -135,9 +135,8 @@ class CakeSession extends Object { * * @param string $base The base path for the Session * @param boolean $start Should session be started right now - * @access public */ - function __construct($base = null, $start = true) { + public function __construct($base = null, $start = true) { App::import('Core', array('Set', 'Security')); $this->time = time(); @@ -198,9 +197,8 @@ function __construct($base = null, $start = true) { * Starts the Session. * * @return boolean True if session was started - * @access public */ - function start() { + public function start() { if ($this->started()) { return true; } @@ -230,9 +228,8 @@ function started() { * * @param string $name Variable name to check for * @return boolean True if variable is there - * @access public */ - function check($name) { + public function check($name) { if (empty($name)) { return false; } @@ -245,9 +242,8 @@ function check($name) { * * @param id $name string * @return string Session id - * @access public */ - function id($id = null) { + public function id($id = null) { if ($id) { $this->id = $id; session_id($this->id); @@ -264,9 +260,8 @@ function id($id = null) { * * @param string $name Session variable to remove * @return boolean Success - * @access public */ - function delete($name) { + public function delete($name) { if ($this->check($name)) { if (in_array($name, $this->watchKeys)) { trigger_error(sprintf(__('Deleting session key {%s}', true), $name), E_USER_NOTICE); @@ -317,9 +312,8 @@ function __error($errorNumber) { * Returns last occurred error as a string, if any. * * @return mixed Error description as a string, or false. - * @access public */ - function error() { + public function error() { if ($this->lastError) { return $this->__error($this->lastError); } else { @@ -331,9 +325,8 @@ function error() { * Returns true if session is valid. * * @return boolean Success - * @access public */ - function valid() { + public function valid() { if ($this->read('Config')) { if ((Configure::read('Session.checkAgent') === false || $this->_userAgent == $this->read('Config.userAgent')) && $this->time <= $this->read('Config.time')) { if ($this->error === false) { @@ -352,9 +345,8 @@ function valid() { * * @param mixed $name The name of the session variable (or a path as sent to Set.extract) * @return mixed The value of the session variable - * @access public */ - function read($name = null) { + public function read($name = null) { if (is_null($name)) { return $this->__returnSessionVars(); } @@ -389,9 +381,8 @@ function __returnSessionVars() { * * @param mixed $var The variable path to watch * @return void - * @access public */ - function watch($var) { + public function watch($var) { if (empty($var)) { return false; } @@ -405,9 +396,8 @@ function watch($var) { * * @param mixed $var The variable path to watch * @return void - * @access public */ - function ignore($var) { + public function ignore($var) { if (!in_array($var, $this->watchKeys)) { return; } @@ -426,9 +416,8 @@ function ignore($var) { * @param mixed $name Name of variable * @param string $value Value to write * @return boolean True if the write was successful, false if the write failed - * @access public */ - function write($name, $value) { + public function write($name, $value) { if (empty($name)) { return false; } @@ -443,9 +432,8 @@ function write($name, $value) { * Helper method to destroy invalid sessions. * * @return void - * @access public */ - function destroy() { + public function destroy() { $_SESSION = array(); $this->__construct($this->path); $this->start(); @@ -671,9 +659,8 @@ function __regenerateId() { /** * Restarts this session. * - * @access public */ - function renew() { + public function renew() { $this->__regenerateId(); } diff --git a/cake/libs/cake_socket.php b/cake/libs/cake_socket.php index 0c14876b9..c5995c1ac 100644 --- a/cake/libs/cake_socket.php +++ b/cake/libs/cake_socket.php @@ -102,9 +102,8 @@ function __construct($config = array()) { * Connect the socket to the given host and port. * * @return boolean Success - * @access public */ - function connect() { + public function connect() { if ($this->connection != null) { $this->disconnect(); } @@ -136,9 +135,8 @@ function connect() { * Get the host name of the current connection. * * @return string Host name - * @access public */ - function host() { + public function host() { if (Validation::ip($this->config['host'])) { return gethostbyaddr($this->config['host']); } else { @@ -150,9 +148,8 @@ function host() { * Get the IP address of the current connection. * * @return string IP address - * @access public */ - function address() { + public function address() { if (Validation::ip($this->config['host'])) { return $this->config['host']; } else { @@ -164,9 +161,8 @@ function address() { * Get all IP addresses associated with the current connection. * * @return array IP addresses - * @access public */ - function addresses() { + public function addresses() { if (Validation::ip($this->config['host'])) { return array($this->config['host']); } else { @@ -178,9 +174,8 @@ function addresses() { * Get the last error as a string. * * @return string Last error - * @access public */ - function lastError() { + public function lastError() { if (!empty($this->lastError)) { return $this->lastError['num'] . ': ' . $this->lastError['str']; } else { @@ -193,9 +188,8 @@ function lastError() { * * @param integer $errNum Error code * @param string $errStr Error string - * @access public */ - function setLastError($errNum, $errStr) { + public function setLastError($errNum, $errStr) { $this->lastError = array('num' => $errNum, 'str' => $errStr); } @@ -204,9 +198,8 @@ function setLastError($errNum, $errStr) { * * @param string $data The data to write to the socket * @return boolean Success - * @access public */ - function write($data) { + public function write($data) { if (!$this->connected) { if (!$this->connect()) { return false; @@ -222,9 +215,8 @@ function write($data) { * * @param integer $length Optional buffer length to read; defaults to 1024 * @return mixed Socket data - * @access public */ - function read($length = 1024) { + public function read($length = 1024) { if (!$this->connected) { if (!$this->connect()) { return false; @@ -248,18 +240,16 @@ function read($length = 1024) { * Abort socket operation. * * @return boolean Success - * @access public */ - function abort() { + public function abort() { } /** * Disconnect the socket from the current connection. * * @return boolean Success - * @access public */ - function disconnect() { + public function disconnect() { if (!is_resource($this->connection)) { $this->connected = false; return true; @@ -285,9 +275,8 @@ function __destruct() { * Resets the state of this Socket instance to it's initial state (before Object::__construct got executed) * * @return boolean True on success - * @access public */ - function reset($state = null) { + public function reset($state = null) { if (empty($state)) { static $initalState = array(); if (empty($initalState)) { diff --git a/cake/libs/class_registry.php b/cake/libs/class_registry.php index dd78c35c9..42aa17f9e 100644 --- a/cake/libs/class_registry.php +++ b/cake/libs/class_registry.php @@ -60,9 +60,8 @@ class ClassRegistry { * Return a singleton instance of the ClassRegistry. * * @return ClassRegistry instance - * @access public */ - function &getInstance() { + public function &getInstance() { static $instance = array(); if (!$instance) { $instance[0] =& new ClassRegistry(); diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 4fef8051d..7fd198a25 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -40,9 +40,8 @@ class Configure extends Object { * Returns a singleton instance of the Configure class. * * @return Configure instance - * @access public */ - function &getInstance($boot = true) { + public function &getInstance($boot = true) { static $instance = array(); if (!$instance) { if (!class_exists('Set')) { @@ -76,9 +75,8 @@ function &getInstance($boot = true) { * @param array $config Name of var to write * @param mixed $value Value to set for var * @return boolean True if write was successful - * @access public */ - function write($config, $value = null) { + public function write($config, $value = null) { $_this =& Configure::getInstance(); if (!is_array($config)) { @@ -148,9 +146,8 @@ function write($config, $value = null) { * @link http://book.cakephp.org/view/927/read * @param string $var Variable to obtain. Use '.' to access array elements. * @return string value of Configure::$var - * @access public */ - function read($var = 'debug') { + public function read($var = 'debug') { $_this =& Configure::getInstance(); if ($var === 'debug') { @@ -198,9 +195,8 @@ function read($var = 'debug') { * @link http://book.cakephp.org/view/928/delete * @param string $var the var to be deleted * @return void - * @access public */ - function delete($var = null) { + public function delete($var = null) { $_this =& Configure::getInstance(); if (strpos($var, '.') === false) { @@ -226,9 +222,8 @@ function delete($var = null) { * @param string $fileName name of file to load, extension must be .php and only the name * should be used, not the extenstion * @return mixed false if file not found, void if load successful - * @access public */ - function load($fileName) { + public function load($fileName) { $found = $plugin = $pluginPath = false; list($plugin, $fileName) = pluginSplit($fileName); if ($plugin) { @@ -275,9 +270,8 @@ function load($fileName) { * * @link http://book.cakephp.org/view/930/version * @return string Current version of CakePHP - * @access public */ - function version() { + public function version() { $_this =& Configure::getInstance(); if (!isset($_this->Cake['version'])) { @@ -300,9 +294,8 @@ function version() { * @param string $name file name. * @param array $data array of values to store. * @return void - * @access public */ - function store($type, $name, $data = array()) { + public function store($type, $name, $data = array()) { $write = true; $content = ''; @@ -627,9 +620,8 @@ class App extends Object { * * @param string $type type of path * @return string array - * @access public */ - function path($type) { + public function path($type) { $_this =& App::getInstance(); if (!isset($_this->{$type})) { return array(); @@ -644,9 +636,8 @@ function path($type) { * @param array $paths paths defines in config/bootstrap.php * @param boolean $reset true will set paths, false merges paths [default] false * @return void - * @access public */ - function build($paths = array(), $reset = false) { + public function build($paths = array(), $reset = false) { $_this =& App::getInstance(); $defaults = array( 'models' => array(MODELS), @@ -723,9 +714,8 @@ function pluginPath($plugin) { * @param string $type valid values are: 'model', 'behavior', 'controller', 'component', * 'view', 'helper', 'datasource', 'libs', and 'cake' * @return array numeric keyed array of core lib paths - * @access public */ - function core($type = null) { + public function core($type = null) { static $paths = false; if ($paths === false) { $paths = Cache::read('core_paths', '_cake_core_'); @@ -765,9 +755,8 @@ function core($type = null) { * type will be used. * @param boolean $cache Set to false to rescan objects of the chosen type. Defaults to true. * @return mixed Either false on incorrect / miss. Or an array of found objects. - * @access public */ - function objects($type, $path = null, $cache = true) { + public function objects($type, $path = null, $cache = true) { $objects = array(); $extension = false; $name = $type; @@ -838,9 +827,8 @@ function objects($type, $path = null, $cache = true) { * @param boolean $return, return the loaded file, the file must have a return * statement in it to work: return $variable; * @return boolean true if Class is already in memory or if file is found and loaded, false if not - * @access public */ - function import($type = null, $name = null, $parent = true, $search = array(), $file = null, $return = false) { + public function import($type = null, $name = null, $parent = true, $search = array(), $file = null, $return = false) { $plugin = $directory = null; if (is_array($type)) { @@ -958,9 +946,8 @@ function import($type = null, $name = null, $parent = true, $search = array(), $ * Returns a single instance of App. * * @return object - * @access public */ - function &getInstance() { + public function &getInstance() { static $instance = array(); if (!$instance) { $instance[0] =& new App(); diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php index 6400fc6cb..b6f6b0c11 100644 --- a/cake/libs/controller/component.php +++ b/cake/libs/controller/component.php @@ -64,9 +64,8 @@ class Component extends Object { * * @param object $controller Controller with components to load * @return void - * @access public */ - function init(&$controller) { + public function init(&$controller) { if (!is_array($controller->components)) { return; } @@ -131,9 +130,8 @@ function beforeRender(&$controller) { * * @param object $controller Controller with components to beforeRedirect * @return void - * @access public */ - function beforeRedirect(&$controller, $url, $status = null, $exit = true) { + public function beforeRedirect(&$controller, $url, $status = null, $exit = true) { $response = array(); foreach ($this->_primary as $name) { @@ -177,9 +175,8 @@ function shutdown(&$controller) { * @param Controller $controller Controller instance * @param string $callback Callback to trigger. * @return void - * @access public */ - function triggerCallback($callback, &$controller) { + public function triggerCallback($callback, &$controller) { foreach ($this->_primary as $name) { $component =& $this->_loaded[$name]; if (method_exists($component, $callback) && $component->enabled === true) { diff --git a/cake/libs/controller/components/acl.php b/cake/libs/controller/components/acl.php index 417282161..1690f5695 100644 --- a/cake/libs/controller/components/acl.php +++ b/cake/libs/controller/components/acl.php @@ -63,9 +63,8 @@ function __construct() { * * @param object $controller Controller using this component * @return boolean Proceed with component usage (true), or fail (false) - * @access public */ - function startup(&$controller) { + public function startup(&$controller) { return true; } @@ -85,9 +84,8 @@ function _initACL() { * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success - * @access public */ - function check($aro, $aco, $action = "*") { + public function check($aro, $aco, $action = "*") { return $this->_Instance->check($aro, $aco, $action); } @@ -99,9 +97,8 @@ function check($aro, $aco, $action = "*") { * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success - * @access public */ - function allow($aro, $aco, $action = "*") { + public function allow($aro, $aco, $action = "*") { return $this->_Instance->allow($aro, $aco, $action); } @@ -113,9 +110,8 @@ function allow($aro, $aco, $action = "*") { * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success - * @access public */ - function deny($aro, $aco, $action = "*") { + public function deny($aro, $aco, $action = "*") { return $this->_Instance->deny($aro, $aco, $action); } @@ -127,9 +123,8 @@ function deny($aro, $aco, $action = "*") { * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success - * @access public */ - function inherit($aro, $aco, $action = "*") { + public function inherit($aro, $aco, $action = "*") { return $this->_Instance->inherit($aro, $aco, $action); } @@ -140,9 +135,8 @@ function inherit($aro, $aco, $action = "*") { * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success - * @access public */ - function grant($aro, $aco, $action = "*") { + public function grant($aro, $aco, $action = "*") { return $this->_Instance->grant($aro, $aco, $action); } @@ -153,9 +147,8 @@ function grant($aro, $aco, $action = "*") { * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success - * @access public */ - function revoke($aro, $aco, $action = "*") { + public function revoke($aro, $aco, $action = "*") { return $this->_Instance->revoke($aro, $aco, $action); } } @@ -187,18 +180,16 @@ function __construct() { * @param string $aro ARO The requesting object identifier. * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) - * @access public */ - function check($aro, $aco, $action = "*") { + public function check($aro, $aco, $action = "*") { } /** * Empty method to be overridden in subclasses * * @param object $component Component - * @access public */ - function initialize(&$component) { + public function initialize(&$component) { } } @@ -242,9 +233,8 @@ function __construct() { * * @param AclComponent $component * @return void - * @access public */ - function initialize(&$component) { + public function initialize(&$component) { $component->Aro =& $this->Aro; $component->Aco =& $this->Aco; } @@ -256,9 +246,8 @@ function initialize(&$component) { * @param string $aco ACO The controlled object identifier. * @param string $action Action (defaults to *) * @return boolean Success (true if ARO has access to action in ACO, false otherwise) - * @access public */ - function check($aro, $aco, $action = "*") { + public function check($aro, $aco, $action = "*") { if ($aro == null || $aco == null) { return false; } @@ -347,9 +336,8 @@ function check($aro, $aco, $action = "*") { * @param string $actions Action (defaults to *) * @param integer $value Value to indicate access type (1 to give access, -1 to deny, 0 to inherit) * @return boolean Success - * @access public */ - function allow($aro, $aco, $actions = "*", $value = 1) { + public function allow($aro, $aco, $actions = "*", $value = 1) { $perms = $this->getAclLink($aro, $aco); $permKeys = $this->_getAcoKeys($this->Aro->Permission->schema()); $save = array(); @@ -398,9 +386,8 @@ function allow($aro, $aco, $actions = "*", $value = 1) { * @param string $aco ACO The controlled object identifier. * @param string $actions Action (defaults to *) * @return boolean Success - * @access public */ - function deny($aro, $aco, $action = "*") { + public function deny($aro, $aco, $action = "*") { return $this->allow($aro, $aco, $action, -1); } @@ -411,9 +398,8 @@ function deny($aro, $aco, $action = "*") { * @param string $aco ACO The controlled object identifier. * @param string $actions Action (defaults to *) * @return boolean Success - * @access public */ - function inherit($aro, $aco, $action = "*") { + public function inherit($aro, $aco, $action = "*") { return $this->allow($aro, $aco, $action, 0); } @@ -425,9 +411,8 @@ function inherit($aro, $aco, $action = "*") { * @param string $actions Action (defaults to *) * @return boolean Success * @see allow() - * @access public */ - function grant($aro, $aco, $action = "*") { + public function grant($aro, $aco, $action = "*") { return $this->allow($aro, $aco, $action); } @@ -439,9 +424,8 @@ function grant($aro, $aco, $action = "*") { * @param string $actions Action (defaults to *) * @return boolean Success * @see deny() - * @access public */ - function revoke($aro, $aco, $action = "*") { + public function revoke($aro, $aco, $action = "*") { return $this->deny($aro, $aco, $action); } @@ -451,9 +435,8 @@ function revoke($aro, $aco, $action = "*") { * @param string $aro ARO The requesting object identifier. * @param string $aco ACO The controlled object identifier. * @return array Indexed array with: 'aro', 'aco' and 'link' - * @access public */ - function getAclLink($aro, $aco) { + public function getAclLink($aro, $aco) { $obj = array(); $obj['Aro'] = $this->Aro->node($aro); $obj['Aco'] = $this->Aco->node($aco); @@ -524,9 +507,8 @@ function __construct() { * @param string $aco ACO * @param string $aco_action Action * @return boolean Success - * @access public */ - function check($aro, $aco, $aco_action = null) { + public function check($aro, $aco, $aco_action = null) { if ($this->config == null) { $this->config = $this->readConfigFile(CONFIGS . 'acl.ini.php'); } @@ -579,9 +561,8 @@ function check($aro, $aco, $aco_action = null) { * * @param string $fileName File * @return array INI section structure - * @access public */ - function readConfigFile($fileName) { + public function readConfigFile($fileName) { $fileLineArray = file($fileName); foreach ($fileLineArray as $fileLine) { @@ -622,9 +603,8 @@ function readConfigFile($fileName) { * * @param array $array Array to trim * @return array Trimmed array - * @access public */ - function arrayTrim($array) { + public function arrayTrim($array) { foreach ($array as $key => $value) { $array[$key] = trim($value); } diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index 8cca285a5..fc377c183 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -251,9 +251,8 @@ class AuthComponent extends Object { * * @param object $controller A reference to the instantiating controller object * @return void - * @access public */ - function initialize(&$controller, $settings = array()) { + public function initialize(&$controller, $settings = array()) { $this->params = $controller->params; $crud = array('create', 'read', 'update', 'delete'); $this->actionMap = array_merge($this->actionMap, array_combine($crud, $crud)); @@ -288,9 +287,8 @@ function initialize(&$controller, $settings = array()) { * * @param object $controller A reference to the instantiating controller object * @return boolean - * @access public */ - function startup(&$controller) { + public function startup(&$controller) { $isErrorOrTests = ( strtolower($controller->name) == 'cakeerror' || (strtolower($controller->name) == 'tests' && Configure::read() > 0) @@ -487,9 +485,8 @@ function __setDefaults() { * @param mixed $object object, model object, or model name * @param mixed $user The user to check the authorization of * @return boolean True if $user is authorized, otherwise false - * @access public */ - function isAuthorized($type = null, $object = null, $user = null) { + public function isAuthorized($type = null, $object = null, $user = null) { if (empty($user) && !$this->user()) { return false; } elseif (empty($user)) { @@ -589,9 +586,8 @@ function __authType($auth = null) { * @param string $action Controller action name * @param string ... etc. * @return void - * @access public */ - function allow() { + public function allow() { $args = func_get_args(); if (empty($args) || $args == array('*')) { $this->allowedActions = $this->_methods; @@ -611,9 +607,8 @@ function allow() { * @param string ... etc. * @return void * @see AuthComponent::allow() - * @access public */ - function deny() { + public function deny() { $args = func_get_args(); if (isset($args[0]) && is_array($args[0])) { $args = $args[0]; @@ -632,9 +627,8 @@ function deny() { * * @param array $map Actions to map * @return void - * @access public */ - function mapActions($map = array()) { + public function mapActions($map = array()) { $crud = array('create', 'read', 'update', 'delete'); foreach ($map as $action => $type) { if (in_array($action, $crud) && is_array($type)) { @@ -657,9 +651,8 @@ function mapActions($map = array()) { * * @param mixed $data User object * @return boolean True on login success, false on failure - * @access public */ - function login($data = null) { + public function login($data = null) { $this->__setDefaults(); $this->_loggedIn = false; @@ -680,9 +673,8 @@ function login($data = null) { * @param mixed $url Optional URL to redirect the user to after logout * @return string AuthComponent::$loginAction * @see AuthComponent::$loginAction - * @access public */ - function logout() { + public function logout() { $this->__setDefaults(); $this->Session->delete($this->sessionKey); $this->Session->delete('Auth.redirect'); @@ -695,9 +687,8 @@ function logout() { * * @param string $key field to retrive. Leave null to get entire User record * @return mixed User record. or null if no user is logged in. - * @access public */ - function user($key = null) { + public function user($key = null) { $this->__setDefaults(); if (!$this->Session->check($this->sessionKey)) { return null; @@ -720,9 +711,8 @@ function user($key = null) { * * @param mixed $url Optional URL to write as the login redirect URL. * @return string Redirect URL - * @access public */ - function redirect($url = null) { + public function redirect($url = null) { if (!is_null($url)) { $redir = $url; $this->Session->write('Auth.redirect', $redir); @@ -750,9 +740,8 @@ function redirect($url = null) { * @param string $action Optional. The action to validate against. * @see AuthComponent::identify() * @return boolean True if the user validates, false otherwise. - * @access public */ - function validate($object, $user = null, $action = null) { + public function validate($object, $user = null, $action = null) { if (empty($user)) { $user = $this->user(); } @@ -769,9 +758,8 @@ function validate($object, $user = null, $action = null) { * user against. The current request action is used if * none is specified. * @return boolean ACO node path - * @access public */ - function action($action = ':plugin/:controller/:action') { + public function action($action = ':plugin/:controller/:action') { $plugin = empty($this->params['plugin']) ? null : Inflector::camelize($this->params['plugin']) . '/'; return str_replace( array(':controller', ':action', ':plugin/'), @@ -786,9 +774,8 @@ function action($action = ':plugin/:controller/:action') { * * @param string $name Model name (defaults to AuthComponent::$userModel) * @return object A reference to a model object - * @access public */ - function &getModel($name = null) { + public function &getModel($name = null) { $model = null; if (!$name) { $name = $this->userModel; @@ -815,9 +802,8 @@ function &getModel($name = null) { * Uses the current user session if none specified. * @param array $conditions Optional. Additional conditions to a find. * @return array User record data, or null, if the user could not be identified. - * @access public */ - function identify($user = null, $conditions = null) { + public function identify($user = null, $conditions = null) { if ($conditions === false) { $conditions = null; } elseif (is_array($conditions)) { @@ -891,9 +877,8 @@ function identify($user = null, $conditions = null) { * * @param array $data Set of data to look for passwords * @return array Data with passwords hashed - * @access public */ - function hashPasswords($data) { + public function hashPasswords($data) { if (is_object($this->authenticate) && method_exists($this->authenticate, 'hashPasswords')) { return $this->authenticate->hashPasswords($data); } @@ -912,9 +897,8 @@ function hashPasswords($data) { * * @param string $password Password to hash * @return string Hashed password - * @access public */ - function password($password) { + public function password($password) { return Security::hash($password, null, true); } @@ -922,9 +906,8 @@ function password($password) { * Component shutdown. If user is logged in, wipe out redirect. * * @param object $controller Instantiating controller - * @access public */ - function shutdown(&$controller) { + public function shutdown(&$controller) { if ($this->_loggedIn) { $this->Session->delete('Auth.redirect'); } diff --git a/cake/libs/controller/components/cookie.php b/cake/libs/controller/components/cookie.php index ce6266006..2bc6a0512 100644 --- a/cake/libs/controller/components/cookie.php +++ b/cake/libs/controller/components/cookie.php @@ -160,9 +160,8 @@ class CookieComponent extends Object { * Main execution method. * * @param object $controller A reference to the instantiating controller object - * @access public */ - function initialize(&$controller, $settings) { + public function initialize(&$controller, $settings) { $this->key = Configure::read('Security.salt'); $this->_set($settings); } @@ -170,9 +169,8 @@ function initialize(&$controller, $settings) { /** * Start CookieComponent for use in the controller * - * @access public */ - function startup() { + public function startup() { $this->__expire($this->time); if (isset($_COOKIE[$this->name])) { @@ -196,9 +194,8 @@ function startup() { * @param mixed $value Value * @param boolean $encrypt Set to true to encrypt value, false otherwise * @param string $expires Can be either Unix timestamp, or date string - * @access public */ - function write($key, $value = null, $encrypt = true, $expires = null) { + public function write($key, $value = null, $encrypt = true, $expires = null) { if (is_null($encrypt)) { $encrypt = true; } @@ -234,9 +231,8 @@ function write($key, $value = null, $encrypt = true, $expires = null) { * * @param mixed $key Key of the value to be obtained. If none specified, obtain map key => values * @return string or null, value for specified key - * @access public */ - function read($key = null) { + public function read($key = null) { if (empty($this->__values) && isset($_COOKIE[$this->name])) { $this->__values = $this->__decrypt($_COOKIE[$this->name]); } @@ -270,9 +266,8 @@ function read($key = null) { * * @param string $key Key of the value to be deleted * @return void - * @access public */ - function delete($key) { + public function delete($key) { if (empty($this->__values)) { $this->read(); } @@ -293,9 +288,8 @@ function delete($key) { * Failure to do so will result in header already sent errors. * * @return void - * @access public */ - function destroy() { + public function destroy() { if (isset($_COOKIE[$this->name])) { $this->__values = $this->__decrypt($_COOKIE[$this->name]); } diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index bf3253b79..63655ab49 100755 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -302,9 +302,8 @@ class EmailComponent extends Object{ * Initialize component * * @param object $controller Instantiating controller - * @access public */ - function initialize(&$controller, $settings = array()) { + public function initialize(&$controller, $settings = array()) { $this->Controller =& $controller; if (Configure::read('App.encoding') !== null) { $this->charset = Configure::read('App.encoding'); @@ -316,9 +315,8 @@ function initialize(&$controller, $settings = array()) { * Startup component * * @param object $controller Instantiating controller - * @access public */ - function startup(&$controller) {} + public function startup(&$controller) {} /** * Send an email using the specified content, template and layout @@ -327,9 +325,8 @@ function startup(&$controller) {} * @param string $template Template to use when sending email * @param string $layout Layout to use to enclose email body * @return boolean Success - * @access public */ - function send($content = null, $template = null, $layout = null) { + public function send($content = null, $template = null, $layout = null) { $this->_createHeader(); if ($template) { @@ -389,9 +386,8 @@ function send($content = null, $template = null, $layout = null) { /** * Reset all EmailComponent internal variables to be able to send out a new email. * - * @access public */ - function reset() { + public function reset() { $this->template = null; $this->to = array(); $this->from = null; diff --git a/cake/libs/controller/components/request_handler.php b/cake/libs/controller/components/request_handler.php index 6b63552b6..1ee6bf3e4 100644 --- a/cake/libs/controller/components/request_handler.php +++ b/cake/libs/controller/components/request_handler.php @@ -195,9 +195,8 @@ function __construct() { * @param array $settings Array of settings to _set(). * @return void * @see Router::parseExtensions() - * @access public */ - function initialize(&$controller, $settings = array()) { + public function initialize(&$controller, $settings = array()) { if (isset($controller->params['url']['ext'])) { $this->ext = $controller->params['url']['ext']; } @@ -220,9 +219,8 @@ function initialize(&$controller, $settings = array()) { * * @param object $controller A reference to the controller * @return void - * @access public */ - function startup(&$controller) { + public function startup(&$controller) { if (!$this->enabled) { return; } @@ -259,9 +257,8 @@ function startup(&$controller) { * * @param object $controller A reference to the controller * @param mixed $url A string or array containing the redirect location - * @access public */ - function beforeRedirect(&$controller, $url) { + public function beforeRedirect(&$controller, $url) { if (!$this->isAjax()) { return; } @@ -279,9 +276,8 @@ function beforeRedirect(&$controller, $url) { * Returns true if the current HTTP request is Ajax, false otherwise * * @return boolean True if call is Ajax - * @access public */ - function isAjax() { + public function isAjax() { return env('HTTP_X_REQUESTED_WITH') === "XMLHttpRequest"; } @@ -289,9 +285,8 @@ function isAjax() { * Returns true if the current HTTP request is coming from a Flash-based client * * @return boolean True if call is from Flash - * @access public */ - function isFlash() { + public function isFlash() { return (preg_match('/^(Shockwave|Adobe) Flash/', env('HTTP_USER_AGENT')) == 1); } @@ -299,9 +294,8 @@ function isFlash() { * Returns true if the current request is over HTTPS, false otherwise. * * @return bool True if call is over HTTPS - * @access public */ - function isSSL() { + public function isSSL() { return env('HTTPS'); } @@ -309,9 +303,8 @@ function isSSL() { * Returns true if the current call accepts an XML response, false otherwise * * @return boolean True if client accepts an XML response - * @access public */ - function isXml() { + public function isXml() { return $this->prefers('xml'); } @@ -319,9 +312,8 @@ function isXml() { * Returns true if the current call accepts an RSS response, false otherwise * * @return boolean True if client accepts an RSS response - * @access public */ - function isRss() { + public function isRss() { return $this->prefers('rss'); } @@ -329,9 +321,8 @@ function isRss() { * Returns true if the current call accepts an Atom response, false otherwise * * @return boolean True if client accepts an RSS response - * @access public */ - function isAtom() { + public function isAtom() { return $this->prefers('atom'); } @@ -360,9 +351,8 @@ function isMobile() { * Returns true if the client accepts WAP content * * @return bool - * @access public */ - function isWap() { + public function isWap() { return $this->prefers('wap'); } @@ -370,9 +360,8 @@ function isWap() { * Returns true if the current call a POST request * * @return boolean True if call is a POST - * @access public */ - function isPost() { + public function isPost() { return (strtolower(env('REQUEST_METHOD')) == 'post'); } @@ -380,9 +369,8 @@ function isPost() { * Returns true if the current call a PUT request * * @return boolean True if call is a PUT - * @access public */ - function isPut() { + public function isPut() { return (strtolower(env('REQUEST_METHOD')) == 'put'); } @@ -390,9 +378,8 @@ function isPut() { * Returns true if the current call a GET request * * @return boolean True if call is a GET - * @access public */ - function isGet() { + public function isGet() { return (strtolower(env('REQUEST_METHOD')) == 'get'); } @@ -400,9 +387,8 @@ function isGet() { * Returns true if the current call a DELETE request * * @return boolean True if call is a DELETE - * @access public */ - function isDelete() { + public function isDelete() { return (strtolower(env('REQUEST_METHOD')) == 'delete'); } @@ -411,9 +397,8 @@ function isDelete() { * The Prototype library sets a special "Prototype version" HTTP header. * * @return string Prototype version of component making Ajax call - * @access public */ - function getAjaxVersion() { + public function getAjaxVersion() { if (env('HTTP_X_PROTOTYPE_VERSION') != null) { return env('HTTP_X_PROTOTYPE_VERSION'); } @@ -430,9 +415,8 @@ function getAjaxVersion() { * @param mixed $type The Content-type or array of Content-types assigned to the name, * i.e. "text/html", or "application/xml" * @return void - * @access public */ - function setContent($name, $type = null) { + public function setContent($name, $type = null) { if (is_array($name)) { $this->__requestContent = array_merge($this->__requestContent, $name); return; @@ -444,9 +428,8 @@ function setContent($name, $type = null) { * Gets the server name from which this request was referred * * @return string Server address - * @access public */ - function getReferer() { + public function getReferer() { if (env('HTTP_HOST') != null) { $sessHost = env('HTTP_HOST'); } @@ -461,9 +444,8 @@ function getReferer() { * Gets remote client IP * * @return string Client IP address - * @access public */ - function getClientIP($safe = true) { + public function getClientIP($safe = true) { if (!$safe && env('HTTP_X_FORWARDED_FOR') != null) { $ipaddr = preg_replace('/(?:,.*)/', '', env('HTTP_X_FORWARDED_FOR')); } else { @@ -538,9 +520,8 @@ function accepts($type = null) { * * @param mixed $type Can be null (or no parameter), a string type name, or an array of types * @return mixed - * @access public */ - function requestedWith($type = null) { + public function requestedWith($type = null) { if (!$this->isPost() && !$this->isPut()) { return null; } @@ -746,9 +727,8 @@ function respondAs($type, $options = array()) { * * @return mixed A string content type alias, or raw content type if no alias map exists, * otherwise null - * @access public */ - function responseType() { + public function responseType() { if ($this->__responseTypeSet == null) { return null; } @@ -760,9 +740,8 @@ function responseType() { * * @param mixed $type Content type * @return mixed Alias - * @access public */ - function mapType($ctype) { + public function mapType($ctype) { if (is_array($ctype)) { $out = array(); foreach ($ctype as $t) { diff --git a/cake/libs/controller/components/security.php b/cake/libs/controller/components/security.php index 4d09d80a8..5191db08f 100644 --- a/cake/libs/controller/components/security.php +++ b/cake/libs/controller/components/security.php @@ -174,9 +174,8 @@ class SecurityComponent extends Object { * @param object $controller Controller instance for the request * @param array $settings Settings to set to the component * @return void - * @access public */ - function initialize(&$controller, $settings = array()) { + public function initialize(&$controller, $settings = array()) { $this->_set($settings); } @@ -185,9 +184,8 @@ function initialize(&$controller, $settings = array()) { * * @param object $controller Instantiating controller * @return void - * @access public */ - function startup(&$controller) { + public function startup(&$controller) { $this->_action = strtolower($controller->action); $this->_methodsRequired($controller); $this->_secureRequired($controller); @@ -214,9 +212,8 @@ function startup(&$controller) { * Sets the actions that require a POST request, or empty for all actions * * @return void - * @access public */ - function requirePost() { + public function requirePost() { $args = func_get_args(); $this->_requireMethod('Post', $args); } @@ -225,9 +222,8 @@ function requirePost() { * Sets the actions that require a GET request, or empty for all actions * * @return void - * @access public */ - function requireGet() { + public function requireGet() { $args = func_get_args(); $this->_requireMethod('Get', $args); } @@ -236,9 +232,8 @@ function requireGet() { * Sets the actions that require a PUT request, or empty for all actions * * @return void - * @access public */ - function requirePut() { + public function requirePut() { $args = func_get_args(); $this->_requireMethod('Put', $args); } @@ -247,9 +242,8 @@ function requirePut() { * Sets the actions that require a DELETE request, or empty for all actions * * @return void - * @access public */ - function requireDelete() { + public function requireDelete() { $args = func_get_args(); $this->_requireMethod('Delete', $args); } @@ -258,9 +252,8 @@ function requireDelete() { * Sets the actions that require a request that is SSL-secured, or empty for all actions * * @return void - * @access public */ - function requireSecure() { + public function requireSecure() { $args = func_get_args(); $this->_requireMethod('Secure', $args); } @@ -269,9 +262,8 @@ function requireSecure() { * Sets the actions that require an authenticated request, or empty for all actions * * @return void - * @access public */ - function requireAuth() { + public function requireAuth() { $args = func_get_args(); $this->_requireMethod('Auth', $args); } @@ -280,9 +272,8 @@ function requireAuth() { * Sets the actions that require an HTTP-authenticated request, or empty for all actions * * @return void - * @access public */ - function requireLogin() { + public function requireLogin() { $args = func_get_args(); $base = $this->loginOptions; @@ -305,9 +296,8 @@ function requireLogin() { * * @param string $type Either 'basic', 'digest', or null. If null/empty, will try both. * @return mixed If successful, returns an array with login name and password, otherwise null. - * @access public */ - function loginCredentials($type = null) { + public function loginCredentials($type = null) { switch (strtolower($type)) { case 'basic': $login = array('username' => env('PHP_AUTH_USER'), 'password' => env('PHP_AUTH_PW')); @@ -344,9 +334,8 @@ function loginCredentials($type = null) { * * @param array $options Set of options for header * @return string HTTP-authentication request header - * @access public */ - function loginRequest($options = array()) { + public function loginRequest($options = array()) { $options = array_merge($this->loginOptions, $options); $this->_setLoginDefaults($options); $auth = 'WWW-Authenticate: ' . ucfirst($options['type']); @@ -366,9 +355,8 @@ function loginRequest($options = array()) { * * @param string $digest Digest authentication response * @return array Digest authentication parameters - * @access public */ - function parseDigestAuthData($digest) { + public function parseDigestAuthData($digest) { if (substr($digest, 0, 7) == 'Digest ') { $digest = substr($digest, 7); } diff --git a/cake/libs/controller/components/session.php b/cake/libs/controller/components/session.php index 17d46584b..3decd3f51 100644 --- a/cake/libs/controller/components/session.php +++ b/cake/libs/controller/components/session.php @@ -66,9 +66,8 @@ function __construct($base = null) { * * @param object $controller Instantiating controller * @return void - * @access public */ - function startup(&$controller) { + public function startup(&$controller) { if ($this->started() === false && $this->__active === true) { $this->__start(); } @@ -79,9 +78,8 @@ function startup(&$controller) { * * @param string $base The base path for the Session * @return void - * @access public */ - function activate($base = null) { + public function activate($base = null) { if ($this->__active === true) { return; } @@ -98,9 +96,8 @@ function activate($base = null) { * This should be in a Controller.key format for better organizing * @param string $value The value you want to store in a session. * @return boolean Success - * @access public */ - function write($name, $value = null) { + public function write($name, $value = null) { if ($this->__active === true) { $this->__start(); if (is_array($name)) { @@ -127,9 +124,8 @@ function write($name, $value = null) { * * @param string $name the name of the session key you want to read * @return mixed value from the session vars - * @access public */ - function read($name = null) { + public function read($name = null) { if ($this->__active === true) { $this->__start(); return parent::read($name); @@ -144,9 +140,8 @@ function read($name = null) { * * @param string $name the name of the session key you want to delete * @return boolean true is session variable is set and can be deleted, false is variable was not set. - * @access public */ - function delete($name) { + public function delete($name) { if ($this->__active === true) { $this->__start(); return parent::delete($name); @@ -161,9 +156,8 @@ function delete($name) { * * @param string $name the name of the session key you want to check * @return boolean true is session variable is set, false if not - * @access public */ - function check($name) { + public function check($name) { if ($this->__active === true) { $this->__start(); return parent::check($name); @@ -177,9 +171,8 @@ function check($name) { * In your controller: $this->Session->error(); * * @return string Last session error - * @access public */ - function error() { + public function error() { if ($this->__active === true) { $this->__start(); return parent::error(); @@ -198,9 +191,8 @@ function error() { * @param string $element Element to wrap flash message in. * @param array $params Parameters to be sent to layout as view variables * @param string $key Message key, default is 'flash' - * @access public */ - function setFlash($message, $element = 'default', $params = array(), $key = 'flash') { + public function setFlash($message, $element = 'default', $params = array(), $key = 'flash') { if ($this->__active === true) { $this->__start(); $this->write('Message.' . $key, compact('message', 'element', 'params')); @@ -213,9 +205,8 @@ function setFlash($message, $element = 'default', $params = array(), $key = 'fla * In your controller: $this->Session->renew(); * * @return void - * @access public */ - function renew() { + public function renew() { if ($this->__active === true) { $this->__start(); parent::renew(); @@ -228,9 +219,8 @@ function renew() { * In your controller: $this->Session->valid(); * * @return boolean true is session is valid, false is session is invalid - * @access public */ - function valid() { + public function valid() { if ($this->__active === true) { $this->__start(); return parent::valid(); @@ -244,9 +234,8 @@ function valid() { * In your controller: $this->Session->destroy(); * * @return void - * @access public */ - function destroy() { + public function destroy() { if ($this->__active === true) { $this->__start(); parent::destroy(); @@ -261,9 +250,8 @@ function destroy() { * * @param $id string * @return string - * @access public */ - function id($id = null) { + public function id($id = null) { return parent::id($id); } diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index f82906fa8..73d01c6db 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -519,9 +519,8 @@ function constructClasses() { * - triggers Component `startup` methods. * * @return void - * @access public */ - function startupProcess() { + public function startupProcess() { $this->Component->initialize($this); $this->beforeFilter(); $this->Component->triggerCallback('startup', $this); @@ -535,9 +534,8 @@ function startupProcess() { * - calls the Controller's `afterFilter` method. * * @return void - * @access public */ - function shutdownProcess() { + public function shutdownProcess() { $this->Component->triggerCallback('shutdown', $this); $this->afterFilter(); } @@ -608,9 +606,8 @@ function httpCodes($code = null) { * @param string $modelClass Name of model class to load * @param mixed $id Initial ID the instanced model class should have * @return mixed true when single model found and instance created error returned if models not found. - * @access public */ - function loadModel($modelClass = null, $id = null) { + public function loadModel($modelClass = null, $id = null) { if ($modelClass === null) { $modelClass = $this->modelClass; } @@ -738,9 +735,8 @@ function redirect($url, $status = null, $exit = true) { * * @param string $status The header message that is being set. * @return void - * @access public */ - function header($status) { + public function header($status) { header($status); } @@ -783,9 +779,8 @@ function set($one, $two = null) { * @param mixed Any other parameters passed to this method will be passed as * parameters to the new action. * @return mixed Returns the return value of the called action - * @access public */ - function setAction($action) { + public function setAction($action) { $this->action = $action; $args = func_get_args(); unset($args[0]); @@ -811,9 +806,8 @@ function isAuthorized() { * Returns number of errors in a submitted FORM. * * @return integer Number of errors - * @access public */ - function validate() { + public function validate() { $args = func_get_args(); $errors = call_user_func_array(array(&$this, 'validateErrors'), $args); @@ -830,9 +824,8 @@ function validate() { * * @param mixed A list of models as a variable argument * @return array Validation errors, or false if none - * @access public */ - function validateErrors() { + public function validateErrors() { $objects = func_get_args(); if (empty($objects)) { diff --git a/cake/libs/controller/pages_controller.php b/cake/libs/controller/pages_controller.php index 74979eaab..eed42e06a 100644 --- a/cake/libs/controller/pages_controller.php +++ b/cake/libs/controller/pages_controller.php @@ -58,9 +58,8 @@ class PagesController extends AppController { * Displays a view * * @param mixed What page to display - * @access public */ - function display() { + public function display() { $path = func_get_args(); $count = count($path); diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index 4aac72060..0653d2fe6 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -242,9 +242,8 @@ function log($var, $level = LOG_DEBUG) { * @param integer $line Line that triggered the error * @param array $context Context * @return boolean true if error was handled - * @access public */ - function handleError($code, $description, $file = null, $line = null, $context = null) { + public function handleError($code, $description, $file = null, $line = null, $context = null) { if (error_reporting() == 0 || $code === 2048 || $code === 8192) { return; } diff --git a/cake/libs/error.php b/cake/libs/error.php index be6dae192..4163ae943 100644 --- a/cake/libs/error.php +++ b/cake/libs/error.php @@ -129,9 +129,8 @@ function __construct($method, $messages) { * Displays an error page (e.g. 404 Not found). * * @param array $params Parameters for controller - * @access public */ - function error($params) { + public function error($params) { extract($params, EXTR_OVERWRITE); $this->controller->set(array( 'code' => $code, @@ -146,9 +145,8 @@ function error($params) { * Convenience method to display a 404 page. * * @param array $params Parameters for controller - * @access public */ - function error404($params) { + public function error404($params) { extract($params, EXTR_OVERWRITE); if (!isset($url)) { @@ -169,9 +167,8 @@ function error404($params) { * Convenience method to display a 500 page. * * @param array $params Parameters for controller - * @access public */ - function error500($params) { + public function error500($params) { extract($params, EXTR_OVERWRITE); if (!isset($url)) { @@ -191,9 +188,8 @@ function error500($params) { * Renders the Missing Controller web page. * * @param array $params Parameters for controller - * @access public */ - function missingController($params) { + public function missingController($params) { extract($params, EXTR_OVERWRITE); $controllerName = str_replace('Controller', '', $className); @@ -209,9 +205,8 @@ function missingController($params) { * Renders the Missing Action web page. * * @param array $params Parameters for controller - * @access public */ - function missingAction($params) { + public function missingAction($params) { extract($params, EXTR_OVERWRITE); $controllerName = str_replace('Controller', '', $className); @@ -228,9 +223,8 @@ function missingAction($params) { * Renders the Private Action web page. * * @param array $params Parameters for controller - * @access public */ - function privateAction($params) { + public function privateAction($params) { extract($params, EXTR_OVERWRITE); $this->controller->set(array( @@ -245,9 +239,8 @@ function privateAction($params) { * Renders the Missing Table web page. * * @param array $params Parameters for controller - * @access public */ - function missingTable($params) { + public function missingTable($params) { extract($params, EXTR_OVERWRITE); $this->controller->header("HTTP/1.0 500 Internal Server Error"); @@ -264,9 +257,8 @@ function missingTable($params) { * Renders the Missing Database web page. * * @param array $params Parameters for controller - * @access public */ - function missingDatabase($params = array()) { + public function missingDatabase($params = array()) { $this->controller->header("HTTP/1.0 500 Internal Server Error"); $this->controller->set(array( 'code' => '500', @@ -279,9 +271,8 @@ function missingDatabase($params = array()) { * Renders the Missing View web page. * * @param array $params Parameters for controller - * @access public */ - function missingView($params) { + public function missingView($params) { extract($params, EXTR_OVERWRITE); $this->controller->set(array( @@ -297,9 +288,8 @@ function missingView($params) { * Renders the Missing Layout web page. * * @param array $params Parameters for controller - * @access public */ - function missingLayout($params) { + public function missingLayout($params) { extract($params, EXTR_OVERWRITE); $this->controller->layout = 'default'; @@ -314,9 +304,8 @@ function missingLayout($params) { * Renders the Database Connection web page. * * @param array $params Parameters for controller - * @access public */ - function missingConnection($params) { + public function missingConnection($params) { extract($params, EXTR_OVERWRITE); $this->controller->header("HTTP/1.0 500 Internal Server Error"); @@ -332,9 +321,8 @@ function missingConnection($params) { * Renders the Missing Helper file web page. * * @param array $params Parameters for controller - * @access public */ - function missingHelperFile($params) { + public function missingHelperFile($params) { extract($params, EXTR_OVERWRITE); $this->controller->set(array( @@ -349,9 +337,8 @@ function missingHelperFile($params) { * Renders the Missing Helper class web page. * * @param array $params Parameters for controller - * @access public */ - function missingHelperClass($params) { + public function missingHelperClass($params) { extract($params, EXTR_OVERWRITE); $this->controller->set(array( @@ -366,9 +353,8 @@ function missingHelperClass($params) { * Renders the Missing Behavior file web page. * * @param array $params Parameters for controller - * @access public */ - function missingBehaviorFile($params) { + public function missingBehaviorFile($params) { extract($params, EXTR_OVERWRITE); $this->controller->set(array( @@ -383,9 +369,8 @@ function missingBehaviorFile($params) { * Renders the Missing Behavior class web page. * * @param array $params Parameters for controller - * @access public */ - function missingBehaviorClass($params) { + public function missingBehaviorClass($params) { extract($params, EXTR_OVERWRITE); $this->controller->set(array( @@ -400,9 +385,8 @@ function missingBehaviorClass($params) { * Renders the Missing Component file web page. * * @param array $params Parameters for controller - * @access public */ - function missingComponentFile($params) { + public function missingComponentFile($params) { extract($params, EXTR_OVERWRITE); $this->controller->set(array( @@ -418,9 +402,8 @@ function missingComponentFile($params) { * Renders the Missing Component class web page. * * @param array $params Parameters for controller - * @access public */ - function missingComponentClass($params) { + public function missingComponentClass($params) { extract($params, EXTR_OVERWRITE); $this->controller->set(array( @@ -436,9 +419,8 @@ function missingComponentClass($params) { * Renders the Missing Model class web page. * * @param unknown_type $params Parameters for controller - * @access public */ - function missingModel($params) { + public function missingModel($params) { extract($params, EXTR_OVERWRITE); $this->controller->set(array( diff --git a/cake/libs/file.php b/cake/libs/file.php index ee9428773..748d50d15 100644 --- a/cake/libs/file.php +++ b/cake/libs/file.php @@ -118,9 +118,8 @@ function __destruct() { * Creates the File. * * @return boolean Success - * @access public */ - function create() { + public function create() { $dir = $this->Folder->pwd(); if (is_dir($dir) && is_writable($dir) && !$this->exists()) { $old = umask(0); @@ -138,9 +137,8 @@ function create() { * @param string $mode A valid 'fopen' mode string (r|w|a ...) * @param boolean $force If true then the file will be re-opened even if its already opened, otherwise it won't * @return boolean True on success, false on failure - * @access public */ - function open($mode = 'r', $force = false) { + public function open($mode = 'r', $force = false) { if (!$force && is_resource($this->handle)) { return true; } @@ -165,9 +163,8 @@ function open($mode = 'r', $force = false) { * @param string $mode A `fread` compatible mode. * @param boolean $force If true then the file will be re-opened even if its already opened, otherwise it won't * @return mixed string on success, false on failure - * @access public */ - function read($bytes = false, $mode = 'rb', $force = false) { + public function read($bytes = false, $mode = 'rb', $force = false) { if ($bytes === false && $this->lock === null) { return file_get_contents($this->path); } @@ -202,9 +199,8 @@ function read($bytes = false, $mode = 'rb', $force = false) { * @param mixed $offset The $offset in bytes to seek. If set to false then the current offset is returned. * @param integer $seek PHP Constant SEEK_SET | SEEK_CUR | SEEK_END determining what the $offset is relative to * @return mixed True on success, false on failure (set mode), false on failure or integer offset on success (get mode) - * @access public */ - function offset($offset = false, $seek = SEEK_SET) { + public function offset($offset = false, $seek = SEEK_SET) { if ($offset === false) { if (is_resource($this->handle)) { return ftell($this->handle); @@ -222,9 +218,8 @@ function offset($offset = false, $seek = SEEK_SET) { * * @param string $data Data to prepare for writing. * @return string The with converted line endings. - * @access public */ - function prepare($data, $forceWindows = false) { + public function prepare($data, $forceWindows = false) { $lineBreak = "\n"; if (DIRECTORY_SEPARATOR == '\\' || $forceWindows === true) { $lineBreak = "\r\n"; @@ -239,9 +234,8 @@ function prepare($data, $forceWindows = false) { * @param string $mode Mode of writing. {@link http://php.net/fwrite See fwrite()}. * @param string $force force the file to open * @return boolean Success - * @access public */ - function write($data, $mode = 'w', $force = false) { + public function write($data, $mode = 'w', $force = false) { $success = false; if ($this->open($mode, $force) === true) { if ($this->lock !== null) { @@ -266,9 +260,8 @@ function write($data, $mode = 'w', $force = false) { * @param string $data Data to write * @param string $force force the file to open * @return boolean Success - * @access public */ - function append($data, $force = false) { + public function append($data, $force = false) { return $this->write($data, 'a', $force); } @@ -276,9 +269,8 @@ function append($data, $force = false) { * Closes the current file if it is opened. * * @return boolean True if closing was successful or file was already closed, otherwise false - * @access public */ - function close() { + public function close() { if (!is_resource($this->handle)) { return true; } @@ -289,9 +281,8 @@ function close() { * Deletes the File. * * @return boolean Success - * @access public */ - function delete() { + public function delete() { clearstatcache(); if ($this->exists()) { return unlink($this->path); @@ -303,9 +294,8 @@ function delete() { * Returns the File info. * * @return string The File extension - * @access public */ - function info() { + public function info() { if ($this->info == null) { $this->info = pathinfo($this->path); } @@ -319,9 +309,8 @@ function info() { * Returns the File extension. * * @return string The File extension - * @access public */ - function ext() { + public function ext() { if ($this->info == null) { $this->info(); } @@ -335,9 +324,8 @@ function ext() { * Returns the File name without extension. * * @return string The File name without extension. - * @access public */ - function name() { + public function name() { if ($this->info == null) { $this->info(); } @@ -355,9 +343,8 @@ function name() { * @param string $name The name of the file to make safe if different from $this->name * @param strin $ext The name of the extension to make safe if different from $this->ext * @return string $ext the extension of the file - * @access public */ - function safe($name = null, $ext = null) { + public function safe($name = null, $ext = null) { if (!$name) { $name = $this->name; } @@ -372,9 +359,8 @@ function safe($name = null, $ext = null) { * * @param mixed $maxsize in MB or true to force * @return string md5 Checksum {@link http://php.net/md5_file See md5_file()} - * @access public */ - function md5($maxsize = 5) { + public function md5($maxsize = 5) { if ($maxsize === true) { return md5_file($this->path); } @@ -391,9 +377,8 @@ function md5($maxsize = 5) { * Returns the full path of the File. * * @return string Full path to file - * @access public */ - function pwd() { + public function pwd() { if (is_null($this->path)) { $this->path = $this->Folder->slashTerm($this->Folder->pwd()) . $this->name; } @@ -404,9 +389,8 @@ function pwd() { * Returns true if the File exists. * * @return boolean true if it exists, false otherwise - * @access public */ - function exists() { + public function exists() { return (file_exists($this->path) && is_file($this->path)); } @@ -414,9 +398,8 @@ function exists() { * Returns the "chmod" (permissions) of the File. * * @return string Permissions for the file - * @access public */ - function perms() { + public function perms() { if ($this->exists()) { return substr(sprintf('%o', fileperms($this->path)), -4); } @@ -427,9 +410,8 @@ function perms() { * Returns the Filesize * * @return integer size of the file in bytes, or false in case of an error - * @access public */ - function size() { + public function size() { if ($this->exists()) { return filesize($this->path); } @@ -440,9 +422,8 @@ function size() { * Returns true if the File is writable. * * @return boolean true if its writable, false otherwise - * @access public */ - function writable() { + public function writable() { return is_writable($this->path); } @@ -450,9 +431,8 @@ function writable() { * Returns true if the File is executable. * * @return boolean true if its executable, false otherwise - * @access public */ - function executable() { + public function executable() { return is_executable($this->path); } @@ -460,9 +440,8 @@ function executable() { * Returns true if the File is readable. * * @return boolean true if file is readable, false otherwise - * @access public */ - function readable() { + public function readable() { return is_readable($this->path); } @@ -470,9 +449,8 @@ function readable() { * Returns the File's owner. * * @return integer the Fileowner - * @access public */ - function owner() { + public function owner() { if ($this->exists()) { return fileowner($this->path); } @@ -483,9 +461,8 @@ function owner() { * Returns the File's group. * * @return integer the Filegroup - * @access public */ - function group() { + public function group() { if ($this->exists()) { return filegroup($this->path); } @@ -496,9 +473,8 @@ function group() { * Returns last access time. * * @return integer timestamp Timestamp of last access time - * @access public */ - function lastAccess() { + public function lastAccess() { if ($this->exists()) { return fileatime($this->path); } @@ -509,9 +485,8 @@ function lastAccess() { * Returns last modified time. * * @return integer timestamp Timestamp of last modification - * @access public */ - function lastChange() { + public function lastChange() { if ($this->exists()) { return filemtime($this->path); } @@ -522,9 +497,8 @@ function lastChange() { * Returns the current folder. * * @return Folder Current folder - * @access public */ - function &Folder() { + public function &Folder() { return $this->Folder; } @@ -534,9 +508,8 @@ function &Folder() { * @param string $dest destination for the copy * @param boolean $overwrite Overwrite $dest if exists * @return boolean Succes - * @access public */ - function copy($dest, $overwrite = true) { + public function copy($dest, $overwrite = true) { if (!$this->exists() || is_file($dest) && !$overwrite) { return false; } diff --git a/cake/libs/folder.php b/cake/libs/folder.php index a3031f018..20eddf4e3 100644 --- a/cake/libs/folder.php +++ b/cake/libs/folder.php @@ -123,9 +123,8 @@ function __construct($path = false, $create = false, $mode = false) { * Return current path. * * @return string Current path - * @access public */ - function pwd() { + public function pwd() { return $this->path; } @@ -134,9 +133,8 @@ function pwd() { * * @param string $path Path to the directory to change to * @return string The new path. Returns false on failure - * @access public */ - function cd($path) { + public function cd($path) { $path = $this->realpath($path); if (is_dir($path)) { return $this->path = $path; @@ -153,9 +151,8 @@ function cd($path) { * @param mixed $exceptions Either an array or boolean true will not grab dot files * @param boolean $fullPath True returns the full path * @return mixed Contents of current directory as an array, an empty array on failure - * @access public */ - function read($sort = true, $exceptions = false, $fullPath = false) { + public function read($sort = true, $exceptions = false, $fullPath = false) { $dirs = $files = array(); if (!$this->pwd()) { @@ -198,9 +195,8 @@ function read($sort = true, $exceptions = false, $fullPath = false) { * @param string $pattern Preg_match pattern (Defaults to: .*) * @param boolean $sort Whether results should be sorted. * @return array Files that match given pattern - * @access public */ - function find($regexpPattern = '.*', $sort = false) { + public function find($regexpPattern = '.*', $sort = false) { list($dirs, $files) = $this->read($sort); return array_values(preg_grep('/^' . $regexpPattern . '$/i', $files)); ; } @@ -211,9 +207,8 @@ function find($regexpPattern = '.*', $sort = false) { * @param string $pattern Preg_match pattern (Defaults to: .*) * @param boolean $sort Whether results should be sorted. * @return array Files matching $pattern - * @access public */ - function findRecursive($pattern = '.*', $sort = false) { + public function findRecursive($pattern = '.*', $sort = false) { if (!$this->pwd()) { return array(); } @@ -330,9 +325,8 @@ function addPathElement($path, $element) { * * @param string $path The path to check. * @return bool - * @access public */ - function inCakePath($path = '') { + public function inCakePath($path = '') { $dir = substr(Folder::slashTerm(ROOT), 0, -1); $newdir = $dir . $path; @@ -345,9 +339,8 @@ function inCakePath($path = '') { * @param string $path The path to check that the current pwd() resides with in. * @param boolean $reverse * @return bool - * @access public */ - function inPath($path = '', $reverse = false) { + public function inPath($path = '', $reverse = false) { $dir = Folder::slashTerm($path); $current = Folder::slashTerm($this->pwd()); @@ -367,9 +360,8 @@ function inPath($path = '', $reverse = false) { * @param boolean $recursive chmod recursively, set to false to only change the current directory. * @param array $exceptions array of files, directories to skip * @return boolean Returns TRUE on success, FALSE on failure - * @access public */ - function chmod($path, $mode = false, $recursive = true, $exceptions = array()) { + public function chmod($path, $mode = false, $recursive = true, $exceptions = array()) { if (!$mode) { $mode = $this->mode; } @@ -418,9 +410,8 @@ function chmod($path, $mode = false, $recursive = true, $exceptions = array()) { * @param mixed $exceptions Array of files to exclude, defaults to excluding hidden files. * @param string $type either file or dir. null returns both files and directories * @return mixed array of nested directories and files in each directory - * @access public */ - function tree($path, $exceptions = true, $type = null) { + public function tree($path, $exceptions = true, $type = null) { $original = $this->path; $path = rtrim($path, DS); if (!$this->cd($path)) { @@ -474,9 +465,8 @@ function __tree($path, $exceptions) { * @param string $pathname The directory structure to create * @param integer $mode octal value 0755 * @return boolean Returns TRUE on success, FALSE on failure - * @access public */ - function create($pathname, $mode = false) { + public function create($pathname, $mode = false) { if (is_dir($pathname) || empty($pathname)) { return true; } @@ -513,9 +503,8 @@ function create($pathname, $mode = false) { * * @param string $directory Path to directory * @return int size in bytes of current folder - * @access public */ - function dirsize() { + public function dirsize() { $size = 0; $directory = Folder::slashTerm($this->path); $stack = array($directory); @@ -550,9 +539,8 @@ function dirsize() { * * @param string $path Path of directory to delete * @return boolean Success - * @access public */ - function delete($path = null) { + public function delete($path = null) { if (!$path) { $path = $this->pwd(); } @@ -607,9 +595,8 @@ function delete($path = null) { * * @param mixed $options Either an array of options (see above) or a string of the destination directory. * @return bool Success - * @access public */ - function copy($options = array()) { + public function copy($options = array()) { if (!$this->pwd()) { return false; } @@ -693,9 +680,8 @@ function copy($options = array()) { * * @param array $options (to, from, chmod, skip) * @return boolean Success - * @access public */ - function move($options) { + public function move($options) { $to = null; if (is_string($options)) { $to = $options; @@ -715,9 +701,8 @@ function move($options) { * get messages from latest method * * @return array - * @access public */ - function messages() { + public function messages() { return $this->__messages; } @@ -725,9 +710,8 @@ function messages() { * get error from latest method * * @return array - * @access public */ - function errors() { + public function errors() { return $this->__errors; } diff --git a/cake/libs/http_socket.php b/cake/libs/http_socket.php index 767f149d9..f70a057b6 100644 --- a/cake/libs/http_socket.php +++ b/cake/libs/http_socket.php @@ -160,9 +160,8 @@ class HttpSocket extends CakeSocket { * See HttpSocket::$config for options that can be used. * * @param mixed $config Configuration information, either a string url or an array of options. - * @access public */ - function __construct($config = array()) { + public function __construct($config = array()) { if (is_string($config)) { $this->_configUri($config); } elseif (is_array($config)) { @@ -181,9 +180,8 @@ function __construct($config = array()) { * * @param mixed $request Either an URI string, or an array defining host/uri * @return mixed false on error, request body on success - * @access public */ - function request($request = array()) { + public function request($request = array()) { $this->reset(false); if (is_string($request)) { @@ -308,9 +306,8 @@ function request($request = array()) { * @param array $query Querystring parameters to append to URI * @param array $request An indexed array with indexes such as 'method' or uri * @return mixed Result of request, either false on failure or the response to the request. - * @access public */ - function get($uri = null, $query = array(), $request = array()) { + public function get($uri = null, $query = array(), $request = array()) { if (!empty($query)) { $uri = $this->_parseUri($uri); if (isset($uri['query'])) { @@ -341,9 +338,8 @@ function get($uri = null, $query = array(), $request = array()) { * @param array $data Array of POST data keys and values. * @param array $request An indexed array with indexes such as 'method' or uri * @return mixed Result of request, either false on failure or the response to the request. - * @access public */ - function post($uri = null, $data = array(), $request = array()) { + public function post($uri = null, $data = array(), $request = array()) { $request = Set::merge(array('method' => 'POST', 'uri' => $uri, 'body' => $data), $request); return $this->request($request); } @@ -355,9 +351,8 @@ function post($uri = null, $data = array(), $request = array()) { * @param array $data Array of PUT data keys and values. * @param array $request An indexed array with indexes such as 'method' or uri * @return mixed Result of request - * @access public */ - function put($uri = null, $data = array(), $request = array()) { + public function put($uri = null, $data = array(), $request = array()) { $request = Set::merge(array('method' => 'PUT', 'uri' => $uri, 'body' => $data), $request); return $this->request($request); } @@ -369,9 +364,8 @@ function put($uri = null, $data = array(), $request = array()) { * @param array $data Query to append to URI * @param array $request An indexed array with indexes such as 'method' or uri * @return mixed Result of request - * @access public */ - function delete($uri = null, $data = array(), $request = array()) { + public function delete($uri = null, $data = array(), $request = array()) { $request = Set::merge(array('method' => 'DELETE', 'uri' => $uri, 'body' => $data), $request); return $this->request($request); } @@ -402,9 +396,8 @@ function delete($uri = null, $data = array(), $request = array()) { * @param mixed $url Either a string or array of url options to create a url with. * @param string $uriTemplate A template string to use for url formatting. * @return mixed Either false on failure or a string containing the composed url. - * @access public */ - function url($url = null, $uriTemplate = null) { + public function url($url = null, $uriTemplate = null) { if (is_null($url)) { $url = '/'; } @@ -1042,9 +1035,8 @@ function _tokenEscapeChars($hex = true, $chars = null) { * * @param boolean $full If set to false only HttpSocket::response and HttpSocket::request are reseted * @return boolean True on success - * @access public */ - function reset($full = true) { + public function reset($full = true) { static $initalState = array(); if (empty($initalState)) { $initalState = get_class_vars(__CLASS__); diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index e20e241c5..e6ebee914 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -103,9 +103,8 @@ class I18n extends Object { * Return a static instance of the I18n class * * @return object I18n - * @access public */ - function &getInstance() { + public function &getInstance() { static $instance = array(); if (!$instance) { $instance[0] =& new I18n(); @@ -124,9 +123,8 @@ function &getInstance() { * @param string $category Category The integer value of the category to use. * @param integer $count Count Count is used with $plural to choose the correct plural form. * @return string translated string. - * @access public */ - function translate($singular, $plural = null, $domain = null, $category = 6, $count = null) { + public function translate($singular, $plural = null, $domain = null, $category = 6, $count = null) { $_this =& I18n::getInstance(); if (strpos($singular, "\r\n") !== false) { diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index 1be467e95..7441e700c 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -255,9 +255,8 @@ class Inflector { * Gets a reference to the Inflector object instance * * @return object - * @access public */ - function &getInstance() { + public function &getInstance() { static $instance = array(); if (!$instance) { diff --git a/cake/libs/l10n.php b/cake/libs/l10n.php index 0bd41e80c..a5c7fae5e 100644 --- a/cake/libs/l10n.php +++ b/cake/libs/l10n.php @@ -340,9 +340,8 @@ function __construct() { * the method will get the settings from L10n::__setLanguage(); * * @param string $language Language (if null will use DEFAULT_LANGUAGE if defined) - * @access public */ - function get($language = null) { + public function get($language = null) { if ($language !== null) { return $this->__setLanguage($language); } elseif ($this->__autoLanguage() === false) { @@ -434,9 +433,8 @@ function __autoLanguage() { * @param mixed $mixed 2/3 char string (language/locale), array of those strings, or null * @return mixed string language/locale, array of those values, whole map as an array, * or false when language/locale doesn't exist - * @access public */ - function map($mixed = null) { + public function map($mixed = null) { if (is_array($mixed)) { $result = array(); foreach ($mixed as $_mixed) { @@ -462,9 +460,8 @@ function map($mixed = null) { * @param mixed $language string requested language, array of requested languages, or null for whole catalog * @return mixed array catalog record for requested language, array of catalog records, whole catalog, * or false when language doesn't exist - * @access public */ - function catalog($language = null) { + public function catalog($language = null) { if (is_array($language)) { $result = array(); foreach ($language as $_language) { diff --git a/cake/libs/magic_db.php b/cake/libs/magic_db.php index 002a3073a..a2e86bcf6 100644 --- a/cake/libs/magic_db.php +++ b/cake/libs/magic_db.php @@ -78,9 +78,8 @@ function read($magicDb = null) { * * @param string $data A MagicDb string to turn into an array * @return array A parsed MagicDb array or an empty array if the $data param was invalid. Returns the db property if $data is not set. - * @access public */ - function toArray($data = null) { + public function toArray($data = null) { if (is_array($data)) { return $data; } @@ -132,9 +131,8 @@ function toArray($data = null) { * * @param mixed $magicDb A $magicDb string / array to validate (optional) * @return boolean True if the $magicDb / instance db validates, false if not - * @access public */ - function validates($magicDb = null) { + public function validates($magicDb = null) { if (is_null($magicDb)) { $magicDb = $this->db; } elseif (!is_array($magicDb)) { @@ -150,9 +148,8 @@ function validates($magicDb = null) { * @param string $file Absolute path to the file to analyze * @param array $options TBT * @return mixed - * @access public */ - function analyze($file, $options = array()) { + public function analyze($file, $options = array()) { if (!is_string($file)) { return false; } @@ -201,9 +198,8 @@ class MagicFileResource extends Object{ * * @param unknown $file * @return void - * @access public */ - function __construct($file) { + public function __construct($file) { if (file_exists($file)) { $this->resource =& new File($file); } else { @@ -216,9 +212,8 @@ function __construct($file) { * * @param unknown $magic * @return void - * @access public */ - function test($magic) { + public function test($magic) { $offset = null; $type = null; $expected = null; @@ -245,9 +240,8 @@ function test($magic) { * @param unknown $type * @param unknown $length * @return void - * @access public */ - function read($length = null) { + public function read($length = null) { if (!is_object($this->resource)) { return substr($this->resource, $this->offset, $length); } @@ -260,9 +254,8 @@ function read($length = null) { * @param unknown $type * @param unknown $expected * @return void - * @access public */ - function extract($offset, $type, $expected) { + public function extract($offset, $type, $expected) { switch ($type) { case 'string': $this->offset($offset); @@ -280,9 +273,8 @@ function extract($offset, $type, $expected) { * @param unknown $offset * @param unknown $whence * @return void - * @access public */ - function offset($offset = null) { + public function offset($offset = null) { if (is_null($offset)) { if (!is_object($this->resource)) { return $this->offset; diff --git a/cake/libs/model/behaviors/acl.php b/cake/libs/model/behaviors/acl.php index c30dffd15..304d5e7cf 100644 --- a/cake/libs/model/behaviors/acl.php +++ b/cake/libs/model/behaviors/acl.php @@ -41,9 +41,8 @@ class AclBehavior extends ModelBehavior { * * @param mixed $config * @return void - * @access public */ - function setup(&$model, $config = array()) { + public function setup(&$model, $config = array()) { if (is_string($config)) { $config = array('type' => $config); } @@ -68,9 +67,8 @@ function setup(&$model, $config = array()) { * * @param mixed $ref * @return array - * @access public */ - function node(&$model, $ref = null) { + public function node(&$model, $ref = null) { $type = $this->__typeMaps[strtolower($this->settings[$model->name]['type'])]; if (empty($ref)) { $ref = array('model' => $model->name, 'foreign_key' => $model->id); @@ -83,9 +81,8 @@ function node(&$model, $ref = null) { * * @param boolean $created True if this is a new record * @return void - * @access public */ - function afterSave(&$model, $created) { + public function afterSave(&$model, $created) { $type = $this->__typeMaps[strtolower($this->settings[$model->alias]['type'])]; $parent = $model->parentNode(); if (!empty($parent)) { @@ -108,9 +105,8 @@ function afterSave(&$model, $created) { * Destroys the ARO/ACO node bound to the deleted record * * @return void - * @access public */ - function afterDelete(&$model) { + public function afterDelete(&$model) { $type = $this->__typeMaps[strtolower($this->settings[$model->name]['type'])]; $node = Set::extract($this->node($model), "0.{$type}.id"); if (!empty($node)) { diff --git a/cake/libs/model/behaviors/containable.php b/cake/libs/model/behaviors/containable.php index f5d6a1b08..1c82542dd 100644 --- a/cake/libs/model/behaviors/containable.php +++ b/cake/libs/model/behaviors/containable.php @@ -61,9 +61,8 @@ class ContainableBehavior extends ModelBehavior { * * @param object $Model Model using the behavior * @param array $settings Settings to override for model. - * @access public */ - function setup(&$Model, $settings = array()) { + public function setup(&$Model, $settings = array()) { if (!isset($this->settings[$Model->alias])) { $this->settings[$Model->alias] = array('recursive' => true, 'notices' => true, 'autoFields' => true); } @@ -93,9 +92,8 @@ function setup(&$Model, $settings = array()) { * @param object $Model Model using the behavior * @param array $query Query parameters as set by cake * @return array - * @access public */ - function beforeFind(&$Model, $query) { + public function beforeFind(&$Model, $query) { $reset = (isset($query['reset']) ? $query['reset'] : true); $noContain = ((isset($this->runtime[$Model->alias]['contain']) && empty($this->runtime[$Model->alias]['contain'])) || (isset($query['contain']) && empty($query['contain']))); $contain = array(); @@ -214,9 +212,8 @@ function beforeFind(&$Model, $query) { * @param object $Model Model on which we are resetting * @param array $results Results of the find operation * @param bool $primary true if this is the primary model that issued the find operation, false otherwise - * @access public */ - function afterFind(&$Model, $results, $primary) { + public function afterFind(&$Model, $results, $primary) { if (!empty($Model->__backContainableAssociation)) { foreach ($Model->__backContainableAssociation as $relation => $bindings) { $Model->{$relation} = $bindings; @@ -231,9 +228,8 @@ function afterFind(&$Model, $results, $primary) { * * @param object $Model Model on which binding restriction is being applied * @return void - * @access public */ - function contain(&$Model) { + public function contain(&$Model) { $args = func_get_args(); $contain = call_user_func_array('am', array_slice($args, 1)); $this->runtime[$Model->alias]['contain'] = $contain; @@ -246,9 +242,8 @@ function contain(&$Model) { * * @param object $Model Model on which to reset bindings * @return void - * @access public */ - function resetBindings(&$Model) { + public function resetBindings(&$Model) { if (!empty($Model->__backOriginalAssociation)) { $Model->__backAssociation = $Model->__backOriginalAssociation; unset($Model->__backOriginalAssociation); @@ -271,9 +266,8 @@ function resetBindings(&$Model) { * @param array $containments Current set of containments * @param bool $throwErrors Wether unexisting bindings show throw errors * @return array Containments - * @access public */ - function containments(&$Model, $contain, $containments = array(), $throwErrors = null) { + public function containments(&$Model, $contain, $containments = array(), $throwErrors = null) { $options = array('className', 'joinTable', 'with', 'foreignKey', 'associationForeignKey', 'conditions', 'fields', 'order', 'limit', 'offset', 'unique', 'finderQuery', 'deleteQuery', 'insertQuery'); $keep = array(); $depth = array(); @@ -375,9 +369,8 @@ function containments(&$Model, $contain, $containments = array(), $throwErrors = * @param array $map Map of relations for given model * @param mixed $fields If array, fields to initially load, if false use $Model as primary model * @return array Fields - * @access public */ - function fieldDependencies(&$Model, $map, $fields = array()) { + public function fieldDependencies(&$Model, $map, $fields = array()) { if ($fields === false) { foreach ($map as $parent => $children) { foreach ($children as $type => $bindings) { @@ -421,9 +414,8 @@ function fieldDependencies(&$Model, $map, $fields = array()) { * * @param array $containments Containments * @return array Built containments - * @access public */ - function containmentsMap($containments) { + public function containmentsMap($containments) { $map = array(); foreach ($containments['models'] as $name => $model) { $instance =& $model['instance']; diff --git a/cake/libs/model/behaviors/translate.php b/cake/libs/model/behaviors/translate.php index a6104d13f..7e15f2ef2 100644 --- a/cake/libs/model/behaviors/translate.php +++ b/cake/libs/model/behaviors/translate.php @@ -46,9 +46,8 @@ class TranslateBehavior extends ModelBehavior { * * @param array $config * @return mixed - * @access public */ - function setup(&$model, $config = array()) { + public function setup(&$model, $config = array()) { $db =& ConnectionManager::getDataSource($model->useDbConfig); if (!$db->connected) { trigger_error( @@ -68,9 +67,8 @@ function setup(&$model, $config = array()) { * Callback * * @return void - * @access public */ - function cleanup(&$model) { + public function cleanup(&$model) { $this->unbindTranslation($model); unset($this->settings[$model->alias]); unset($this->runtime[$model->alias]); @@ -81,9 +79,8 @@ function cleanup(&$model) { * * @param array $query * @return array Modified query - * @access public */ - function beforeFind(&$model, $query) { + public function beforeFind(&$model, $query) { $locale = $this->_getLocale($model); if (empty($locale)) { return $query; @@ -207,9 +204,8 @@ function beforeFind(&$model, $query) { * @param array $results * @param boolean $primary * @return array Modified results - * @access public */ - function afterFind(&$model, $results, $primary) { + public function afterFind(&$model, $results, $primary) { $this->runtime[$model->alias]['fields'] = array(); $locale = $this->_getLocale($model); @@ -250,9 +246,8 @@ function afterFind(&$model, $results, $primary) { * beforeValidate Callback * * @return boolean - * @access public */ - function beforeValidate(&$model) { + public function beforeValidate(&$model) { $locale = $this->_getLocale($model); if (empty($locale)) { return true; @@ -284,9 +279,8 @@ function beforeValidate(&$model) { * * @param boolean $created * @return void - * @access public */ - function afterSave(&$model, $created) { + public function afterSave(&$model, $created) { if (!isset($this->runtime[$model->alias]['beforeSave'])) { return true; } @@ -327,9 +321,8 @@ function afterSave(&$model, $created) { * afterDelete Callback * * @return void - * @access public */ - function afterDelete(&$model) { + public function afterDelete(&$model) { $RuntimeModel =& $this->translateModel($model); $conditions = array('model' => $model->alias, 'foreign_key' => $model->id); $RuntimeModel->deleteAll($conditions); @@ -358,9 +351,8 @@ function _getLocale(&$model) { * Get instance of model for translations * * @return object - * @access public */ - function &translateModel(&$model) { + public function &translateModel(&$model) { if (!isset($this->runtime[$model->alias]['model'])) { if (!isset($model->translateModel) || empty($model->translateModel)) { $className = 'I18nModel'; diff --git a/cake/libs/model/behaviors/tree.php b/cake/libs/model/behaviors/tree.php index bf48a72cd..fca1e906f 100644 --- a/cake/libs/model/behaviors/tree.php +++ b/cake/libs/model/behaviors/tree.php @@ -55,9 +55,8 @@ class TreeBehavior extends ModelBehavior { * @param object $Model instance of model * @param array $config array of configuration settings. * @return void - * @access public */ - function setup(&$Model, $config = array()) { + public function setup(&$Model, $config = array()) { if (!is_array($config)) { $config = array('type' => $config); } @@ -81,9 +80,8 @@ function setup(&$Model, $config = array()) { * @param AppModel $Model Model instance. * @param boolean $created indicates whether the node just saved was created or updated * @return boolean true on success, false on failure - * @access public */ - function afterSave(&$Model, $created) { + public function afterSave(&$Model, $created) { extract($this->settings[$Model->alias]); if ($created) { if ((isset($Model->data[$Model->alias][$parent])) && $Model->data[$Model->alias][$parent]) { @@ -102,9 +100,8 @@ function afterSave(&$Model, $created) { * * @param AppModel $Model Model instance * @return boolean true to continue, false to abort the delete - * @access public */ - function beforeDelete(&$Model) { + public function beforeDelete(&$Model) { extract($this->settings[$Model->alias]); list($name, $data) = array($Model->alias, $Model->read()); $data = $data[$name]; @@ -135,9 +132,8 @@ function beforeDelete(&$Model) { * @since 1.2 * @param AppModel $Model Model instance * @return boolean true to continue, false to abort the save - * @access public */ - function beforeSave(&$Model) { + public function beforeSave(&$Model) { extract($this->settings[$Model->alias]); $this->_addToWhitelist($Model, array($left, $right)); @@ -205,9 +201,8 @@ function beforeSave(&$Model) { * @param mixed $id The ID of the record to read or false to read all top level nodes * @param boolean $direct whether to count direct, or all, children * @return integer number of child nodes - * @access public */ - function childcount(&$Model, $id = null, $direct = false) { + public function childcount(&$Model, $id = null, $direct = false) { if (is_array($id)) { extract (array_merge(array('id' => null), $id)); } @@ -251,9 +246,8 @@ function childcount(&$Model, $id = null, $direct = false) { * @param integer $page Page number, for accessing paged data * @param integer $recursive The number of levels deep to fetch associated records * @return array Array of child nodes - * @access public */ - function children(&$Model, $id = null, $direct = false, $fields = null, $order = null, $limit = null, $page = 1, $recursive = null) { + public function children(&$Model, $id = null, $direct = false, $fields = null, $order = null, $limit = null, $page = 1, $recursive = null) { if (is_array($id)) { extract (array_merge(array('id' => null), $id)); } @@ -308,9 +302,8 @@ function children(&$Model, $id = null, $direct = false, $fields = null, $order = * @param string $spacer The character or characters which will be repeated * @param integer $recursive The number of levels deep to fetch associated records * @return array An associative array of records, where the id is the key, and the display field is the value - * @access public */ - function generatetreelist(&$Model, $conditions = null, $keyPath = null, $valuePath = null, $spacer = '_', $recursive = null) { + public function generatetreelist(&$Model, $conditions = null, $keyPath = null, $valuePath = null, $spacer = '_', $recursive = null) { $overrideRecursive = $recursive; extract($this->settings[$Model->alias]); if (!is_null($overrideRecursive)) { @@ -363,9 +356,8 @@ function generatetreelist(&$Model, $conditions = null, $keyPath = null, $valuePa * @param mixed $id The ID of the record to read * @param integer $recursive The number of levels deep to fetch associated records * @return array Array of data for the parent node - * @access public */ - function getparentnode(&$Model, $id = null, $fields = null, $recursive = null) { + public function getparentnode(&$Model, $id = null, $fields = null, $recursive = null) { if (is_array($id)) { extract (array_merge(array('id' => null), $id)); } @@ -396,9 +388,8 @@ function getparentnode(&$Model, $id = null, $fields = null, $recursive = null) { * @param mixed $fields Either a single string of a field name, or an array of field names * @param integer $recursive The number of levels deep to fetch associated records * @return array Array of nodes from top most parent to current node - * @access public */ - function getpath(&$Model, $id = null, $fields = null, $recursive = null) { + public function getpath(&$Model, $id = null, $fields = null, $recursive = null) { if (is_array($id)) { extract (array_merge(array('id' => null), $id)); } @@ -433,9 +424,8 @@ function getpath(&$Model, $id = null, $fields = null, $recursive = null) { * @param mixed $id The ID of the record to move * @param mixed $number how many places to move the node or true to move to last position * @return boolean true on success, false on failure - * @access public */ - function movedown(&$Model, $id = null, $number = 1) { + public function movedown(&$Model, $id = null, $number = 1) { if (is_array($id)) { extract (array_merge(array('id' => null), $id)); } @@ -491,9 +481,8 @@ function movedown(&$Model, $id = null, $number = 1) { * @param mixed $id The ID of the record to move * @param mixed $number how many places to move the node, or true to move to first position * @return boolean true on success, false on failure - * @access public */ - function moveup(&$Model, $id = null, $number = 1) { + public function moveup(&$Model, $id = null, $number = 1) { if (is_array($id)) { extract (array_merge(array('id' => null), $id)); } @@ -555,9 +544,8 @@ function moveup(&$Model, $id = null, $number = 1) { * @param mixed $missingParentAction 'return' to do nothing and return, 'delete' to * delete, or the id of the parent to set as the parent_id * @return boolean true on success, false on failure - * @access public */ - function recover(&$Model, $mode = 'parent', $missingParentAction = null) { + public function recover(&$Model, $mode = 'parent', $missingParentAction = null) { if (is_array($mode)) { extract (array_merge(array('mode' => 'parent'), $mode)); } @@ -672,9 +660,8 @@ function reorder(&$Model, $options = array()) { * @param mixed $id The ID of the record to remove * @param boolean $delete whether to delete the node after reparenting children (if any) * @return boolean true on success, false on failure - * @access public */ - function removefromtree(&$Model, $id = null, $delete = false) { + public function removefromtree(&$Model, $id = null, $delete = false) { if (is_array($id)) { extract (array_merge(array('id' => null), $id)); } @@ -740,9 +727,8 @@ function removefromtree(&$Model, $id = null, $delete = false) { * @param AppModel $Model Model instance * @return mixed true if the tree is valid or empty, otherwise an array of (error type [index, node], * [incorrect left/right index,node id], message) - * @access public */ - function verify(&$Model) { + public function verify(&$Model) { extract($this->settings[$Model->alias]); if (!$Model->find('count', array('conditions' => $scope))) { return true; diff --git a/cake/libs/model/cake_schema.php b/cake/libs/model/cake_schema.php index fb6db0566..e481c10bd 100644 --- a/cake/libs/model/cake_schema.php +++ b/cake/libs/model/cake_schema.php @@ -139,9 +139,8 @@ function _build($data) { * * @param array $events schema object properties * @return boolean Should process continue - * @access public */ - function before($event = array()) { + public function before($event = array()) { return true; } @@ -149,9 +148,8 @@ function before($event = array()) { * After callback to be implemented in subclasses * * @param array $events schema object properties - * @access public */ - function after($event = array()) { + public function after($event = array()) { } /** @@ -159,9 +157,8 @@ function after($event = array()) { * * @param array $options schema object properties * @return array Set of name and tables - * @access public */ - function &load($options = array()) { + public function &load($options = array()) { if (is_string($options)) { $options = array('path' => $options); } @@ -198,9 +195,8 @@ function &load($options = array()) { * * @param array $options schema object properties * @return array Array indexed by name and tables - * @access public */ - function read($options = array()) { + public function read($options = array()) { extract(array_merge( array( 'connection' => $this->connection, @@ -319,9 +315,8 @@ function read($options = array()) { * @param mixed $object schema object or options array * @param array $options schema object properties to override object * @return mixed false or string written to file - * @access public */ - function write($object, $options = array()) { + public function write($object, $options = array()) { if (is_object($object)) { $object = get_object_vars($object); $this->_build($object); @@ -427,9 +422,8 @@ function generateTable($table, $fields) { * @param mixed $old Schema object or array * @param mixed $new Schema object or array * @return array Tables (that are added, dropped, or changed) - * @access public */ - function compare($old, $new = null) { + public function compare($old, $new = null) { if (empty($new)) { $new =& $this; } @@ -513,9 +507,8 @@ function compare($old, $new = null) { * * @param array $values options keys(type, null, default, key, length, extra) * @return array Formatted values - * @access public */ - function __values($values) { + public function __values($values) { $vals = array(); if (is_array($values)) { foreach ($values as $key => $val) { @@ -535,9 +528,8 @@ function __values($values) { * * @param array $Obj model object * @return array Formatted columns - * @access public */ - function __columns(&$Obj) { + public function __columns(&$Obj) { $db =& ConnectionManager::getDataSource($Obj->useDbConfig); $fields = $Obj->schema(true); $columns = $props = array(); diff --git a/cake/libs/model/datasources/datasource.php b/cake/libs/model/datasources/datasource.php index c23ce9b03..94120d865 100644 --- a/cake/libs/model/datasources/datasource.php +++ b/cake/libs/model/datasources/datasource.php @@ -221,9 +221,8 @@ function __construct($config = array()) { * * @param mixed $data * @return array Array of sources available in this datasource. - * @access public */ - function listSources($data = null) { + public function listSources($data = null) { if ($this->cacheSources === false) { return null; } @@ -250,9 +249,8 @@ function listSources($data = null) { * * @param boolean $reset Whether or not the source list should be reset. * @return array Array of sources available in this datasource - * @access public */ - function sources($reset = false) { + public function sources($reset = false) { if ($reset === true) { $this->_sources = null; } @@ -264,9 +262,8 @@ function sources($reset = false) { * * @param Model $model * @return array Array of Metadata for the $model - * @access public */ - function describe(&$model) { + public function describe(&$model) { if ($this->cacheSources === false) { return null; } @@ -288,9 +285,8 @@ function describe(&$model) { * Begin a transaction * * @return boolean Returns true if a transaction is not in progress - * @access public */ - function begin(&$model) { + public function begin(&$model) { return !$this->_transactionStarted; } @@ -298,9 +294,8 @@ function begin(&$model) { * Commit a transaction * * @return boolean Returns true if a transaction is in progress - * @access public */ - function commit(&$model) { + public function commit(&$model) { return $this->_transactionStarted; } @@ -308,9 +303,8 @@ function commit(&$model) { * Rollback a transaction * * @return boolean Returns true if a transaction is in progress - * @access public */ - function rollback(&$model) { + public function rollback(&$model) { return $this->_transactionStarted; } @@ -319,9 +313,8 @@ function rollback(&$model) { * * @param string $real Real column type (i.e. "varchar(255)") * @return string Abstract column type (i.e. "string") - * @access public */ - function column($real) { + public function column($real) { return false; } @@ -334,9 +327,8 @@ function column($real) { * @param array $fields An Array of fields to be saved. * @param array $values An Array of values to save. * @return boolean success - * @access public */ - function create(&$model, $fields = null, $values = null) { + public function create(&$model, $fields = null, $values = null) { return false; } @@ -348,9 +340,8 @@ function create(&$model, $fields = null, $values = null) { * @param Model $model The model being read. * @param array $queryData An array of query data used to find the data you want * @return mixed - * @access public */ - function read(&$model, $queryData = array()) { + public function read(&$model, $queryData = array()) { return false; } @@ -363,9 +354,8 @@ function read(&$model, $queryData = array()) { * @param array $fields Array of fields to be updated * @param array $values Array of values to be update $fields to. * @return boolean Success - * @access public */ - function update(&$model, $fields = null, $values = null) { + public function update(&$model, $fields = null, $values = null) { return false; } @@ -376,9 +366,8 @@ function update(&$model, $fields = null, $values = null) { * * @param Model $model The model class having record(s) deleted * @param mixed $id Primary key of the model - * @access public */ - function delete(&$model, $id = null) { + public function delete(&$model, $id = null) { if ($id == null) { $id = $model->id; } @@ -389,9 +378,8 @@ function delete(&$model, $id = null) { * * @param unknown_type $source * @return mixed Last ID key generated in previous INSERT - * @access public */ - function lastInsertId($source = null) { + public function lastInsertId($source = null) { return false; } @@ -400,9 +388,8 @@ function lastInsertId($source = null) { * * @param unknown_type $source * @return integer Number of rows returned by last operation - * @access public */ - function lastNumRows($source = null) { + public function lastNumRows($source = null) { return false; } @@ -411,9 +398,8 @@ function lastNumRows($source = null) { * * @param unknown_type $source * @return integer Number of rows affected by last query. - * @access public */ - function lastAffected($source = null) { + public function lastAffected($source = null) { return false; } @@ -423,9 +409,8 @@ function lastAffected($source = null) { * before establishing a connection. * * @return boolean Whether or not the Datasources conditions for use are met. - * @access public */ - function enabled() { + public function enabled() { return true; } /** @@ -433,9 +418,8 @@ function enabled() { * * @param string $interface The name of the interface (method) * @return boolean True on success - * @access public */ - function isInterfaceSupported($interface) { + public function isInterfaceSupported($interface) { static $methods = false; if ($methods === false) { $methods = array_map('strtolower', get_class_methods($this)); @@ -449,9 +433,8 @@ function isInterfaceSupported($interface) { * * @param array $config The configuration array * @return void - * @access public */ - function setConfig($config = array()) { + public function setConfig($config = array()) { $this->config = array_merge($this->_baseConfig, $this->config, $config); } @@ -572,9 +555,8 @@ function insertQueryData($query, $data, $association, $assocData, &$model, &$lin * @param Model $model Model instance * @param string $key Key name to make * @return string Key name for model. - * @access public */ - function resolveKey(&$model, $key) { + public function resolveKey(&$model, $key) { return $model->alias . $key; } @@ -582,9 +564,8 @@ function resolveKey(&$model, $key) { * Closes the current datasource. * * @return void - * @access public */ - function __destruct() { + public function __destruct() { if ($this->_transactionStarted) { $null = null; $this->rollback($null); diff --git a/cake/libs/model/datasources/dbo/dbo_oracle.php b/cake/libs/model/datasources/dbo/dbo_oracle.php index 3734e4e43..3ad8a5981 100644 --- a/cake/libs/model/datasources/dbo/dbo_oracle.php +++ b/cake/libs/model/datasources/dbo/dbo_oracle.php @@ -165,9 +165,8 @@ class DboOracle extends DboSource { * Connects to the database using options in the given configuration array. * * @return boolean True if the database could be connected, else false - * @access public */ - function connect() { + public function connect() { $config = $this->config; $this->connected = false; $config['charset'] = !empty($config['charset']) ? $config['charset'] : null; @@ -246,9 +245,8 @@ function getEncoding() { * Disconnects from database. * * @return boolean True if the database could be disconnected, else false - * @access public */ - function disconnect() { + public function disconnect() { if ($this->connection) { $this->connected = !ocilogoff($this->connection); return !$this->connected; @@ -311,9 +309,8 @@ function _scrapeSQL($sql) { * @param integer $limit Maximum number of rows to return * @param integer $offset Row to begin returning * @return modified SQL Query - * @access public */ - function limit($limit = -1, $offset = 0) { + public function limit($limit = -1, $offset = 0) { $this->_limit = (int) $limit; $this->_offset = (int) $offset; } @@ -323,9 +320,8 @@ function limit($limit = -1, $offset = 0) { * this returns false. * * @return integer Number of rows in resultset - * @access public */ - function lastNumRows() { + public function lastNumRows() { return $this->_numRows; } @@ -381,9 +377,8 @@ function _execute($sql) { * Enter description here... * * @return unknown - * @access public */ - function fetchRow() { + public function fetchRow() { if ($this->_currentRow >= $this->_numRows) { ocifreestatement($this->_statementId); $this->_map = null; @@ -421,9 +416,8 @@ function fetchResult() { * * @param string $sequence * @return bool - * @access public */ - function sequenceExists($sequence) { + public function sequenceExists($sequence) { $sql = "SELECT SEQUENCE_NAME FROM USER_SEQUENCES WHERE SEQUENCE_NAME = '$sequence'"; if (!$this->execute($sql)) { return false; @@ -436,9 +430,8 @@ function sequenceExists($sequence) { * * @param string $sequence * @return bool - * @access public */ - function createSequence($sequence) { + public function createSequence($sequence) { $sql = "CREATE SEQUENCE $sequence"; return $this->execute($sql); } @@ -448,9 +441,8 @@ function createSequence($sequence) { * * @param unknown_type $table * @return unknown - * @access public */ - function createTrigger($table) { + public function createTrigger($table) { $sql = "CREATE OR REPLACE TRIGGER pk_$table" . "_trigger BEFORE INSERT ON $table FOR EACH ROW BEGIN SELECT pk_$table.NEXTVAL INTO :NEW.ID FROM DUAL; END;"; return $this->execute($sql); } @@ -460,9 +452,8 @@ function createTrigger($table) { * raised and the application exits. * * @return array tablenames in the database - * @access public */ - function listSources() { + public function listSources() { $cache = parent::listSources(); if ($cache != null) { return $cache; @@ -486,9 +477,8 @@ function listSources() { * * @param object instance of a model to inspect * @return array Fields in table. Keys are name and type - * @access public */ - function describe(&$model) { + public function describe(&$model) { $table = $this->fullTableName($model, false); if (!empty($model->sequence)) { @@ -744,9 +734,8 @@ function alterSchema($compare, $table = null) { * * @param unknown_type $var * @return unknown - * @access public */ - function name($name) { + public function name($name) { if (strpos($name, '.') !== false && strpos($name, '"') === false) { list($model, $field) = explode('.', $name); if ($field[0] == "_") { @@ -802,9 +791,8 @@ function commit() { * * @param string $real Real database-layer column type (i.e. "varchar(255)") * @return string Abstract column type (i.e. "string") - * @access public */ - function column($real) { + public function column($real) { if (is_array($real)) { $col = $real['name']; @@ -853,9 +841,8 @@ function column($real) { * * @param string $data String to be prepared for use in an SQL statement * @return string Quoted and escaped - * @access public */ - function value($data, $column = null, $safe = false) { + public function value($data, $column = null, $safe = false) { $parent = parent::value($data, $column, $safe); if ($parent != null) { @@ -894,9 +881,8 @@ function value($data, $column = null, $safe = false) { * * @param string * @return integer - * @access public */ - function lastInsertId($source) { + public function lastInsertId($source) { $sequence = $this->_sequenceMap[$source]; $sql = "SELECT $sequence.currval FROM dual"; @@ -914,9 +900,8 @@ function lastInsertId($source) { * Returns a formatted error message from previous database operation. * * @return string Error message with error number - * @access public */ - function lastError() { + public function lastError() { return $this->_error; } @@ -924,9 +909,8 @@ function lastError() { * Returns number of affected rows in previous database operation. If no previous operation exists, this returns false. * * @return int Number of affected rows - * @access public */ - function lastAffected() { + public function lastAffected() { return $this->_statementId ? ocirowcount($this->_statementId): false; } diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index 37f61b950..deb6b161b 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -389,9 +389,8 @@ function getSequence($table, $field = 'id') { * @param integer $reset If -1, sequences are dropped, if 0 (default), sequences are reset, * and if 1, sequences are not modified * @return boolean SQL TRUNCATE TABLE statement, false if not applicable. - * @access public */ - function truncate($table, $reset = 0) { + public function truncate($table, $reset = 0) { if (parent::truncate($table)) { $table = $this->fullTableName($table, false); if (isset($this->_sequenceMap[$table]) && $reset !== 1) { diff --git a/cake/libs/model/datasources/dbo/dbo_sqlite.php b/cake/libs/model/datasources/dbo/dbo_sqlite.php index 290c17981..03252c8d0 100644 --- a/cake/libs/model/datasources/dbo/dbo_sqlite.php +++ b/cake/libs/model/datasources/dbo/dbo_sqlite.php @@ -313,9 +313,8 @@ function update(&$model, $fields = array(), $values = null, $conditions = null) * * @param mixed $table A string or model class representing the table to be truncated * @return boolean SQL TRUNCATE TABLE statement, false if not applicable. - * @access public */ - function truncate($table) { + public function truncate($table) { return $this->execute('DELETE From ' . $this->fullTableName($table)); } diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index e2a845f72..0075410de 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -118,9 +118,8 @@ class DboSource extends DataSource { * * @param array $config Array of configuration information for the Datasource. * @param boolean $autoConnect Whether or not the datasource should automatically connect. - * @access public */ - function __construct($config = null, $autoConnect = true) { + public function __construct($config = null, $autoConnect = true) { if (!isset($config['prefix'])) { $config['prefix'] = ''; } @@ -141,9 +140,8 @@ function __construct($config = null, $autoConnect = true) { * * @param array $config An array defining the new configuration settings * @return boolean True on success, false on failure - * @access public */ - function reconnect($config = null) { + public function reconnect($config = null) { $this->disconnect(); $this->setConfig($config); $this->_sources = null; @@ -158,9 +156,8 @@ function reconnect($config = null) { * @param string $column The column into which this data will be inserted * @param boolean $read Value to be used in READ or WRITE context * @return mixed Prepared value or array of values. - * @access public */ - function value($data, $column = null, $read = true) { + public function value($data, $column = null, $read = true) { if (is_array($data) && !empty($data)) { return array_map( array(&$this, 'value'), @@ -184,9 +181,8 @@ function value($data, $column = null, $read = true) { * * @param string $identifier * @return object An object representing a database identifier to be used in a query - * @access public */ - function identifier($identifier) { + public function identifier($identifier) { $obj = new stdClass(); $obj->type = 'identifier'; $obj->value = $identifier; @@ -198,9 +194,8 @@ function identifier($identifier) { * * @param string $expression * @return object An object representing a database expression to be used in a query - * @access public */ - function expression($expression) { + public function expression($expression) { $obj = new stdClass(); $obj->type = 'expression'; $obj->value = $expression; @@ -212,9 +207,8 @@ function expression($expression) { * * @param string $sql SQL statement * @return boolean - * @access public */ - function rawQuery($sql) { + public function rawQuery($sql) { $this->took = $this->error = $this->numRows = false; return $this->execute($sql); } @@ -233,9 +227,8 @@ function rawQuery($sql) { * @param string $sql * @param array $options * @return mixed Resource or object representing the result set, or false on failure - * @access public */ - function execute($sql, $options = array()) { + public function execute($sql, $options = array()) { $defaults = array('stats' => true, 'log' => $this->fullDebug); $options = array_merge($defaults, $options); @@ -263,9 +256,8 @@ function execute($sql, $options = array()) { * DataSource Query abstraction * * @return resource Result resource identifier. - * @access public */ - function query() { + public function query() { $args = func_get_args(); $fields = null; $order = null; @@ -360,9 +352,8 @@ function query() { * Returns a row from current resultset as an array * * @return array The fetched row as an array - * @access public */ - function fetchRow($sql = null) { + public function fetchRow($sql = null) { if (!empty($sql) && is_string($sql) && strlen($sql) > 5) { if (!$this->execute($sql)) { return null; @@ -388,9 +379,8 @@ function fetchRow($sql = null) { * @param string $sql SQL statement * @param boolean $cache Enables returning/storing cached query results * @return array Array of resultset rows, or false if no rows matched - * @access public */ - function fetchAll($sql, $cache = true, $modelName = null) { + public function fetchAll($sql, $cache = true, $modelName = null) { if ($cache && isset($this->_queryCache[$sql])) { if (preg_match('/^\s*select/i', $sql)) { return $this->_queryCache[$sql]; @@ -458,9 +448,8 @@ function fetchVirtualField(&$result) { * @param string $name Name of the field * @param string $sql SQL query * @return mixed Value of field read. - * @access public */ - function field($name, $sql) { + public function field($name, $sql) { $data = $this->fetchRow($sql); if (!isset($data[$name]) || empty($data[$name])) { return false; @@ -507,9 +496,8 @@ function cacheMethod($method, $key, $value = null) { * * @param string $data * @return string SQL field - * @access public */ - function name($data) { + public function name($data) { if (is_object($data) && isset($data->type)) { return $data->value; } @@ -563,9 +551,8 @@ function name($data) { * Checks if the source is connected to the database. * * @return boolean True if the database is connected, else false - * @access public */ - function isConnected() { + public function isConnected() { return $this->connected; } @@ -573,9 +560,8 @@ function isConnected() { * Checks if the result is valid * * @return boolean True if the result is valid else false - * @access public */ - function hasResult() { + public function hasResult() { return is_resource($this->_result); } @@ -584,9 +570,8 @@ function hasResult() { * * @param boolean $sorted Get the queries sorted by time taken, defaults to false. * @return array Array of queries run as an array - * @access public */ - function getLog($sorted = false, $clear = true) { + public function getLog($sorted = false, $clear = true) { if ($sorted) { $log = sortByKey($this->_queriesLog, 'took', 'desc', SORT_NUMERIC); } else { @@ -628,9 +613,8 @@ function showLog($sorted = false) { * * @param string $sql SQL statement * @todo: Add hook to log errors instead of returning false - * @access public */ - function logQuery($sql) { + public function logQuery($sql) { $this->_queriesCnt++; $this->_queriesTime += $this->took; $this->_queriesLog[] = array( @@ -653,9 +637,8 @@ function logQuery($sql) { * and execution time in microseconds. If the query fails, an error is output instead. * * @param string $sql Query to show information on. - * @access public */ - function showQuery($sql) { + public function showQuery($sql) { $error = $this->error; if (strlen($sql) > 200 && !$this->fullDebug && Configure::read() > 1) { $sql = substr($sql, 0, 200) . '[...]'; @@ -677,9 +660,8 @@ function showQuery($sql) { * @param mixed $model Either a Model object or a string table name. * @param boolean $quote Whether you want the table name quoted. * @return string Full quoted table name - * @access public */ - function fullTableName($model, $quote = true) { + public function fullTableName($model, $quote = true) { if (is_object($model)) { $table = $model->tablePrefix . $model->table; } elseif (isset($this->config['prefix'])) { @@ -704,9 +686,8 @@ function fullTableName($model, $quote = true) { * @param array $values An array of values with keys matching the fields. If null, $model->data will * be used to generate values. * @return boolean Success - * @access public */ - function create(&$model, $fields = null, $values = null) { + public function create(&$model, $fields = null, $values = null) { $id = null; if ($fields == null) { @@ -1047,9 +1028,8 @@ function queryAssociation(&$model, &$linkModel, $type, $association, $assocData, * @param string $query Association query * @param array $ids Array of IDs of associated records * @return array Association results - * @access public */ - function fetchAssociated($model, $query, $ids) { + public function fetchAssociated($model, $query, $ids) { $query = str_replace('{$__cakeID__$}', implode(', ', $ids), $query); if (count($ids) > 1) { $query = str_replace('= (', 'IN (', $query); @@ -1190,9 +1170,8 @@ function __mergeAssociation(&$data, $merge, $association, $type, $selfJoin = fal * @param boolean $external * @param array $resultSet * @return mixed - * @access public */ - function generateAssociationQuery(&$model, &$linkModel, $type, $association = null, $assocData = array(), &$queryData, $external = false, &$resultSet) { + public function generateAssociationQuery(&$model, &$linkModel, $type, $association = null, $assocData = array(), &$queryData, $external = false, &$resultSet) { $queryData = $this->__scrubQueryData($queryData); $assocData = $this->__scrubQueryData($assocData); @@ -1356,9 +1335,8 @@ function generateAssociationQuery(&$model, &$linkModel, $type, $association = nu * @param object $model Model object * @param array $association Association array * @return array Conditions array defining the constraint between $model and $association - * @access public */ - function getConstraint($type, $model, $linkModel, $alias, $assoc, $alias2 = null) { + public function getConstraint($type, $model, $linkModel, $alias, $assoc, $alias2 = null) { $assoc = array_merge(array('external' => false, 'self' => false), $assoc); if (array_key_exists('foreignKey', $assoc) && empty($assoc['foreignKey'])) { @@ -1453,9 +1431,8 @@ function buildStatement($query, &$model) { * * @param array $data * @return string - * @access public */ - function renderJoinStatement($data) { + public function renderJoinStatement($data) { extract($data); return trim("{$type} JOIN {$table} {$alias} ON ({$conditions})"); } @@ -1466,9 +1443,8 @@ function renderJoinStatement($data) { * @param string $type type of query being run. e.g select, create, update, delete, schema, alter. * @param array $data Array of data to insert into the query. * @return string Rendered SQL expression to be run. - * @access public */ - function renderStatement($type, $data) { + public function renderStatement($type, $data) { extract($data); $aliases = null; @@ -1546,9 +1522,8 @@ function __mergeConditions($query, $assoc) { * @param array $values * @param mixed $conditions * @return boolean Success - * @access public */ - function update(&$model, $fields = array(), $values = null, $conditions = null) { + public function update(&$model, $fields = array(), $values = null, $conditions = null) { if ($values == null) { $combined = $fields; } else { @@ -1625,9 +1600,8 @@ function _prepareUpdateFields(&$model, $fields, $quoteValues = true, $alias = fa * @param Model $model * @param mixed $conditions * @return boolean Success - * @access public */ - function delete(&$model, $conditions = null) { + public function delete(&$model, $conditions = null) { $alias = $joins = null; $table = $this->fullTableName($model); $conditions = $this->_matchRecords($model, $conditions); @@ -1726,9 +1700,8 @@ function _getJoins($model) { * @param string $func Lowercase name of SQL function, i.e. 'count' or 'max' * @param array $params Function parameters (any values must be quoted manually) * @return string An SQL calculation function - * @access public */ - function calculate(&$model, $func, $params = array()) { + public function calculate(&$model, $func, $params = array()) { $params = (array)$params; switch (strtolower($func)) { @@ -1766,9 +1739,8 @@ function calculate(&$model, $func, $params = array()) { * * @param mixed $table A string or model class representing the table to be truncated * @return boolean SQL TRUNCATE TABLE statement, false if not applicable. - * @access public */ - function truncate($table) { + public function truncate($table) { return $this->execute('TRUNCATE TABLE ' . $this->fullTableName($table)); } @@ -1779,9 +1751,8 @@ function truncate($table) { * @return boolean True on success, false on fail * (i.e. if the database/model does not support transactions, * or a transaction has not started). - * @access public */ - function begin(&$model) { + public function begin(&$model) { if (parent::begin($model) && $this->execute($this->_commands['begin'])) { $this->_transactionStarted = true; return true; @@ -1796,9 +1767,8 @@ function begin(&$model) { * @return boolean True on success, false on fail * (i.e. if the database/model does not support transactions, * or a transaction has not started). - * @access public */ - function commit(&$model) { + public function commit(&$model) { if (parent::commit($model) && $this->execute($this->_commands['commit'])) { $this->_transactionStarted = false; return true; @@ -1813,9 +1783,8 @@ function commit(&$model) { * @return boolean True on success, false on fail * (i.e. if the database/model does not support transactions, * or a transaction has not started). - * @access public */ - function rollback(&$model) { + public function rollback(&$model) { if (parent::rollback($model) && $this->execute($this->_commands['rollback'])) { $this->_transactionStarted = false; return true; @@ -1836,9 +1805,8 @@ function rollback(&$model) { * @return mixed Either null, false, $conditions or an array of default conditions to use. * @see DboSource::update() * @see DboSource::conditions() - * @access public */ - function defaultConditions(&$model, $conditions, $useAlias = true) { + public function defaultConditions(&$model, $conditions, $useAlias = true) { if (!empty($conditions)) { return $conditions; } @@ -1863,9 +1831,8 @@ function defaultConditions(&$model, $conditions, $useAlias = true) { * @param unknown_type $key * @param unknown_type $assoc * @return string - * @access public */ - function resolveKey($model, $key, $assoc = null) { + public function resolveKey($model, $key, $assoc = null) { if (empty($assoc)) { $assoc = $model->alias; } @@ -1880,9 +1847,8 @@ function resolveKey($model, $key, $assoc = null) { * * @param array $data * @return array - * @access public */ - function __scrubQueryData($data) { + public function __scrubQueryData($data) { foreach (array('conditions', 'fields', 'joins', 'order', 'limit', 'offset', 'group') as $key) { if (empty($data[$key])) { $data[$key] = array(); @@ -1917,9 +1883,8 @@ function _constructVirtualFields(&$model, $alias, $fields) { * @param mixed $fields * @param boolean $quote If false, returns fields array unquoted * @return array - * @access public */ - function fields(&$model, $alias = null, $fields = array(), $quote = true) { + public function fields(&$model, $alias = null, $fields = array(), $quote = true) { if (empty($alias)) { $alias = $model->alias; } @@ -2047,9 +2012,8 @@ function fields(&$model, $alias = null, $fields = array(), $quote = true) { * @param boolean $where If true, "WHERE " will be prepended to the return value * @param Model $model A reference to the Model instance making the query * @return string SQL fragment - * @access public */ - function conditions($conditions, $quoteValues = true, $where = true, $model = null) { + public function conditions($conditions, $quoteValues = true, $where = true, $model = null) { if (is_object($model)) { $cacheKey = array( $model->useDbConfig, @@ -2110,9 +2074,8 @@ function conditions($conditions, $quoteValues = true, $where = true, $model = nu * @param boolean $quoteValues If true, values should be quoted * @param Model $model A reference to the Model instance making the query * @return string SQL fragment - * @access public */ - function conditionKeysToString($conditions, $quoteValues = true, $model = null) { + public function conditionKeysToString($conditions, $quoteValues = true, $model = null) { $c = 0; $out = array(); $data = $columnType = null; @@ -2346,9 +2309,8 @@ function __quoteMatchedField($match) { * @param integer $limit Limit of results returned * @param integer $offset Offset from which to start results * @return string SQL limit/offset statement - * @access public */ - function limit($limit, $offset = null) { + public function limit($limit, $offset = null) { if ($limit) { $rt = ''; if (!strpos(strtolower($limit), 'limit') || strpos(strtolower($limit), 'limit') === 0) { @@ -2372,9 +2334,8 @@ function limit($limit, $offset = null) { * @param string $direction Direction (ASC or DESC) * @param object $model model reference (used to look for virtual field) * @return string ORDER BY clause - * @access public */ - function order($keys, $direction = 'ASC', $model = null) { + public function order($keys, $direction = 'ASC', $model = null) { if (!is_array($keys)) { $keys = array($keys); } @@ -2436,9 +2397,8 @@ function order($keys, $direction = 'ASC', $model = null) { * * @param string $group Group By Condition * @return mixed string condition or null - * @access public */ - function group($group, $model = null) { + public function group($group, $model = null) { if ($group) { if (!is_array($group)) { $group = array($group); @@ -2458,9 +2418,8 @@ function group($group, $model = null) { * Disconnects database, kills the connection and says the connection is closed. * * @return void - * @access public */ - function close() { + public function close() { $this->disconnect(); } @@ -2470,9 +2429,8 @@ function close() { * @param Model $model Model to search * @param string $sql SQL WHERE clause (condition only, not the "WHERE" part) * @return boolean True if the table has a matching record, else false - * @access public */ - function hasAny(&$Model, $sql) { + public function hasAny(&$Model, $sql) { $sql = $this->conditions($sql); $table = $this->fullTableName($Model); $alias = $this->alias . $this->name($Model->alias); @@ -2492,9 +2450,8 @@ function hasAny(&$Model, $sql) { * * @param string $real Real database-layer column type (i.e. "varchar(255)") * @return mixed An integer or string representing the length of the column - * @access public */ - function length($real) { + public function length($real) { if (!preg_match_all('/([\w\s]+)(?:\((\d+)(?:,(\d+))?\))?(\sunsigned)?(\szerofill)?/', $real, $result)) { trigger_error(__("FIXME: Can't parse field: " . $real, true), E_USER_WARNING); $col = str_replace(array(')', 'unsigned'), '', $real); @@ -2553,9 +2510,8 @@ function length($real) { * * @param mixed $data Value to be translated * @return mixed Converted boolean value - * @access public */ - function boolean($data) { + public function boolean($data) { if ($data === true || $data === false) { if ($data === true) { return 1; @@ -2590,9 +2546,8 @@ function insertMulti($table, $fields, $values) { * * @param string $model Name of model to inspect * @return array Fields in table. Keys are column and unique - * @access public */ - function index($model) { + public function index($model) { return false; } @@ -2603,9 +2558,8 @@ function index($model) { * @param string $tableName Optional. If specified only the table name given will be generated. * Otherwise, all tables defined in the schema are generated. * @return string - * @access public */ - function createSchema($schema, $tableName = null) { + public function createSchema($schema, $tableName = null) { if (!is_a($schema, 'CakeSchema')) { trigger_error(__('Invalid schema object', true), E_USER_WARNING); return null; @@ -2665,9 +2619,8 @@ function alterSchema($compare, $table = null) { * @param string $table Optional. If specified only the table name given will be generated. * Otherwise, all tables defined in the schema are generated. * @return string - * @access public */ - function dropSchema($schema, $table = null) { + public function dropSchema($schema, $table = null) { if (!is_a($schema, 'CakeSchema')) { trigger_error(__('Invalid schema object', true), E_USER_WARNING); return null; @@ -2688,9 +2641,8 @@ function dropSchema($schema, $table = null) { * @param array $column An array structured like the following: array('name'=>'value', 'type'=>'value'[, options]), * where options can be 'default', 'length', or 'key'. * @return string - * @access public */ - function buildColumn($column) { + public function buildColumn($column) { $name = $type = null; extract(array_merge(array('null' => true), $column)); @@ -2754,9 +2706,8 @@ function buildColumn($column) { * @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. - * @access public */ - function _buildFieldParameters($columnString, $columnData, $position) { + public function _buildFieldParameters($columnString, $columnData, $position) { foreach ($this->fieldParameters as $paramName => $value) { if (isset($columnData[$paramName]) && $value['position'] == $position) { if (isset($value['options']) && !in_array($columnData[$paramName], $value['options'])) { @@ -2778,9 +2729,8 @@ function _buildFieldParameters($columnString, $columnData, $position) { * @param array $indexes * @param string $table * @return array - * @access public */ - function buildIndex($indexes, $table = null) { + public function buildIndex($indexes, $table = null) { $join = array(); foreach ($indexes as $name => $value) { $out = ''; @@ -2809,9 +2759,8 @@ function buildIndex($indexes, $table = null) { * @param array $parameters * @param string $table * @return array - * @access public */ - function readTableParameters($name) { + public function readTableParameters($name) { $parameters = array(); if ($this->isInterfaceSupported('listDetailedSources')) { $currentTableDetails = $this->listDetailedSources($name); @@ -2830,9 +2779,8 @@ function readTableParameters($name) { * @param array $parameters * @param string $table * @return array - * @access public */ - function buildTableParameters($parameters, $table = null) { + public function buildTableParameters($parameters, $table = null) { $result = array(); foreach ($parameters as $name => $value) { if (isset($this->tableParameters[$name])) { @@ -2850,9 +2798,8 @@ function buildTableParameters($parameters, $table = null) { * * @param string $value * @return void - * @access public */ - function introspectType($value) { + public function introspectType($value) { if (!is_array($value)) { if ($value === true || $value === false) { return 'boolean'; diff --git a/cake/libs/model/db_acl.php b/cake/libs/model/db_acl.php index 1c78532ef..67afad1b6 100644 --- a/cake/libs/model/db_acl.php +++ b/cake/libs/model/db_acl.php @@ -67,9 +67,8 @@ function __construct() { * * @param mixed $ref Array with 'model' and 'foreign_key', model object, or string value * @return array Node found in database - * @access public */ - function node($ref = null) { + public function node($ref = null) { $db =& ConnectionManager::getDataSource($this->useDbConfig); $type = $this->alias; $result = null; diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 59035bcb6..425e282ee 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -751,9 +751,8 @@ function __generateAssociation($type) { * * @param string $tableName Name of the custom table * @return void - * @access public */ - function setSource($tableName) { + public function setSource($tableName) { $this->setDataSource($this->useDbConfig); $db =& ConnectionManager::getDataSource($this->useDbConfig); $db->cacheSources = ($this->cacheSources && $db->cacheSources); @@ -837,9 +836,8 @@ function set($one, $two = null) { * @param string $field The name of the field to be deconstructed * @param mixed $data An array or object to be deconstructed into a field * @return mixed The resulting data that should be assigned to a field - * @access public */ - function deconstruct($field, $data) { + public function deconstruct($field, $data) { if (!is_array($data)) { return $data; } @@ -912,9 +910,8 @@ function deconstruct($field, $data) { * * @param mixed $field Set to true to reload schema, or a string to return a specific field * @return array Array of table metadata - * @access public */ - function schema($field = false) { + public function schema($field = false) { if (!is_array($this->_schema) || $field === true) { $db =& ConnectionManager::getDataSource($this->useDbConfig); $db->cacheSources = ($this->cacheSources && $db->cacheSources); @@ -938,9 +935,8 @@ function schema($field = false) { * Returns an associative array of field names and column types. * * @return array Field types indexed by field name - * @access public */ - function getColumnTypes() { + public function getColumnTypes() { $columns = $this->schema(); if (empty($columns)) { trigger_error(__('(Model::getColumnTypes) Unable to build model field data. If you are using a model without a database table, try implementing schema()', true), E_USER_WARNING); @@ -957,9 +953,8 @@ function getColumnTypes() { * * @param string $column The name of the model column * @return string Column type - * @access public */ - function getColumnType($column) { + public function getColumnType($column) { $db =& ConnectionManager::getDataSource($this->useDbConfig); $cols = $this->schema(); $model = null; @@ -986,9 +981,8 @@ function getColumnType($column) { * @return mixed If $name is a string, returns a boolean indicating whether the field exists. * If $name is an array of field names, returns the first field that exists, * or false if none exist. - * @access public */ - function hasField($name, $checkVirtual = false) { + public function hasField($name, $checkVirtual = false) { if (is_array($name)) { foreach ($name as $n) { if ($this->hasField($n, $checkVirtual)) { @@ -1019,9 +1013,8 @@ function hasField($name, $checkVirtual = false) { * * @param mixed $name Name of field to look for * @return boolean indicating whether the field exists as a model virtual field. - * @access public */ - function isVirtualField($field) { + public function isVirtualField($field) { if (empty($this->virtualFields) || !is_string($field)) { return false; } @@ -1044,9 +1037,8 @@ function isVirtualField($field) { * @return mixed If $field is string expression bound to virtual field $field * If $field is null, returns an array of all model virtual fields * or false if none $field exist. - * @access public */ - function getVirtualField($field = null) { + public function getVirtualField($field = null) { if ($field == null) { return empty($this->virtualFields) ? false : $this->virtualFields; } @@ -1464,9 +1456,8 @@ function __saveMulti($joined, $id, &$db) { * @param boolean $created True if a new record was created, otherwise only associations with * 'counterScope' defined get updated * @return void - * @access public */ - function updateCounterCache($keys = array(), $created = false) { + public function updateCounterCache($keys = array(), $created = false) { $keys = empty($keys) ? $this->data[$this->alias] : $keys; $keys['old'] = isset($keys['old']) ? $keys['old'] : array(); @@ -1964,9 +1955,8 @@ function __collectForeignKeys($type = 'belongsTo') { * to ascertain the existence of the record in persistent storage. * * @return boolean True if such a record exists - * @access public */ - function exists() { + public function exists() { if ($this->getID() === false) { return false; } @@ -1980,9 +1970,8 @@ function exists() { * * @param array $conditions SQL conditions array * @return boolean True if such a record exists - * @access public */ - function hasAny($conditions = null) { + public function hasAny($conditions = null) { return ($this->find('count', array('conditions' => $conditions, 'recursive' => -1)) != false); } @@ -2339,9 +2328,8 @@ function __filterResults($results, $primary = true) { * to those originally defined in the model. * * @return boolean Success - * @access public */ - function resetAssociations() { + public function resetAssociations() { if (!empty($this->__backAssociation)) { foreach ($this->__associations as $type) { if (isset($this->__backAssociation[$type])) { @@ -2368,9 +2356,8 @@ function resetAssociations() { * @param array $fields Field/value pairs to search (if no values specified, they are pulled from $this->data) * @param boolean $or If false, all fields specified must match in order for a false return value * @return boolean False if any records matching any fields are found - * @access public */ - function isUnique($fields, $or = true) { + public function isUnique($fields, $or = true) { if (!is_array($fields)) { $fields = func_get_args(); if (is_bool($fields[count($fields) - 1])) { @@ -2639,9 +2626,8 @@ function __validateWithModels($options) { * @param string $field The name of the field to invalidate * @param mixed $value Name of validation rule that was not failed, or validation message to * be returned. If no validation key is provided, defaults to true. - * @access public */ - function invalidate($field, $value = true) { + public function invalidate($field, $value = true) { if (!is_array($this->validationErrors)) { $this->validationErrors = array(); } @@ -2653,9 +2639,8 @@ function invalidate($field, $value = true) { * * @param string $field Returns true if the input string ends in "_id" * @return boolean True if the field is a foreign key listed in the belongsTo array. - * @access public */ - function isForeignKey($field) { + public function isForeignKey($field) { $foreignKeys = array(); if (!empty($this->belongsTo)) { foreach ($this->belongsTo as $assoc => $data) { @@ -2672,9 +2657,8 @@ function isForeignKey($field) { * @param string $field Field to escape (e.g: id) * @param string $alias Alias for the model (e.g: Post) * @return string The name of the escaped field for this Model (i.e. id becomes `Post`.`id`). - * @access public */ - function escapeField($field = null, $alias = null) { + public function escapeField($field = null, $alias = null) { if (empty($alias)) { $alias = $this->alias; } @@ -2693,9 +2677,8 @@ function escapeField($field = null, $alias = null) { * * @param integer $list Index on which the composed ID is located * @return mixed The ID of the current record, false if no ID - * @access public */ - function getID($list = 0) { + public function getID($list = 0) { if (empty($this->id) || (is_array($this->id) && isset($this->id[0]) && empty($this->id[0]))) { return false; } @@ -2725,9 +2708,8 @@ function getID($list = 0) { * Returns the ID of the last record this model inserted. * * @return mixed Last inserted ID - * @access public */ - function getLastInsertID() { + public function getLastInsertID() { return $this->getInsertID(); } @@ -2735,9 +2717,8 @@ function getLastInsertID() { * Returns the ID of the last record this model inserted. * * @return mixed Last inserted ID - * @access public */ - function getInsertID() { + public function getInsertID() { return $this->__insertID; } @@ -2745,9 +2726,8 @@ function getInsertID() { * Sets the ID of the last record this model inserted * * @param mixed Last inserted ID - * @access public */ - function setInsertID($id) { + public function setInsertID($id) { $this->__insertID = $id; } @@ -2755,9 +2735,8 @@ function setInsertID($id) { * Returns the number of rows returned from the last query. * * @return int Number of rows - * @access public */ - function getNumRows() { + public function getNumRows() { $db =& ConnectionManager::getDataSource($this->useDbConfig); return $db->lastNumRows(); } @@ -2766,9 +2745,8 @@ function getNumRows() { * Returns the number of rows affected by the last query. * * @return int Number of rows - * @access public */ - function getAffectedRows() { + public function getAffectedRows() { $db =& ConnectionManager::getDataSource($this->useDbConfig); return $db->lastAffected(); } @@ -2778,9 +2756,8 @@ function getAffectedRows() { * * @param string $dataSource The name of the DataSource, as defined in app/config/database.php * @return boolean True on success - * @access public */ - function setDataSource($dataSource = null) { + public function setDataSource($dataSource = null) { $oldConfig = $this->useDbConfig; if ($dataSource != null) { @@ -2807,9 +2784,8 @@ function setDataSource($dataSource = null) { * Not safe for use with some versions of PHP4, because this class is overloaded. * * @return object A DataSource object - * @access public */ - function &getDataSource() { + public function &getDataSource() { $db =& ConnectionManager::getDataSource($this->useDbConfig); return $db; } @@ -2818,9 +2794,8 @@ function &getDataSource() { * Get associations * * @return array - * @access public */ - function associations() { + public function associations() { return $this->__associations; } @@ -2829,9 +2804,8 @@ function associations() { * * @param string $type Only result associations of this type * @return array Associations - * @access public */ - function getAssociated($type = null) { + public function getAssociated($type = null) { if ($type == null) { $associated = array(); foreach ($this->__associations as $assoc) { @@ -2876,9 +2850,8 @@ function getAssociated($type = null) { * @param mixed $with The 'with' key of the model association * @param array $keys Any join keys which must be merged with the keys queried * @return array - * @access public */ - function joinModel($assoc, $keys = array()) { + public function joinModel($assoc, $keys = array()) { if (is_string($assoc)) { return array($assoc, array_keys($this->{$assoc}->schema())); } elseif (is_array($assoc)) { diff --git a/cake/libs/model/model_behavior.php b/cake/libs/model/model_behavior.php index c5eb06d10..25c06e6ea 100644 --- a/cake/libs/model/model_behavior.php +++ b/cake/libs/model/model_behavior.php @@ -58,9 +58,8 @@ class ModelBehavior extends Object { * * @param object $model Model using this behavior * @param array $config Configuration settings for $model - * @access public */ - function setup(&$model, $config = array()) { } + public function setup(&$model, $config = array()) { } /** * Clean up any initialization this behavior has done on a model. Called when a behavior is dynamically @@ -82,9 +81,8 @@ function cleanup(&$model) { * @param object $model Model using this behavior * @param array $queryData Data used to execute this query, i.e. conditions, order, etc. * @return boolean True if the operation should continue, false if it should abort - * @access public */ - function beforeFind(&$model, $query) { } + public function beforeFind(&$model, $query) { } /** * After find callback. Can be used to modify any results returned by find and findAll. @@ -93,36 +91,32 @@ function beforeFind(&$model, $query) { } * @param mixed $results The results of the find operation * @param boolean $primary Whether this model is being queried directly (vs. being queried as an association) * @return mixed Result of the find operation - * @access public */ - function afterFind(&$model, $results, $primary) { } + public function afterFind(&$model, $results, $primary) { } /** * Before validate callback * * @param object $model Model using this behavior * @return boolean True if validate operation should continue, false to abort - * @access public */ - function beforeValidate(&$model) { } + public function beforeValidate(&$model) { } /** * Before save callback * * @param object $model Model using this behavior * @return boolean True if the operation should continue, false if it should abort - * @access public */ - function beforeSave(&$model) { } + public function beforeSave(&$model) { } /** * After save callback * * @param object $model Model using this behavior * @param boolean $created True if this save created a new record - * @access public */ - function afterSave(&$model, $created) { } + public function afterSave(&$model, $created) { } /** * Before delete callback @@ -130,26 +124,23 @@ function afterSave(&$model, $created) { } * @param object $model Model using this behavior * @param boolean $cascade If true records that depend on this record will also be deleted * @return boolean True if the operation should continue, false if it should abort - * @access public */ - function beforeDelete(&$model, $cascade = true) { } + public function beforeDelete(&$model, $cascade = true) { } /** * After delete callback * * @param object $model Model using this behavior - * @access public */ - function afterDelete(&$model) { } + public function afterDelete(&$model) { } /** * DataSource error callback * * @param object $model Model using this behavior * @param string $error Error generated in DataSource - * @access public */ - function onError(&$model, $error) { } + public function onError(&$model, $error) { } /** * Overrides Object::dispatchMethod to account for PHP4's broken reference support @@ -276,9 +267,8 @@ function init($modelName, $behaviors = array()) { * @param string $behavior CamelCased name of the behavior to load * @param array $config Behavior configuration parameters * @return boolean True on success, false on failure - * @access public */ - function attach($behavior, $config = array()) { + public function attach($behavior, $config = array()) { list($plugin, $name) = pluginSplit($behavior); $class = $name . 'Behavior'; @@ -369,9 +359,8 @@ function attach($behavior, $config = array()) { * * @param string $name CamelCased name of the behavior to unload * @return void - * @access public */ - function detach($name) { + public function detach($name) { if (isset($this->{$name})) { $this->{$name}->cleanup(ClassRegistry::getObject($this->modelName)); unset($this->{$name}); @@ -389,9 +378,8 @@ function detach($name) { * * @param mixed $name CamelCased name of the behavior(s) to enable (string or array) * @return void - * @access public */ - function enable($name) { + public function enable($name) { $this->_disabled = array_diff($this->_disabled, (array)$name); } @@ -401,9 +389,8 @@ function enable($name) { * * @param mixed $name CamelCased name of the behavior(s) to disable (string or array) * @return void - * @access public */ - function disable($name) { + public function disable($name) { foreach ((array)$name as $behavior) { if (in_array($behavior, $this->_attached) && !in_array($behavior, $this->_disabled)) { $this->_disabled[] = $behavior; @@ -418,9 +405,8 @@ function disable($name) { * returns an array of currently-enabled behaviors * @return mixed If $name is specified, returns the boolean status of the corresponding behavior. * Otherwise, returns an array of all enabled behaviors. - * @access public */ - function enabled($name = null) { + public function enabled($name = null) { if (!empty($name)) { return (in_array($name, $this->_attached) && !in_array($name, $this->_disabled)); } @@ -431,9 +417,8 @@ function enabled($name = null) { * Dispatches a behavior method * * @return array All methods for all behaviors attached to this object - * @access public */ - function dispatchMethod(&$model, $method, $params = array(), $strict = false) { + public function dispatchMethod(&$model, $method, $params = array(), $strict = false) { $methods = array_keys($this->__methods); foreach ($methods as $key => $value) { $methods[$key] = strtolower($value); @@ -476,9 +461,8 @@ function dispatchMethod(&$model, $method, $params = array(), $strict = false) { * @param array $params * @param array $options * @return mixed - * @access public */ - function trigger(&$model, $callback, $params = array(), $options = array()) { + public function trigger(&$model, $callback, $params = array(), $options = array()) { if (empty($this->_attached)) { return true; } @@ -509,9 +493,8 @@ function trigger(&$model, $callback, $params = array(), $options = array()) { * Gets the method list for attached behaviors, i.e. all public, non-callback methods * * @return array All public methods for all behaviors attached to this collection - * @access public */ - function methods() { + public function methods() { return $this->__methods; } @@ -522,9 +505,8 @@ function methods() { * returns an array of currently-attached behaviors * @return mixed If $name is specified, returns the boolean status of the corresponding behavior. * Otherwise, returns an array of all attached behaviors. - * @access public */ - function attached($name = null) { + public function attached($name = null) { if (!empty($name)) { return (in_array($name, $this->_attached)); } diff --git a/cake/libs/object.php b/cake/libs/object.php index f8034a5aa..c87c5621e 100644 --- a/cake/libs/object.php +++ b/cake/libs/object.php @@ -59,9 +59,8 @@ function __construct() { * Each class can override this method as necessary. * * @return string The name of this class - * @access public */ - function toString() { + public function toString() { $class = get_class($this); return $class; } @@ -75,9 +74,8 @@ function toString() { * @param array $extra if array includes the key "return" it sets the AutoRender to true. * @return mixed Boolean true or false on success/failure, or contents * of rendered action if 'return' is set in $extra. - * @access public */ - function requestAction($url, $extra = array()) { + public function requestAction($url, $extra = array()) { if (empty($url)) { return false; } @@ -102,9 +100,8 @@ function requestAction($url, $extra = array()) { * @param string $method Name of the method to call * @param array $params Parameter list to use when calling $method * @return mixed Returns the result of the method call - * @access public */ - function dispatchMethod($method, $params = array()) { + public function dispatchMethod($method, $params = array()) { switch (count($params)) { case 0: return $this->{$method}(); @@ -130,9 +127,8 @@ function dispatchMethod($method, $params = array()) { * * @param $status see http://php.net/exit for values * @return void - * @access public */ - function _stop($status = 0) { + public function _stop($status = 0) { exit($status); } @@ -143,9 +139,8 @@ function _stop($status = 0) { * @param string $msg Log message * @param integer $type Error type constant. Defined in app/config/core.php. * @return boolean Success of log write - * @access public */ - function log($msg, $type = LOG_ERROR) { + public function log($msg, $type = LOG_ERROR) { if (!class_exists('CakeLog')) { require LIBS . 'cake_log.php'; } @@ -182,9 +177,8 @@ function _set($properties = array()) { * @param string $method Method to be called in the error class (AppError or ErrorHandler classes) * @param array $messages Message that is to be displayed by the error class * @return error message - * @access public */ - function cakeError($method, $messages = array()) { + public function cakeError($method, $messages = array()) { if (!class_exists('ErrorHandler')) { App::import('Core', 'Error'); diff --git a/cake/libs/overloadable_php4.php b/cake/libs/overloadable_php4.php index 516f7aa6a..175a9bbf4 100644 --- a/cake/libs/overloadable_php4.php +++ b/cake/libs/overloadable_php4.php @@ -41,9 +41,8 @@ function __construct() { /** * Overload implementation. * - * @access public */ - function overload() { + public function overload() { if (function_exists('overload')) { if (func_num_args() > 0) { foreach (func_get_args() as $class) { @@ -101,9 +100,8 @@ function __construct() { /** * Overload implementation. * - * @access public */ - function overload() { + public function overload() { if (function_exists('overload')) { if (func_num_args() > 0) { foreach (func_get_args() as $class) { diff --git a/cake/libs/overloadable_php5.php b/cake/libs/overloadable_php5.php index 6a768ac0b..f70a8373a 100644 --- a/cake/libs/overloadable_php5.php +++ b/cake/libs/overloadable_php5.php @@ -31,9 +31,8 @@ class Overloadable extends Object { /** * Overload implementation. No need for implementation in PHP5. * - * @access public */ - function overload() { } + public function overload() { } /** * Magic method handler. @@ -63,9 +62,8 @@ class Overloadable2 extends Object { /** * Overload implementation. No need for implementation in PHP5. * - * @access public */ - function overload() { } + public function overload() { } /** * Magic method handler. diff --git a/cake/libs/router.php b/cake/libs/router.php index e8c3c9649..eb6e5c666 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -1286,9 +1286,8 @@ class CakeRoute { * @param array $defaults Array of defaults for the route. * @param string $params Array of parameters and additional options for the Route * @return void - * @access public */ - function CakeRoute($template, $defaults = array(), $options = array()) { + public function CakeRoute($template, $defaults = array(), $options = array()) { $this->template = $template; $this->defaults = (array)$defaults; $this->options = (array)$options; @@ -1298,9 +1297,8 @@ function CakeRoute($template, $defaults = array(), $options = array()) { * Check if a Route has been compiled into a regular expression. * * @return boolean - * @access public */ - function compiled() { + public function compiled() { return !empty($this->_compiledRoute); } @@ -1309,9 +1307,8 @@ function compiled() { * and populates $this->names with the named routing elements. * * @return array Returns a string regular expression of the compiled route. - * @access public */ - function compile() { + public function compile() { if ($this->compiled()) { return $this->_compiledRoute; } @@ -1373,9 +1370,8 @@ function _writeRoute() { * * @param string $url The url to attempt to parse. * @return mixed Boolean false on failure, otherwise an array or parameters - * @access public */ - function parse($url) { + public function parse($url) { if (!$this->compiled()) { $this->compile(); } @@ -1429,9 +1425,8 @@ function parse($url) { * @param array $url The array to apply persistent parameters to. * @param array $params An array of persistent values to replace persistent ones. * @return array An array with persistent parameters applied. - * @access public */ - function persistParams($url, $params) { + public function persistParams($url, $params) { foreach ($this->options['persist'] as $persistKey) { if (array_key_exists($persistKey, $params) && !isset($url[$persistKey])) { $url[$persistKey] = $params[$persistKey]; @@ -1447,9 +1442,8 @@ function persistParams($url, $params) { * * @param array $url An array of parameters to check matching with. * @return mixed Either a string url for the parameters if they match or false. - * @access public */ - function match($url) { + public function match($url) { if (!$this->compiled()) { $this->compile(); } diff --git a/cake/libs/sanitize.php b/cake/libs/sanitize.php index 4c2da5e4f..a53711a67 100644 --- a/cake/libs/sanitize.php +++ b/cake/libs/sanitize.php @@ -164,9 +164,8 @@ function stripScripts($str) { * * @param string $str String to sanitize * @return string sanitized string - * @access public */ - function stripAll($str) { + public function stripAll($str) { $str = Sanitize::stripWhitespace($str); $str = Sanitize::stripImages($str); $str = Sanitize::stripScripts($str); diff --git a/cake/libs/validation.php b/cake/libs/validation.php index a7e3aae43..ba75979e6 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -116,9 +116,8 @@ function &getInstance() { * * @param mixed $check Value to check * @return boolean Success - * @access public */ - function notEmpty($check) { + public function notEmpty($check) { $_this =& Validation::getInstance(); $_this->__reset(); $_this->check = $check; @@ -144,9 +143,8 @@ function notEmpty($check) { * * @param mixed $check Value to check * @return boolean Success - * @access public */ - function alphaNumeric($check) { + public function alphaNumeric($check) { $_this =& Validation::getInstance(); $_this->__reset(); $_this->check = $check; @@ -171,9 +169,8 @@ function alphaNumeric($check) { * @param integer $min Minimum value in range (inclusive) * @param integer $max Maximum value in range (inclusive) * @return boolean Success - * @access public */ - function between($check, $min, $max) { + public function between($check, $min, $max) { $length = mb_strlen($check); return ($length >= $min && $length <= $max); } @@ -187,9 +184,8 @@ function between($check, $min, $max) { * * @param mixed $check Value to check * @return boolean Success - * @access public */ - function blank($check) { + public function blank($check) { $_this =& Validation::getInstance(); $_this->__reset(); $_this->check = $check; @@ -292,9 +288,8 @@ function cc($check, $type = 'fast', $deep = false, $regex = null) { * less or equal <=, is less <, equal to ==, not equal != * @param integer $check2 only needed if $check1 is a string * @return boolean Success - * @access public */ - function comparison($check1, $operator = null, $check2 = null) { + public function comparison($check1, $operator = null, $check2 = null) { if (is_array($check1)) { extract($check1, EXTR_OVERWRITE); } @@ -352,9 +347,8 @@ function comparison($check1, $operator = null, $check2 = null) { * As and array: array('check' => value, 'regex' => 'valid regular expression') * @param string $regex If $check is passed as a string, $regex must also be set to valid regular expression * @return boolean Success - * @access public */ - function custom($check, $regex = null) { + public function custom($check, $regex = null) { $_this =& Validation::getInstance(); $_this->__reset(); $_this->check = $check; @@ -384,9 +378,8 @@ function custom($check, $regex = null) { * my 12/2006 separators can be a space, period, dash, forward slash * @param string $regex If a custom regular expression is used this is the only validation that will occur. * @return boolean Success - * @access public */ - function date($check, $format = 'ymd', $regex = null) { + public function date($check, $format = 'ymd', $regex = null) { $_this =& Validation::getInstance(); $_this->__reset(); $_this->check = $check; @@ -422,10 +415,9 @@ function date($check, $format = 'ymd', $regex = null) { * * @param string $check a valid time string * @return boolean Success - * @access public */ - function time($check) { + public function time($check) { $_this =& Validation::getInstance(); $_this->__reset(); $_this->check = $check; @@ -438,9 +430,8 @@ function time($check) { * * @param string $check a valid boolean * @return boolean Success - * @access public */ - function boolean($check) { + public function boolean($check) { $booleanList = array(0, 1, '0', '1', true, false); return in_array($check, $booleanList, true); } @@ -453,9 +444,8 @@ function boolean($check) { * @param integer $places if set $check value must have exactly $places after the decimal point * @param string $regex If a custom regular expression is used this is the only validation that will occur. * @return boolean Success - * @access public */ - function decimal($check, $places = null, $regex = null) { + public function decimal($check, $places = null, $regex = null) { $_this =& Validation::getInstance(); $_this->__reset(); $_this->regex = $regex; @@ -478,9 +468,8 @@ function decimal($check, $places = null, $regex = null) { * @param boolean $deep Perform a deeper validation (if true), by also checking availability of host * @param string $regex Regex to use (if none it will use built in regex) * @return boolean Success - * @access public */ - function email($check, $deep = false, $regex = null) { + public function email($check, $deep = false, $regex = null) { $_this =& Validation::getInstance(); $_this->__reset(); $_this->check = $check; @@ -518,9 +507,8 @@ function email($check, $deep = false, $regex = null) { * @param mixed $check Value to check * @param mixed $comparedTo Value to compare * @return boolean Success - * @access public */ - function equalTo($check, $comparedTo) { + public function equalTo($check, $comparedTo) { return ($check === $comparedTo); } @@ -530,9 +518,8 @@ function equalTo($check, $comparedTo) { * @param mixed $check Value to check * @param array $extensions file extenstions to allow * @return boolean Success - * @access public */ - function extension($check, $extensions = array('gif', 'jpeg', 'png', 'jpg')) { + public function extension($check, $extensions = array('gif', 'jpeg', 'png', 'jpg')) { if (is_array($check)) { return Validation::extension(array_shift($check), $extensions); } @@ -556,9 +543,8 @@ function extension($check, $extensions = array('gif', 'jpeg', 'png', 'jpg')) { * @param string $check The string to test. * @param string $type The IP Version to test against * @return boolean Success - * @access public */ - function ip($check, $type = 'both') { + public function ip($check, $type = 'both') { $_this =& Validation::getInstance(); $success = false; $type = strtolower($type); @@ -611,9 +597,8 @@ function _ipv6($check) { * @param string $check The string to test * @param integer $min The minimal string length * @return boolean Success - * @access public */ - function minLength($check, $min) { + public function minLength($check, $min) { $length = mb_strlen($check); return ($length >= $min); } @@ -624,9 +609,8 @@ function minLength($check, $min) { * @param string $check The string to test * @param integer $max The maximal string length * @return boolean Success - * @access public */ - function maxLength($check, $max) { + public function maxLength($check, $max) { $length = mb_strlen($check); return ($length <= $max); } @@ -637,9 +621,8 @@ function maxLength($check, $max) { * @param string $check Value to check * @param string $symbolPosition Where symbol is located (left/right) * @return boolean Success - * @access public */ - function money($check, $symbolPosition = 'left') { + public function money($check, $symbolPosition = 'left') { $_this =& Validation::getInstance(); $_this->check = $check; @@ -663,9 +646,8 @@ function money($check, $symbolPosition = 'left') { * @param mixed $check Value to check * @param mixed $options Options for the check. * @return boolean Success - * @access public */ - function multiple($check, $options = array()) { + public function multiple($check, $options = array()) { $defaults = array('in' => null, 'max' => null, 'min' => null); $options = array_merge($defaults, $options); $check = array_filter((array)$check); @@ -693,9 +675,8 @@ function multiple($check, $options = array()) { * * @param string $check Value to check * @return boolean Succcess - * @access public */ - function numeric($check) { + public function numeric($check) { return is_numeric($check); } @@ -706,9 +687,8 @@ function numeric($check) { * @param string $regex Regular expression to use * @param string $country Country code (defaults to 'all') * @return boolean Success - * @access public */ - function phone($check, $regex = null, $country = 'all') { + public function phone($check, $regex = null, $country = 'all') { $_this =& Validation::getInstance(); $_this->check = $check; $_this->regex = $regex; @@ -740,9 +720,8 @@ function phone($check, $regex = null, $country = 'all') { * @param string $regex Regular expression to use * @param string $country Country to use for formatting * @return boolean Success - * @access public */ - function postal($check, $regex = null, $country = null) { + public function postal($check, $regex = null, $country = null) { $_this =& Validation::getInstance(); $_this->check = $check; $_this->regex = $regex; @@ -789,9 +768,8 @@ function postal($check, $regex = null, $country = null) { * @param integer $lower Lower limit * @param integer $upper Upper limit * @return boolean Success - * @access public */ - function range($check, $lower = null, $upper = null) { + public function range($check, $lower = null, $upper = null) { if (!is_numeric($check)) { return false; } @@ -808,9 +786,8 @@ function range($check, $lower = null, $upper = null) { * @param string $regex Regular expression to use * @param string $country Country * @return boolean Success - * @access public */ - function ssn($check, $regex = null, $country = null) { + public function ssn($check, $regex = null, $country = null) { $_this =& Validation::getInstance(); $_this->check = $check; $_this->regex = $regex; @@ -843,9 +820,8 @@ function ssn($check, $regex = null, $country = null) { * * @param string $check Value to check * @return boolean Success - * @access public */ - function uuid($check) { + public function uuid($check) { $_this =& Validation::getInstance(); $_this->check = $check; $_this->regex = '/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i'; @@ -868,9 +844,8 @@ function uuid($check) { * @param string $check Value to check * @param boolean $strict Require URL to be prefixed by a valid scheme (one of http(s)/ftp(s)/file/news/gopher) * @return boolean Success - * @access public */ - function url($check, $strict = false) { + public function url($check, $strict = false) { $_this =& Validation::getInstance(); $_this->__populateIp(); $_this->check = $check; @@ -890,9 +865,8 @@ function url($check, $strict = false) { * @param string $check Value to check * @param array $list List to check against * @return boolean Succcess - * @access public */ - function inList($check, $list) { + public function inList($check, $list) { return in_array($check, $list); } @@ -904,9 +878,8 @@ function inList($check, $list) { * @param string $method class method name for validation to run * @param array $args arguments to send to method * @return mixed user-defined class class method returns - * @access public */ - function userDefined($check, $object, $method, $args = null) { + public function userDefined($check, $object, $method, $args = null) { return call_user_func_array(array(&$object, $method), array($check, $args)); } diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index 72b4b7f30..714dace7e 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -159,9 +159,8 @@ function call__($method, $params) { * * @param $name file name inside app/config to load. * @return array merged tags from config/$name.php - * @access public */ - function loadConfig($name = 'tags') { + public function loadConfig($name = 'tags') { if (file_exists(CONFIGS . $name .'.php')) { require(CONFIGS . $name .'.php'); if (isset($tags)) { @@ -181,9 +180,8 @@ function loadConfig($name = 'tags') { * the reverse routing features of CakePHP. * @param boolean $full If true, the full base URL will be prepended to the result * @return string Full translated URL with base path. - * @access public */ - function url($url = null, $full = false) { + public function url($url = null, $full = false) { return h(Router::url($url, $full)); } @@ -192,9 +190,8 @@ function url($url = null, $full = false) { * * @param string $file The file to create a webroot path to. * @return string Web accessible path to file. - * @access public */ - function webroot($file) { + public function webroot($file) { $asset = explode('?', $file); $asset[1] = isset($asset[1]) ? '?' . $asset[1] : null; $webPath = "{$this->webroot}" . $asset[0]; @@ -236,9 +233,8 @@ function webroot($file) { * * @param string $path The file path to timestamp, the path must be inside WWW_ROOT * @return string Path with a timestamp added, or not. - * @access public */ - function assetTimestamp($path) { + public function assetTimestamp($path) { $timestampEnabled = ( (Configure::read('Asset.timestamp') === true && Configure::read() > 0) || Configure::read('Asset.timestamp') === 'force' @@ -256,9 +252,8 @@ function assetTimestamp($path) { * * @param mixed $output Either an array of strings to clean or a single string to clean. * @return cleaned content for output - * @access public */ - function clean($output) { + public function clean($output) { $this->__reset(); if (empty($output)) { return null; @@ -311,9 +306,8 @@ function clean($output) { * @param string $insertBefore String to be inserted before options. * @param string $insertAfter String to be inserted after options. * @return string Composed attributes. - * @access public */ - function _parseAttributes($options, $exclude = null, $insertBefore = ' ', $insertAfter = null) { + public function _parseAttributes($options, $exclude = null, $insertBefore = ' ', $insertAfter = null) { if (is_array($options)) { $options = array_merge(array('escape' => true), $options); @@ -371,9 +365,8 @@ function __formatAttribute($key, $value, $escape = true) { * @param mixed $entity A field name, like "ModelName.fieldName" or "ModelName.ID.fieldName" * @param boolean $setScope Sets the view scope to the model specified in $tagValue * @return void - * @access public */ - function setEntity($entity, $setScope = false) { + public function setEntity($entity, $setScope = false) { $view =& ClassRegistry::getObject('view'); if ($setScope) { @@ -517,9 +510,8 @@ function setEntity($entity, $setScope = false) { * Gets the currently-used model of the rendering context. * * @return string - * @access public */ - function model() { + public function model() { $view =& ClassRegistry::getObject('view'); if (!empty($view->association)) { return $view->association; @@ -532,9 +524,8 @@ function model() { * Gets the ID of the currently-used model of the rendering context. * * @return mixed - * @access public */ - function modelID() { + public function modelID() { $view =& ClassRegistry::getObject('view'); return $view->modelId; } @@ -543,9 +534,8 @@ function modelID() { * Gets the currently-used model field of the rendering context. * * @return string - * @access public */ - function field() { + public function field() { $view =& ClassRegistry::getObject('view'); return $view->field; } @@ -747,9 +737,8 @@ function _initInputField($field, $options = array()) { * @param string $class The classname being added. * @param string $key the key to use for class. * @return array Array of options with $key set. - * @access public */ - function addClass($options = array(), $class = null, $key = 'class') { + public function addClass($options = array(), $class = null, $key = 'class') { if (isset($options[$key]) && trim($options[$key]) != '') { $options[$key] .= ' ' . $class; } else { @@ -777,9 +766,8 @@ function output($str) { * Overridden in subclasses. * * @return void - * @access public */ - function beforeRender() { + public function beforeRender() { } /** @@ -789,9 +777,8 @@ function beforeRender() { * Overridden in subclasses. * * @return void - * @access public */ - function afterRender() { + public function afterRender() { } /** @@ -800,9 +787,8 @@ function afterRender() { * Overridden in subclasses. * * @return void - * @access public */ - function beforeLayout() { + public function beforeLayout() { } /** @@ -811,9 +797,8 @@ function beforeLayout() { * Overridden in subclasses. * * @return void - * @access public */ - function afterLayout() { + public function afterLayout() { } /** diff --git a/cake/libs/view/helpers/ajax.php b/cake/libs/view/helpers/ajax.php index bbac4998b..840cd9e9f 100644 --- a/cake/libs/view/helpers/ajax.php +++ b/cake/libs/view/helpers/ajax.php @@ -986,9 +986,8 @@ function _optionsToString($options, $stringOpts = array()) { * Executed after a view has rendered, used to include bufferred code * blocks. * - * @access public */ - function afterRender() { + public function afterRender() { if (env('HTTP_X_UPDATE') != null && !empty($this->__ajaxBuffer)) { @ob_end_clean(); diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 28f761f16..1e612c157 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -336,9 +336,8 @@ function create($model = null, $options = array()) { * * @param mixed $options as a string will use $options as the value of button, * @return string a closing FORM tag optional submit button. - * @access public */ - function end($options = null) { + public function end($options = null) { if (!empty($this->params['models'])) { $models = $this->params['models'][0]; } @@ -379,9 +378,8 @@ function end($options = null) { * * @param array $fields The list of fields to use when generating the hash * @return string A hidden input field with a security hash - * @access public */ - function secure($fields = array()) { + public function secure($fields = array()) { if (!isset($this->params['_Token']) || empty($this->params['_Token'])) { return; } @@ -447,9 +445,8 @@ function __secure($field = null, $value = null) { * * @param string $field This should be "Modelname.fieldname" * @return boolean If there are errors this method returns true, else false. - * @access public */ - function isFieldError($field) { + public function isFieldError($field) { $this->setEntity($field); return (bool)$this->tagIsInvalid(); } @@ -468,9 +465,8 @@ function isFieldError($field) { * @param mixed $text Error message or array of $options * @param array $options Rendering options for <div /> wrapper tag * @return string If there are errors this method returns an error message, otherwise null. - * @access public */ - function error($field, $text = null, $options = array()) { + public function error($field, $text = null, $options = array()) { $defaults = array('wrap' => true, 'class' => 'error-message', 'escape' => true); $options = array_merge($defaults, $options); $this->setEntity($field); @@ -578,9 +574,8 @@ function label($fieldName = null, $text = null, $options = array()) { * @param mixed $fields An array of fields to generate inputs for, or null. * @param array $blacklist a simple array of fields to not create inputs for. * @return string Completed form inputs. - * @access public */ - function inputs($fields = null, $blacklist = null) { + public function inputs($fields = null, $blacklist = null) { $fieldset = $legend = true; $model = $this->model(); if (is_array($fields)) { @@ -680,9 +675,8 @@ function inputs($fields = null, $blacklist = null) { * @param string $fieldName This should be "Modelname.fieldname" * @param array $options Each type of input takes different options. * @return string Completed form widget. - * @access public */ - function input($fieldName, $options = array()) { + public function input($fieldName, $options = array()) { $this->setEntity($fieldName); $options = array_merge( @@ -973,9 +967,8 @@ function _inputLabel($fieldName, $label, $options) { * @param string $fieldName Name of a field, like this "Modelname.fieldname" * @param array $options Array of HTML attributes. * @return string An HTML text input element. - * @access public */ - function checkbox($fieldName, $options = array()) { + public function checkbox($fieldName, $options = array()) { $options = $this->_initInputField($fieldName, $options) + array('hiddenField' => true); $value = current($this->value()); $output = ""; @@ -1021,9 +1014,8 @@ function checkbox($fieldName, $options = array()) { * @param array $options Radio button options array. * @param array $attributes Array of HTML attributes, and special attributes above. * @return string Completed radio widget set. - * @access public */ - function radio($fieldName, $options = array(), $attributes = array()) { + public function radio($fieldName, $options = array(), $attributes = array()) { $attributes = $this->_initInputField($fieldName, $attributes); $legend = false; @@ -1104,9 +1096,8 @@ function radio($fieldName, $options = array(), $attributes = array()) { * @param string $fieldName Name of a field, in the form "Modelname.fieldname" * @param array $options Array of HTML attributes. * @return string A generated HTML text input element - * @access public */ - function text($fieldName, $options = array()) { + public function text($fieldName, $options = array()) { $options = $this->_initInputField($fieldName, array_merge( array('type' => 'text'), $options )); @@ -1123,9 +1114,8 @@ function text($fieldName, $options = array()) { * @param string $fieldName Name of a field, like in the form "Modelname.fieldname" * @param array $options Array of HTML attributes. * @return string A generated password input. - * @access public */ - function password($fieldName, $options = array()) { + public function password($fieldName, $options = array()) { $options = $this->_initInputField($fieldName, $options); return sprintf( $this->Html->tags['password'], @@ -1144,9 +1134,8 @@ function password($fieldName, $options = array()) { * @param string $fieldName Name of a field, in the form "Modelname.fieldname" * @param array $options Array of HTML attributes, and special options above. * @return string A generated HTML text input element - * @access public */ - function textarea($fieldName, $options = array()) { + public function textarea($fieldName, $options = array()) { $options = $this->_initInputField($fieldName, $options); $value = null; @@ -1171,9 +1160,8 @@ function textarea($fieldName, $options = array()) { * @param string $fieldName Name of a field, in the form of "Modelname.fieldname" * @param array $options Array of HTML attributes. * @return string A generated hidden input - * @access public */ - function hidden($fieldName, $options = array()) { + public function hidden($fieldName, $options = array()) { $secure = true; if (isset($options['secure'])) { @@ -1202,9 +1190,8 @@ function hidden($fieldName, $options = array()) { * @param string $fieldName Name of a field, in the form "Modelname.fieldname" * @param array $options Array of HTML attributes. * @return string A generated file input. - * @access public */ - function file($fieldName, $options = array()) { + public function file($fieldName, $options = array()) { $options = array_merge($options, array('secure' => false)); $options = $this->_initInputField($fieldName, $options); $view =& ClassRegistry::getObject('view'); @@ -1229,9 +1216,8 @@ function file($fieldName, $options = array()) { * @param string $title The button's caption. Not automatically HTML encoded * @param array $options Array of options and HTML attributes. * @return string A HTML button tag. - * @access public */ - function button($title, $options = array()) { + public function button($title, $options = array()) { $options += array('type' => 'submit', 'escape' => false); if ($options['escape']) { $title = h($title); @@ -1270,9 +1256,8 @@ function button($title, $options = array()) { * OR if the first character is not /, image is relative to webroot/img. * @param array $options Array of options. See above. * @return string A HTML submit button - * @access public */ - function submit($caption = null, $options = array()) { + public function submit($caption = null, $options = array()) { if (!$caption) { $caption = __('Submit', true); } @@ -1381,9 +1366,8 @@ function submit($caption = null, $options = array()) { * from POST data will be used when available. * @param array $attributes The HTML attributes of the select element. * @return string Formatted SELECT element - * @access public */ - function select($fieldName, $options = array(), $selected = null, $attributes = array()) { + public function select($fieldName, $options = array(), $selected = null, $attributes = array()) { $select = array(); $showParents = false; $escapeOptions = true; @@ -1479,9 +1463,8 @@ function select($fieldName, $options = array(), $selected = null, $attributes = * @param string $selected Option which is selected. * @param array $attributes HTML attributes for the select element * @return string A generated day select box. - * @access public */ - function day($fieldName, $selected = null, $attributes = array()) { + public function day($fieldName, $selected = null, $attributes = array()) { $attributes += array('empty' => true); $selected = $this->__dateTimeSelected('day', $fieldName, $selected, $attributes); @@ -1509,9 +1492,8 @@ function day($fieldName, $selected = null, $attributes = array()) { * @param string $selected Option which is selected. * @param array $attributes Attribute array for the select elements. * @return string Completed year select input - * @access public */ - function year($fieldName, $minYear = null, $maxYear = null, $selected = null, $attributes = array()) { + public function year($fieldName, $minYear = null, $maxYear = null, $selected = null, $attributes = array()) { $attributes += array('empty' => true); if ((empty($selected) || $selected === true) && $value = $this->value($fieldName)) { if (is_array($value)) { @@ -1561,9 +1543,8 @@ function year($fieldName, $minYear = null, $maxYear = null, $selected = null, $a * @param string $selected Option which is selected. * @param array $attributes Attributes for the select element * @return string A generated month select dropdown. - * @access public */ - function month($fieldName, $selected = null, $attributes = array()) { + public function month($fieldName, $selected = null, $attributes = array()) { $attributes += array('empty' => true); $selected = $this->__dateTimeSelected('month', $fieldName, $selected, $attributes); @@ -1597,9 +1578,8 @@ function month($fieldName, $selected = null, $attributes = array()) { * @param string $selected Option which is selected. * @param array $attributes List of HTML attributes * @return string Completed hour select input - * @access public */ - function hour($fieldName, $format24Hours = false, $selected = null, $attributes = array()) { + public function hour($fieldName, $format24Hours = false, $selected = null, $attributes = array()) { $attributes += array('empty' => true); $selected = $this->__dateTimeSelected('hour', $fieldName, $selected, $attributes); @@ -1631,9 +1611,8 @@ function hour($fieldName, $format24Hours = false, $selected = null, $attributes * @param string $selected Option which is selected. * @param string $attributes Array of Attributes * @return string Completed minute select input. - * @access public */ - function minute($fieldName, $selected = null, $attributes = array()) { + public function minute($fieldName, $selected = null, $attributes = array()) { $attributes += array('empty' => true); $selected = $this->__dateTimeSelected('min', $fieldName, $selected, $attributes); @@ -1694,9 +1673,8 @@ function __dateTimeSelected($select, $fieldName, $selected, $attributes) { * @param string $attributes Array of Attributes * @param bool $showEmpty Show/Hide an empty option * @return string Completed meridian select input - * @access public */ - function meridian($fieldName, $selected = null, $attributes = array()) { + public function meridian($fieldName, $selected = null, $attributes = array()) { $attributes += array('empty' => true); if ((empty($selected) || $selected === true) && $value = $this->value($fieldName)) { if (is_array($value)) { @@ -1742,9 +1720,8 @@ function meridian($fieldName, $selected = null, $attributes = array()) { * @param string $selected Option which is selected. * @param string $attributes array of Attributes * @return string Generated set of select boxes for the date and time formats chosen. - * @access public */ - function dateTime($fieldName, $dateFormat = 'DMY', $timeFormat = '12', $selected = null, $attributes = array()) { + public function dateTime($fieldName, $dateFormat = 'DMY', $timeFormat = '12', $selected = null, $attributes = array()) { $attributes += array('empty' => true); $year = $month = $day = $hour = $min = $meridian = null; diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php index 0ec9a0d51..e2d889635 100644 --- a/cake/libs/view/helpers/html.php +++ b/cake/libs/view/helpers/html.php @@ -137,9 +137,8 @@ class HtmlHelper extends AppHelper { * @param mixed $options Link attributes e.g. array('id'=>'selected') * @return void * @see HtmlHelper::link() for details on $options that can be used. - * @access public */ - function addCrumb($name, $link = null, $options = null) { + public function addCrumb($name, $link = null, $options = null) { $this->_crumbs[] = array($name, $link, $options); } @@ -158,9 +157,8 @@ function addCrumb($name, $link = null, $options = null) { * * @param string $type Doctype to use. * @return string Doctype string - * @access public */ - function docType($type = 'xhtml-strict') { + public function docType($type = 'xhtml-strict') { if (isset($this->__docTypes[$type])) { return $this->__docTypes[$type]; } @@ -179,9 +177,8 @@ function docType($type = 'xhtml-strict') { * @param array $options Other attributes for the generated tag. If the type attribute is html, * rss, atom, or icon, the mime-type is returned. * @return string A completed `<link />` element. - * @access public */ - function meta($type, $url = null, $options = array()) { + public function meta($type, $url = null, $options = array()) { $inline = isset($options['inline']) ? $options['inline'] : true; unset($options['inline']); @@ -244,9 +241,8 @@ function meta($type, $url = null, $options = array()) { * @param string $charset The character set to be used in the meta tag. If empty, * The App.encoding value will be used. Example: "utf-8". * @return string A meta tag containing the specified character set. - * @access public */ - function charset($charset = null) { + public function charset($charset = null) { if (empty($charset)) { $charset = strtolower(Configure::read('App.encoding')); } @@ -271,9 +267,8 @@ function charset($charset = null) { * @param array $options Array of HTML attributes. * @param string $confirmMessage JavaScript confirmation message. * @return string An `<a />` element. - * @access public */ - function link($title, $url = null, $options = array(), $confirmMessage = false) { + public function link($title, $url = null, $options = array(), $confirmMessage = false) { $escapeTitle = true; if ($url !== null) { $url = $this->url($url); @@ -325,9 +320,8 @@ function link($title, $url = null, $options = array(), $confirmMessage = false) * @param string $rel Rel attribute. Defaults to "stylesheet". If equal to 'import' the stylesheet will be imported. * @param array $options Array of HTML attributes. * @return string CSS <link /> or <style /> tag, depending on the type of link. - * @access public */ - function css($path, $rel = null, $options = array()) { + public function css($path, $rel = null, $options = array()) { $options += array('inline' => true); if (is_array($path)) { $out = ''; @@ -397,9 +391,8 @@ function css($path, $rel = null, $options = array()) { * @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. - * @access public */ - function script($url, $options = array()) { + public function script($url, $options = array()) { if (is_bool($options)) { list($inline, $options) = array($options, array()); $options['inline'] = $inline; @@ -455,9 +448,8 @@ function script($url, $options = array()) { * @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']` - * @access public */ - function scriptBlock($script, $options = array()) { + public function scriptBlock($script, $options = array()) { $options += array('safe' => true, 'inline' => true); if ($options['safe']) { $script = "\n" . '//<![CDATA[' . "\n" . $script . "\n" . '//]]>' . "\n"; @@ -486,9 +478,8 @@ function scriptBlock($script, $options = array()) { * * @param array $options Options for the code block. * @return void - * @access public */ - function scriptStart($options = array()) { + public function scriptStart($options = array()) { $options += array('safe' => true, 'inline' => true); $this->_scriptBlockOptions = $options; ob_start(); @@ -501,9 +492,8 @@ function scriptStart($options = array()) { * used when the scriptBlock was started * * @return mixed depending on the settings of scriptStart() either a script tag or null - * @access public */ - function scriptEnd() { + public function scriptEnd() { $buffer = ob_get_clean(); $options = $this->_scriptBlockOptions; $this->_scriptBlockOptions = array(); @@ -525,9 +515,8 @@ function scriptEnd() { * @param array $data Style data array, keys will be used as property names, values as property values. * @param boolean $oneline Whether or not the style block should be displayed on one line. * @return string CSS styling data - * @access public */ - function style($data, $oneline = true) { + public function style($data, $oneline = true) { if (!is_array($data)) { return $data; } @@ -547,9 +536,8 @@ function style($data, $oneline = true) { * @param string $separator Text to separate crumbs. * @param string $startText This will be the first crumb, if false it defaults to first crumb in array * @return string Composed bread crumbs - * @access public */ - function getCrumbs($separator = '»', $startText = false) { + public function getCrumbs($separator = '»', $startText = false) { if (!empty($this->_crumbs)) { $out = array(); if ($startText) { @@ -587,9 +575,8 @@ function getCrumbs($separator = '»', $startText = false) { * @param string $path Path to the image file, relative to the app/webroot/img/ directory. * @param array $options Array of HTML attributes. * @return string completed img tag - * @access public */ - function image($path, $options = array()) { + public function image($path, $options = array()) { if (is_array($path)) { $path = $this->url($path); } elseif (strpos($path, '://') === false) { @@ -624,9 +611,8 @@ function image($path, $options = array()) { * @param array $trOptions HTML options for TR elements. * @param array $thOptions HTML options for TH elements. * @return string Completed table headers - * @access public */ - function tableHeaders($names, $trOptions = null, $thOptions = null) { + public function tableHeaders($names, $trOptions = null, $thOptions = null) { $out = array(); foreach ($names as $arg) { $out[] = sprintf($this->tags['tableheader'], $this->_parseAttributes($thOptions), $arg); @@ -644,9 +630,8 @@ function tableHeaders($names, $trOptions = null, $thOptions = null) { * @param bool $continueOddEven If false, will use a non-static $count variable, * so that the odd/even count is reset to zero just for that call. * @return string Formatted HTML - * @access public */ - function tableCells($data, $oddTrOptions = null, $evenTrOptions = null, $useCount = false, $continueOddEven = true) { + public function tableCells($data, $oddTrOptions = null, $evenTrOptions = null, $useCount = false, $continueOddEven = true) { if (empty($data[0]) || !is_array($data[0])) { $data = array($data); } @@ -700,9 +685,8 @@ function tableCells($data, $oddTrOptions = null, $evenTrOptions = null, $useCoun * If null, only a start tag will be printed * @param array $options Additional HTML attributes of the DIV tag, see above. * @return string The formatted tag element - * @access public */ - function tag($name, $text = null, $options = array()) { + public function tag($name, $text = null, $options = array()) { if (is_array($options) && isset($options['escape']) && $options['escape']) { $text = h($text); unset($options['escape']); @@ -730,9 +714,8 @@ function tag($name, $text = null, $options = array()) { * If null, only a start tag will be printed * @param array $options Additional HTML attributes of the DIV tag * @return string The formatted DIV element - * @access public */ - function div($class = null, $text = null, $options = array()) { + public function div($class = null, $text = null, $options = array()) { if (!empty($class)) { $options['class'] = $class; } @@ -750,9 +733,8 @@ function div($class = null, $text = null, $options = array()) { * @param string $text String content that will appear inside the p element. * @param array $options Additional HTML attributes of the P tag * @return string The formatted P element - * @access public */ - function para($class, $text, $options = array()) { + public function para($class, $text, $options = array()) { if (isset($options['escape'])) { $text = h($text); } @@ -775,9 +757,8 @@ function para($class, $text, $options = array()) { * @param array $itemOptions Additional HTML attributes of the list item (LI) tag * @param string $tag Type of list tag to use (ol/ul) * @return string The nested list - * @access public */ - function nestedList($list, $options = array(), $itemOptions = array(), $tag = 'ul') { + public function nestedList($list, $options = array(), $itemOptions = array(), $tag = 'ul') { if (is_string($options)) { $tag = $options; $options = array(); diff --git a/cake/libs/view/helpers/javascript.php b/cake/libs/view/helpers/javascript.php index e64532cd1..32900ee43 100644 --- a/cake/libs/view/helpers/javascript.php +++ b/cake/libs/view/helpers/javascript.php @@ -135,9 +135,8 @@ class JavascriptHelper extends AppHelper { /** * Constructor. Checks for presence of native PHP JSON extension to use for object encoding * - * @access public */ - function __construct($options = array()) { + public function __construct($options = array()) { if (!empty($options)) { foreach ($options as $key => $val) { if (is_numeric($key)) { diff --git a/cake/libs/view/helpers/jquery_engine.php b/cake/libs/view/helpers/jquery_engine.php index c6bcb7d81..1780b033f 100644 --- a/cake/libs/view/helpers/jquery_engine.php +++ b/cake/libs/view/helpers/jquery_engine.php @@ -120,9 +120,8 @@ class JqueryEngineHelper extends JsBaseEngineHelper { * @param string $options Array of options for method * @param string $callbacks Array of callback / special options. * @return string Composed method string - * @access public */ - function _methodTemplate($method, $template, $options, $extraSafeKeys = array()) { + public function _methodTemplate($method, $template, $options, $extraSafeKeys = array()) { $options = $this->_mapOptions($method, $options); $options = $this->_prepareCallbacks($method, $options); $callbacks = array_keys($this->_callbackArguments[$method]); @@ -138,9 +137,8 @@ function _methodTemplate($method, $template, $options, $extraSafeKeys = array()) * * @param string $selector The selector that is targeted * @return object instance of $this. Allows chained methods. - * @access public */ - function get($selector) { + public function get($selector) { if ($selector == 'window' || $selector == 'document') { $this->selection = $this->jQueryObject . '(' . $selector .')'; } else { @@ -161,9 +159,8 @@ function get($selector) { * @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 - * @access public */ - function event($type, $callback, $options = array()) { + public function event($type, $callback, $options = array()) { $defaults = array('wrap' => true, 'stop' => true); $options = array_merge($defaults, $options); @@ -187,9 +184,8 @@ function event($type, $callback, $options = array()) { * * @param string $functionBody The code to run on domReady * @return string completed domReady method - * @access public */ - function domReady($functionBody) { + public function domReady($functionBody) { return $this->jQueryObject . '(document).ready(function () {' . $functionBody . '});'; } @@ -199,9 +195,8 @@ function domReady($functionBody) { * @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 - * @access public */ - function each($callback) { + public function each($callback) { return $this->selection . '.each(function () {' . $callback . '});'; } diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 03eede43c..fdec2db04 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -83,9 +83,8 @@ class JsHelper extends AppHelper { * * @param array $settings Settings array contains name of engine helper. * @return void - * @access public */ - function __construct($settings = array()) { + public function __construct($settings = array()) { $className = 'Jquery'; if (is_array($settings) && isset($settings[0])) { $className = $settings[0]; @@ -119,9 +118,8 @@ function __construct($settings = array()) { * @param string $method Method to be called * @param array $params Parameters for the method being called. * @return mixed Depends on the return of the dispatched method, or it could be an instance of the EngineHelper - * @access public */ - function call__($method, $params) { + public function call__($method, $params) { if (isset($this->{$this->__engineName}) && method_exists($this->{$this->__engineName}, $method)) { $buffer = false; if (in_array(strtolower($method), $this->{$this->__engineName}->bufferedMethods)) { @@ -163,9 +161,8 @@ function call__($method, $params) { * @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. - * @access public */ - function object($data = array(), $options = array()) { + public function object($data = array(), $options = array()) { return $this->{$this->__engineName}->object($data, $options); } @@ -200,9 +197,8 @@ function value($val, $quoteString = true) { * @param array $options options for the code block * @return mixed Completed javascript tag if there are scripts, if there are no buffered * scripts null will be returned. - * @access public */ - function writeBuffer($options = array()) { + public function writeBuffer($options = array()) { $domReady = isset($this->params['isAjax']) ? !$this->params['isAjax'] : true; $defaults = array( 'onDomReady' => $domReady, 'inline' => true, @@ -243,9 +239,8 @@ function writeBuffer($options = array()) { * @param boolean $top If true the script will be added to the top of the * buffered scripts array. If false the bottom. * @return void - * @access public */ - function buffer($script, $top = false) { + public function buffer($script, $top = false) { if ($top) { array_unshift($this->__bufferedScripts, $script); } else { @@ -258,9 +253,8 @@ function buffer($script, $top = false) { * * @param boolean $clear Whether or not to clear the script caches (default true) * @return array Array of scripts added to the request. - * @access public */ - function getBuffer($clear = true) { + public function getBuffer($clear = true) { $this->_createVars(); $scripts = $this->__bufferedScripts; if ($clear) { @@ -300,9 +294,8 @@ function _createVars() { * @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. - * @access public */ - function link($title, $url = null, $options = array()) { + public function link($title, $url = null, $options = array()) { if (!isset($options['id'])) { $options['id'] = 'link-' . intval(mt_rand()); } @@ -336,9 +329,8 @@ function link($title, $url = null, $options = array()) { * @param mixed $one Either an array of variables to set, or the name of the variable to set. * @param mixed $two If $one is a string, $two is the value for that key. * @return void - * @access public */ - function set($one, $two = null) { + public function set($one, $two = null) { $data = null; if (is_array($one)) { if (is_array($two)) { @@ -366,9 +358,8 @@ function set($one, $two = null) { * @param string $title The display text of the submit button. * @param array $options Array of options to use. * @return string Completed submit button. - * @access public */ - function submit($caption = null, $options = array()) { + public function submit($caption = null, $options = array()) { if (!isset($options['id'])) { $options['id'] = 'submit-' . intval(mt_rand()); } @@ -493,9 +484,8 @@ function __construct() { * * @param string $message Message you want to alter. * @return string completed alert() - * @access public */ - function alert($message) { + public function alert($message) { return 'alert("' . $this->escape($message) . '");'; } @@ -506,9 +496,8 @@ function alert($message) { * @param mixed $url * @param array $options * @return string completed redirect in javascript - * @access public */ - function redirect($url = null) { + public function redirect($url = null) { return 'window.location = "' . Router::url($url) . '";'; } @@ -517,9 +506,8 @@ function redirect($url = null) { * * @param string $message Message you want confirmed. * @return string completed confirm() - * @access public */ - function confirm($message) { + public function confirm($message) { return 'confirm("' . $this->escape($message) . '");'; } @@ -529,9 +517,8 @@ function confirm($message) { * * @param string $message Message to use in the confirm dialog. * @return string completed confirm with return script - * @access public */ - function confirmReturn($message) { + public function confirmReturn($message) { $out = 'var _confirm = ' . $this->confirm($message); $out .= "if (!_confirm) {\n\treturn false;\n}"; return $out; @@ -543,9 +530,8 @@ function confirmReturn($message) { * @param string $message Message you want to prompt. * @param string $default Default message * @return string completed prompt() - * @access public */ - function prompt($message, $default = '') { + public function prompt($message, $default = '') { return 'prompt("' . $this->escape($message) . '", "' . $this->escape($default) . '");'; } @@ -561,9 +547,8 @@ function prompt($message, $default = '') { * @param array $data Data to be converted. * @param array $options Set of options, see above. * @return string A JSON code block - * @access public */ - function object($data = array(), $options = array()) { + public function object($data = array(), $options = array()) { $defaultOptions = array( 'prefix' => '', 'postfix' => '', ); @@ -621,9 +606,8 @@ function object($data = array(), $options = array()) { * @param mixed $val A PHP variable to be converted to JSON * @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) { + public function value($val, $quoteString = true) { switch (true) { case (is_array($val) || is_object($val)): $val = $this->object($val); @@ -661,9 +645,8 @@ function value($val, $quoteString = true) { * * @param string $script String that needs to get escaped. * @return string Escaped string. - * @access public */ - function escape($string) { + public function escape($string) { App::import('Core', 'Multibyte'); return $this->_utf8ToHex($string); } @@ -769,9 +752,8 @@ function _utf8ToHex($string) { * * @param string $selector The selector that is targeted * @return object instance of $this. Allows chained methods. - * @access public */ - function get($selector) { + public function get($selector) { trigger_error(sprintf(__('%s does not have get() implemented', true), get_class($this)), E_USER_WARNING); return $this; } @@ -788,9 +770,8 @@ function get($selector) { * @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 - * @access public */ - function event($type, $callback, $options = array()) { + public function event($type, $callback, $options = array()) { trigger_error(sprintf(__('%s does not have event() implemented', true), get_class($this)), E_USER_WARNING); } @@ -799,9 +780,8 @@ function event($type, $callback, $options = array()) { * * @param string $functionBody The code to run on domReady * @return string completed domReady method - * @access public */ - function domReady($functionBody) { + public function domReady($functionBody) { trigger_error(sprintf(__('%s does not have domReady() implemented', true), get_class($this)), E_USER_WARNING); } @@ -837,9 +817,8 @@ function each($callback) { * @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. - * @access public */ - function effect($name, $options) { + public function effect($name, $options) { trigger_error(sprintf(__('%s does not have effect() implemented', true), get_class($this)), E_USER_WARNING); } @@ -867,9 +846,8 @@ function effect($name, $options) { * @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. - * @access public */ - function request($url, $options = array()) { + public function request($url, $options = array()) { trigger_error(sprintf(__('%s does not have request() implemented', true), get_class($this)), E_USER_WARNING); } @@ -891,9 +869,8 @@ function request($url, $options = array()) { * * @param array $options Options array see above. * @return string Completed drag script - * @access public */ - function drag($options = array()) { + public function drag($options = array()) { trigger_error(sprintf(__('%s does not have drag() implemented', true), get_class($this)), E_USER_WARNING); } @@ -913,9 +890,8 @@ function drag($options = array()) { * - `leave` - Event fired when a drag is removed from a drop zone without being dropped. * * @return string Completed drop script - * @access public */ - function drop($options = array()) { + public function drop($options = array()) { trigger_error(sprintf(__('%s does not have drop() implemented', true), get_class($this)), E_USER_WARNING); } @@ -939,9 +915,8 @@ function drop($options = array()) { * * @param array $options Array of options for the sortable. See above. * @return string Completed sortable script. - * @access public */ - function sortable() { + public function sortable() { trigger_error(sprintf(__('%s does not have sortable() implemented', true), get_class($this)), E_USER_WARNING); } @@ -964,9 +939,8 @@ function sortable() { * - `complete` - Fired when the user stops sliding the handle * * @return string Completed slider script - * @access public */ - function slider() { + public function slider() { trigger_error(sprintf(__('%s does not have slider() implemented', true), get_class($this)), E_USER_WARNING); } @@ -983,9 +957,8 @@ function slider() { * * @param array $options options for serialization generation. * @return string completed form serialization script - * @access public */ - function serializeForm() { + public function serializeForm() { trigger_error( sprintf(__('%s does not have serializeForm() implemented', true), get_class($this)), E_USER_WARNING ); diff --git a/cake/libs/view/helpers/number.php b/cake/libs/view/helpers/number.php index 6ebf5a2c2..156c5df0f 100644 --- a/cake/libs/view/helpers/number.php +++ b/cake/libs/view/helpers/number.php @@ -69,9 +69,8 @@ class NumberHelper extends AppHelper { * @param float $number A floating point number. * @param integer $precision The precision of the returned number. * @return float Enter description here... - * @access public */ - function precision($number, $precision = 3) { + public function precision($number, $precision = 3) { return sprintf("%01.{$precision}f", $number); } @@ -80,9 +79,8 @@ function precision($number, $precision = 3) { * * @param integer $length Size in bytes * @return string Human readable size - * @access public */ - function toReadableSize($size) { + public function toReadableSize($size) { switch (true) { case $size < 1024: return sprintf(__n('%d Byte', '%d Bytes', $size, true), $size); @@ -103,9 +101,8 @@ function toReadableSize($size) { * @param float $number A floating point number * @param integer $precision The precision of the returned number * @return string Percentage string - * @access public */ - function toPercentage($number, $precision = 2) { + public function toPercentage($number, $precision = 2) { return $this->precision($number, $precision) . '%'; } @@ -116,9 +113,8 @@ function toPercentage($number, $precision = 2) { * @param integer $options if int then places, if string then before, if (,.-) then use it * or array with places and before keys * @return string formatted number - * @access public */ - function format($number, $options = false) { + public function format($number, $options = false) { $places = 0; if (is_int($options)) { $places = $options; @@ -173,9 +169,8 @@ function format($number, $options = false) { * set at least 'before' and 'after' options. * @param array $options * @return string Number formatted as a currency. - * @access public */ - function currency($number, $currency = 'USD', $options = array()) { + public function currency($number, $currency = 'USD', $options = array()) { $default = $this->_currencyDefaults; if (isset($this->_currencies[$currency])) { @@ -242,9 +237,8 @@ function currency($number, $currency = 'USD', $options = array()) { * @param array $options The array of options for this format. * @return void * @see NumberHelper::currency() - * @access public */ - function addFormat($formatName, $options) { + public function addFormat($formatName, $options) { $this->_currencies[$formatName] = $options + $this->_currencyDefaults; } diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index 8edce3a9d..ca641e67b 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -102,9 +102,8 @@ function __construct($config = array()) { * Before render callback. Overridden to merge passed args with url options. * * @return void - * @access public */ - function beforeRender() { + public function beforeRender() { $this->options['url'] = array_merge($this->params['pass'], $this->params['named']); parent::beforeRender(); @@ -115,9 +114,8 @@ function beforeRender() { * * @param string $model Optional model name. Uses the default if none is specified. * @return array The array of paging parameters for the paginated resultset. - * @access public */ - function params($model = null) { + public function params($model = null) { if (empty($model)) { $model = $this->defaultModel(); } @@ -133,9 +131,8 @@ function params($model = null) { * @param mixed $options Default options for pagination links. If a string is supplied - it * is used as the DOM id element to update. See PaginatorHelper::$options for list of keys. * @return void - * @access public */ - function options($options = array()) { + public function options($options = array()) { if (is_string($options)) { $options = array('update' => $options); } @@ -166,9 +163,8 @@ function options($options = array()) { * * @param string $model Optional model name. Uses the default if none is specified. * @return string The current page number of the recordset. - * @access public */ - function current($model = null) { + public function current($model = null) { $params = $this->params($model); if (isset($params['page'])) { @@ -184,9 +180,8 @@ function current($model = null) { * @param mixed $options Options for pagination links. See #options for list of keys. * @return string The name of the key by which the recordset is being sorted, or * null if the results are not currently sorted. - * @access public */ - function sortKey($model = null, $options = array()) { + public function sortKey($model = null, $options = array()) { if (empty($options)) { $params = $this->params($model); $options = array_merge($params['defaults'], $params['options']); @@ -217,9 +212,8 @@ function sortKey($model = null, $options = array()) { * @param mixed $options Options for pagination links. See #options for list of keys. * @return string The direction by which the recordset is being sorted, or * null if the results are not currently sorted. - * @access public */ - function sortDir($model = null, $options = array()) { + public function sortDir($model = null, $options = array()) { $dir = null; if (empty($options)) { @@ -253,9 +247,8 @@ function sortDir($model = null, $options = array()) { * @param string $disabledTitle Title when the link is disabled. * @param mixed $disabledOptions Options for the disabled pagination link. See #options for list of keys. * @return string A "previous" link or $disabledTitle text if the link is disabled. - * @access public */ - function prev($title = '<< Previous', $options = array(), $disabledTitle = null, $disabledOptions = array()) { + public function prev($title = '<< Previous', $options = array(), $disabledTitle = null, $disabledOptions = array()) { return $this->__pagingLink('Prev', $title, $options, $disabledTitle, $disabledOptions); } @@ -273,9 +266,8 @@ function prev($title = '<< Previous', $options = array(), $disabledTitle = null, * @param string $disabledTitle Title when the link is disabled. * @param mixed $disabledOptions Options for the disabled pagination link. See above for list of keys. * @return string A "next" link or or $disabledTitle text if the link is disabled. - * @access public */ - function next($title = 'Next >>', $options = array(), $disabledTitle = null, $disabledOptions = array()) { + public function next($title = 'Next >>', $options = array(), $disabledTitle = null, $disabledOptions = array()) { return $this->__pagingLink('Next', $title, $options, $disabledTitle, $disabledOptions); } @@ -294,9 +286,8 @@ function next($title = 'Next >>', $options = array(), $disabledTitle = null, $di * @param array $options Options for sorting link. See above for list of keys. * @return string A link sorting default by 'asc'. If the resultset is sorted 'asc' by the specified * key the returned link will sort by 'desc'. - * @access public */ - function sort($title, $key = null, $options = array()) { + public function sort($title, $key = null, $options = array()) { $options = array_merge(array('url' => array(), 'model' => null), $options); $url = $options['url']; unset($options['url']); @@ -342,9 +333,8 @@ function sort($title, $key = null, $options = array()) { * @param mixed $url Url for the action. See Router::url() * @param array $options Options for the link. See #options for list of keys. * @return string A link with pagination parameters. - * @access public */ - function link($title, $url = array(), $options = array()) { + public function link($title, $url = array(), $options = array()) { $options = array_merge(array('model' => null, 'escape' => true), $options); $model = $options['model']; unset($options['model']); @@ -371,9 +361,8 @@ function link($title, $url = array(), $options = array()) { * @param boolean $asArray Return the url as an array, or a URI string * @param string $model Which model to paginate on * @return mixed By default, returns a full pagination URL string for use in non-standard contexts (i.e. JavaScript) - * @access public */ - function url($options = array(), $asArray = false, $model = null) { + public function url($options = array(), $asArray = false, $model = null) { $paging = $this->params($model); $url = array_merge(array_filter(Set::diff(array_merge( $paging['defaults'], $paging['options']), $paging['defaults'])), $options @@ -438,9 +427,8 @@ function __pagingLink($which, $title = null, $options = array(), $disabledTitle * * @param string $model Optional model name. Uses the default if none is specified. * @return boolean True if the result set is not at the first page. - * @access public */ - function hasPrev($model = null) { + public function hasPrev($model = null) { return $this->__hasPage($model, 'prev'); } @@ -449,9 +437,8 @@ function hasPrev($model = null) { * * @param string $model Optional model name. Uses the default if none is specified. * @return boolean True if the result set is not at the last page. - * @access public */ - function hasNext($model = null) { + public function hasNext($model = null) { return $this->__hasPage($model, 'next'); } @@ -461,9 +448,8 @@ function hasNext($model = null) { * @param string $model Optional model name. Uses the default if none is specified. * @param int $page The page number - if not set defaults to 1. * @return boolean True if the given result set has the specified page number. - * @access public */ - function hasPage($model = null, $page = 1) { + public function hasPage($model = null, $page = 1) { if (is_numeric($model)) { $page = $model; $model = null; @@ -494,9 +480,8 @@ function __hasPage($model, $page) { * Gets the default model of the paged sets * * @return string Model name or null if the pagination isn't initialized. - * @access public */ - function defaultModel() { + public function defaultModel() { if ($this->__defaultModel != null) { return $this->__defaultModel; } @@ -521,9 +506,8 @@ function defaultModel() { * * @param mixed $options Options for the counter string. See #options for list of keys. * @return string Counter string. - * @access public */ - function counter($options = array()) { + public function counter($options = array()) { if (is_string($options)) { $options = array('format' => $options); } @@ -599,9 +583,8 @@ function counter($options = array()) { * * @param mixed $options Options for the numbers, (before, after, model, modulus, separator) * @return string numbers string. - * @access public */ - function numbers($options = array()) { + public function numbers($options = array()) { if ($options === true) { $options = array( 'before' => ' | ', 'after' => ' | ', 'first' => 'first', 'last' => 'last' @@ -715,9 +698,8 @@ function numbers($options = array()) { * @param mixed $first if string use as label for the link, if numeric print page numbers * @param mixed $options * @return string numbers string. - * @access public */ - function first($first = '<< first', $options = array()) { + public function first($first = '<< first', $options = array()) { $options = array_merge( array( 'tag' => 'span', @@ -769,9 +751,8 @@ function first($first = '<< first', $options = array()) { * @param mixed $last if string use as label for the link, if numeric print page numbers * @param mixed $options Array of options * @return string numbers string. - * @access public */ - function last($last = 'last >>', $options = array()) { + public function last($last = 'last >>', $options = array()) { $options = array_merge( array( 'tag' => 'span', diff --git a/cake/libs/view/helpers/prototype_engine.php b/cake/libs/view/helpers/prototype_engine.php index 9031adb4a..c59950c64 100644 --- a/cake/libs/view/helpers/prototype_engine.php +++ b/cake/libs/view/helpers/prototype_engine.php @@ -158,9 +158,8 @@ function event($type, $callback, $options = array()) { * * @param string $functionBody The code to run on domReady * @return string completed domReady method - * @access public */ - function domReady($functionBody) { + public function domReady($functionBody) { $this->selection = 'document'; return $this->event('dom:loaded', $functionBody, array('stop' => false)); } @@ -171,9 +170,8 @@ function domReady($functionBody) { * @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 - * @access public */ - function each($callback) { + public function each($callback) { return $this->selection . '.each(function (item, index) {' . $callback . '});'; } @@ -229,9 +227,8 @@ function effect($name, $options = array()) { * @param mixed $url * @param array $options * @return string The completed ajax call. - * @access public */ - function request($url, $options = array()) { + public function request($url, $options = array()) { $url = '"'. $this->url($url) . '"'; $options = $this->_mapOptions('request', $options); $type = '.Request'; diff --git a/cake/libs/view/helpers/rss.php b/cake/libs/view/helpers/rss.php index 07b9014cb..becca00df 100644 --- a/cake/libs/view/helpers/rss.php +++ b/cake/libs/view/helpers/rss.php @@ -106,9 +106,8 @@ class RssHelper extends XmlHelper { * * @param array $attrib `<rss />` tag attributes * @return string An RSS document - * @access public */ - function document($attrib = array(), $content = null) { + public function document($attrib = array(), $content = null) { if ($content === null) { $content = $attrib; $attrib = array(); @@ -127,9 +126,8 @@ function document($attrib = array(), $content = null) { * @param mixed $elements Named array elements which are converted to tags * @param mixed $content Content (`<item />`'s belonging to this channel * @return string An RSS `<channel />` - * @access public */ - function channel($attrib = array(), $elements = array(), $content = null) { + public function channel($attrib = array(), $elements = array(), $content = null) { $view =& ClassRegistry::getObject('view'); if (!isset($elements['title']) && !empty($view->pageTitle)) { @@ -174,9 +172,8 @@ function channel($attrib = array(), $elements = array(), $content = null) { * @param mixed $callback A string function name, or array containing an object * and a string method name * @return string A set of RSS `<item />` elements - * @access public */ - function items($items, $callback = null) { + public function items($items, $callback = null) { if ($callback != null) { $items = array_map($callback, $items); } @@ -196,9 +193,8 @@ function items($items, $callback = null) { * @param array $attrib The attributes of the `<item />` element * @param array $elements The list of elements contained in this `<item />` * @return string An RSS `<item />` element - * @access public */ - function item($att = array(), $elements = array()) { + public function item($att = array(), $elements = array()) { $content = null; if (isset($elements['link']) && !isset($elements['guid'])) { diff --git a/cake/libs/view/helpers/session.php b/cake/libs/view/helpers/session.php index 9d8c0037e..5b5716449 100644 --- a/cake/libs/view/helpers/session.php +++ b/cake/libs/view/helpers/session.php @@ -63,9 +63,8 @@ function __construct($base = null) { * Turn sessions on if 'Session.start' is set to false in core.php * * @param string $base - * @access public */ - function activate($base = null) { + public function activate($base = null) { $this->__active = true; } @@ -77,9 +76,8 @@ function activate($base = null) { * * @param string $name the name of the session key you want to read * @return values from the session vars - * @access public */ - function read($name = null) { + public function read($name = null) { if ($this->__active === true && $this->__start()) { return parent::read($name); } @@ -93,9 +91,8 @@ function read($name = null) { * * @param string $name * @return boolean - * @access public */ - function check($name) { + public function check($name) { if ($this->__active === true && $this->__start()) { return parent::check($name); } @@ -108,9 +105,8 @@ function check($name) { * In your view: `$session->error();` * * @return string last error - * @access public */ - function error() { + public function error() { if ($this->__active === true && $this->__start()) { return parent::error(); } @@ -125,9 +121,8 @@ function error() { * * @param string $key The [Message.]key you are rendering in the view. * @return boolean|string Will return the value if $key is set, or false if not set. - * @access public */ - function flash($key = 'flash') { + public function flash($key = 'flash') { $out = false; if ($this->__active === true && $this->__start()) { @@ -159,9 +154,8 @@ function flash($key = 'flash') { * Used to check is a session is valid in a view * * @return boolean - * @access public */ - function valid() { + public function valid() { if ($this->__active === true && $this->__start()) { return parent::valid(); } @@ -172,9 +166,8 @@ function valid() { * This method should not be used in a view * * @return boolean - * @access public */ - function write() { + public function write() { trigger_error(__('You can not write to a Session from the view', true), E_USER_WARNING); } diff --git a/cake/libs/view/helpers/text.php b/cake/libs/view/helpers/text.php index e4feb4013..92b03687c 100644 --- a/cake/libs/view/helpers/text.php +++ b/cake/libs/view/helpers/text.php @@ -54,9 +54,8 @@ class TextHelper extends AppHelper { * @param string $phrase The phrase that will be searched * @param array $options An array of html attributes and options. * @return string The highlighted text - * @access public */ - function highlight($text, $phrase, $options = array()) { + public function highlight($text, $phrase, $options = array()) { if (empty($phrase)) { return $text; } @@ -98,9 +97,8 @@ function highlight($text, $phrase, $options = array()) { * * @param string $text Text * @return string The text without links - * @access public */ - function stripLinks($text) { + public function stripLinks($text) { return preg_replace('|<a\s+[^>]+>|im', '', preg_replace('|<\/a>|im', '', $text)); } @@ -111,9 +109,8 @@ function stripLinks($text) { * @param string $text Text to add links to * @param array $options Array of HTML options. * @return string The text with links - * @access public */ - function autoLinkUrls($text, $options = array()) { + public function autoLinkUrls($text, $options = array()) { $linkOptions = 'array('; foreach ($options as $option => $value) { $value = var_export($value, true); @@ -134,9 +131,8 @@ function autoLinkUrls($text, $options = array()) { * @param string $text Text * @param array $options Array of HTML options. * @return string The text with links - * @access public */ - function autoLinkEmails($text, $options = array()) { + public function autoLinkEmails($text, $options = array()) { $linkOptions = 'array('; foreach ($options as $option => $value) { $value = var_export($value, true); @@ -154,9 +150,8 @@ function autoLinkEmails($text, $options = array()) { * @param string $text Text * @param array $options Array of HTML options. * @return string The text with links - * @access public */ - function autoLink($text, $options = array()) { + public function autoLink($text, $options = array()) { return $this->autoLinkEmails($this->autoLinkUrls($text, $options), $options); } @@ -176,9 +171,8 @@ function autoLink($text, $options = array()) { * @param integer $length Length of returned string, including ellipsis. * @param array $options An array of html attributes and options. * @return string Trimmed string. - * @access public */ - function truncate($text, $length = 100, $options = array()) { + public function truncate($text, $length = 100, $options = array()) { $default = array( 'ending' => '...', 'exact' => true, 'html' => false ); @@ -276,9 +270,8 @@ function truncate($text, $length = 100, $options = array()) { * @param integer $radius The amount of characters that will be returned on each side of the founded phrase * @param string $ending Ending that will be appended * @return string Modified string - * @access public */ - function excerpt($text, $phrase, $radius = 100, $ending = '...') { + public function excerpt($text, $phrase, $radius = 100, $ending = '...') { if (empty($text) or empty($phrase)) { return $this->truncate($text, $radius * 2, array('ending' => $ending)); } @@ -321,9 +314,8 @@ function excerpt($text, $phrase, $radius = 100, $ending = '...') { * @param string $and The word used to join the last and second last items together with. Defaults to 'and' * @param string $separator The separator used to join all othe other items together. Defaults to ', ' * @return string The glued together string. - * @access public */ - function toList($list, $and = 'and', $separator = ', ') { + public function toList($list, $and = 'and', $separator = ', ') { if (count($list) > 1) { return implode($separator, array_slice($list, null, -1)) . ' ' . $and . ' ' . array_pop($list); } else { diff --git a/cake/libs/view/helpers/time.php b/cake/libs/view/helpers/time.php index 7e1584a75..af1f9256a 100644 --- a/cake/libs/view/helpers/time.php +++ b/cake/libs/view/helpers/time.php @@ -36,9 +36,8 @@ class TimeHelper extends AppHelper { * Accepts the special specifier %S which mimics th modifier S for date() * @param string UNIX timestamp * @return string windows safe and date() function compatible format for strftime - * @access public */ - function convertSpecifiers($format, $time = null) { + public function convertSpecifiers($format, $time = null) { if (!$time) { $time = time(); } @@ -141,9 +140,8 @@ function __translateSpecifier($specifier) { * @param string $serverTime UNIX timestamp * @param int $userOffset User's offset from GMT (in hours) * @return string UNIX timestamp - * @access public */ - function convert($serverTime, $userOffset) { + public function convert($serverTime, $userOffset) { $serverOffset = $this->serverOffset(); $gmtTime = $serverTime - $serverOffset; $userTime = $gmtTime + $userOffset * (60*60); @@ -154,9 +152,8 @@ function convert($serverTime, $userOffset) { * Returns server's offset from GMT in seconds. * * @return int Offset - * @access public */ - function serverOffset() { + public function serverOffset() { return date('Z', time()); } @@ -166,9 +163,8 @@ function serverOffset() { * @param string $dateString Datetime string * @param int $userOffset User's offset from GMT (in hours) * @return string Parsed timestamp - * @access public */ - function fromString($dateString, $userOffset = null) { + public function fromString($dateString, $userOffset = null) { if (empty($dateString)) { return false; } @@ -192,9 +188,8 @@ function fromString($dateString, $userOffset = null) { * @param string $dateString Datetime string or Unix timestamp * @param int $userOffset User's offset from GMT (in hours) * @return string Formatted date string - * @access public */ - function nice($dateString = null, $userOffset = null) { + public function nice($dateString = null, $userOffset = null) { if ($dateString != null) { $date = $this->fromString($dateString, $userOffset); } else { @@ -215,9 +210,8 @@ function nice($dateString = null, $userOffset = null) { * @param string $dateString Datetime string or Unix timestamp * @param int $userOffset User's offset from GMT (in hours) * @return string Described, relative date string - * @access public */ - function niceShort($dateString = null, $userOffset = null) { + public function niceShort($dateString = null, $userOffset = null) { $date = $dateString ? $this->fromString($dateString, $userOffset) : time(); $y = $this->isThisYear($date) ? '' : ' %Y'; @@ -242,9 +236,8 @@ function niceShort($dateString = null, $userOffset = null) { * @param string $fieldName Name of database field to compare with * @param int $userOffset User's offset from GMT (in hours) * @return string Partial SQL string. - * @access public */ - function daysAsSql($begin, $end, $fieldName, $userOffset = null) { + public function daysAsSql($begin, $end, $fieldName, $userOffset = null) { $begin = $this->fromString($begin, $userOffset); $end = $this->fromString($end, $userOffset); $begin = date('Y-m-d', $begin) . ' 00:00:00'; @@ -261,9 +254,8 @@ function daysAsSql($begin, $end, $fieldName, $userOffset = null) { * @param string $fieldName Name of database field to compare with * @param int $userOffset User's offset from GMT (in hours) * @return string Partial SQL string. - * @access public */ - function dayAsSql($dateString, $fieldName, $userOffset = null) { + public function dayAsSql($dateString, $fieldName, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); return $this->daysAsSql($dateString, $dateString, $fieldName); } @@ -274,9 +266,8 @@ function dayAsSql($dateString, $fieldName, $userOffset = null) { * @param string $dateString Datetime string or Unix timestamp * @param int $userOffset User's offset from GMT (in hours) * @return boolean True if datetime string is today - * @access public */ - function isToday($dateString, $userOffset = null) { + public function isToday($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); return date('Y-m-d', $date) == date('Y-m-d', time()); } @@ -286,9 +277,8 @@ function isToday($dateString, $userOffset = null) { * @param string $dateString * @param int $userOffset User's offset from GMT (in hours) * @return boolean True if datetime string is within current week - * @access public */ - function isThisWeek($dateString, $userOffset = null) { + public function isThisWeek($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); return date('W Y', $date) == date('W Y', time()); } @@ -298,9 +288,8 @@ function isThisWeek($dateString, $userOffset = null) { * @param string $dateString * @param int $userOffset User's offset from GMT (in hours) * @return boolean True if datetime string is within current month - * @access public */ - function isThisMonth($dateString, $userOffset = null) { + public function isThisMonth($dateString, $userOffset = null) { $date = $this->fromString($dateString); return date('m Y',$date) == date('m Y', time()); } @@ -310,9 +299,8 @@ function isThisMonth($dateString, $userOffset = null) { * * @param string $dateString Datetime string or Unix timestamp * @return boolean True if datetime string is within current year - * @access public */ - function isThisYear($dateString, $userOffset = null) { + public function isThisYear($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); return date('Y', $date) == date('Y', time()); } @@ -323,9 +311,8 @@ function isThisYear($dateString, $userOffset = null) { * @param string $dateString Datetime string or Unix timestamp * @param int $userOffset User's offset from GMT (in hours) * @return boolean True if datetime string was yesterday - * @access public */ - function wasYesterday($dateString, $userOffset = null) { + public function wasYesterday($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); return date('Y-m-d', $date) == date('Y-m-d', strtotime('yesterday')); } @@ -336,9 +323,8 @@ function wasYesterday($dateString, $userOffset = null) { * @param string $dateString Datetime string or Unix timestamp * @param int $userOffset User's offset from GMT (in hours) * @return boolean True if datetime string was yesterday - * @access public */ - function isTomorrow($dateString, $userOffset = null) { + public function isTomorrow($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); return date('Y-m-d', $date) == date('Y-m-d', strtotime('tomorrow')); } @@ -349,9 +335,8 @@ function isTomorrow($dateString, $userOffset = null) { * @param string $dateString * @param boolean $range if true returns a range in Y-m-d format * @return boolean True if datetime string is within current week - * @access public */ - function toQuarter($dateString, $range = false) { + public function toQuarter($dateString, $range = false) { $time = $this->fromString($dateString); $date = ceil(date('m', $time) / 3); @@ -386,9 +371,8 @@ function toQuarter($dateString, $range = false) { * @param string $dateString Datetime string to be represented as a Unix timestamp * @param int $userOffset User's offset from GMT (in hours) * @return integer Unix timestamp - * @access public */ - function toUnix($dateString, $userOffset = null) { + public function toUnix($dateString, $userOffset = null) { return $this->fromString($dateString, $userOffset); } @@ -398,9 +382,8 @@ function toUnix($dateString, $userOffset = null) { * @param string $dateString Datetime string or Unix timestamp * @param int $userOffset User's offset from GMT (in hours) * @return string Formatted date string - * @access public */ - function toAtom($dateString, $userOffset = null) { + public function toAtom($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); return date('Y-m-d\TH:i:s\Z', $date); } @@ -411,9 +394,8 @@ function toAtom($dateString, $userOffset = null) { * @param string $dateString Datetime string or Unix timestamp * @param int $userOffset User's offset from GMT (in hours) * @return string Formatted date string - * @access public */ - function toRSS($dateString, $userOffset = null) { + public function toRSS($dateString, $userOffset = null) { $date = $this->fromString($dateString, $userOffset); return date("r", $date); } @@ -441,9 +423,8 @@ function toRSS($dateString, $userOffset = null) { * @param string $dateString Datetime string or Unix timestamp * @param array $options Default format if timestamp is used in $dateString * @return string Relative time string. - * @access public */ - function timeAgoInWords($dateTime, $options = array()) { + public function timeAgoInWords($dateTime, $options = array()) { $userOffset = null; if (is_array($options) && isset($options['userOffset'])) { $userOffset = $options['userOffset']; @@ -622,9 +603,8 @@ function relativeTime($dateTime, $options = array()) { * @param mixed $dateString the datestring or unix timestamp to compare * @param int $userOffset User's offset from GMT (in hours) * @return bool - * @access public */ - function wasWithinLast($timeInterval, $dateString, $userOffset = null) { + public function wasWithinLast($timeInterval, $dateString, $userOffset = null) { $tmp = str_replace(' ', '', $timeInterval); if (is_numeric($tmp)) { $timeInterval = $tmp . ' ' . __('days', true); @@ -645,9 +625,8 @@ function wasWithinLast($timeInterval, $dateString, $userOffset = null) { * * @param string $dateString Datetime string * @return string Formatted date string - * @access public */ - function gmt($string = null) { + public function gmt($string = null) { if ($string != null) { $string = $this->fromString($string); } else { @@ -674,9 +653,8 @@ function gmt($string = null) { * @param boolean $invalid flag to ignore results of fromString == false * @param int $userOffset User's offset from GMT (in hours) * @return string Formatted date string - * @access public */ - function format($format, $date = null, $invalid = false, $userOffset = null) { + public function format($format, $date = null, $invalid = false, $userOffset = null) { $time = $this->fromString($date, $userOffset); $_time = $this->fromString($format, $userOffset); @@ -699,9 +677,8 @@ function format($format, $date = null, $invalid = false, $userOffset = null) { * @param boolean $invalid flag to ignore results of fromString == false * @param int $userOffset User's offset from GMT (in hours) * @return string Formatted and translated date string @access public - * @access public */ - function i18nFormat($date, $format = null, $invalid = false, $userOffset = null) { + public function i18nFormat($date, $format = null, $invalid = false, $userOffset = null) { $date = $this->fromString($date, $userOffset); if ($date === false && $invalid !== false) { return $invalid; diff --git a/cake/libs/view/helpers/xml.php b/cake/libs/view/helpers/xml.php index d6f1226e8..2aa751016 100644 --- a/cake/libs/view/helpers/xml.php +++ b/cake/libs/view/helpers/xml.php @@ -53,9 +53,8 @@ function __construct() { * * @param array $attrib Header tag attributes * @return string XML header - * @access public */ - function header($attrib = array()) { + public function header($attrib = array()) { if (Configure::read('App.encoding') !== null) { $this->encoding = Configure::read('App.encoding'); } @@ -90,9 +89,8 @@ function addNs($name, $url = null) { * @param string $name The namespace name or URI * @deprecated * @see Xml::removeNs() - * @access public */ - function removeNs($name) { + public function removeNs($name) { return $this->Xml->removeGlobalNamespace($name); } @@ -104,9 +102,8 @@ function removeNs($name) { * @param mixed $content XML element content * @param boolean $endTag Whether the end tag of the element should be printed * @return string XML - * @access public */ - function elem($name, $attrib = array(), $content = null, $endTag = true) { + public function elem($name, $attrib = array(), $content = null, $endTag = true) { $namespace = null; if (isset($attrib['namespace'])) { $namespace = $attrib['namespace']; @@ -142,9 +139,8 @@ function elem($name, $attrib = array(), $content = null, $endTag = true) { * Create closing tag for current element * * @return string - * @access public */ - function closeElem() { + public function closeElem() { $name = $this->Xml->name(); if ($parent =& $this->Xml->parent()) { $this->Xml =& $parent; @@ -160,9 +156,8 @@ function closeElem() { * XmlNode::__construct(). * @return string A copy of $data in XML format * @see XmlNode - * @access public */ - function serialize($data, $options = array()) { + public function serialize($data, $options = array()) { $options += array('attributes' => false, 'format' => 'attributes'); $data =& new Xml($data, $options); return $data->toString($options + array('header' => false)); diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index 5c9f4eab4..70ab8080f 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -338,9 +338,8 @@ function __construct(&$controller, $register = true) { * @param array $params Array of data to be made available to the for rendered * view (i.e. the Element) * @return string Rendered Element - * @access public */ - function element($name, $params = array(), $loadHelpers = false) { + public function element($name, $params = array(), $loadHelpers = false) { $file = $plugin = $key = null; if (isset($params['plugin'])) { @@ -403,9 +402,8 @@ function element($name, $params = array(), $loadHelpers = false) { * @param string $layout Layout to use * @param string $file Custom filename for view * @return string Rendered Element - * @access public */ - function render($action = null, $layout = null, $file = null) { + public function render($action = null, $layout = null, $file = null) { if ($this->hasRendered) { return true; } @@ -454,9 +452,8 @@ function render($action = null, $layout = null, $file = null) { * * @param string $content_for_layout Content to render in a view, wrapped by the surrounding layout. * @return mixed Rendered output, or false on error - * @access public */ - function renderLayout($content_for_layout, $layout = null) { + public function renderLayout($content_for_layout, $layout = null) { $layoutFileName = $this->_getLayoutFileName($layout); if (empty($layoutFileName)) { return $this->output; @@ -522,9 +519,8 @@ function _triggerHelpers($callback) { * @param string $filename the cache file to include * @param string $timeStart the page render start time * @return boolean Success of rendering the cached file. - * @access public */ - function renderCache($filename, $timeStart) { + public function renderCache($filename, $timeStart) { ob_start(); include ($filename); @@ -553,9 +549,8 @@ function renderCache($filename, $timeStart) { * Returns a list of variables available in the current View context * * @return array Array of the set view variable names. - * @access public */ - function getVars() { + public function getVars() { return array_keys($this->viewVars); } @@ -564,9 +559,8 @@ function getVars() { * * @param string $var The view var you want the contents of. * @return mixed The content of the named var if its set, otherwise null. - * @access public */ - function getVar($var) { + public function getVar($var) { if (!isset($this->viewVars[$var])) { return null; } else { @@ -582,9 +576,8 @@ function getVar($var) { * update/replace a script element. * @param string $content The content of the script being added, optional. * @return void - * @access public */ - function addScript($name, $content = null) { + public function addScript($name, $content = null) { if (empty($content)) { if (!in_array($name, array_values($this->__scripts))) { $this->__scripts[] = $name; @@ -600,9 +593,8 @@ function addScript($name, $content = null) { * @param string $object Type of object, i.e. 'form' or 'link' * @param string $url The object's target URL * @return string - * @access public */ - function uuid($object, $url) { + public function uuid($object, $url) { $c = 1; $url = Router::url($url); $hash = $object . substr(md5($object . $url), 0, 10); @@ -618,9 +610,8 @@ function uuid($object, $url) { * Returns the entity reference of the current context as an array of identity parts * * @return array An array containing the identity elements of an entity - * @access public */ - function entity() { + public function entity() { $assoc = ($this->association) ? $this->association : $this->model; if (!empty($this->entityPath)) { $path = explode('.', $this->entityPath); @@ -648,9 +639,8 @@ function entity() { * @param mixed $two Value in case $one is a string (which then works as the key). * Unused if $one is an associative array, otherwise serves as the values to $one's keys. * @return void - * @access public */ - function set($one, $two = null) { + public function set($one, $two = null) { $data = null; if (is_array($one)) { if (is_array($two)) { @@ -673,9 +663,8 @@ function set($one, $two = null) { * @param integer $code HTTP Error code (for instance: 404) * @param string $name Name of the error (for instance: Not Found) * @param string $message Error message as a web page - * @access public */ - function error($code, $name, $message) { + public function error($code, $name, $message) { header ("HTTP/1.1 {$code} {$name}"); print ($this->_render( $this->_getLayoutFileName('error'), diff --git a/cake/libs/xml.php b/cake/libs/xml.php index 0c714dc44..d6d83847f 100644 --- a/cake/libs/xml.php +++ b/cake/libs/xml.php @@ -189,9 +189,8 @@ function &createTextNode($value = null) { * * @param object $object Object to get properties from * @return array Properties from object - * @access public */ - function normalize($object, $keyName = null, $options = array()) { + public function normalize($object, $keyName = null, $options = array()) { if (is_a($object, 'XmlNode')) { return $object; } @@ -324,9 +323,8 @@ function __tagOptions($name, $option = null) { /** * Returns the fully-qualified XML node name, with namespace * - * @access public */ - function name() { + public function name() { if (!empty($this->namespace)) { $_this =& XmlManager::getInstance(); if (!isset($_this->options['verifyNs']) || !$_this->options['verifyNs'] || in_array($this->namespace, array_keys($_this->namespaces))) { @@ -339,9 +337,8 @@ function name() { /** * Sets the parent node of this XmlNode. * - * @access public */ - function setParent(&$parent) { + public function setParent(&$parent) { if (strtolower(get_class($this)) == 'xml') { return; } @@ -368,9 +365,8 @@ function setParent(&$parent) { * Returns a copy of self. * * @return object Cloned instance - * @access public */ - function cloneNode() { + public function cloneNode() { return clone($this); } @@ -379,9 +375,8 @@ function cloneNode() { * * @param object An XmlNode or subclass instance * @return boolean True if the nodes match, false otherwise - * @access public */ - function compare($node) { + public function compare($node) { $keys = array(get_object_vars($this), get_object_vars($node)); return ($keys[0] === $keys[1]); } @@ -392,9 +387,8 @@ function compare($node) { * @param object $child XmlNode with appended child * @param array $options XML generator options for objects and arrays * @return object A reference to the appended child node - * @access public */ - function &append(&$child, $options = array()) { + public function &append(&$child, $options = array()) { if (empty($child)) { $return = false; return $return; @@ -445,9 +439,8 @@ function &append(&$child, $options = array()) { * Returns first child node, or null if empty. * * @return object First XmlNode - * @access public */ - function &first() { + public function &first() { if (isset($this->children[0])) { return $this->children[0]; } else { @@ -460,9 +453,8 @@ function &first() { * Returns last child node, or null if empty. * * @return object Last XmlNode - * @access public */ - function &last() { + public function &last() { if (count($this->children) > 0) { return $this->children[count($this->children) - 1]; } else { @@ -476,9 +468,8 @@ function &last() { * * @param string $id Name of child node * @return object Child XmlNode - * @access public */ - function &child($id) { + public function &child($id) { $null = null; if (is_int($id)) { @@ -502,9 +493,8 @@ function &child($id) { * * @param string $name Tag name of child nodes * @return array An array of XmlNodes with the given tag name - * @access public */ - function children($name) { + public function children($name) { $nodes = array(); $count = count($this->children); for ($i = 0; $i < $count; $i++) { @@ -519,9 +509,8 @@ function children($name) { * Gets a reference to the next child node in the list of this node's parent. * * @return object A reference to the XmlNode object - * @access public */ - function &nextSibling() { + public function &nextSibling() { $null = null; $count = count($this->__parent->children); for ($i = 0; $i < $count; $i++) { @@ -539,9 +528,8 @@ function &nextSibling() { * Gets a reference to the previous child node in the list of this node's parent. * * @return object A reference to the XmlNode object - * @access public */ - function &previousSibling() { + public function &previousSibling() { $null = null; $count = count($this->__parent->children); for ($i = 0; $i < $count; $i++) { @@ -559,9 +547,8 @@ function &previousSibling() { * Returns parent node. * * @return object Parent XmlNode - * @access public */ - function &parent() { + public function &parent() { return $this->__parent; } @@ -569,9 +556,8 @@ function &parent() { * Returns the XML document to which this node belongs * * @return object Parent XML object - * @access public */ - function &document() { + public function &document() { $document =& $this; while (true) { if (get_class($document) == 'Xml' || $document == null) { @@ -586,9 +572,8 @@ function &document() { * Returns true if this structure has child nodes. * * @return bool - * @access public */ - function hasChildren() { + public function hasChildren() { if (is_array($this->children) && !empty($this->children)) { return true; } @@ -599,9 +584,8 @@ function hasChildren() { * Returns this XML structure as a string. * * @return string String representation of the XML structure. - * @access public */ - function toString($options = array(), $depth = 0) { + public function toString($options = array(), $depth = 0) { if (is_int($options)) { $depth = $options; $options = array(); @@ -683,9 +667,8 @@ function toString($options = array(), $depth = 0) { * * @param boolean $camelize true will camelize child nodes, false will not alter node names * @return array Array representation - * @access public */ - function toArray($camelize = true) { + public function toArray($camelize = true) { $out = $this->attributes; $multi = null; @@ -891,9 +874,8 @@ function __construct($input = null, $options = array()) { * * @param string $input XML string, a path to a file, or an HTTP resource to load * @return boolean Success - * @access public */ - function load($input) { + public function load($input) { if (!is_string($input)) { return false; } @@ -994,9 +976,8 @@ function compose($options = array()) { * @param string $msg Error message * @param integer $code Error code * @param integer $line Line in file - * @access public */ - function error($msg, $code = 0, $line = 0) { + public function error($msg, $code = 0, $line = 0) { if (Configure::read('debug')) { echo $msg . " " . $code . " " . $line; } @@ -1007,9 +988,8 @@ function error($msg, $code = 0, $line = 0) { * * @param integer $code Error code * @return string Error message - * @access public */ - function getError($code) { + public function getError($code) { $r = @xml_error_string($code); return $r; } @@ -1020,9 +1000,8 @@ function getError($code) { * Get next element. NOT implemented. * * @return object - * @access public */ - function &next() { + public function &next() { $return = null; return $return; } @@ -1031,9 +1010,8 @@ function &next() { * Get previous element. NOT implemented. * * @return object - * @access public */ - function &previous() { + public function &previous() { $return = null; return $return; } @@ -1042,9 +1020,8 @@ function &previous() { * Get parent element. NOT implemented. * * @return object - * @access public */ - function &parent() { + public function &parent() { $return = null; return $return; } @@ -1086,9 +1063,8 @@ function removeNamespace($prefix) { * Return string representation of current object. * * @return string String representation - * @access public */ - function toString($options = array()) { + public function toString($options = array()) { if (is_bool($options)) { $options = array('header' => $options); } @@ -1379,9 +1355,8 @@ function append() { * Return string representation of current text node object. * * @return string String representation - * @access public */ - function toString($options = array(), $depth = 0) { + public function toString($options = array(), $depth = 0) { if (is_int($options)) { $depth = $options; $options = array(); @@ -1453,9 +1428,8 @@ class XmlManager { * Returns a reference to the global XML object that manages app-wide XML settings * * @return object - * @access public */ - function &getInstance() { + public function &getInstance() { static $instance = array(); if (!$instance) { diff --git a/cake/tests/cases/basics.test.php b/cake/tests/cases/basics.test.php index 1afbe8ae6..96c9c447a 100644 --- a/cake/tests/cases/basics.test.php +++ b/cake/tests/cases/basics.test.php @@ -32,9 +32,8 @@ class BasicsTest extends CakeTestCase { * setUp method * * @return void - * @access public */ - function setUp() { + public function setUp() { App::build(array( 'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS) )); @@ -45,9 +44,8 @@ function setUp() { * tearDown method * * @return void - * @access public */ - function tearDown() { + public function tearDown() { App::build(); Configure::write('Config.language', $this->_language); } @@ -56,9 +54,8 @@ function tearDown() { * test the array_diff_key compatibility function. * * @return void - * @access public */ - function testArrayDiffKey() { + public function testArrayDiffKey() { $one = array('one' => 1, 'two' => 2, 'three' => 3); $two = array('one' => 'one', 'two' => 'two'); $result = array_diff_key($one, $two); @@ -87,9 +84,8 @@ function testArrayDiffKey() { * testHttpBase method * * @return void - * @access public */ - function testEnv() { + public function testEnv() { $this->skipIf(!function_exists('ini_get') || ini_get('safe_mode') === '1', '%s safe mode is on'); $__SERVER = $_SERVER; @@ -194,9 +190,8 @@ function testUses() { * Test h() * * @return void - * @access public */ - function testH() { + public function testH() { $string = '<foo>'; $result = h($string); $this->assertEqual('<foo>', $result); @@ -211,9 +206,8 @@ function testH() { * Test a() * * @return void - * @access public */ - function testA() { + public function testA() { $result = a('this', 'that', 'bar'); $this->assertEqual(array('this', 'that', 'bar'), $result); } @@ -222,9 +216,8 @@ function testA() { * Test aa() * * @return void - * @access public */ - function testAa() { + public function testAa() { $result = aa('a', 'b', 'c', 'd'); $expected = array('a' => 'b', 'c' => 'd'); $this->assertEqual($expected, $result); @@ -238,9 +231,8 @@ function testAa() { * Test am() * * @return void - * @access public */ - function testAm() { + public function testAm() { $result = am(array('one', 'two'), 2, 3, 4); $expected = array('one', 'two', 2, 3, 4); $this->assertEqual($result, $expected); @@ -254,9 +246,8 @@ function testAm() { * test cache() * * @return void - * @access public */ - function testCache() { + public function testCache() { $_cacheDisable = Configure::read('Cache.disable'); if ($this->skipIf($_cacheDisable, 'Cache is disabled, skipping cache() tests. %s')) { return; @@ -290,9 +281,8 @@ function testCache() { * test clearCache() * * @return void - * @access public */ - function testClearCache() { + public function testClearCache() { $cacheOff = Configure::read('Cache.disable'); if ($this->skipIf($cacheOff, 'Cache is disabled, skipping clearCache() tests. %s')) { return; @@ -355,9 +345,8 @@ function testClearCache() { * test __() * * @return void - * @access public */ - function test__() { + public function test__() { Configure::write('Config.language', 'rule_1_po'); $result = __('Plural Rule 1', true); @@ -379,9 +368,8 @@ function test__() { * test __n() * * @return void - * @access public */ - function test__n() { + public function test__n() { Configure::write('Config.language', 'rule_1_po'); $result = __n('%d = 1', '%d = 0 or > 1', 0, true); @@ -407,9 +395,8 @@ function test__n() { * test __d() * * @return void - * @access public */ - function test__d() { + public function test__d() { Configure::write('Config.language', 'rule_1_po'); $result = __d('default', 'Plural Rule 1', true); @@ -435,9 +422,8 @@ function test__d() { * test __dn() * * @return void - * @access public */ - function test__dn() { + public function test__dn() { Configure::write('Config.language', 'rule_1_po'); $result = __dn('default', '%d = 1', '%d = 0 or > 1', 0, true); @@ -467,9 +453,8 @@ function test__dn() { * test __c() * * @return void - * @access public */ - function test__c() { + public function test__c() { Configure::write('Config.language', 'rule_1_po'); $result = __c('Plural Rule 1', 6, true); @@ -491,9 +476,8 @@ function test__c() { * test __dc() * * @return void - * @access public */ - function test__dc() { + public function test__dc() { Configure::write('Config.language', 'rule_1_po'); $result = __dc('default', 'Plural Rule 1', 6, true); @@ -523,9 +507,8 @@ function test__dc() { * test __dcn() * * @return void - * @access public */ - function test__dcn() { + public function test__dcn() { Configure::write('Config.language', 'rule_1_po'); $result = __dcn('default', '%d = 1', '%d = 0 or > 1', 0, 6, true); @@ -551,9 +534,8 @@ function test__dcn() { * test LogError() * * @return void - * @access public */ - function testLogError() { + public function testLogError() { @unlink(LOGS . 'error.log'); LogError('Testing LogError() basic function'); @@ -569,9 +551,8 @@ function testLogError() { * test fileExistsInPath() * * @return void - * @access public */ - function testFileExistsInPath() { + public function testFileExistsInPath() { $this->skipUnless(function_exists('ini_set'), '%s ini_set function not available'); $_includePath = ini_get('include_path'); @@ -614,9 +595,8 @@ function testFileExistsInPath() { * test convertSlash() * * @return void - * @access public */ - function testConvertSlash() { + public function testConvertSlash() { $result = convertSlash('\path\to\location\\'); $expected = '\path\to\location\\'; $this->assertEqual($result, $expected); @@ -630,9 +610,8 @@ function testConvertSlash() { * test debug() * * @return void - * @access public */ - function testDebug() { + public function testDebug() { ob_start(); debug('this-is-a-test'); $result = ob_get_clean(); @@ -654,9 +633,8 @@ function testDebug() { * test pr() * * @return void - * @access public */ - function testPr() { + public function testPr() { ob_start(); pr('this is a test'); $result = ob_get_clean(); @@ -674,9 +652,8 @@ function testPr() { * test params() * * @return void - * @access public */ - function testParams() { + public function testParams() { $this->assertNull(params('weekend')); $this->assertNull(params(array())); $this->assertEqual(params(array('weekend')), array('weekend')); @@ -692,9 +669,8 @@ function testParams() { * test stripslashes_deep() * * @return void - * @access public */ - function testStripslashesDeep() { + public function testStripslashesDeep() { $this->skipIf(ini_get('magic_quotes_sybase') === '1', '%s magic_quotes_sybase is on'); $this->assertEqual(stripslashes_deep("tes\'t"), "tes't"); @@ -730,9 +706,8 @@ function testStripslashesDeep() { * test stripslashes_deep() with magic_quotes_sybase on * * @return void - * @access public */ - function testStripslashesDeepSybase() { + public function testStripslashesDeepSybase() { $this->skipUnless(ini_get('magic_quotes_sybase') === '1', '%s magic_quotes_sybase is off'); $this->assertEqual(stripslashes_deep("tes\'t"), "tes\'t"); @@ -764,9 +739,8 @@ function testStripslashesDeepSybase() { * test ife() * * @return void - * @access public */ - function testIfe() { + public function testIfe() { $this->assertEqual(ife(true, 'a', 'b'), 'a'); $this->assertEqual(ife(' ', 'a', 'b'), 'a'); $this->assertEqual(ife('test', 'a', 'b'), 'a'); diff --git a/cake/tests/cases/console/cake.test.php b/cake/tests/cases/console/cake.test.php index fa1af172e..d4335bc61 100644 --- a/cake/tests/cases/console/cake.test.php +++ b/cake/tests/cases/console/cake.test.php @@ -91,9 +91,8 @@ function _initEnvironment() { * stderr method * * @return void - * @access public */ - function stderr($string) { + public function stderr($string) { $this->stderr .= rtrim($string, ' '); } @@ -101,9 +100,8 @@ function stderr($string) { * stdout method * * @return void - * @access public */ - function stdout($string, $newline = true) { + public function stdout($string, $newline = true) { if ($newline) { $this->stdout .= rtrim($string, ' ') . "\n"; } else { @@ -115,9 +113,8 @@ function stdout($string, $newline = true) { * clear method * * @return void - * @access public */ - function clear() { + public function clear() { } @@ -137,9 +134,8 @@ function _stop($status = 0) { * * @param mixed $plugin * @return mixed - * @access public */ - function getShell($plugin = null) { + public function getShell($plugin = null) { return $this->_getShell($plugin); } @@ -170,9 +166,8 @@ class ShellDispatcherTest extends CakeTestCase { * setUp method * * @return void - * @access public */ - function setUp() { + public function setUp() { App::build(array( 'plugins' => array( TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS @@ -188,9 +183,8 @@ function setUp() { * tearDown method * * @return void - * @access public */ - function tearDown() { + public function tearDown() { App::build(); } @@ -198,9 +192,8 @@ function tearDown() { * testParseParams method * * @return void - * @access public */ - function testParseParams() { + public function testParseParams() { $Dispatcher =& new TestShellDispatcher(); $params = array( @@ -457,9 +450,8 @@ function testParseParams() { * testBuildPaths method * * @return void - * @access public */ - function testBuildPaths() { + public function testBuildPaths() { $Dispatcher =& new TestShellDispatcher(); $result = $Dispatcher->shellPaths; @@ -480,9 +472,8 @@ function testBuildPaths() { * Verify loading of (plugin-) shells * * @return void - * @access public */ - function testGetShell() { + public function testGetShell() { $this->skipIf(class_exists('SampleShell'), '%s SampleShell Class already loaded'); $this->skipIf(class_exists('ExampleShell'), '%s ExampleShell Class already loaded'); @@ -509,9 +500,8 @@ function testGetShell() { * Verify correct dispatch of Shell subclasses with a main method * * @return void - * @access public */ - function testDispatchShellWithMain() { + public function testDispatchShellWithMain() { Mock::generate('Shell', 'MockWithMainShell', array('main', '_secret')); $Dispatcher =& new TestShellDispatcher(); @@ -600,9 +590,8 @@ function testDispatchShellWithMain() { * Verify correct dispatch of Shell subclasses without a main method * * @return void - * @access public */ - function testDispatchShellWithoutMain() { + public function testDispatchShellWithoutMain() { Mock::generate('Shell', 'MockWithoutMainShell', array('initDb', '_secret')); $Dispatcher =& new TestShellDispatcher(); @@ -672,9 +661,8 @@ function testDispatchShellWithoutMain() { * Verify correct dispatch of custom classes with a main method * * @return void - * @access public */ - function testDispatchNotAShellWithMain() { + public function testDispatchNotAShellWithMain() { Mock::generate('Object', 'MockWithMainNotAShell', array('main', 'initialize', 'loadTasks', 'startup', '_secret')); @@ -752,9 +740,8 @@ function testDispatchNotAShellWithMain() { * Verify correct dispatch of custom classes without a main method * * @return void - * @access public */ - function testDispatchNotAShellWithoutMain() { + public function testDispatchNotAShellWithoutMain() { Mock::generate('Object', 'MockWithoutMainNotAShell', array('initDb', 'initialize', 'loadTasks', 'startup', '_secret')); @@ -823,9 +810,8 @@ function testDispatchNotAShellWithoutMain() { * the name of the task * * @return void - * @access public */ - function testDispatchTask() { + public function testDispatchTask() { Mock::generate('Shell', 'MockWeekShell', array('main')); Mock::generate('Shell', 'MockOnSundayTask', array('execute')); @@ -871,9 +857,8 @@ function testDispatchTask() { * Verify shifting of arguments * * @return void - * @access public */ - function testShiftArgs() { + public function testShiftArgs() { $Dispatcher =& new TestShellDispatcher(); $Dispatcher->args = array('a', 'b', 'c'); @@ -901,9 +886,8 @@ function testShiftArgs() { * testHelpCommand method * * @return void - * @access public */ - function testHelpCommand() { + public function testHelpCommand() { $Dispatcher =& new TestShellDispatcher(); $expected = "/example \[.*TestPlugin, TestPluginTwo.*\]/"; diff --git a/cake/tests/cases/console/libs/acl.test.php b/cake/tests/cases/console/libs/acl.test.php index 834f8d263..e8662aa44 100644 --- a/cake/tests/cases/console/libs/acl.test.php +++ b/cake/tests/cases/console/libs/acl.test.php @@ -65,9 +65,8 @@ class AclShellTest extends CakeTestCase { * configure Configure for testcase * * @return void - * @access public */ - function startCase() { + public function startCase() { $this->_aclDb = Configure::read('Acl.database'); $this->_aclClass = Configure::read('Acl.classname'); @@ -79,9 +78,8 @@ function startCase() { * restore Environment settings * * @return void - * @access public */ - function endCase() { + public function endCase() { Configure::write('Acl.database', $this->_aclDb); Configure::write('Acl.classname', $this->_aclClass); } @@ -90,9 +88,8 @@ function endCase() { * startTest method * * @return void - * @access public */ - function startTest() { + public function startTest() { $this->Dispatcher =& new TestAclShellMockShellDispatcher(); $this->Task =& new MockAclShell($this->Dispatcher); $this->Task->Dispatch =& $this->Dispatcher; @@ -106,9 +103,8 @@ function startTest() { * endTest method * * @return void - * @access public */ - function endTest() { + public function endTest() { ClassRegistry::flush(); } @@ -116,9 +112,8 @@ function endTest() { * test that model.foreign_key output works when looking at acl rows * * @return void - * @access public */ - function testViewWithModelForeignKeyOutput() { + public function testViewWithModelForeignKeyOutput() { $this->Task->command = 'view'; $this->Task->startup(); $data = array( @@ -142,9 +137,8 @@ function testViewWithModelForeignKeyOutput() { * test view with an argument * * @return void - * @access public */ - function testViewWithArgument() { + public function testViewWithArgument() { $this->Task->args = array('aro', 'admins'); $this->Task->expectAt(0, 'out', array('Aro tree:')); $this->Task->expectAt(1, 'out', array(' [2] admins')); @@ -157,9 +151,8 @@ function testViewWithArgument() { * test the method that splits model.foreign key. and that it returns an array. * * @return void - * @access public */ - function testParsingModelAndForeignKey() { + public function testParsingModelAndForeignKey() { $result = $this->Task->parseIdentifier('Model.foreignKey'); $expected = array('model' => 'Model', 'foreign_key' => 'foreignKey'); @@ -174,9 +167,8 @@ function testParsingModelAndForeignKey() { * test creating aro/aco nodes * * @return void - * @access public */ - function testCreate() { + public function testCreate() { $this->Task->args = array('aro', 'root', 'User.1'); $this->Task->expectAt(0, 'out', array(new PatternExpectation('/created/'), '*')); $this->Task->create(); @@ -215,9 +207,8 @@ function testCreate() { * test the delete method with different node types. * * @return void - * @access public */ - function testDelete() { + public function testDelete() { $this->Task->args = array('aro', 'AuthUser.1'); $this->Task->expectAt(0, 'out', array(new NoPatternExpectation('/not/'), true)); $this->Task->delete(); @@ -231,9 +222,8 @@ function testDelete() { * test setParent method. * * @return void - * @access public */ - function testSetParent() { + public function testSetParent() { $this->Task->args = array('aro', 'AuthUser.2', 'root'); $this->Task->setParent(); @@ -246,9 +236,8 @@ function testSetParent() { * test grant * * @return void - * @access public */ - function testGrant() { + public function testGrant() { $this->Task->args = array('AuthUser.2', 'ROOT/Controller1', 'create'); $this->Task->expectAt(0, 'out', array(new PatternExpectation('/Permission granted/'), true)); $this->Task->grant(); @@ -262,9 +251,8 @@ function testGrant() { * test deny * * @return void - * @access public */ - function testDeny() { + public function testDeny() { $this->Task->args = array('AuthUser.2', 'ROOT/Controller1', 'create'); $this->Task->expectAt(0, 'out', array(new PatternExpectation('/Permission denied/'), true)); $this->Task->deny(); @@ -278,9 +266,8 @@ function testDeny() { * test checking allowed and denied perms * * @return void - * @access public */ - function testCheck() { + public function testCheck() { $this->Task->args = array('AuthUser.2', 'ROOT/Controller1', '*'); $this->Task->expectAt(0, 'out', array(new PatternExpectation('/not allowed/'), true)); $this->Task->check(); @@ -302,9 +289,8 @@ function testCheck() { * test inherit and that it 0's the permission fields. * * @return void - * @access public */ - function testInherit() { + public function testInherit() { $this->Task->args = array('AuthUser.2', 'ROOT/Controller1', 'create'); $this->Task->expectAt(0, 'out', array(new PatternExpectation('/Permission granted/'), true)); $this->Task->grant(); @@ -322,9 +308,8 @@ function testInherit() { * test getting the path for an aro/aco * * @return void - * @access public */ - function testGetPath() { + public function testGetPath() { $this->Task->args = array('aro', 'AuthUser.2'); $this->Task->expectAt(1, 'out', array('[1] ROOT')); $this->Task->expectAt(2, 'out', array(' [2] admins')); diff --git a/cake/tests/cases/console/libs/api.test.php b/cake/tests/cases/console/libs/api.test.php index 7433245e7..1b576c26e 100644 --- a/cake/tests/cases/console/libs/api.test.php +++ b/cake/tests/cases/console/libs/api.test.php @@ -55,9 +55,8 @@ class ApiShellTest extends CakeTestCase { * setUp method * * @return void - * @access public */ - function startTest() { + public function startTest() { $this->Dispatcher =& new ApiShellMockShellDispatcher(); $this->Shell =& new MockApiShell($this->Dispatcher); $this->Shell->Dispatch =& $this->Dispatcher; @@ -67,9 +66,8 @@ function startTest() { * tearDown method * * @return void - * @access public */ - function endTest() { + public function endTest() { ClassRegistry::flush(); } @@ -77,9 +75,8 @@ function endTest() { * Test that method names are detected properly including those with no arguments. * * @return void - * @access public */ - function testMethodNameDetection () { + public function testMethodNameDetection () { $this->Shell->setReturnValueAt(0, 'in', 'q'); $this->Shell->expectAt(0, 'out', array('Controller')); $expected = array( diff --git a/cake/tests/cases/console/libs/bake.test.php b/cake/tests/cases/console/libs/bake.test.php index 0aef9ed21..36eb22fa6 100644 --- a/cake/tests/cases/console/libs/bake.test.php +++ b/cake/tests/cases/console/libs/bake.test.php @@ -69,9 +69,8 @@ class BakeShellTestCase extends CakeTestCase { * start test * * @return void - * @access public */ - function startTest() { + public function startTest() { $this->Dispatch =& new BakeShellMockShellDispatcher(); $this->Shell =& new MockBakeShell(); $this->Shell->Dispatch =& $this->Dispatch; @@ -82,9 +81,8 @@ function startTest() { * endTest method * * @return void - * @access public */ - function endTest() { + public function endTest() { unset($this->Dispatch, $this->Shell); } @@ -92,9 +90,8 @@ function endTest() { * test bake all * * @return void - * @access public */ - function testAllWithModelName() { + public function testAllWithModelName() { App::import('Model', 'User'); $userExists = class_exists('User'); if ($this->skipIf($userExists, 'User class exists, cannot test `bake all [param]`. %s')) { diff --git a/cake/tests/cases/console/libs/schema.test.php b/cake/tests/cases/console/libs/schema.test.php index a8d9ae411..229e420e7 100644 --- a/cake/tests/cases/console/libs/schema.test.php +++ b/cake/tests/cases/console/libs/schema.test.php @@ -129,9 +129,8 @@ class SchemaShellTest extends CakeTestCase { * startTest method * * @return void - * @access public */ - function startTest() { + public function startTest() { $this->Dispatcher =& new TestSchemaShellMockShellDispatcher(); $this->Shell =& new MockSchemaShell($this->Dispatcher); $this->Shell->Dispatch =& $this->Dispatcher; @@ -141,9 +140,8 @@ function startTest() { * endTest method * * @return void - * @access public */ - function endTest() { + public function endTest() { ClassRegistry::flush(); } @@ -151,9 +149,8 @@ function endTest() { * test startup method * * @return void - * @access public */ - function testStartup() { + public function testStartup() { $this->Shell->startup(); $this->assertTrue(isset($this->Shell->Schema)); $this->assertTrue(is_a($this->Shell->Schema, 'CakeSchema')); @@ -187,9 +184,8 @@ function testStartup() { * Test View - and that it dumps the schema file to stdout * * @return void - * @access public */ - function testView() { + public function testView() { $this->Shell->startup(); $this->Shell->Schema->path = APP . 'config' . DS . 'schema'; $this->Shell->params['file'] = 'i18n.php'; @@ -202,9 +198,8 @@ function testView() { * test that view() can find plugin schema files. * * @return void - * @access public */ - function testViewWithPlugins() { + public function testViewWithPlugins() { App::build(array( 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) )); @@ -226,9 +221,8 @@ function testViewWithPlugins() { * test dump() with sql file generation * * @return void - * @access public */ - function testDumpWithFileWriting() { + public function testDumpWithFileWriting() { $this->Shell->params = array( 'name' => 'i18n', 'write' => TMP . 'tests' . DS . 'i18n.sql' @@ -255,9 +249,8 @@ function testDumpWithFileWriting() { * test that dump() can find and work with plugin schema files. * * @return void - * @access public */ - function testDumpFileWritingWithPlugins() { + public function testDumpFileWritingWithPlugins() { App::build(array( 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) )); @@ -285,9 +278,8 @@ function testDumpFileWritingWithPlugins() { * test generate with snapshot generation * * @return void - * @access public */ - function testGenerateSnaphot() { + public function testGenerateSnaphot() { $this->Shell->path = TMP; $this->Shell->params['file'] = 'schema.php'; $this->Shell->args = array('snapshot'); @@ -305,9 +297,8 @@ function testGenerateSnaphot() { * test generate without a snapshot. * * @return void - * @access public */ - function testGenerateNoOverwrite() { + public function testGenerateNoOverwrite() { touch(TMP . 'schema.php'); $this->Shell->params['file'] = 'schema.php'; $this->Shell->args = array(); @@ -325,9 +316,8 @@ function testGenerateNoOverwrite() { * test generate with overwriting of the schema files. * * @return void - * @access public */ - function testGenerateOverwrite() { + public function testGenerateOverwrite() { touch(TMP . 'schema.php'); $this->Shell->params['file'] = 'schema.php'; $this->Shell->args = array(); @@ -351,9 +341,8 @@ function testGenerateOverwrite() { * in a plugin. * * @return void - * @access public */ - function testGenerateWithPlugins() { + public function testGenerateWithPlugins() { App::build(array( 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) )); @@ -383,9 +372,8 @@ function testGenerateWithPlugins() { * Test schema run create with no table args. * * @return void - * @access public */ - function testCreateNoArgs() { + public function testCreateNoArgs() { $this->Shell->params = array( 'connection' => 'test_suite', 'path' => APP . 'config' . DS . 'sql' @@ -407,9 +395,8 @@ function testCreateNoArgs() { * Test schema run create with no table args. * * @return void - * @access public */ - function testCreateWithTableArgs() { + public function testCreateWithTableArgs() { $this->Shell->params = array( 'connection' => 'test_suite', 'name' => 'DbAcl', @@ -433,9 +420,8 @@ function testCreateWithTableArgs() { * test run update with a table arg. * * @return void - * @access public */ - function testUpdateWithTable() { + public function testUpdateWithTable() { $this->Shell->params = array( 'connection' => 'test_suite', 'f' => true @@ -457,9 +443,8 @@ function testUpdateWithTable() { * test that the plugin param creates the correct path in the schema object. * * @return void - * @access public */ - function testPluginParam() { + public function testPluginParam() { App::build(array( 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) )); @@ -478,9 +463,8 @@ function testPluginParam() { * test that using Plugin.name with write. * * @return void - * @access public */ - function testPluginDotSyntaxWithCreate() { + public function testPluginDotSyntaxWithCreate() { App::build(array( 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) )); diff --git a/cake/tests/cases/console/libs/shell.test.php b/cake/tests/cases/console/libs/shell.test.php index 3c984f335..59a875700 100644 --- a/cake/tests/cases/console/libs/shell.test.php +++ b/cake/tests/cases/console/libs/shell.test.php @@ -114,9 +114,8 @@ class ShellTest extends CakeTestCase { * setUp method * * @return void - * @access public */ - function setUp() { + public function setUp() { $this->Dispatcher =& new TestShellMockShellDispatcher(); $this->Shell =& new TestShell($this->Dispatcher); } @@ -125,9 +124,8 @@ function setUp() { * tearDown method * * @return void - * @access public */ - function tearDown() { + public function tearDown() { ClassRegistry::flush(); } @@ -135,9 +133,8 @@ function tearDown() { * testConstruct method * * @return void - * @access public */ - function testConstruct() { + public function testConstruct() { $this->assertIsA($this->Shell->Dispatch, 'TestShellMockShellDispatcher'); $this->assertEqual($this->Shell->name, 'TestShell'); $this->assertEqual($this->Shell->alias, 'TestShell'); @@ -147,9 +144,8 @@ function testConstruct() { * testInitialize method * * @return void - * @access public */ - function testInitialize() { + public function testInitialize() { App::build(array( 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), 'models' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'models' . DS) @@ -180,9 +176,8 @@ function testInitialize() { * testIn method * * @return void - * @access public */ - function testIn() { + public function testIn() { $this->Shell->Dispatch->setReturnValueAt(0, 'getInput', 'n'); $this->Shell->Dispatch->expectAt(0, 'getInput', array('Just a test?', array('y', 'n'), 'n')); $result = $this->Shell->in('Just a test?', array('y', 'n'), 'n'); @@ -218,9 +213,8 @@ function testIn() { * testOut method * * @return void - * @access public */ - function testOut() { + public function testOut() { $this->Shell->Dispatch->expectAt(0, 'stdout', array("Just a test\n", false)); $this->Shell->out('Just a test'); @@ -238,9 +232,8 @@ function testOut() { * testErr method * * @return void - * @access public */ - function testErr() { + public function testErr() { $this->Shell->Dispatch->expectAt(0, 'stderr', array("Just a test\n")); $this->Shell->err('Just a test'); @@ -258,9 +251,8 @@ function testErr() { * testNl * * @return void - * @access public */ - function testNl() { + public function testNl() { $this->assertEqual($this->Shell->nl(), "\n"); $this->assertEqual($this->Shell->nl(true), "\n"); $this->assertEqual($this->Shell->nl(false), ""); @@ -272,9 +264,8 @@ function testNl() { * testHr * * @return void - * @access public */ - function testHr() { + public function testHr() { $bar = '---------------------------------------------------------------'; $this->Shell->Dispatch->expectAt(0, 'stdout', array('', false)); @@ -297,9 +288,8 @@ function testHr() { * testError * * @return void - * @access public */ - function testError() { + public function testError() { $this->Shell->Dispatch->expectAt(0, 'stderr', array("Error: Foo Not Found\n")); $this->Shell->error('Foo Not Found'); $this->assertIdentical($this->Shell->stopped, 1); @@ -316,9 +306,8 @@ function testError() { * testLoadTasks method * * @return void - * @access public */ - function testLoadTasks() { + public function testLoadTasks() { $this->assertTrue($this->Shell->loadTasks()); $this->Shell->tasks = null; @@ -359,9 +348,8 @@ function testLoadTasks() { * testShortPath method * * @return void - * @access public */ - function testShortPath() { + public function testShortPath() { $path = $expected = DS . 'tmp' . DS . 'ab' . DS . 'cd'; $this->assertEqual($this->Shell->shortPath($path), $expected); @@ -401,9 +389,8 @@ function testShortPath() { * testCreateFile method * * @return void - * @access public */ - function testCreateFile() { + public function testCreateFile() { $this->skipIf(DIRECTORY_SEPARATOR === '\\', '%s Not supported on Windows'); $path = TMP . 'shell_test'; @@ -452,9 +439,8 @@ function testCreateFile() { * testCreateFileWindows method * * @return void - * @access public */ - function testCreateFileWindows() { + public function testCreateFileWindows() { $this->skipUnless(DIRECTORY_SEPARATOR === '\\', 'testCreateFileWindows supported on Windows only'); $path = TMP . 'shell_test'; diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 40071cdd8..cdd10dcef 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -96,9 +96,8 @@ class ControllerTaskTest extends CakeTestCase { * startTest method * * @return void - * @access public */ - function startTest() { + public function startTest() { $this->Dispatcher =& new TestControllerTaskMockShellDispatcher(); $this->Task =& new MockControllerTask($this->Dispatcher); $this->Task->name = 'ControllerTask'; @@ -115,9 +114,8 @@ function startTest() { * endTest method * * @return void - * @access public */ - function endTest() { + public function endTest() { unset($this->Task, $this->Dispatcher); ClassRegistry::flush(); } @@ -126,9 +124,8 @@ function endTest() { * test ListAll * * @return void - * @access public */ - function testListAll() { + public function testListAll() { $this->Task->connection = 'test_suite'; $this->Task->interactive = true; $this->Task->expectAt(1, 'out', array('1. Articles')); @@ -156,9 +153,8 @@ function testListAll() { * Test that getName interacts with the user and returns the controller name. * * @return void - * @access public */ - function testGetName() { + public function testGetName() { $this->Task->interactive = true; $this->Task->setReturnValue('in', 1); @@ -185,9 +181,8 @@ function testGetName() { * test helper interactions * * @return void - * @access public */ - function testDoHelpers() { + public function testDoHelpers() { $this->Task->setReturnValue('in', 'n'); $result = $this->Task->doHelpers(); $this->assertEqual($result, array()); @@ -209,9 +204,8 @@ function testDoHelpers() { * test component interactions * * @return void - * @access public */ - function testDoComponents() { + public function testDoComponents() { $this->Task->setReturnValue('in', 'n'); $result = $this->Task->doComponents(); $this->assertEqual($result, array()); @@ -233,9 +227,8 @@ function testDoComponents() { * test Confirming controller user interaction * * @return void - * @access public */ - function testConfirmController() { + public function testConfirmController() { $controller = 'Posts'; $scaffold = false; $helpers = array('Ajax', 'Time'); @@ -252,9 +245,8 @@ function testConfirmController() { * test the bake method * * @return void - * @access public */ - function testBake() { + public function testBake() { $helpers = array('Ajax', 'Time'); $components = array('Acl', 'Auth'); $this->Task->setReturnValue('createFile', true); @@ -282,9 +274,8 @@ function testBake() { * test bake() with a -plugin param * * @return void - * @access public */ - function testBakeWithPlugin() { + public function testBakeWithPlugin() { $this->Task->plugin = 'ControllerTest'; $helpers = array('Ajax', 'Time'); $components = array('Acl', 'Auth'); @@ -305,9 +296,8 @@ function testBakeWithPlugin() { * test that bakeActions is creating the correct controller Code. (Using sessions) * * @return void - * @access public */ - function testBakeActionsUsingSessions() { + public function testBakeActionsUsingSessions() { $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Testing bakeActions requires Article, Comment & Tag Model to be undefined. %s'); if ($skip) { @@ -348,9 +338,8 @@ function testBakeActionsUsingSessions() { * Test baking with Controller::flash() or no sessions. * * @return void - * @access public */ - function testBakeActionsWithNoSessions() { + public function testBakeActionsWithNoSessions() { $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Testing bakeActions requires Article, Tag, Comment Models to be undefined. %s'); if ($skip) { @@ -384,9 +373,8 @@ function testBakeActionsWithNoSessions() { * test baking a test * * @return void - * @access public */ - function testBakeTest() { + public function testBakeTest() { $this->Task->plugin = 'ControllerTest'; $this->Task->connection = 'test_suite'; $this->Task->interactive = false; @@ -403,9 +391,8 @@ function testBakeTest() { * test Interactive mode. * * @return void - * @access public */ - function testInteractive() { + public function testInteractive() { $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path'; $this->Task->setReturnValue('in', '1'); @@ -428,9 +415,8 @@ function testInteractive() { * test that execute runs all when the first arg == all * * @return void - * @access public */ - function testExecuteIntoAll() { + public function testExecuteIntoAll() { $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Execute into all could not be run as an Article, Tag or Comment model was already loaded. %s'); if ($skip) { @@ -454,9 +440,8 @@ function testExecuteIntoAll() { * test that `cake bake controller foos` works. * * @return void - * @access public */ - function testExecuteWithController() { + public function testExecuteWithController() { $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Execute with scaffold param requires no Article, Tag or Comment model to be defined. %s'); if ($skip) { @@ -478,9 +463,8 @@ function testExecuteWithController() { * test that both plural and singular forms work for controller baking. * * @return void - * @access public */ - function testExecuteWithControllerNameVariations() { + public function testExecuteWithControllerNameVariations() { $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Execute with scaffold param requires no Article, Tag or Comment model to be defined. %s'); if ($skip) { @@ -530,9 +514,8 @@ function testExecuteWithControllerNameVariations() { * test that `cake bake controller foo scaffold` works. * * @return void - * @access public */ - function testExecuteWithPublicParam() { + public function testExecuteWithPublicParam() { $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Execute with scaffold param requires no Article, Tag or Comment model to be defined. %s'); if ($skip) { @@ -554,9 +537,8 @@ function testExecuteWithPublicParam() { * test that `cake bake controller foos both` works. * * @return void - * @access public */ - function testExecuteWithControllerAndBoth() { + public function testExecuteWithControllerAndBoth() { $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Execute with scaffold param requires no Article, Tag or Comment model to be defined. %s'); if ($skip) { @@ -579,9 +561,8 @@ function testExecuteWithControllerAndBoth() { * test that `cake bake controller foos admin` works. * * @return void - * @access public */ - function testExecuteWithControllerAndAdmin() { + public function testExecuteWithControllerAndAdmin() { $skip = $this->skipIf(!defined('ARTICLE_MODEL_CREATED'), 'Execute with scaffold param requires no Article, Tag or Comment model to be defined. %s'); if ($skip) { diff --git a/cake/tests/cases/console/libs/tasks/db_config.test.php b/cake/tests/cases/console/libs/tasks/db_config.test.php index 886550f94..4ba609bb8 100644 --- a/cake/tests/cases/console/libs/tasks/db_config.test.php +++ b/cake/tests/cases/console/libs/tasks/db_config.test.php @@ -77,9 +77,8 @@ class DbConfigTaskTest extends CakeTestCase { * startTest method * * @return void - * @access public */ - function startTest() { + public function startTest() { $this->Dispatcher =& new TestDbConfigTaskMockShellDispatcher(); $this->Task =& new MockDbConfigTask($this->Dispatcher); $this->Task->Dispatch =& $this->Dispatcher; @@ -93,9 +92,8 @@ function startTest() { * endTest method * * @return void - * @access public */ - function endTest() { + public function endTest() { unset($this->Task, $this->Dispatcher); ClassRegistry::flush(); } @@ -104,9 +102,8 @@ function endTest() { * Test the getConfig method. * * @return void - * @access public */ - function testGetConfig() { + public function testGetConfig() { $this->Task->setReturnValueAt(0, 'in', 'otherOne'); $result = $this->Task->getConfig(); $this->assertEqual($result, 'otherOne'); @@ -116,9 +113,8 @@ function testGetConfig() { * test that initialize sets the path up. * * @return void - * @access public */ - function testInitialize() { + public function testInitialize() { $this->assertTrue(empty($this->Task->path)); $this->Task->initialize(); $this->assertFalse(empty($this->Task->path)); @@ -130,9 +126,8 @@ function testInitialize() { * test execute and by extension __interactive * * @return void - * @access public */ - function testExecuteIntoInteractive() { + public function testExecuteIntoInteractive() { $this->Task->initialize(); $this->Task->expectOnce('_stop'); diff --git a/cake/tests/cases/console/libs/tasks/extract.test.php b/cake/tests/cases/console/libs/tasks/extract.test.php index bbef0da97..f105419e5 100644 --- a/cake/tests/cases/console/libs/tasks/extract.test.php +++ b/cake/tests/cases/console/libs/tasks/extract.test.php @@ -53,9 +53,8 @@ class ExtractTaskTest extends CakeTestCase { * setUp method * * @return void - * @access public */ - function setUp() { + public function setUp() { $this->Dispatcher =& new TestExtractTaskMockShellDispatcher(); $this->Task =& new ExtractTask($this->Dispatcher); } @@ -64,9 +63,8 @@ function setUp() { * tearDown method * * @return void - * @access public */ - function tearDown() { + public function tearDown() { ClassRegistry::flush(); } @@ -74,9 +72,8 @@ function tearDown() { * testExecute method * * @return void - * @access public */ - function testExecute() { + public function testExecute() { $path = TMP . 'tests' . DS . 'extract_task_test'; new Folder($path . DS . 'locale', true); diff --git a/cake/tests/cases/console/libs/tasks/fixture.test.php b/cake/tests/cases/console/libs/tasks/fixture.test.php index f1d22594e..381080c24 100644 --- a/cake/tests/cases/console/libs/tasks/fixture.test.php +++ b/cake/tests/cases/console/libs/tasks/fixture.test.php @@ -68,9 +68,8 @@ class FixtureTaskTest extends CakeTestCase { * startTest method * * @return void - * @access public */ - function startTest() { + public function startTest() { $this->Dispatcher =& new TestFixtureTaskMockShellDispatcher(); $this->Task =& new MockFixtureTask(); $this->Task->Model =& new MockFixtureModelTask(); @@ -84,9 +83,8 @@ function startTest() { * endTest method * * @return void - * @access public */ - function endTest() { + public function endTest() { unset($this->Task, $this->Dispatcher); ClassRegistry::flush(); } @@ -95,9 +93,8 @@ function endTest() { * test that initialize sets the path * * @return void - * @access public */ - function testConstruct() { + public function testConstruct() { $this->Dispatch->params['working'] = DS . 'my' . DS . 'path'; $Task =& new FixtureTask($this->Dispatch); @@ -109,9 +106,8 @@ function testConstruct() { * test import option array generation * * @return void - * @access public */ - function testImportOptions() { + public function testImportOptions() { $this->Task->setReturnValueAt(0, 'in', 'y'); $this->Task->setReturnValueAt(1, 'in', 'y'); @@ -139,9 +135,8 @@ function testImportOptions() { * test generating a fixture with database conditions. * * @return void - * @access public */ - function testImportRecordsFromDatabaseWithConditions() { + public function testImportRecordsFromDatabaseWithConditions() { $this->Task->interactive = true; $this->Task->setReturnValueAt(0, 'in', 'WHERE 1=1 LIMIT 10'); $this->Task->connection = 'test_suite'; @@ -160,9 +155,8 @@ function testImportRecordsFromDatabaseWithConditions() { * test that execute passes runs bake depending with named model. * * @return void - * @access public */ - function testExecuteWithNamedModel() { + public function testExecuteWithNamedModel() { $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; $this->Task->args = array('article'); @@ -175,9 +169,8 @@ function testExecuteWithNamedModel() { * test that execute passes runs bake depending with named model. * * @return void - * @access public */ - function testExecuteWithNamedModelVariations() { + public function testExecuteWithNamedModelVariations() { $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; @@ -206,9 +199,8 @@ function testExecuteWithNamedModelVariations() { * test that execute runs all() when args[0] = all * * @return void - * @access public */ - function testExecuteIntoAll() { + public function testExecuteIntoAll() { $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; $this->Task->args = array('all'); @@ -227,9 +219,8 @@ function testExecuteIntoAll() { * test using all() with -count and -records * * @return void - * @access public */ - function testAllWithCountAndRecordsFlags() { + public function testAllWithCountAndRecordsFlags() { $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; $this->Task->args = array('all'); @@ -249,9 +240,8 @@ function testAllWithCountAndRecordsFlags() { * test interactive mode of execute * * @return void - * @access public */ - function testExecuteInteractive() { + public function testExecuteInteractive() { $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; @@ -268,9 +258,8 @@ function testExecuteInteractive() { * Test that bake works * * @return void - * @access public */ - function testBake() { + public function testBake() { $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; @@ -304,9 +293,8 @@ function testBake() { * test record generation with float and binary types * * @return void - * @access public */ - function testRecordGenerationForBinaryAndFloat() { + public function testRecordGenerationForBinaryAndFloat() { $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; @@ -321,9 +309,8 @@ function testRecordGenerationForBinaryAndFloat() { * Test that file generation includes headers and correct path for plugins. * * @return void - * @access public */ - function testGenerateFixtureFile() { + public function testGenerateFixtureFile() { $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; $filename = '/my/path/article_fixture.php'; @@ -339,9 +326,8 @@ function testGenerateFixtureFile() { * test generating files into plugins. * * @return void - * @access public */ - function testGeneratePluginFixtureFile() { + public function testGeneratePluginFixtureFile() { $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; $this->Task->plugin = 'TestFixture'; diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index ab7b7e291..57d94da5f 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -73,9 +73,8 @@ class ModelTaskTest extends CakeTestCase { * starTest method * * @return void - * @access public */ - function startTest() { + public function startTest() { $this->Dispatcher =& new TestModelTaskMockShellDispatcher(); $this->Task =& new MockModelTask($this->Dispatcher); $this->Task->name = 'ModelTask'; @@ -91,9 +90,8 @@ function startTest() { * endTest method * * @return void - * @access public */ - function endTest() { + public function endTest() { unset($this->Task, $this->Dispatcher); ClassRegistry::flush(); } @@ -102,9 +100,8 @@ function endTest() { * Test that listAll scans the database connection and lists all the tables in it.s * * @return void - * @access public */ - function testListAll() { + public function testListAll() { $this->Task->expectAt(1, 'out', array('1. Article')); $this->Task->expectAt(2, 'out', array('2. ArticlesTag')); $this->Task->expectAt(3, 'out', array('3. CategoryThread')); @@ -130,9 +127,8 @@ function testListAll() { * Test that getName interacts with the user and returns the model name. * * @return void - * @access public */ - function testGetName() { + public function testGetName() { $this->Task->setReturnValue('in', 1); $this->Task->setReturnValueAt(0, 'in', 'q'); @@ -158,9 +154,8 @@ function testGetName() { * Test table name interactions * * @return void - * @access public */ - function testGetTableName() { + public function testGetTableName() { $this->Task->setReturnValueAt(0, 'in', 'y'); $result = $this->Task->getTable('Article', 'test_suite'); $expected = 'articles'; @@ -177,9 +172,8 @@ function testGetTableName() { * test that initializing the validations works. * * @return void - * @access public */ - function testInitValidations() { + public function testInitValidations() { $result = $this->Task->initValidations(); $this->assertTrue(in_array('notempty', $result)); } @@ -189,9 +183,8 @@ function testInitValidations() { * tests the guessing features of validation * * @return void - * @access public */ - function testFieldValidationGuessing() { + public function testFieldValidationGuessing() { $this->Task->interactive = false; $this->Task->initValidations(); @@ -218,9 +211,8 @@ function testFieldValidationGuessing() { * test that interactive field validation works and returns multiple validators. * * @return void - * @access public */ - function testInteractiveFieldValidation() { + public function testInteractiveFieldValidation() { $this->Task->initValidations(); $this->Task->interactive = true; $this->Task->setReturnValueAt(0, 'in', '19'); @@ -271,9 +263,8 @@ function testInteractiveFieldValidationWithRegexp() { * test the validation Generation routine * * @return void - * @access public */ - function testNonInteractiveDoValidation() { + public function testNonInteractiveDoValidation() { $Model =& new MockModelTaskModel(); $Model->primaryKey = 'id'; $Model->setReturnValue('schema', array( @@ -333,9 +324,8 @@ function testNonInteractiveDoValidation() { * test that finding primary key works * * @return void - * @access public */ - function testFindPrimaryKey() { + public function testFindPrimaryKey() { $fields = array( 'one' => array(), 'two' => array(), @@ -352,9 +342,8 @@ function testFindPrimaryKey() { * test finding Display field * * @return void - * @access public */ - function testFindDisplayField() { + public function testFindDisplayField() { $fields = array('id' => array(), 'tagname' => array(), 'body' => array(), 'created' => array(), 'modified' => array()); @@ -373,9 +362,8 @@ function testFindDisplayField() { * test that belongsTo generation works. * * @return void - * @access public */ - function testBelongsToGeneration() { + public function testBelongsToGeneration() { $model = new Model(array('ds' => 'test_suite', 'name' => 'Comment')); $result = $this->Task->findBelongsTo($model, array()); $expected = array( @@ -412,9 +400,8 @@ function testBelongsToGeneration() { * test that hasOne and/or hasMany relations are generated properly. * * @return void - * @access public */ - function testHasManyHasOneGeneration() { + public function testHasManyHasOneGeneration() { $model = new Model(array('ds' => 'test_suite', 'name' => 'Article')); $this->Task->connection = 'test_suite'; $this->Task->listAll(); @@ -462,9 +449,8 @@ function testHasManyHasOneGeneration() { * Test that HABTM generation works * * @return void - * @access public */ - function testHasAndBelongsToManyGeneration() { + public function testHasAndBelongsToManyGeneration() { $model = new Model(array('ds' => 'test_suite', 'name' => 'Article')); $this->Task->connection = 'test_suite'; $this->Task->listAll(); @@ -487,9 +473,8 @@ function testHasAndBelongsToManyGeneration() { * test non interactive doAssociations * * @return void - * @access public */ - function testDoAssociationsNonInteractive() { + public function testDoAssociationsNonInteractive() { $this->Task->connection = 'test_suite'; $this->Task->interactive = false; $model = new Model(array('ds' => 'test_suite', 'name' => 'Article')); @@ -518,9 +503,8 @@ function testDoAssociationsNonInteractive() { * Ensure that the fixutre object is correctly called. * * @return void - * @access public */ - function testBakeFixture() { + public function testBakeFixture() { $this->Task->plugin = 'test_plugin'; $this->Task->interactive = true; $this->Task->Fixture->expectAt(0, 'bake', array('Article', 'articles')); @@ -535,9 +519,8 @@ function testBakeFixture() { * Ensure that the test object is correctly called. * * @return void - * @access public */ - function testBakeTest() { + public function testBakeTest() { $this->Task->plugin = 'test_plugin'; $this->Task->interactive = true; $this->Task->Test->expectAt(0, 'bake', array('Model', 'Article')); @@ -553,9 +536,8 @@ function testBakeTest() { * a question for the hasOne is also not asked. * * @return void - * @access public */ - function testConfirmAssociations() { + public function testConfirmAssociations() { $associations = array( 'hasOne' => array( array( @@ -594,9 +576,8 @@ function testConfirmAssociations() { * test that inOptions generates questions and only accepts a valid answer * * @return void - * @access public */ - function testInOptions() { + public function testInOptions() { $options = array('one', 'two', 'three'); $this->Task->expectAt(0, 'out', array('1. one')); $this->Task->expectAt(1, 'out', array('2. two')); @@ -615,9 +596,8 @@ function testInOptions() { * test baking validation * * @return void - * @access public */ - function testBakeValidation() { + public function testBakeValidation() { $validate = array( 'name' => array( 'notempty' => 'notempty' @@ -655,9 +635,8 @@ function testBakeValidation() { * test baking relations * * @return void - * @access public */ - function testBakeRelations() { + public function testBakeRelations() { $associations = array( 'belongsTo' => array( array( @@ -710,9 +689,8 @@ function testBakeRelations() { * test bake() with a -plugin param * * @return void - * @access public */ - function testBakeWithPlugin() { + public function testBakeWithPlugin() { $this->Task->plugin = 'ControllerTest'; $path = APP . 'plugins' . DS . 'controller_test' . DS . 'models' . DS . 'article.php'; @@ -734,9 +712,8 @@ function testBakeWithPlugin() { * test that execute passes runs bake depending with named model. * * @return void - * @access public */ - function testExecuteWithNamedModel() { + public function testExecuteWithNamedModel() { $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; $this->Task->args = array('article'); @@ -753,9 +730,8 @@ function testExecuteWithNamedModel() { * test that execute passes with different inflections of the same name. * * @return void - * @access public */ - function testExecuteWithNamedModelVariations() { + public function testExecuteWithNamedModelVariations() { $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; $this->Task->setReturnValue('_checkUnitTest', 1); @@ -779,9 +755,8 @@ function testExecuteWithNamedModelVariations() { * test that execute with a model name picks up hasMany associations. * * @return void - * @access public */ - function testExecuteWithNamedModelHasManyCreated() { + public function testExecuteWithNamedModelHasManyCreated() { $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; $this->Task->args = array('article'); @@ -795,9 +770,8 @@ function testExecuteWithNamedModelHasManyCreated() { * test that execute runs all() when args[0] = all * * @return void - * @access public */ - function testExecuteIntoAll() { + public function testExecuteIntoAll() { $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; $this->Task->args = array('all'); @@ -861,9 +835,8 @@ function testSkipTablesAndAll() { * test the interactive side of bake. * * @return void - * @access public */ - function testExecuteIntoInteractive() { + public function testExecuteIntoInteractive() { $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; $this->Task->interactive = true; @@ -894,9 +867,8 @@ function testExecuteIntoInteractive() { * test using bake interactively with a table that does not exist. * * @return void - * @access public */ - function testExecuteWithNonExistantTableName() { + public function testExecuteWithNonExistantTableName() { $this->Task->connection = 'test_suite'; $this->Task->path = '/my/path/'; diff --git a/cake/tests/cases/console/libs/tasks/plugin.test.php b/cake/tests/cases/console/libs/tasks/plugin.test.php index 29521bb38..f1dc013ec 100644 --- a/cake/tests/cases/console/libs/tasks/plugin.test.php +++ b/cake/tests/cases/console/libs/tasks/plugin.test.php @@ -58,9 +58,8 @@ class PluginTaskTest extends CakeTestCase { * startTest method * * @return void - * @access public */ - function startTest() { + public function startTest() { $this->Dispatcher =& new TestPluginTaskMockShellDispatcher(); $this->Dispatcher->shellPaths = App::path('shells'); $this->Task =& new MockPluginTask($this->Dispatcher); @@ -72,9 +71,8 @@ function startTest() { * startCase methods * * @return void - * @access public */ - function startCase() { + public function startCase() { $this->_paths = $paths = App::path('plugins'); $this->_testPath = array_push($paths, TMP . 'tests' . DS); App::build(array('plugins' => $paths)); @@ -84,9 +82,8 @@ function startCase() { * endCase * * @return void - * @access public */ - function endCase() { + public function endCase() { App::build(array('plugins' => $this->_paths)); } @@ -94,9 +91,8 @@ function endCase() { * endTest method * * @return void - * @access public */ - function endTest() { + public function endTest() { ClassRegistry::flush(); } @@ -104,9 +100,8 @@ function endTest() { * test bake() * * @return void - * @access public */ - function testBakeFoldersAndFiles() { + public function testBakeFoldersAndFiles() { $this->Task->setReturnValueAt(0, 'in', $this->_testPath); $this->Task->setReturnValueAt(1, 'in', 'y'); $this->Task->bake('BakeTestPlugin'); @@ -192,9 +187,8 @@ function testBakeFoldersAndFiles() { * test execute with no args, flowing into interactive, * * @return void - * @access public */ - function testExecuteWithNoArgs() { + public function testExecuteWithNoArgs() { $this->Task->setReturnValueAt(0, 'in', 'TestPlugin'); $this->Task->setReturnValueAt(1, 'in', '3'); $this->Task->setReturnValueAt(2, 'in', 'y'); @@ -218,9 +212,8 @@ function testExecuteWithNoArgs() { * Test Execute * * @return void - * @access public */ - function testExecuteWithOneArg() { + public function testExecuteWithOneArg() { $this->Task->setReturnValueAt(0, 'in', $this->_testPath); $this->Task->setReturnValueAt(1, 'in', 'y'); $this->Task->Dispatch->args = array('BakeTestPlugin'); @@ -243,9 +236,8 @@ function testExecuteWithOneArg() { * test execute chaining into MVC parts * * @return void - * @access public */ - function testExecuteWithTwoArgs() { + public function testExecuteWithTwoArgs() { $this->Task->Model =& new PluginTestMockModelTask(); $this->Task->setReturnValueAt(0, 'in', $this->_testPath); $this->Task->setReturnValueAt(1, 'in', 'y'); diff --git a/cake/tests/cases/console/libs/tasks/project.test.php b/cake/tests/cases/console/libs/tasks/project.test.php index 781aaa493..9eea4535b 100644 --- a/cake/tests/cases/console/libs/tasks/project.test.php +++ b/cake/tests/cases/console/libs/tasks/project.test.php @@ -55,9 +55,8 @@ class ProjectTaskTest extends CakeTestCase { * startTest method * * @return void - * @access public */ - function startTest() { + public function startTest() { $this->Dispatcher =& new TestProjectTaskMockShellDispatcher(); $this->Dispatcher->shellPaths = App::path('shells'); $this->Task =& new MockProjectTask($this->Dispatcher); @@ -69,9 +68,8 @@ function startTest() { * endTest method * * @return void - * @access public */ - function endTest() { + public function endTest() { ClassRegistry::flush(); $Folder =& new Folder($this->Task->path . 'bake_test_app'); @@ -95,9 +93,8 @@ function _setupTestProject() { * test bake() method and directory creation. * * @return void - * @access public */ - function testBake() { + public function testBake() { $this->_setupTestProject(); $path = $this->Task->path . 'bake_test_app'; @@ -117,9 +114,8 @@ function testBake() { * test bake() method with -empty flag, directory creation and empty files. * * @return void - * @access public */ - function testBakeEmptyFlag() { + public function testBakeEmptyFlag() { $this->Task->params['empty'] = true; $this->_setupTestProject(); $path = $this->Task->path . 'bake_test_app'; @@ -159,9 +155,8 @@ function testBakeEmptyFlag() { * test generation of Security.salt * * @return void - * @access public */ - function testSecuritySaltGeneration() { + public function testSecuritySaltGeneration() { $this->_setupTestProject(); $path = $this->Task->path . 'bake_test_app' . DS; @@ -177,9 +172,8 @@ function testSecuritySaltGeneration() { * test generation of Security.cipherSeed * * @return void - * @access public - */ - function testSecurityCipherSeedGeneration() { + */ + public function testSecurityCipherSeedGeneration() { $this->_setupTestProject(); $path = $this->Task->path . 'bake_test_app' . DS; @@ -195,9 +189,8 @@ function testSecurityCipherSeedGeneration() { * Test that index.php is generated correctly. * * @return void - * @access public */ - function testIndexPhpGeneration() { + public function testIndexPhpGeneration() { $this->_setupTestProject(); $path = $this->Task->path . 'bake_test_app' . DS; @@ -216,9 +209,8 @@ function testIndexPhpGeneration() { * test getPrefix method, and that it returns Routing.prefix or writes to config file. * * @return void - * @access public */ - function testGetPrefix() { + public function testGetPrefix() { Configure::write('Routing.prefixes', array('admin')); $result = $this->Task->getPrefix(); $this->assertEqual($result, 'admin_'); @@ -239,9 +231,8 @@ function testGetPrefix() { * test cakeAdmin() writing core.php * * @return void - * @access public */ - function testCakeAdmin() { + public function testCakeAdmin() { $file =& new File(CONFIGS . 'core.php'); $contents = $file->read();; $file =& new File(TMP . 'tests' . DS . 'core.php'); @@ -260,9 +251,8 @@ function testCakeAdmin() { * test getting the prefix with more than one prefix setup * * @return void - * @access public */ - function testGetPrefixWithMultiplePrefixes() { + public function testGetPrefixWithMultiplePrefixes() { Configure::write('Routing.prefixes', array('admin', 'ninja', 'shinobi')); $this->_setupTestProject(); $this->Task->configPath = $this->Task->path . 'bake_test_app' . DS . 'config' . DS; @@ -276,9 +266,8 @@ function testGetPrefixWithMultiplePrefixes() { * Test execute method with one param to destination folder. * * @return void - * @access public */ - function testExecute() { + public function testExecute() { $this->Task->params['skel'] = CAKE_CORE_INCLUDE_PATH . DS . CAKE . DS . 'console' . DS. 'templates' . DS . 'skel'; $this->Task->params['working'] = TMP . 'tests' . DS; diff --git a/cake/tests/cases/console/libs/tasks/template.test.php b/cake/tests/cases/console/libs/tasks/template.test.php index cc3d87950..8a8411f2e 100644 --- a/cake/tests/cases/console/libs/tasks/template.test.php +++ b/cake/tests/cases/console/libs/tasks/template.test.php @@ -57,9 +57,8 @@ class TemplateTaskTest extends CakeTestCase { * startTest method * * @return void - * @access public */ - function startTest() { + public function startTest() { $this->Dispatcher =& new TestTemplateTaskMockShellDispatcher(); $this->Task =& new MockTemplateTask($this->Dispatcher); $this->Task->Dispatch =& $this->Dispatcher; @@ -70,9 +69,8 @@ function startTest() { * endTest method * * @return void - * @access public */ - function endTest() { + public function endTest() { unset($this->Task, $this->Dispatcher); ClassRegistry::flush(); } @@ -81,9 +79,8 @@ function endTest() { * test that set sets variables * * @return void - * @access public */ - function testSet() { + public function testSet() { $this->Task->set('one', 'two'); $this->assertTrue(isset($this->Task->templateVars['one'])); $this->assertEqual($this->Task->templateVars['one'], 'two'); @@ -99,9 +96,8 @@ function testSet() { * test finding themes installed in * * @return void - * @access public */ - function testFindingInstalledThemesForBake() { + public function testFindingInstalledThemesForBake() { $consoleLibs = CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS; $this->Task->Dispatch->shellPaths = array($consoleLibs); $this->Task->initialize(); @@ -113,9 +109,8 @@ function testFindingInstalledThemesForBake() { * that the user is not bugged. If there are more, find and return the correct theme name * * @return void - * @access public */ - function testGetThemePath() { + public function testGetThemePath() { $defaultTheme = CAKE_CORE_INCLUDE_PATH . DS . dirname(CONSOLE_LIBS) . 'templates' . DS . 'default' .DS; $this->Task->templatePaths = array('default' => $defaultTheme); $this->Task->expectCallCount('in', 1); @@ -139,9 +134,8 @@ function testGetThemePath() { * test generate * * @return void - * @access public */ - function testGenerate() { + public function testGenerate() { App::build(array( 'shells' => array( TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS . 'shells' . DS @@ -159,9 +153,8 @@ function testGenerate() { * ensure fallback to default works. * * @return void - * @access public */ - function testGenerateWithTemplateFallbacks() { + public function testGenerateWithTemplateFallbacks() { App::build(array( 'shells' => array( TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS . 'shells' . DS, diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index 38ee3ec39..d25dfd46c 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -103,18 +103,16 @@ class TestTaskArticle extends Model { * Example public method * * @return void - * @access public */ - function doSomething() { + public function doSomething() { } /** * Example Secondary public method * * @return void - * @access public */ - function doSomethingElse() { + public function doSomethingElse() { } /** @@ -259,9 +257,8 @@ class TestTaskTest extends CakeTestCase { * startTest method * * @return void - * @access public */ - function startTest() { + public function startTest() { $this->Dispatcher =& new TestTestTaskMockShellDispatcher(); $this->Dispatcher->shellPaths = App::path('shells'); $this->Task =& new MockTestTask($this->Dispatcher); @@ -274,9 +271,8 @@ function startTest() { * endTest method * * @return void - * @access public */ - function endTest() { + public function endTest() { ClassRegistry::flush(); } @@ -284,9 +280,8 @@ function endTest() { * Test that file path generation doesn't continuously append paths. * * @return void - * @access public */ - function testFilePathGeneration() { + public function testFilePathGeneration() { $file = TESTS . 'cases' . DS . 'models' . DS . 'my_class.test.php'; $this->Task->Dispatch->expectNever('stderr'); @@ -320,9 +315,8 @@ function testMethodIntrospection() { * test that the generation of fixtures works correctly. * * @return void - * @access public */ - function testFixtureArrayGenerationFromModel() { + public function testFixtureArrayGenerationFromModel() { $subject = ClassRegistry::init('TestTaskArticle'); $result = $this->Task->generateFixtureList($subject); $expected = array('plugin.test_task.test_task_comment', 'app.articles_tags', @@ -335,9 +329,8 @@ function testFixtureArrayGenerationFromModel() { * test that the generation of fixtures works correctly. * * @return void - * @access public */ - function testFixtureArrayGenerationFromController() { + public function testFixtureArrayGenerationFromController() { $subject = new TestTaskCommentsController(); $result = $this->Task->generateFixtureList($subject); $expected = array('plugin.test_task.test_task_comment', 'app.articles_tags', @@ -350,9 +343,8 @@ function testFixtureArrayGenerationFromController() { * test user interaction to get object type * * @return void - * @access public */ - function testGetObjectType() { + public function testGetObjectType() { $this->Task->expectOnce('_stop'); $this->Task->setReturnValueAt(0, 'in', 'q'); $this->Task->getObjectType(); @@ -366,9 +358,8 @@ function testGetObjectType() { * creating test subjects should clear the registry so the registry is always fresh * * @return void - * @access public */ - function testRegistryClearWhenBuildingTestObjects() { + public function testRegistryClearWhenBuildingTestObjects() { ClassRegistry::flush(); $model = ClassRegistry::init('TestTaskComment'); $model->bindModel(array( @@ -391,9 +382,8 @@ function testRegistryClearWhenBuildingTestObjects() { * test that getClassName returns the user choice as a classname. * * @return void - * @access public */ - function testGetClassName() { + public function testGetClassName() { $objects = App::objects('model'); $skip = $this->skipIf(empty($objects), 'No models in app, this test will fail. %s'); if ($skip) { @@ -413,9 +403,8 @@ function testGetClassName() { * Test the user interaction for defining additional fixtures. * * @return void - * @access public */ - function testGetUserFixtures() { + public function testGetUserFixtures() { $this->Task->setReturnValueAt(0, 'in', 'y'); $this->Task->setReturnValueAt(1, 'in', 'app.pizza, app.topping, app.side_dish'); $result = $this->Task->getUserFixtures(); @@ -427,9 +416,8 @@ function testGetUserFixtures() { * test that resolving classnames works * * @return void - * @access public */ - function testGetRealClassname() { + public function testGetRealClassname() { $result = $this->Task->getRealClassname('Model', 'Post'); $this->assertEqual($result, 'Post'); @@ -451,9 +439,8 @@ function testGetRealClassname() { * as PHP4 classnames are all lower case, breaking the plugin path inflection. * * @return void - * @access public */ - function testBakeModelTest() { + public function testBakeModelTest() { $this->Task->setReturnValue('createFile', true); $this->Task->setReturnValue('isLoadableClass', true); @@ -485,9 +472,8 @@ function testBakeModelTest() { * causing issues with inflection of path name from classname. * * @return void - * @access public */ - function testBakeControllerTest() { + public function testBakeControllerTest() { $this->Task->setReturnValue('createFile', true); $this->Task->setReturnValue('isLoadableClass', true); @@ -519,9 +505,8 @@ function testBakeControllerTest() { * test Constructor generation ensure that constructClasses is called for controllers * * @return void - * @access public */ - function testGenerateConstructor() { + public function testGenerateConstructor() { $result = $this->Task->generateConstructor('controller', 'PostsController'); $expected = "new TestPostsController();\n\t\t\$this->Posts->constructClasses();\n"; $this->assertEqual($result, $expected); @@ -539,9 +524,8 @@ function testGenerateConstructor() { * Test that mock class generation works for the appropriate classes * * @return void - * @access public */ - function testMockClassGeneration() { + public function testMockClassGeneration() { $result = $this->Task->hasMockClass('controller'); $this->assertTrue($result); } @@ -550,9 +534,8 @@ function testMockClassGeneration() { * test bake() with a -plugin param * * @return void - * @access public */ - function testBakeWithPlugin() { + public function testBakeWithPlugin() { $this->Task->plugin = 'TestTest'; $path = APP . 'plugins' . DS . 'test_test' . DS . 'tests' . DS . 'cases' . DS . 'helpers' . DS . 'form.test.php'; @@ -564,9 +547,8 @@ function testBakeWithPlugin() { * Test filename generation for each type + plugins * * @return void - * @access public */ - function testTestCaseFileName() { + public function testTestCaseFileName() { $this->Task->path = '/my/path/tests/'; $result = $this->Task->testCaseFileName('Model', 'Post'); @@ -599,9 +581,8 @@ function testTestCaseFileName() { * test execute with a type defined * * @return void - * @access public */ - function testExecuteWithOneArg() { + public function testExecuteWithOneArg() { $this->Task->args[0] = 'Model'; $this->Task->setReturnValueAt(0, 'in', 'TestTaskTag'); $this->Task->setReturnValue('isLoadableClass', true); @@ -613,9 +594,8 @@ function testExecuteWithOneArg() { * test execute with type and class name defined * * @return void - * @access public */ - function testExecuteWithTwoArgs() { + public function testExecuteWithTwoArgs() { $this->Task->args = array('Model', 'TestTaskTag'); $this->Task->setReturnValueAt(0, 'in', 'TestTaskTag'); $this->Task->setReturnValue('isLoadableClass', true); diff --git a/cake/tests/cases/console/libs/tasks/view.test.php b/cake/tests/cases/console/libs/tasks/view.test.php index 89d0b02c5..2e089f83a 100644 --- a/cake/tests/cases/console/libs/tasks/view.test.php +++ b/cake/tests/cases/console/libs/tasks/view.test.php @@ -132,18 +132,16 @@ class ViewTaskCommentsController extends Controller { * Testing public controller action * * @return void - * @access public */ - function index() { + public function index() { } /** * Testing public controller action * * @return void - * @access public */ - function add() { + public function add() { } } @@ -167,63 +165,56 @@ class ViewTaskArticlesController extends Controller { * Test public controller action * * @return void - * @access public */ - function index() { + public function index() { } /** * Test public controller action * * @return void - * @access public */ - function add() { + public function add() { } /** * Test admin prefixed controller action * * @return void - * @access public */ - function admin_index() { + public function admin_index() { } /** * Test admin prefixed controller action * * @return void - * @access public */ - function admin_add() { + public function admin_add() { } /** * Test admin prefixed controller action * * @return void - * @access public */ - function admin_view() { + public function admin_view() { } /** * Test admin prefixed controller action * * @return void - * @access public */ - function admin_edit() { + public function admin_edit() { } /** * Test admin prefixed controller action * * @return void - * @access public */ - function admin_delete() { + public function admin_delete() { } } @@ -249,9 +240,8 @@ class ViewTaskTest extends CakeTestCase { * Ensure that the default theme is used * * @return void - * @access public */ - function startTest() { + public function startTest() { $this->Dispatcher =& new TestViewTaskMockShellDispatcher(); $this->Dispatcher->shellPaths = App::path('shells'); $this->Task =& new MockViewTask($this->Dispatcher); @@ -270,9 +260,8 @@ function startTest() { * endTest method * * @return void - * @access public */ - function endTest() { + public function endTest() { ClassRegistry::flush(); Configure::write('Routing', $this->_routing); } @@ -281,9 +270,8 @@ function endTest() { * Test getContent and parsing of Templates. * * @return void - * @access public */ - function testGetContent() { + public function testGetContent() { $vars = array( 'modelClass' => 'TestViewModel', 'schema' => array(), @@ -312,9 +300,8 @@ function testGetContent() { * test getContent() using an admin_prefixed action. * * @return void - * @access public */ - function testGetContentWithAdminAction() { + public function testGetContentWithAdminAction() { $_back = Configure::read('Routing'); Configure::write('Routing.prefixes', array('admin')); $vars = array( @@ -352,9 +339,8 @@ function testGetContentWithAdminAction() { * test Bake method * * @return void - * @access public */ - function testBake() { + public function testBake() { $this->Task->controllerName = 'ViewTaskComments'; $this->Task->controllerPath = 'view_task_comments'; @@ -378,9 +364,8 @@ function testBake() { * test bake() with a -plugin param * * @return void - * @access public */ - function testBakeWithPlugin() { + public function testBakeWithPlugin() { $this->Task->controllerName = 'ViewTaskComments'; $this->Task->controllerPath = 'view_task_comments'; $this->Task->plugin = 'TestTest'; @@ -394,9 +379,8 @@ function testBakeWithPlugin() { * test bake actions baking multiple actions. * * @return void - * @access public */ - function testBakeActions() { + public function testBakeActions() { $this->Task->controllerName = 'ViewTaskComments'; $this->Task->controllerPath = 'view_task_comments'; @@ -420,9 +404,8 @@ function testBakeActions() { * test baking a customAction (non crud) * * @return void - * @access public */ - function testCustomAction() { + public function testCustomAction() { $this->Task->controllerName = 'ViewTaskComments'; $this->Task->controllerPath = 'view_task_comments'; $this->Task->params['app'] = APP; @@ -439,9 +422,8 @@ function testCustomAction() { * Test all() * * @return void - * @access public */ - function testExecuteIntoAll() { + public function testExecuteIntoAll() { $this->Task->args[0] = 'all'; $this->Task->Controller->setReturnValue('listAll', array('view_task_comments')); @@ -458,9 +440,8 @@ function testExecuteIntoAll() { * Test all() with action parameter * * @return void - * @access public */ - function testExecuteIntoAllWithActionName() { + public function testExecuteIntoAllWithActionName() { $this->Task->args = array('all', 'index'); $this->Task->Controller->setReturnValue('listAll', array('view_task_comments')); @@ -476,9 +457,8 @@ function testExecuteIntoAllWithActionName() { * test `cake bake view $controller view` * * @return void - * @access public */ - function testExecuteWithActionParam() { + public function testExecuteWithActionParam() { $this->Task->args[0] = 'ViewTaskComments'; $this->Task->args[1] = 'view'; @@ -492,9 +472,8 @@ function testExecuteWithActionParam() { * Ensure that views are only baked for actions that exist in the controller. * * @return void - * @access public */ - function testExecuteWithController() { + public function testExecuteWithController() { $this->Task->args[0] = 'ViewTaskComments'; $this->Task->expectCallCount('createFile', 2); @@ -508,9 +487,8 @@ function testExecuteWithController() { * test that both plural and singular forms can be used for baking views. * * @return void - * @access public */ - function testExecuteWithControllerVariations() { + public function testExecuteWithControllerVariations() { $this->Task->args = array('ViewTaskComments'); $this->Task->expectAt(0, 'createFile', array(TMP . 'view_task_comments' . DS . 'index.ctp', '*')); @@ -529,9 +507,8 @@ function testExecuteWithControllerVariations() { * Which only bakes admin methods, not non-admin methods. * * @return void - * @access public */ - function testExecuteWithControllerAndAdminFlag() { + public function testExecuteWithControllerAndAdminFlag() { $_back = Configure::read('Routing'); Configure::write('Routing.prefixes', array('admin')); $this->Task->args[0] = 'ViewTaskArticles'; @@ -552,9 +529,8 @@ function testExecuteWithControllerAndAdminFlag() { * test execute into interactive. * * @return void - * @access public */ - function testExecuteInteractive() { + public function testExecuteInteractive() { $this->Task->connection = 'test_suite'; $this->Task->args = array(); $this->Task->params = array(); @@ -590,9 +566,8 @@ function testExecuteInteractive() { * test `cake bake view posts index list` * * @return void - * @access public */ - function testExecuteWithAlternateTemplates() { + public function testExecuteWithAlternateTemplates() { $this->Task->connection = 'test_suite'; $this->Task->args = array('ViewTaskComments', 'index', 'list'); $this->Task->params = array(); @@ -609,9 +584,8 @@ function testExecuteWithAlternateTemplates() { * test execute into interactive() with admin methods. * * @return void - * @access public */ - function testExecuteInteractiveWithAdmin() { + public function testExecuteInteractiveWithAdmin() { Configure::write('Routing.prefixes', array('admin')); $this->Task->connection = 'test_suite'; $this->Task->args = array(); diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index e83c03c6f..971dd21ed 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -59,9 +59,8 @@ function _invoke(&$controller, $params) { * * @param mixed $filename * @return void - * @access public */ - function cakeError($filename, $params) { + public function cakeError($filename, $params) { return array($filename, $params); } @@ -113,9 +112,8 @@ class MyPluginController extends MyPluginAppController { * index method * * @return void - * @access public */ - function index() { + public function index() { return true; } @@ -123,9 +121,8 @@ function index() { * add method * * @return void - * @access public */ - function add() { + public function add() { return true; } @@ -134,9 +131,8 @@ function add() { * * @param mixed $id * @return void - * @access public */ - function admin_add($id = null) { + public function admin_add($id = null) { return $id; } } @@ -170,9 +166,8 @@ class SomePagesController extends AppController { * * @param mixed $page * @return void - * @access public */ - function display($page = null) { + public function display($page = null) { return $page; } @@ -180,9 +175,8 @@ function display($page = null) { * index method * * @return void - * @access public */ - function index() { + public function index() { return true; } @@ -200,9 +194,8 @@ function _protected() { * redirect method overriding * * @return void - * @access public */ - function redirect() { + public function redirect() { echo 'this should not be accessible'; } } @@ -236,9 +229,8 @@ class OtherPagesController extends MyPluginAppController { * * @param mixed $page * @return void - * @access public */ - function display($page = null) { + public function display($page = null) { return $page; } @@ -246,9 +238,8 @@ function display($page = null) { * index method * * @return void - * @access public */ - function index() { + public function index() { return true; } } @@ -281,9 +272,8 @@ class TestDispatchPagesController extends AppController { * admin_index method * * @return void - * @access public */ - function admin_index() { + public function admin_index() { return true; } @@ -291,9 +281,8 @@ function admin_index() { * camelCased method * * @return void - * @access public */ - function camelCased() { + public function camelCased() { return true; } } @@ -335,9 +324,8 @@ class ArticlesTestController extends ArticlesTestAppController { * admin_index method * * @return void - * @access public */ - function admin_index() { + public function admin_index() { return true; } } @@ -378,9 +366,8 @@ class SomePostsController extends AppController { * beforeFilter method * * @return void - * @access public */ - function beforeFilter() { + public function beforeFilter() { if ($this->params['action'] == 'index') { $this->params['action'] = 'view'; } else { @@ -393,9 +380,8 @@ function beforeFilter() { * index method * * @return void - * @access public */ - function index() { + public function index() { return true; } @@ -403,9 +389,8 @@ function index() { * change method * * @return void - * @access public */ - function change() { + public function change() { return true; } } @@ -466,9 +451,8 @@ class TestCachedPagesController extends AppController { * index method * * @return void - * @access public */ - function index() { + public function index() { $this->render(); } @@ -476,9 +460,8 @@ function index() { * test_nocache_tags method * * @return void - * @access public */ - function test_nocache_tags() { + public function test_nocache_tags() { $this->render(); } @@ -486,9 +469,8 @@ function test_nocache_tags() { * view method * * @return void - * @access public */ - function view($id = null) { + public function view($id = null) { $this->render('index'); } /** @@ -530,9 +512,8 @@ class TimesheetsController extends AppController { * index method * * @return void - * @access public */ - function index() { + public function index() { return true; } } @@ -549,9 +530,8 @@ class DispatcherTest extends CakeTestCase { * setUp method * * @return void - * @access public */ - function startTest() { + public function startTest() { $this->_get = $_GET; $_GET = array(); $this->_post = $_POST; @@ -576,9 +556,8 @@ function startTest() { * tearDown method * * @return void - * @access public */ - function endTest() { + public function endTest() { $_GET = $this->_get; $_POST = $this->_post; $_FILES = $this->_files; @@ -593,9 +572,8 @@ function endTest() { * testParseParamsWithoutZerosAndEmptyPost method * * @return void - * @access public */ - function testParseParamsWithoutZerosAndEmptyPost() { + public function testParseParamsWithoutZerosAndEmptyPost() { $Dispatcher =& new Dispatcher(); $test = $Dispatcher->parseParams("/testcontroller/testaction/params1/params2/params3"); $this->assertIdentical($test['controller'], 'testcontroller'); @@ -610,9 +588,8 @@ function testParseParamsWithoutZerosAndEmptyPost() { * testParseParamsReturnsPostedData method * * @return void - * @access public */ - function testParseParamsReturnsPostedData() { + public function testParseParamsReturnsPostedData() { $_POST['testdata'] = "My Posted Content"; $Dispatcher =& new Dispatcher(); $test = $Dispatcher->parseParams("/"); @@ -624,9 +601,8 @@ function testParseParamsReturnsPostedData() { * testParseParamsWithSingleZero method * * @return void - * @access public */ - function testParseParamsWithSingleZero() { + public function testParseParamsWithSingleZero() { $Dispatcher =& new Dispatcher(); $test = $Dispatcher->parseParams("/testcontroller/testaction/1/0/23"); $this->assertIdentical($test['controller'], 'testcontroller'); @@ -640,9 +616,8 @@ function testParseParamsWithSingleZero() { * testParseParamsWithManySingleZeros method * * @return void - * @access public */ - function testParseParamsWithManySingleZeros() { + public function testParseParamsWithManySingleZeros() { $Dispatcher =& new Dispatcher(); $test = $Dispatcher->parseParams("/testcontroller/testaction/0/0/0/0/0/0"); $this->assertPattern('/\\A(?:0)\\z/', $test['pass'][0]); @@ -657,9 +632,8 @@ function testParseParamsWithManySingleZeros() { * testParseParamsWithManyZerosInEachSectionOfUrl method * * @return void - * @access public */ - function testParseParamsWithManyZerosInEachSectionOfUrl() { + public function testParseParamsWithManyZerosInEachSectionOfUrl() { $Dispatcher =& new Dispatcher(); $test = $Dispatcher->parseParams("/testcontroller/testaction/000/0000/00000/000000/000000/0000000"); $this->assertPattern('/\\A(?:000)\\z/', $test['pass'][0]); @@ -674,9 +648,8 @@ function testParseParamsWithManyZerosInEachSectionOfUrl() { * testParseParamsWithMixedOneToManyZerosInEachSectionOfUrl method * * @return void - * @access public */ - function testParseParamsWithMixedOneToManyZerosInEachSectionOfUrl() { + public function testParseParamsWithMixedOneToManyZerosInEachSectionOfUrl() { $Dispatcher =& new Dispatcher(); $test = $Dispatcher->parseParams("/testcontroller/testaction/01/0403/04010/000002/000030/0000400"); $this->assertPattern('/\\A(?:01)\\z/', $test['pass'][0]); @@ -691,9 +664,8 @@ function testParseParamsWithMixedOneToManyZerosInEachSectionOfUrl() { * testQueryStringOnRoot method * * @return void - * @access public */ - function testQueryStringOnRoot() { + public function testQueryStringOnRoot() { Router::reload(); Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home')); Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display')); @@ -721,9 +693,8 @@ function testQueryStringOnRoot() { * testFileUploadArrayStructure method * * @return void - * @access public */ - function testFileUploadArrayStructure() { + public function testFileUploadArrayStructure() { $_FILES = array('data' => array('name' => array( 'File' => array( array('data' => 'cake_mssql_patch.patch'), @@ -974,9 +945,8 @@ function testFileUploadArrayStructure() { * testGetUrl method * * @return void - * @access public */ - function testGetUrl() { + public function testGetUrl() { $Dispatcher =& new Dispatcher(); $Dispatcher->base = '/app/webroot/index.php'; $uri = '/app/webroot/index.php/posts/add'; @@ -1014,9 +984,8 @@ function testGetUrl() { * testBaseUrlAndWebrootWithModRewrite method * * @return void - * @access public */ - function testBaseUrlAndWebrootWithModRewrite() { + public function testBaseUrlAndWebrootWithModRewrite() { $Dispatcher =& new Dispatcher(); $Dispatcher->base = false; @@ -1090,9 +1059,8 @@ function testBaseUrlAndWebrootWithModRewrite() { * testBaseUrlwithModRewriteAlias method * * @return void - * @access public */ - function testBaseUrlwithModRewriteAlias() { + public function testBaseUrlwithModRewriteAlias() { $_SERVER['DOCUMENT_ROOT'] = '/home/aplusnur/public_html'; $_SERVER['SCRIPT_FILENAME'] = '/home/aplusnur/cake2/app/webroot/index.php'; $_SERVER['PHP_SELF'] = '/control/index.php'; @@ -1125,9 +1093,8 @@ function testBaseUrlwithModRewriteAlias() { * testBaseUrlAndWebrootWithBaseUrl method * * @return void - * @access public */ - function testBaseUrlAndWebrootWithBaseUrl() { + public function testBaseUrlAndWebrootWithBaseUrl() { $Dispatcher =& new Dispatcher(); Configure::write('App.dir', 'app'); @@ -1195,9 +1162,8 @@ function testBaseUrlAndWebrootWithBaseUrl() { * testBaseUrlAndWebrootWithBase method * * @return void - * @access public */ - function testBaseUrlAndWebrootWithBase() { + public function testBaseUrlAndWebrootWithBase() { $Dispatcher =& new Dispatcher(); $Dispatcher->base = '/app'; $result = $Dispatcher->baseUrl(); @@ -1226,9 +1192,8 @@ function testBaseUrlAndWebrootWithBase() { * testMissingController method * * @return void - * @access public */ - function testMissingController() { + public function testMissingController() { $Dispatcher =& new TestDispatcher(); Configure::write('App.baseUrl', '/index.php'); $url = 'some_controller/home/param:value/param2:value2'; @@ -1246,9 +1211,8 @@ function testMissingController() { * testPrivate method * * @return void - * @access public */ - function testPrivate() { + public function testPrivate() { $Dispatcher =& new TestDispatcher(); Configure::write('App.baseUrl','/index.php'); $url = 'some_pages/_protected/param:value/param2:value2'; @@ -1269,9 +1233,8 @@ function testPrivate() { * testMissingAction method * * @return void - * @access public */ - function testMissingAction() { + public function testMissingAction() { $Dispatcher =& new TestDispatcher(); Configure::write('App.baseUrl', '/index.php'); $url = 'some_pages/home/param:value/param2:value2'; @@ -1307,9 +1270,8 @@ function testMissingAction() { * testDispatch method * * @return void - * @access public */ - function testDispatch() { + public function testDispatch() { $Dispatcher =& new TestDispatcher(); Configure::write('App.baseUrl','/index.php'); $url = 'pages/home/param:value/param2:value2'; @@ -1364,9 +1326,8 @@ function testDispatch() { * testDispatchWithArray method * * @return void - * @access public */ - function testDispatchWithArray() { + public function testDispatchWithArray() { $Dispatcher =& new TestDispatcher(); Configure::write('App.baseUrl','/index.php'); $url = 'pages/home/param:value/param2:value2'; @@ -1384,9 +1345,8 @@ function testDispatchWithArray() { * testAdminDispatch method * * @return void - * @access public */ - function testAdminDispatch() { + public function testAdminDispatch() { $_POST = array(); $Dispatcher =& new TestDispatcher(); Configure::write('Routing.prefixes', array('admin')); @@ -1415,9 +1375,8 @@ function testAdminDispatch() { * testPluginDispatch method * * @return void - * @access public */ - function testPluginDispatch() { + public function testPluginDispatch() { $_POST = array(); $_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php'; @@ -1464,9 +1423,8 @@ function testPluginDispatch() { * testAutomaticPluginDispatch method * * @return void - * @access public */ - function testAutomaticPluginDispatch() { + public function testAutomaticPluginDispatch() { $_POST = array(); $_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php'; @@ -1502,9 +1460,8 @@ function testAutomaticPluginDispatch() { * testAutomaticPluginControllerDispatch method * * @return void - * @access public */ - function testAutomaticPluginControllerDispatch() { + public function testAutomaticPluginControllerDispatch() { $_POST = array(); $_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php'; @@ -1597,9 +1554,8 @@ function testAutomaticPluginControllerDispatch() { * plugin short form instead. * * @return void - * @access public */ - function testAutomaticPluginDispatchWithShortAccess() { + public function testAutomaticPluginDispatchWithShortAccess() { $_POST = array(); $_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php'; @@ -1704,9 +1660,8 @@ function testPluginShortCutUrlsWithControllerThatNeedsToBeLoaded() { * testAutomaticPluginControllerMissingActionDispatch method * * @return void - * @access public */ - function testAutomaticPluginControllerMissingActionDispatch() { + public function testAutomaticPluginControllerMissingActionDispatch() { $_POST = array(); $_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php'; @@ -1747,9 +1702,8 @@ function testAutomaticPluginControllerMissingActionDispatch() { * testPrefixProtection method * * @return void - * @access public */ - function testPrefixProtection() { + public function testPrefixProtection() { $_POST = array(); $_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php'; @@ -1776,9 +1730,8 @@ function testPrefixProtection() { * Test dispatching into the TestPlugin in the test_app * * @return void - * @access public */ - function testTestPluginDispatch() { + public function testTestPluginDispatch() { $Dispatcher =& new TestDispatcher(); App::build(array( 'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) @@ -1805,9 +1758,8 @@ function testTestPluginDispatch() { * testChangingParamsFromBeforeFilter method * * @return void - * @access public */ - function testChangingParamsFromBeforeFilter() { + public function testChangingParamsFromBeforeFilter() { $_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php'; $Dispatcher =& new TestDispatcher(); $url = 'some_posts/index/param:value/param2:value2'; @@ -1839,9 +1791,8 @@ function testChangingParamsFromBeforeFilter() { * testStaticAssets method * * @return void - * @access public */ - function testAssets() { + public function testAssets() { Router::reload(); $Configure =& Configure::getInstance(); $Configure->__objects = null; @@ -2004,9 +1955,8 @@ function testMissingAssetProcessor404() { * testFullPageCachingDispatch method * * @return void - * @access public */ - function testFullPageCachingDispatch() { + public function testFullPageCachingDispatch() { Configure::write('Cache.disable', false); Configure::write('Cache.check', true); Configure::write('debug', 2); @@ -2183,9 +2133,8 @@ function testCachedRegisteringViewObject() { * testHttpMethodOverrides method * * @return void - * @access public */ - function testHttpMethodOverrides() { + public function testHttpMethodOverrides() { Router::reload(); Router::mapResources('Posts'); @@ -2237,9 +2186,8 @@ function testHttpMethodOverrides() { * Tests that invalid characters cannot be injected into the application base path. * * @return void - * @access public */ - function testBasePathInjection() { + public function testBasePathInjection() { $self = $_SERVER['PHP_SELF']; $_SERVER['PHP_SELF'] = urldecode( "/index.php/%22%3E%3Ch1%20onclick=%22alert('xss');%22%3Eheya%3C/h1%3E" @@ -2255,9 +2203,8 @@ function testBasePathInjection() { * testEnvironmentDetection method * * @return void - * @access public */ - function testEnvironmentDetection() { + public function testEnvironmentDetection() { $dispatcher =& new Dispatcher(); $environments = array( @@ -2361,9 +2308,8 @@ function testEnvironmentDetection() { * Tests that the Dispatcher does not return an empty action * * @return void - * @access public */ - function testTrailingSlash() { + public function testTrailingSlash() { $_POST = array(); $_SERVER['PHP_SELF'] = '/cake/repo/branches/1.2.x.x/index.php'; diff --git a/cake/tests/cases/libs/cake_test_case.test.php b/cake/tests/cases/libs/cake_test_case.test.php index b138d7a76..0aab98a24 100644 --- a/cake/tests/cases/libs/cake_test_case.test.php +++ b/cake/tests/cases/libs/cake_test_case.test.php @@ -57,9 +57,8 @@ function setReporter(&$reporter) { * testDummy method * * @return void - * @access public */ - function testDummy() { + public function testDummy() { } } @@ -294,9 +293,8 @@ function testLoadFixtures() { * testGetTests Method * * @return void - * @access public */ - function testGetTests() { + public function testGetTests() { $result = $this->Case->getTests(); $this->assertEqual(array_slice($result, 0, 2), array('start', 'startCase')); $this->assertEqual(array_slice($result, -2), array('endCase', 'end')); diff --git a/cake/tests/cases/libs/code_coverage_manager.test.php b/cake/tests/cases/libs/code_coverage_manager.test.php index 2058c1fb5..4913e9a5a 100644 --- a/cake/tests/cases/libs/code_coverage_manager.test.php +++ b/cake/tests/cases/libs/code_coverage_manager.test.php @@ -31,9 +31,8 @@ class CodeCoverageManagerTest extends CakeTestCase { /** * Skip if XDebug not installed * - * @access public */ - function skip() { + public function skip() { $this->skipIf(!extension_loaded('xdebug'), '%s XDebug not installed'); } @@ -183,9 +182,8 @@ class Set extends Object { /** * Constructor. Defaults to an empty array. * - * @access public - */ - function __construct() { + */ + public function __construct() { if (func_num_args() == 1 && is_array(func_get_arg(0))) { \$this->value = func_get_arg(0); } else { @@ -197,9 +195,8 @@ function __construct() { * Returns the contents of the Set object * * @return array - * @access public - */ - function &get() { + */ + public function &get() { return \$this->value; } @@ -213,9 +210,8 @@ function &get() { * @param array \$arr1 Array to be merged * @param array \$arr2 Array to merge with * @return array Merged array - * @access public - */ - function merge(\$arr1, \$arr2 = null) { + */ + public function merge(\$arr1, \$arr2 = null) { \$args = func_get_args(); if (isset(\$this) && is_a(\$this, 'set')) { diff --git a/cake/tests/cases/libs/controller/component.test.php b/cake/tests/cases/libs/controller/component.test.php index 3e28b2f45..6b8d751ea 100644 --- a/cake/tests/cases/libs/controller/component.test.php +++ b/cake/tests/cases/libs/controller/component.test.php @@ -204,9 +204,8 @@ function initialize(&$controller, $settings) { * * @param Controller $controller * @return string - * @access public */ - function startup(&$controller) { + public function startup(&$controller) { $controller->foo = 'pass'; } } @@ -232,9 +231,8 @@ class BananaComponent extends Object { * * @param Controller $controller * @return string - * @access public */ - function startup(&$controller) { + public function startup(&$controller) { $controller->bar = 'fail'; } } @@ -569,9 +567,8 @@ function testSomethingReferencingEmailComponent() { * Test that SessionComponent doesn't get added if its already in the components array. * * @return void - * @access public */ - function testDoubleLoadingOfSessionComponent() { + public function testDoubleLoadingOfSessionComponent() { if ($this->skipIf(defined('APP_CONTROLLER_EXISTS'), '%s Need a non-existent AppController')) { return; } diff --git a/cake/tests/cases/libs/controller/components/email.test.php b/cake/tests/cases/libs/controller/components/email.test.php index 00eeab9aa..e17148ace 100755 --- a/cake/tests/cases/libs/controller/components/email.test.php +++ b/cake/tests/cases/libs/controller/components/email.test.php @@ -778,9 +778,8 @@ function testMultibyte() { * undocumented function * * @return void - * @access public */ - function testSendWithAttachments() { + public function testSendWithAttachments() { $this->Controller->EmailTest->to = 'postmaster@localhost'; $this->Controller->EmailTest->from = 'noreply@example.com'; $this->Controller->EmailTest->subject = 'Attachment Test'; @@ -804,9 +803,8 @@ function testSendWithAttachments() { * testSendAsIsNotIgnoredIfAttachmentsPresent method * * @return void - * @access public */ - function testSendAsIsNotIgnoredIfAttachmentsPresent() { + public function testSendAsIsNotIgnoredIfAttachmentsPresent() { $this->Controller->EmailTest->to = 'postmaster@localhost'; $this->Controller->EmailTest->from = 'noreply@example.com'; $this->Controller->EmailTest->subject = 'Attachment Test'; @@ -841,9 +839,8 @@ function testSendAsIsNotIgnoredIfAttachmentsPresent() { * testNoDoubleNewlinesInHeaders function * * @return void - * @access public */ - function testNoDoubleNewlinesInHeaders() { + public function testNoDoubleNewlinesInHeaders() { $this->Controller->EmailTest->to = 'postmaster@localhost'; $this->Controller->EmailTest->from = 'noreply@example.com'; $this->Controller->EmailTest->subject = 'Attachment Test'; diff --git a/cake/tests/cases/libs/controller/components/request_handler.test.php b/cake/tests/cases/libs/controller/components/request_handler.test.php index 046d619df..f2920d680 100644 --- a/cake/tests/cases/libs/controller/components/request_handler.test.php +++ b/cake/tests/cases/libs/controller/components/request_handler.test.php @@ -114,9 +114,8 @@ function __construct($params = array()) { * beforeFilter method * * @return void - * @access public */ - function beforeFilter() { + public function beforeFilter() { $this->RequestHandler->enabled = false; } } diff --git a/cake/tests/cases/libs/controller/components/security.test.php b/cake/tests/cases/libs/controller/components/security.test.php index 492352e88..180020fce 100644 --- a/cake/tests/cases/libs/controller/components/security.test.php +++ b/cake/tests/cases/libs/controller/components/security.test.php @@ -106,9 +106,8 @@ function redirect($option, $code, $exit) { * * @param string $status * @return void - * @access public */ - function header($status) { + public function header($status) { $this->testHeaders[] = $status; } } diff --git a/cake/tests/cases/libs/controller/components/session.test.php b/cake/tests/cases/libs/controller/components/session.test.php index 5a303e6f6..a5e678cf9 100644 --- a/cake/tests/cases/libs/controller/components/session.test.php +++ b/cake/tests/cases/libs/controller/components/session.test.php @@ -40,9 +40,8 @@ class SessionTestController extends Controller { * session_id method * * @return string - * @access public */ - function session_id() { + public function session_id() { return $this->Session->id(); } } @@ -67,9 +66,8 @@ class OrangeSessionTestController extends Controller { * session_id method * * @return string - * @access public */ - function session_id() { + public function session_id() { return $this->Session->id(); } } diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index 23693941c..d3c11b5d3 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -249,9 +249,8 @@ class ControllerPaginateModel extends CakeTestModel { * paginate method * * @return void - * @access public */ - function paginate($conditions, $fields, $order, $limit, $page, $recursive, $extra) { + public function paginate($conditions, $fields, $order, $limit, $page, $recursive, $extra) { $this->extra = $extra; } @@ -669,9 +668,8 @@ function testPaginateExtraParams() { * testPaginatePassedArgs method * * @return void - * @access public */ - function testPaginatePassedArgs() { + public function testPaginatePassedArgs() { $Controller =& new Controller(); $Controller->uses = array('ControllerPost'); $Controller->passedArgs[] = array('1', '2', '3'); diff --git a/cake/tests/cases/libs/folder.test.php b/cake/tests/cases/libs/folder.test.php index 1b9e8cb3b..4e65a53c9 100644 --- a/cake/tests/cases/libs/folder.test.php +++ b/cake/tests/cases/libs/folder.test.php @@ -214,9 +214,8 @@ function testOperations() { * testChmod method * * @return void - * @access public */ - function testChmod() { + public function testChmod() { $this->skipIf(DIRECTORY_SEPARATOR === '\\', '%s Folder permissions tests not supported on Windows'); $path = TEST_CAKE_CORE_INCLUDE_PATH . 'console' . DS . 'templates' . DS . 'skel'; diff --git a/cake/tests/cases/libs/inflector.test.php b/cake/tests/cases/libs/inflector.test.php index 12c318a6b..4b5ee6f34 100644 --- a/cake/tests/cases/libs/inflector.test.php +++ b/cake/tests/cases/libs/inflector.test.php @@ -262,9 +262,8 @@ function testInflectorSlugWithMapOverridingDefault() { * testInflectorUnderscore method * * @return void - * @access public */ - function testInflectorUnderscore() { + public function testInflectorUnderscore() { $this->assertIdentical(Inflector::underscore('TestThing'), 'test_thing'); $this->assertIdentical(Inflector::underscore('testThing'), 'test_thing'); $this->assertIdentical(Inflector::underscore('TestThingExtra'), 'test_thing_extra'); diff --git a/cake/tests/cases/libs/magic_db.test.php b/cake/tests/cases/libs/magic_db.test.php index 344554530..4a85a7fe9 100644 --- a/cake/tests/cases/libs/magic_db.test.php +++ b/cake/tests/cases/libs/magic_db.test.php @@ -37,17 +37,15 @@ class MagicDbTest extends UnitTestCase { /** * Sets up a MagicDb class instance for testing * - * @access public */ - function setUp() { + public function setUp() { $this->Db =& new MagicDb(); } /** * MagicDb::analyze should properly detect the file type and output additional info as requested. * - * @access public */ - function testAnalyze() { + public function testAnalyze() { $r = $this->Db->read(MagicDbTestData::get('magic.db')); $this->assertTrue($r === true); @@ -61,9 +59,8 @@ function testAnalyze() { * MagicDb::read should properly read MagicDb databases from .php-/.db-files and plain data arguments passed in and return false if the file wasn't found or * if the readed data did not validate. * - * @access public */ - function testRead() { + public function testRead() { $this->Db->db = array(); $r = $this->Db->read(true); @@ -99,9 +96,8 @@ function testRead() { /** * MagicDb::toArray should either return the MagicDb::db property, or the parsed array data if a magic.db dump is passed in as the first argument * - * @access public */ - function testToArray() { + public function testToArray() { $this->Db->db = array(); $r = $this->Db->toArray(); @@ -125,9 +121,8 @@ function testToArray() { /** * The MagicDb::validates function should return if the array passed to it or the local db property contains a valid MagicDb record set * - * @access public */ - function testValidates() { + public function testValidates() { $r = $this->Db->validates(array()); $this->assertTrue($r === false); @@ -174,9 +169,8 @@ class MagicDbTestData extends Object { * Returns the test data for a given key * * @param string $key - * @access public */ - function get($key) { + public function get($key) { /** * data property * diff --git a/cake/tests/cases/libs/model/behaviors/acl.test.php b/cake/tests/cases/libs/model/behaviors/acl.test.php index cd97d901d..fd891208e 100644 --- a/cake/tests/cases/libs/model/behaviors/acl.test.php +++ b/cake/tests/cases/libs/model/behaviors/acl.test.php @@ -84,9 +84,8 @@ class AclPerson extends CakeTestModel { * parentNode method * * @return void - * @access public */ - function parentNode() { + public function parentNode() { if (!$this->id && empty($this->data)) { return null; } @@ -137,9 +136,8 @@ class AclUser extends CakeTestModel { /** * parentNode * - * @access public */ - function parentNode() { + public function parentNode() { return null; } } @@ -179,9 +177,8 @@ class AclPost extends CakeTestModel { /** * parentNode * - * @access public */ - function parentNode() { + public function parentNode() { return null; } } @@ -222,9 +219,8 @@ class AclBehaviorTestCase extends CakeTestCase { * Set up the test * * @return void - * @access public */ - function startTest() { + public function startTest() { Configure::write('Acl.database', 'test_suite'); $this->Aco =& new Aco(); @@ -235,9 +231,8 @@ function startTest() { * tearDown method * * @return void - * @access public */ - function tearDown() { + public function tearDown() { ClassRegistry::flush(); unset($this->Aro, $this->Aco); } @@ -246,9 +241,8 @@ function tearDown() { * Test Setup of AclBehavior * * @return void - * @access public */ - function testSetup() { + public function testSetup() { $User =& new AclUser(); $this->assertTrue(isset($User->Behaviors->Acl->settings['User'])); $this->assertEqual($User->Behaviors->Acl->settings['User']['type'], 'requester'); @@ -264,9 +258,8 @@ function testSetup() { * test After Save * * @return void - * @access public */ - function testAfterSave() { + public function testAfterSave() { $Post =& new AclPost(); $data = array( 'Post' => array( @@ -336,9 +329,8 @@ function testAfterSave() { * Test After Delete * * @return void - * @access public */ - function testAfterDelete() { + public function testAfterDelete() { $aroData = array( 'Aro' => array( 'model' => 'AclPerson', @@ -390,9 +382,8 @@ function testAfterDelete() { * Test Node() * * @return void - * @access public */ - function testNode() { + public function testNode() { $Person =& new AclPerson(); $aroData = array( 'Aro' => array( diff --git a/cake/tests/cases/libs/model/behaviors/containable.test.php b/cake/tests/cases/libs/model/behaviors/containable.test.php index ab5ecbf9f..c048bc6b8 100644 --- a/cake/tests/cases/libs/model/behaviors/containable.test.php +++ b/cake/tests/cases/libs/model/behaviors/containable.test.php @@ -42,9 +42,8 @@ class ContainableBehaviorTest extends CakeTestCase { /** * Method executed before each test * - * @access public */ - function startTest() { + public function startTest() { $this->User =& ClassRegistry::init('User'); $this->Article =& ClassRegistry::init('Article'); $this->Tag =& ClassRegistry::init('Tag'); @@ -67,9 +66,8 @@ function startTest() { /** * Method executed after each test * - * @access public */ - function endTest() { + public function endTest() { unset($this->Article); unset($this->User); unset($this->Tag); @@ -3330,9 +3328,8 @@ function testOriginalAssociations() { /** * testResetAddedAssociation method * - * @access public */ - function testResetAddedAssociation() { + public function testResetAddedAssociation() { $this->assertTrue(empty($this->Article->hasMany['ArticlesTag'])); $this->Article->bindModel(array( @@ -3356,9 +3353,8 @@ function testResetAddedAssociation() { /** * testResetAssociation method * - * @access public */ - function testResetAssociation() { + public function testResetAssociation() { $this->Article->Behaviors->attach('Containable'); $this->Article->Comment->Behaviors->attach('Containable'); $this->Article->User->Behaviors->attach('Containable'); @@ -3388,9 +3384,8 @@ function testResetAssociation() { /** * testResetDeeperHasOneAssociations method * - * @access public */ - function testResetDeeperHasOneAssociations() { + public function testResetDeeperHasOneAssociations() { $this->Article->User->unbindModel(array( 'hasMany' => array('ArticleFeatured', 'Comment') ), false); @@ -3449,9 +3444,8 @@ function testResetDeeperHasOneAssociations() { /** * testResetMultipleHabtmAssociations method * - * @access public */ - function testResetMultipleHabtmAssociations() { + public function testResetMultipleHabtmAssociations() { $articleHabtm = array( 'hasAndBelongsToMany' => array( 'Tag' => array( diff --git a/cake/tests/cases/libs/model/behaviors/tree.test.php b/cake/tests/cases/libs/model/behaviors/tree.test.php index b39c957fe..eadc085a0 100644 --- a/cake/tests/cases/libs/model/behaviors/tree.test.php +++ b/cake/tests/cases/libs/model/behaviors/tree.test.php @@ -965,9 +965,8 @@ function testRemoveLastTopParent() { * testRemoveNoChildren method * * @return void - * @access public */ - function testRemoveNoChildren() { + public function testRemoveNoChildren() { extract($this->settings); $this->Tree =& new $modelClass(); $this->Tree->initialize(2, 2); @@ -1033,9 +1032,8 @@ function testRemoveAndDelete() { * testRemoveAndDeleteNoChildren method * * @return void - * @access public */ - function testRemoveAndDeleteNoChildren() { + public function testRemoveAndDeleteNoChildren() { extract($this->settings); $this->Tree =& new $modelClass(); $this->Tree->initialize(2, 2); @@ -1508,9 +1506,8 @@ function testTranslatingTree() { * testGenerateTreeListWithSelfJoin method * * @return void - * @access public */ - function testAliasesWithScopeInTwoTreeAssociations() { + public function testAliasesWithScopeInTwoTreeAssociations() { extract($this->settings); $this->Tree =& new $modelClass(); $this->Tree->initialize(2, 2); @@ -1672,9 +1669,8 @@ class UuidTreeTest extends NumberTreeTest { * testMovePromote method * * @return void - * @access public */ - function testMovePromote() { + public function testMovePromote() { extract($this->settings); $this->Tree =& new $modelClass(); $this->Tree->initialize(2, 2); @@ -1699,9 +1695,8 @@ function testMovePromote() { * testMoveWithWhitelist method * * @return void - * @access public */ - function testMoveWithWhitelist() { + public function testMoveWithWhitelist() { extract($this->settings); $this->Tree =& new $modelClass(); $this->Tree->initialize(2, 2); @@ -1727,9 +1722,8 @@ function testMoveWithWhitelist() { * testRemoveNoChildren method * * @return void - * @access public */ - function testRemoveNoChildren() { + public function testRemoveNoChildren() { extract($this->settings); $this->Tree =& new $modelClass(); $this->Tree->initialize(2, 2); @@ -1762,9 +1756,8 @@ function testRemoveNoChildren() { * testRemoveAndDeleteNoChildren method * * @return void - * @access public */ - function testRemoveAndDeleteNoChildren() { + public function testRemoveAndDeleteNoChildren() { extract($this->settings); $this->Tree =& new $modelClass(); $this->Tree->initialize(2, 2); @@ -1795,9 +1788,8 @@ function testRemoveAndDeleteNoChildren() { * testChildren method * * @return void - * @access public */ - function testChildren() { + public function testChildren() { extract($this->settings); $this->Tree =& new $modelClass(); $this->Tree->initialize(2, 2); @@ -1824,9 +1816,8 @@ function testChildren() { * testNoAmbiguousColumn method * * @return void - * @access public */ - function testNoAmbiguousColumn() { + public function testNoAmbiguousColumn() { extract($this->settings); $this->Tree =& new $modelClass(); $this->Tree->initialize(2, 2); @@ -1858,9 +1849,8 @@ function testNoAmbiguousColumn() { * testGenerateTreeListWithSelfJoin method * * @return void - * @access public */ - function testGenerateTreeListWithSelfJoin() { + public function testGenerateTreeListWithSelfJoin() { extract($this->settings); $this->Tree =& new $modelClass(); $this->Tree->bindModel(array('belongsTo' => array('Dummy' => diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php index b4c6aa456..4716b53a9 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php @@ -299,9 +299,8 @@ class DboMssqlTest extends CakeTestCase { /** * Skip if cannot connect to mssql * - * @access public */ - function skip() { + public function skip() { $this->_initDb(); $this->skipUnless($this->db->config['driver'] == 'mssql', '%s SQL Server connection not available'); } @@ -309,9 +308,8 @@ function skip() { /** * Make sure all fixtures tables are being created * - * @access public */ - function start() { + public function start() { $this->db->simulate = false; parent::start(); $this->db->simulate = true; @@ -319,9 +317,8 @@ function start() { /** * Make sure all fixtures tables are being dropped * - * @access public */ - function end() { + public function end() { $this->db->simulate = false; parent::end(); $this->db->simulate = true; @@ -329,9 +326,8 @@ function end() { /** * Sets up a Dbo class instance for testing * - * @access public */ - function setUp() { + public function setUp() { $db = ConnectionManager::getDataSource('test_suite'); $this->db = new DboMssqlTestDb($db->config); $this->model = new MssqlTestModel(); @@ -496,9 +492,8 @@ function testDescribe() { * testBuildColumn * * @return unknown_type - * @access public */ - function testBuildColumn() { + public function testBuildColumn() { $column = array('name' => 'id', 'type' => 'integer', 'null' => '', 'default' => '', 'length' => '8', 'key' => 'primary'); $result = $this->db->buildColumn($column); $expected = '[id] int IDENTITY (1, 1) NOT NULL'; @@ -554,9 +549,8 @@ function testBuildColumn() { * testBuildIndex method * * @return void - * @access public */ - function testBuildIndex() { + public function testBuildIndex() { $indexes = array( 'PRIMARY' => array('column' => 'id', 'unique' => 1), 'client_id' => array('column' => 'client_id', 'unique' => 1) @@ -581,9 +575,8 @@ function testBuildIndex() { * testUpdateAllSyntax method * * @return void - * @access public */ - function testUpdateAllSyntax() { + public function testUpdateAllSyntax() { $fields = array('MssqlTestModel.client_id' => '[MssqlTestModel].[client_id] + 1'); $conditions = array('MssqlTestModel.updated <' => date('2009-01-01 00:00:00')); $this->db->update($this->model, $fields, null, $conditions); @@ -598,9 +591,8 @@ function testUpdateAllSyntax() { * testGetPrimaryKey method * * @return void - * @access public */ - function testGetPrimaryKey() { + public function testGetPrimaryKey() { // When param is a model $result = $this->db->getPrimaryKey($this->model); $this->assertEqual($result, 'id'); @@ -622,9 +614,8 @@ function testGetPrimaryKey() { * testInsertMulti * * @return void - * @access public */ - function testInsertMulti() { + public function testInsertMulti() { $fields = array('id', 'name', 'login'); $values = array('(1, \'Larry\', \'PhpNut\')', '(2, \'Renan\', \'renan.saddam\')'); $this->db->simulated = array(); @@ -653,9 +644,8 @@ function testInsertMulti() { * testLastError * * @return void - * @access public */ - function testLastError() { + public function testLastError() { $debug = Configure::read('debug'); Configure::write('debug', 0); diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php index 580a31ee0..525028c9d 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php @@ -172,9 +172,8 @@ class DboMysqlTest extends CakeTestCase { /** * Skip if cannot connect to mysql * - * @access public */ - function skip() { + public function skip() { $this->_initDb(); $this->skipUnless($this->db->config['driver'] == 'mysql', '%s MySQL connection not available'); } @@ -182,9 +181,8 @@ function skip() { /** * Sets up a Dbo class instance for testing * - * @access public */ - function startTest() { + public function startTest() { $db = ConnectionManager::getDataSource('test_suite'); $this->model = new MysqlTestModel(); } @@ -192,9 +190,8 @@ function startTest() { /** * Sets up a Dbo class instance for testing * - * @access public */ - function tearDown() { + public function tearDown() { unset($this->model); ClassRegistry::flush(); } @@ -221,9 +218,8 @@ function endCase() { /** * Test Dbo value method * - * @access public */ - function testQuoting() { + public function testQuoting() { $result = $this->db->fields($this->model); $expected = array( '`MysqlTestModel`.`id`', @@ -320,9 +316,8 @@ function testTinyintCasting() { * testIndexDetection method * * @return void - * @access public */ - function testIndexDetection() { + public function testIndexDetection() { $this->db->cacheSources = false; $name = $this->db->fullTableName('simple'); @@ -513,9 +508,8 @@ function testIndexOnMySQL4Output() { * testColumn method * * @return void - * @access public */ - function testColumn() { + public function testColumn() { $result = $this->db->column('varchar(50)'); $expected = 'string'; $this->assertEqual($result, $expected); diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php index 6f2163e02..b75b8005a 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php @@ -145,9 +145,8 @@ class DboMysqliTest extends CakeTestCase { /** * Skip if cannot connect to mysqli * - * @access public */ - function skip() { + public function skip() { $this->_initDb(); $this->skipUnless($this->db->config['driver'] == 'mysqli', '%s MySQLi connection not available'); } @@ -155,18 +154,16 @@ function skip() { /** * Sets up a Dbo class instance for testing * - * @access public */ - function setUp() { + public function setUp() { $this->model = new MysqliTestModel(); } /** * Sets up a Dbo class instance for testing * - * @access public */ - function tearDown() { + public function tearDown() { unset($this->model); ClassRegistry::flush(); } @@ -175,9 +172,8 @@ function tearDown() { * testIndexDetection method * * @return void - * @access public */ - function testIndexDetection() { + public function testIndexDetection() { $this->db->cacheSources = false; $name = $this->db->fullTableName('simple'); @@ -238,9 +234,8 @@ function testIndexDetection() { * testColumn method * * @return void - * @access public */ - function testColumn() { + public function testColumn() { $result = $this->db->column('varchar(50)'); $expected = 'string'; $this->assertEqual($result, $expected); @@ -286,9 +281,8 @@ function testColumn() { * test transaction commands. * * @return void - * @access public */ - function testTransactions() { + public function testTransactions() { $this->db->testing = false; $result = $this->db->begin($this->model); $this->assertTrue($result); diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php index cbabaf5ab..fef8dd2d4 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php @@ -240,9 +240,8 @@ class DboPostgresTest extends CakeTestCase { /** * Skip if cannot connect to postgres * - * @access public */ - function skip() { + public function skip() { $this->_initDb(); $this->skipUnless($this->db->config['driver'] == 'postgres', '%s PostgreSQL connection not available'); } @@ -250,18 +249,16 @@ function skip() { /** * Set up test suite database connection * - * @access public */ - function startTest() { + public function startTest() { $this->_initDb(); } /** * Sets up a Dbo class instance for testing * - * @access public */ - function setUp() { + public function setUp() { Configure::write('Cache.disable', true); $this->startTest(); $this->db =& ConnectionManager::getDataSource('test_suite'); @@ -272,9 +269,8 @@ function setUp() { /** * Sets up a Dbo class instance for testing * - * @access public */ - function tearDown() { + public function tearDown() { Configure::write('Cache.disable', false); unset($this->db2); } @@ -282,9 +278,8 @@ function tearDown() { /** * Test field quoting method * - * @access public */ - function testFieldQuoting() { + public function testFieldQuoting() { $fields = array( '"PostgresTestModel"."id" AS "PostgresTestModel__id"', '"PostgresTestModel"."client_id" AS "PostgresTestModel__client_id"', @@ -558,9 +553,8 @@ function testSchemaIndexSyntax() { * Check that the create statement for a schema generated table is the same as the original sql * * @return void - * @access public */ - function testCakeSchema() { + public function testCakeSchema() { $db1 =& ConnectionManager::getDataSource('test_suite'); $db1->cacheSources = false; $db1->reconnect(array('persistent' => false)); diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php index db77fdf24..b190bd387 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php @@ -101,9 +101,8 @@ class DboSqliteTest extends CakeTestCase { /** * Skip if cannot connect to SQLite * - * @access public */ - function skip() { + public function skip() { $this->_initDb(); $this->skipUnless($this->db->config['driver'] == 'sqlite', '%s SQLite connection not available'); } @@ -111,18 +110,16 @@ function skip() { /** * Set up test suite database connection * - * @access public */ - function startTest() { + public function startTest() { $this->_initDb(); } /** * Sets up a Dbo class instance for testing * - * @access public */ - function setUp() { + public function setUp() { Configure::write('Cache.disable', true); $this->startTest(); $this->db =& ConnectionManager::getDataSource('test_suite'); @@ -132,9 +129,8 @@ function setUp() { /** * Sets up a Dbo class instance for testing * - * @access public */ - function tearDown() { + public function tearDown() { Configure::write('Cache.disable', false); unset($this->db2); } @@ -142,9 +138,8 @@ function tearDown() { /** * Tests that SELECT queries from DboSqlite::listSources() are not cached * - * @access public */ - function testTableListCacheDisabling() { + public function testTableListCacheDisabling() { $this->assertFalse(in_array('foo_test', $this->db->listSources())); $this->db->query('CREATE TABLE foo_test (test VARCHAR(255));'); @@ -189,9 +184,8 @@ function testIndex() { /** * Tests that cached table descriptions are saved under the sanitized key name * - * @access public */ - function testCacheKeyName() { + public function testCacheKeyName() { Configure::write('Cache.disable', false); $dbName = 'db' . rand() . '$(*%&).db'; diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index c87476e12..4a3d840bd 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -3482,9 +3482,8 @@ function testOrderParsing() { * testComplexSortExpression method * * @return void - * @access public */ - function testComplexSortExpression() { + public function testComplexSortExpression() { $result = $this->testDb->order(array('(Model.field > 100) DESC', 'Model.field ASC')); $this->assertPattern("/^\s*ORDER BY\s+\(`Model`\.`field`\s+>\s+100\)\s+DESC,\s+`Model`\.`field`\s+ASC\s*$/", $result); } diff --git a/cake/tests/cases/libs/model/model_behavior.test.php b/cake/tests/cases/libs/model/model_behavior.test.php index 89adf248f..57fb138cd 100644 --- a/cake/tests/cases/libs/model/model_behavior.test.php +++ b/cake/tests/cases/libs/model/model_behavior.test.php @@ -1054,9 +1054,8 @@ function testBehaviorTrigger() { * undocumented function * * @return void - * @access public */ - function testBindModelCallsInBehaviors() { + public function testBindModelCallsInBehaviors() { $this->loadFixtures('Article', 'Comment'); // hasMany diff --git a/cake/tests/cases/libs/model/model_read.test.php b/cake/tests/cases/libs/model/model_read.test.php index 49e1f39fe..978352e67 100755 --- a/cake/tests/cases/libs/model/model_read.test.php +++ b/cake/tests/cases/libs/model/model_read.test.php @@ -3505,9 +3505,8 @@ function testFindAllThreaded() { * test find('neighbors') * * @return void - * @access public */ - function testFindNeighbors() { + public function testFindNeighbors() { $this->loadFixtures('User', 'Article'); $TestModel =& new Article(); @@ -5379,9 +5378,8 @@ function testFindAllRecursiveSelfJoin() { * testFindAllRecursiveWithHabtm method * * @return void - * @access public */ - function testFindAllRecursiveWithHabtm() { + public function testFindAllRecursiveWithHabtm() { $this->loadFixtures( 'MyCategoriesMyUsers', 'MyCategoriesMyProducts', diff --git a/cake/tests/cases/libs/model/model_write.test.php b/cake/tests/cases/libs/model/model_write.test.php index 5a06db1fc..8a335a5dd 100644 --- a/cake/tests/cases/libs/model/model_write.test.php +++ b/cake/tests/cases/libs/model/model_write.test.php @@ -167,9 +167,8 @@ function testAutoSaveUuid() { * x sql error: "Column id specified twice") * * @return void - * @access public */ - function testSaveUuidNull() { + public function testSaveUuidNull() { // SQLite does not support non-integer primary keys $this->skipIf($this->db->config['driver'] == 'sqlite'); @@ -508,9 +507,8 @@ function testCounterCacheWithNonstandardPrimaryKey() { * test Counter Cache With Self Joining table * * @return void - * @access public */ - function testCounterCacheWithSelfJoin() { + public function testCounterCacheWithSelfJoin() { $skip = $this->skipIf( ($this->db->config['driver'] == 'sqlite'), 'SQLite 2.x does not support ALTER TABLE ADD COLUMN' diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 57b450434..3b0713c10 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -1858,9 +1858,8 @@ function testRegexRouteMatching() { * testStripPlugin * * @return void - * @access public */ - function testStripPlugin() { + public function testStripPlugin() { $pluginName = 'forums'; $url = 'example.com/' . $pluginName . '/'; $expected = 'example.com'; @@ -1875,9 +1874,8 @@ function testStripPlugin() { * This test needs some improvement and actual requestAction() usage * * @return void - * @access public */ - function testCurrentRoute() { + public function testCurrentRoute() { $url = array('controller' => 'pages', 'action' => 'display', 'government'); Router::connect('/government', $url); Router::parse('/government'); @@ -1888,9 +1886,8 @@ function testCurrentRoute() { * testRequestRoute * * @return void - * @access public */ - function testRequestRoute() { + public function testRequestRoute() { $url = array('controller' => 'products', 'action' => 'display', 5); Router::connect('/government', $url); Router::parse('/government'); @@ -1915,9 +1912,8 @@ function testRequestRoute() { * testGetParams * * @return void - * @access public */ - function testGetParams() { + public function testGetParams() { $paths = array('base' => '/', 'here' => '/products/display/5', 'webroot' => '/webroot'); $params = array('param1' => '1', 'param2' => '2'); Router::setRequestInfo(array($params, $paths)); diff --git a/cake/tests/cases/libs/test_manager.test.php b/cake/tests/cases/libs/test_manager.test.php index 6dd59b4ae..5191f8ff0 100644 --- a/cake/tests/cases/libs/test_manager.test.php +++ b/cake/tests/cases/libs/test_manager.test.php @@ -32,9 +32,8 @@ class TestManagerTest extends CakeTestCase { * setUp method * * @return void - * @access public */ - function setUp() { + public function setUp() { $this->TestManager =& new TestManager(); $this->Reporter =& new CakeHtmlReporter(); } @@ -43,9 +42,8 @@ function setUp() { * testRunAllTests method * * @return void - * @access public */ - function testRunAllTests() { + public function testRunAllTests() { $folder =& new Folder($this->TestManager->_getTestsPath()); $extension = str_replace('.', '\.', $this->TestManager->getExtension('test')); $out = $folder->findRecursive('.*' . $extension); @@ -60,9 +58,8 @@ function testRunAllTests() { * testRunTestCase method * * @return void - * @access public */ - function testRunTestCase() { + public function testRunTestCase() { $file = md5(time()); $result = $this->TestManager->runTestCase($file, $this->Reporter); $this->assertError('Test case ' . $file . ' cannot be found'); @@ -77,45 +74,40 @@ function testRunTestCase() { * testRunGroupTest method * * @return void - * @access public */ - function testRunGroupTest() { + public function testRunGroupTest() { } /** * testAddTestCasesFromDirectory method * * @return void - * @access public */ - function testAddTestCasesFromDirectory() { + public function testAddTestCasesFromDirectory() { } /** * testAddTestFile method * * @return void - * @access public */ - function testAddTestFile() { + public function testAddTestFile() { } /** * testGetTestCaseList method * * @return void - * @access public */ - function testGetTestCaseList() { + public function testGetTestCaseList() { } /** * testGetGroupTestList method * * @return void - * @access public */ - function testGetGroupTestList() { + public function testGetGroupTestList() { } } ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/validation.test.php b/cake/tests/cases/libs/validation.test.php index f96abe139..b708d7742 100644 --- a/cake/tests/cases/libs/validation.test.php +++ b/cake/tests/cases/libs/validation.test.php @@ -32,9 +32,8 @@ class CustomValidator { * * @param string $email * @return boolean - * @access public */ - function customValidate($check) { + public function customValidate($check) { return preg_match('/^[0-9]{3}$/', $check); } } @@ -145,9 +144,8 @@ function testNotEmpty() { * testNotEmptyISO88591Encoding method * * @return void - * @access public */ - function testNotEmptyISO88591AppEncoding() { + public function testNotEmptyISO88591AppEncoding() { Configure::write('App.encoding', 'ISO-8859-1'); $this->assertTrue(Validation::notEmpty('abcdefg')); $this->assertTrue(Validation::notEmpty('fasdf ')); @@ -1783,9 +1781,8 @@ function testIpv6() { * testIpBoth method * * @return void - * @access public */ - function testIpBoth() { + public function testIpBoth() { $this->assertTrue(Validation::ip('0.0.0.0')); $this->assertTrue(Validation::ip('192.168.1.156')); $this->assertTrue(Validation::ip('255.255.255.255')); diff --git a/cake/tests/cases/libs/view/helpers/cache.test.php b/cake/tests/cases/libs/view/helpers/cache.test.php index b8dfdc376..d8281702f 100644 --- a/cake/tests/cases/libs/view/helpers/cache.test.php +++ b/cake/tests/cases/libs/view/helpers/cache.test.php @@ -250,9 +250,8 @@ function testMultipleNoCacheTagsInViewfile() { * testComplexNoCache method * * @return void - * @access public */ - function testComplexNoCache () { + public function testComplexNoCache () { $this->Controller->cache_parsing(); $this->Controller->params = array( 'controller' => 'cache_test', diff --git a/cake/tests/cases/libs/xml.test.php b/cake/tests/cases/libs/xml.test.php index 376a3c7b0..a47606216 100644 --- a/cake/tests/cases/libs/xml.test.php +++ b/cake/tests/cases/libs/xml.test.php @@ -31,9 +31,8 @@ class TestXml extends Xml { * Return the protected _header instance variable * * @return string Header - * @access public */ - function getHeader() { + public function getHeader() { return $this->_header; } } diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index d62a3a8b8..4ec1fa4c0 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -46,9 +46,8 @@ class CakeTestDispatcher extends Dispatcher { * * @param CakeTestCase $testCase * @return void - * @access public */ - function testCase(&$testCase) { + public function testCase(&$testCase) { $this->testCase =& $testCase; } @@ -140,9 +139,8 @@ class CakeTestCase extends UnitTestCase { * * @param string $method Test method about to get executed. * @return void - * @access public */ - function startCase() { + public function startCase() { } /** @@ -150,9 +148,8 @@ function startCase() { * * @param string $method Test method about that was executed. * @return void - * @access public */ - function endCase() { + public function endCase() { } /** @@ -160,9 +157,8 @@ function endCase() { * * @param string $method Test method about to get executed. * @return void - * @access public */ - function startTest($method) { + public function startTest($method) { } /** @@ -170,9 +166,8 @@ function startTest($method) { * * @param string $method Test method about that was executed. * @return void - * @access public */ - function endTest($method) { + public function endTest($method) { } /** @@ -182,9 +177,8 @@ function endTest($method) { * @param mixed $compare * @param string $message * @return boolean|null - * @access public */ - function assert(&$expectation, $compare, $message = '%s') { + public function assert(&$expectation, $compare, $message = '%s') { if ($this->_should_skip) { return; } @@ -197,9 +191,8 @@ function assert(&$expectation, $compare, $message = '%s') { * @param boolean $shouldSkip * @param string $message * @return boolean - * @access public */ - function skipIf($shouldSkip, $message = '%s') { + public function skipIf($shouldSkip, $message = '%s') { parent::skipIf($shouldSkip, $message); return $shouldSkip; } @@ -210,9 +203,8 @@ function skipIf($shouldSkip, $message = '%s') { * @param Controller $controller Controller that's about to be invoked. * @param array $params Additional parameters as sent by testAction(). * @return void - * @access public */ - function startController(&$controller, $params = array()) { + public function startController(&$controller, $params = array()) { if (isset($params['fixturize']) && ((is_array($params['fixturize']) && !empty($params['fixturize'])) || $params['fixturize'] === true)) { if (!isset($this->db)) { $this->_initDb(); @@ -279,9 +271,8 @@ function startController(&$controller, $params = array()) { * @param Controller $controller Controller that has been invoked. * @param array $params Additional parameters as sent by testAction(). * @return void - * @access public */ - function endController(&$controller, $params = array()) { + public function endController(&$controller, $params = array()) { if (isset($this->db) && isset($this->_actionFixtures) && !empty($this->_actionFixtures) && $this->dropTables) { foreach ($this->_actionFixtures as $fixture) { $fixture->drop($this->db); @@ -307,9 +298,8 @@ function endController(&$controller, $params = array()) { * @param string $url Cake URL to execute (e.g: /articles/view/455) * @param mixed $params Parameters (see above), or simply a string of what to return * @return mixed Whatever is returned depending of requested result - * @access public */ - function testAction($url, $params = array()) { + public function testAction($url, $params = array()) { $default = array( 'return' => 'result', 'fixturize' => false, @@ -395,9 +385,8 @@ function testAction($url, $params = array()) { * * @param string $method Test method just started. * @return void - * @access public */ - function before($method) { + public function before($method) { parent::before($method); if (isset($this->fixtures) && (!is_array($this->fixtures) || empty($this->fixtures))) { @@ -426,9 +415,8 @@ function before($method) { * Runs as first test to create tables. * * @return void - * @access public */ - function start() { + public function start() { if (isset($this->_fixtures) && isset($this->db)) { Configure::write('Cache.disable', true); $cacheSources = $this->db->cacheSources; @@ -455,9 +443,8 @@ function start() { * Runs as last test to drop tables. * * @return void - * @access public */ - function end() { + public function end() { if (isset($this->_fixtures) && isset($this->db)) { if ($this->dropTables) { foreach (array_reverse($this->_fixtures) as $fixture) { @@ -478,9 +465,8 @@ function end() { * * @param string $method Test method just finished. * @return void - * @access public */ - function after($method) { + public function after($method) { $isTestMethod = !in_array(strtolower($method), array('start', 'end')); if (isset($this->_fixtures) && isset($this->db) && $isTestMethod) { @@ -505,9 +491,8 @@ function after($method) { * name "test". This method should be overridden if you want a different rule. * * @return array List of test names. - * @access public */ - function getTests() { + public function getTests() { return array_merge( array('start', 'startCase'), array_diff(parent::getTests(), array('testAction', 'testaction')), @@ -570,9 +555,8 @@ function loadFixtures() { * @param array $expected An array, see above * @param string $message SimpleTest failure output string * @return boolean - * @access public */ - function assertTags($string, $expected, $fullDebug = false) { + public function assertTags($string, $expected, $fullDebug = false) { $regex = array(); $normalized = array(); foreach ((array) $expected as $key => $val) { diff --git a/cake/tests/lib/cake_test_fixture.php b/cake/tests/lib/cake_test_fixture.php index 5e0b065af..dffa4988e 100644 --- a/cake/tests/lib/cake_test_fixture.php +++ b/cake/tests/lib/cake_test_fixture.php @@ -50,9 +50,8 @@ class CakeTestFixture extends Object { /** * Instantiate the fixture. * - * @access public */ - function __construct() { + public function __construct() { App::import('Model', 'CakeSchema'); $this->Schema = new CakeSchema(array('name' => 'TestSuite', 'connection' => 'test_suite')); @@ -126,9 +125,8 @@ function init() { * * @param object $db An instance of the database object used to create the fixture table * @return boolean True on success, false on failure - * @access public */ - function create(&$db) { + public function create(&$db) { if (!isset($this->fields) || empty($this->fields)) { return false; } @@ -144,9 +142,8 @@ function create(&$db) { * * @param object $db An instance of the database object used to create the fixture table * @return boolean True on success, false on failure - * @access public */ - function drop(&$db) { + public function drop(&$db) { $this->Schema->_build(array($this->table => $this->fields)); return ( $db->execute($db->dropSchema($this->Schema), array('log' => false)) !== false @@ -159,9 +156,8 @@ function drop(&$db) { * * @param object $db An instance of the database into which the records will be inserted * @return boolean on success or if there are no records to insert, or false on failure - * @access public */ - function insert(&$db) { + public function insert(&$db) { if (!isset($this->_insert)) { $values = array(); @@ -182,9 +178,8 @@ function insert(&$db) { * * @param object $db A reference to a db instance * @return boolean - * @access public */ - function truncate(&$db) { + public function truncate(&$db) { $fullDebug = $db->fullDebug; $db->fullDebug = false; $return = $db->truncate($this->table); diff --git a/cake/tests/lib/code_coverage_manager.php b/cake/tests/lib/code_coverage_manager.php index 18a9e08cf..2d922982f 100644 --- a/cake/tests/lib/code_coverage_manager.php +++ b/cake/tests/lib/code_coverage_manager.php @@ -76,9 +76,8 @@ class CodeCoverageManager { * Returns a singleton instance * * @return object - * @access public */ - function &getInstance() { + public function &getInstance() { static $instance = array(); if (!$instance) { $instance[0] =& new CodeCoverageManager(); @@ -642,9 +641,8 @@ function __paintHeader($lineCount, $coveredCount, $report) { * Displays a notification concerning group test results * * @return void - * @access public */ - function __paintGroupResultHeader($report) { + public function __paintGroupResultHeader($report) { return '<div class="code-coverage-results"><p class="note">Please keep in mind that the coverage can vary a little bit depending on how much the different tests in the group interfere. If for example, TEST A calls a line from TEST OBJECT B, the coverage for TEST OBJECT B will be a little greater than if you were running the corresponding test case for TEST OBJECT B alone.</p><pre>' . $report . '</pre></div>'; } @@ -749,9 +747,8 @@ function __calcCoverage($lineCount, $coveredCount) { * * @param string $isApp * @return void - * @access public */ - function __getTestFilesPath($isApp = true) { + public function __getTestFilesPath($isApp = true) { $manager = CodeCoverageManager::getInstance(); $path = ROOT . DS; diff --git a/cake/tests/lib/reporter/cake_base_reporter.php b/cake/tests/lib/reporter/cake_base_reporter.php index 25760718b..2ff79b81c 100644 --- a/cake/tests/lib/reporter/cake_base_reporter.php +++ b/cake/tests/lib/reporter/cake_base_reporter.php @@ -79,9 +79,8 @@ class CakeBaseReporter extends SimpleReporter { * * @param string $charset The character set to output with. Defaults to UTF-8 * @param array $params Array of request parameters the reporter should use. See above. - * @access public */ - function CakeBaseReporter($charset = 'utf-8', $params = array()) { + public function CakeBaseReporter($charset = 'utf-8', $params = array()) { $this->SimpleReporter(); if (!$charset) { $charset = 'utf-8'; diff --git a/cake/tests/lib/reporter/cake_cli_reporter.php b/cake/tests/lib/reporter/cake_cli_reporter.php index 838d39d8c..304f4b5ab 100644 --- a/cake/tests/lib/reporter/cake_cli_reporter.php +++ b/cake/tests/lib/reporter/cake_cli_reporter.php @@ -68,9 +68,8 @@ function setFailDetailSeparator($separator) { * * @param string $message Message of the fail. * @return void - * @access public */ - function paintFail($message) { + public function paintFail($message) { parent::paintFail($message); $message .= $this->_getBreadcrumb(); fwrite(STDERR, 'FAIL' . $this->separator . $message); @@ -81,9 +80,8 @@ function paintFail($message) { * * @param string $message Message of the Error * @return void - * @access public */ - function paintError($message) { + public function paintError($message) { parent::paintError($message); $message .= $this->_getBreadcrumb(); fwrite(STDERR, 'ERROR' . $this->separator . $message); @@ -94,9 +92,8 @@ function paintError($message) { * * @param string $message Message of the Error * @return void - * @access public */ - function paintException($exception) { + public function paintException($exception) { parent::paintException($exception); $message .= sprintf('Unexpected exception of type [%s] with message [%s] in [%s] line [%s]', get_class($exception), diff --git a/cake/tests/lib/reporter/cake_html_reporter.php b/cake/tests/lib/reporter/cake_html_reporter.php index 1144a3f00..8ae2385d6 100755 --- a/cake/tests/lib/reporter/cake_html_reporter.php +++ b/cake/tests/lib/reporter/cake_html_reporter.php @@ -34,9 +34,8 @@ class CakeHtmlReporter extends CakeBaseReporter { * * @param string $test_name Name class of test. * @return void - * @access public */ - function paintHeader($testName) { + public function paintHeader($testName) { $this->sendNoCacheHeaders(); $this->paintDocumentStart(); $this->paintTestMenu(); @@ -138,9 +137,8 @@ function groupTestList() { * scratching your head over out of date test data. * * @return void - * @access public */ - function sendNoCacheHeaders() { + public function sendNoCacheHeaders() { if (!headers_sent()) { header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); @@ -156,9 +154,8 @@ function sendNoCacheHeaders() { * * @param string $test_name Name class of test. * @return void - * @access public */ - function paintFooter($test_name) { + public function paintFooter($test_name) { $colour = ($this->getFailCount() + $this->getExceptionCount() > 0 ? "red" : "green"); echo "</ul>\n"; echo "<div style=\""; @@ -253,9 +250,8 @@ function paintDocumentEnd() { * @param string $message Failure message displayed in * the context of the other tests. * @return void - * @access public */ - function paintFail($message) { + public function paintFail($message) { parent::paintFail($message); echo "<li class='fail'>\n"; echo "<span>Failed</span>"; @@ -273,9 +269,8 @@ function paintFail($message) { * * @param string $message Pass message displayed in the context of the other tests. * @return void - * @access public */ - function paintPass($message) { + public function paintPass($message) { parent::paintPass($message); if (isset($this->params['show_passes']) && $this->params['show_passes']) { @@ -294,9 +289,8 @@ function paintPass($message) { * * @param string $message Message is ignored. * @return void - * @access public */ - function paintError($message) { + public function paintError($message) { parent::paintError($message); echo "<li class='error'>\n"; echo "<span>Error</span>"; @@ -312,9 +306,8 @@ function paintError($message) { * * @param Exception $exception Exception to display. * @return void - * @access public */ - function paintException($exception) { + public function paintException($exception) { parent::paintException($exception); echo "<li class='fail'>\n"; echo "<span>Exception</span>"; @@ -334,9 +327,8 @@ function paintException($exception) { * * @param string $message Text of skip condition. * @return void - * @access public */ - function paintSkip($message) { + public function paintSkip($message) { parent::paintSkip($message); echo "<li class='skipped'>\n"; echo "<span>Skipped</span> "; @@ -349,9 +341,8 @@ function paintSkip($message) { * * @param string $message Text to show. * @return void - * @access public */ - function paintFormattedMessage($message) { + public function paintFormattedMessage($message) { echo '<pre>' . $this->_htmlEntities($message) . '</pre>'; } diff --git a/cake/tests/lib/reporter/cake_text_reporter.php b/cake/tests/lib/reporter/cake_text_reporter.php index cc4a6ac3e..d20e2258b 100644 --- a/cake/tests/lib/reporter/cake_text_reporter.php +++ b/cake/tests/lib/reporter/cake_text_reporter.php @@ -44,9 +44,8 @@ function paintDocumentStart() { * * @param string $test_name Name class of test. * @return void - * @access public */ - function paintFooter($test_name) { + public function paintFooter($test_name) { if ($this->getFailCount() + $this->getExceptionCount() == 0) { echo "OK\n"; } else { @@ -76,9 +75,8 @@ class_exists('CodeCoverageManager') * * @param string $test_name Name class of test. * @return void - * @access public */ - function paintHeader($test_name) { + public function paintHeader($test_name) { $this->paintDocumentStart(); echo "$test_name\n"; flush(); @@ -90,9 +88,8 @@ function paintHeader($test_name) { * @param string $message Failure message displayed in * the context of the other tests. * @return void - * @access public */ - function paintFail($message) { + public function paintFail($message) { parent::paintFail($message); echo $this->getFailCount() . ") $message\n"; $breadcrumb = $this->getTestList(); @@ -106,9 +103,8 @@ function paintFail($message) { * * @param string $message Message to be shown. * @return void - * @access public */ - function paintError($message) { + public function paintError($message) { parent::paintError($message); echo "Exception " . $this->getExceptionCount() . "!\n$message\n"; $breadcrumb = $this->getTestList(); @@ -122,9 +118,8 @@ function paintError($message) { * * @param Exception $exception Exception to describe. * @return void - * @access public */ - function paintException($exception) { + public function paintException($exception) { parent::paintException($exception); $message = 'Unexpected exception of type [' . get_class($exception) . '] with message ['. $exception->getMessage() . @@ -142,9 +137,8 @@ function paintException($exception) { * * @param string $message Text of skip condition. * @return void - * @access public */ - function paintSkip($message) { + public function paintSkip($message) { parent::paintSkip($message); echo "Skip: $message\n"; } @@ -154,9 +148,8 @@ function paintSkip($message) { * * @param string $message Text to show. * @return void - * @access public */ - function paintFormattedMessage($message) { + public function paintFormattedMessage($message) { echo "$message\n"; flush(); } diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index ef5470940..7dc3f6675 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -62,9 +62,8 @@ class TestManager { * Constructor for the TestManager class * * @return void - * @access public */ - function TestManager() { + public function TestManager() { $this->_installSimpleTest(); if (isset($_GET['app'])) { $this->appTest = true; @@ -78,9 +77,8 @@ function TestManager() { * Includes the required simpletest files in order for the testsuite to run * * @return void - * @access public */ - function _installSimpleTest() { + public function _installSimpleTest() { App::import('Vendor', array( 'simpletest' . DS . 'unit_tester', 'simpletest' . DS . 'mock_objects', @@ -96,9 +94,8 @@ function _installSimpleTest() { * @param Object $reporter Reporter object for the tests being run. * @param boolean $testing Are tests supposed to be auto run. Set to true to return testcase list. * @return mixed - * @access public */ - function runAllTests(&$reporter, $testing = false) { + public function runAllTests(&$reporter, $testing = false) { $testCases =& $this->_getTestFileList($this->_getTestsPath()); if ($this->appTest) { $test =& new TestSuite(__('All App Tests', true)); @@ -126,9 +123,8 @@ function runAllTests(&$reporter, $testing = false) { * @param Object $reporter Reporter instance to attach to the test case. * @param boolean $testing Set to true if testing, otherwise test case will be run. * @return mixed Result of test case being run. - * @access public */ - function runTestCase($testCaseFile, &$reporter, $testing = false) { + public function runTestCase($testCaseFile, &$reporter, $testing = false) { $testCaseFileWithPath = $this->_getTestsPath() . DS . $testCaseFile; if (!file_exists($testCaseFileWithPath)) { @@ -151,9 +147,8 @@ function runTestCase($testCaseFile, &$reporter, $testing = false) { * @param string $groupTestName GroupTest that you want to run. * @param Object $reporter Reporter instance to use with the group test being run. * @return mixed Results of group test being run. - * @access public */ - function runGroupTest($groupTestName, &$reporter) { + public function runGroupTest($groupTestName, &$reporter) { $filePath = $this->_getTestsPath('groups') . DS . strtolower($groupTestName) . $this->_groupExtension; if (!file_exists($filePath)) { @@ -401,9 +396,8 @@ function _getTestsPath($type = 'cases') { * * @param string $type Type of test to get, either 'test' or 'group' * @return string Extension suffix for test. - * @access public */ - function getExtension($type = 'test') { + public function getExtension($type = 'test') { if ($type == 'test' || $type == 'case') { return $this->_testExtension; } From 50a547167b26e8e613cdb6820b9613b57fe79720 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Mon, 5 Apr 2010 13:21:28 +1000 Subject: [PATCH 1885/2083] Changing protected methods to specify protected access. --- cake/console/cake.php | 9 ++-- cake/console/libs/acl.php | 3 +- cake/console/libs/console.php | 6 +-- cake/console/libs/shell.php | 42 +++++++------------ cake/console/libs/tasks/fixture.php | 12 ++---- cake/console/libs/tasks/test.php | 9 ++-- cake/dispatcher.php | 9 ++-- cake/libs/cache.php | 3 +- cake/libs/cake_log.php | 6 +-- cake/libs/cake_session.php | 3 +- cake/libs/controller/component.php | 3 +- cake/libs/controller/components/acl.php | 6 +-- cake/libs/controller/components/security.php | 27 ++++-------- cake/libs/controller/controller.php | 3 +- cake/libs/controller/scaffold.php | 6 +-- cake/libs/debugger.php | 3 +- cake/libs/error.php | 3 +- cake/libs/http_socket.php | 33 +++++---------- cake/libs/inflector.php | 3 +- cake/libs/model/behaviors/translate.php | 3 +- cake/libs/model/behaviors/tree.php | 3 +- cake/libs/model/cake_schema.php | 3 +- cake/libs/model/datasources/dbo/dbo_mssql.php | 6 +-- cake/libs/model/datasources/dbo/dbo_mysql.php | 3 +- .../libs/model/datasources/dbo/dbo_mysqli.php | 6 +-- .../libs/model/datasources/dbo/dbo_oracle.php | 6 +-- cake/libs/model/datasources/dbo_source.php | 12 ++---- cake/libs/model/model.php | 18 +++----- cake/libs/object.php | 6 +-- cake/libs/router.php | 6 +-- cake/libs/validation.php | 15 +++---- cake/libs/view/helper.php | 6 +-- cake/libs/view/helpers/ajax.php | 3 +- cake/libs/view/helpers/form.php | 18 +++----- cake/libs/view/helpers/js.php | 24 ++++------- cake/libs/view/helpers/paginator.php | 6 +-- cake/libs/view/media.php | 6 +-- cake/libs/view/view.php | 18 +++----- cake/libs/xml.php | 3 +- cake/tests/cases/console/cake.test.php | 9 ++-- cake/tests/cases/console/libs/shell.test.php | 3 +- .../cases/console/libs/tasks/project.test.php | 3 +- .../cases/console/libs/tasks/test.test.php | 3 +- cake/tests/cases/dispatcher.test.php | 9 ++-- cake/tests/lib/cake_test_case.php | 9 ++-- .../tests/lib/reporter/cake_base_reporter.php | 3 +- cake/tests/lib/reporter/cake_cli_reporter.php | 3 +- .../tests/lib/reporter/cake_html_reporter.php | 3 +- cake/tests/lib/test_manager.php | 30 +++++-------- 49 files changed, 145 insertions(+), 290 deletions(-) diff --git a/cake/console/cake.php b/cake/console/cake.php index e1f06cd5e..77b07e423 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -166,9 +166,8 @@ function __initConstants() { /** * Defines current working environment. * - * @access protected */ - function _initEnvironment() { + protected function _initEnvironment() { $this->stdin = fopen('php://stdin', 'r'); $this->stdout = fopen('php://stdout', 'w'); $this->stderr = fopen('php://stderr', 'w'); @@ -389,9 +388,8 @@ public function dispatch() { * * @param string $plugin Optionally the name of a plugin * @return mixed False if no shell could be found or an object on success - * @access protected */ - function _getShell($plugin = null) { + protected function _getShell($plugin = null) { foreach ($this->shellPaths as $path) { $this->shellPath = $path . $this->shell . '.php'; $pluginShellPath = DS . $plugin . DS . 'vendors' . DS . 'shells' . DS; @@ -641,9 +639,8 @@ public function help() { * * @param $status see http://php.net/exit for values * @return void - * @access protected */ - function _stop($status = 0) { + protected function _stop($status = 0) { exit($status); } } diff --git a/cake/console/libs/acl.php b/cake/console/libs/acl.php index 2289e5f37..86709f370 100644 --- a/cake/console/libs/acl.php +++ b/cake/console/libs/acl.php @@ -229,9 +229,8 @@ public function getPath() { * @param array $node Array of node information. * @param integer $indent indent level. * @return void - * @access protected */ - function _outputNode($class, $node, $indent) { + protected function _outputNode($class, $node, $indent) { $indent = str_repeat(' ', $indent); $data = $node[$class]; if ($data['alias']) { diff --git a/cake/console/libs/console.php b/cake/console/libs/console.php index c458506fc..c610fb585 100644 --- a/cake/console/libs/console.php +++ b/cake/console/libs/console.php @@ -323,9 +323,8 @@ public function main($command = null) { * * @param string $modelToCheck * @return boolean true if is an available model, false otherwise - * @access protected */ - function _isValidModel($modelToCheck) { + protected function _isValidModel($modelToCheck) { return in_array($modelToCheck, $this->models); } @@ -334,9 +333,8 @@ function _isValidModel($modelToCheck) { * all routes found * * @return boolean True if config reload was a success, otherwise false - * @access protected */ - function _loadRoutes() { + protected function _loadRoutes() { $router =& Router::getInstance(); $router->reload(); diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php index aaf3b7777..8a84489fc 100644 --- a/cake/console/libs/shell.php +++ b/cake/console/libs/shell.php @@ -192,9 +192,8 @@ public function startup() { /** * Displays a header for the shell * - * @access protected */ - function _welcome() { + protected function _welcome() { $this->Dispatch->clear(); $this->out(); $this->out('Welcome to CakePHP v' . Configure::version() . ' Console'); @@ -209,9 +208,8 @@ function _welcome() { * makes $this->DbConfig available to subclasses * * @return bool - * @access protected */ - function _loadDbConfig() { + protected function _loadDbConfig() { if (config('database') && class_exists('DATABASE_CONFIG')) { $this->DbConfig =& new DATABASE_CONFIG(); return true; @@ -228,9 +226,8 @@ function _loadDbConfig() { * if public $uses is an array of models will load those models * * @return bool - * @access protected */ - function _loadModels() { + protected function _loadModels() { if ($this->uses === null || $this->uses === false) { return; } @@ -424,9 +421,8 @@ public function error($title, $message = null) { * * @param integer $expectedNum Expected number of paramters * @param string $command Command - * @access protected */ - function _checkArgs($expectedNum, $command = null) { + protected function _checkArgs($expectedNum, $command = null) { if (!$command) { $command = $this->command; } @@ -496,9 +492,8 @@ public function help() { * Action to create a Unit Test * * @return boolean Success - * @access protected */ - function _checkUnitTest() { + protected function _checkUnitTest() { if (App::import('vendor', 'simpletest' . DS . 'simpletest')) { return true; } @@ -530,9 +525,8 @@ public function shortPath($file) { * * @param string $name Controller class name * @return string Path to controller - * @access protected */ - function _controllerPath($name) { + protected function _controllerPath($name) { return strtolower(Inflector::underscore($name)); } @@ -541,9 +535,8 @@ function _controllerPath($name) { * * @param string $name Controller class name * @return string Controller plural name - * @access protected */ - function _controllerName($name) { + protected function _controllerName($name) { return Inflector::pluralize(Inflector::camelize($name)); } @@ -552,9 +545,8 @@ function _controllerName($name) { * * @param string $name Name * @return string Camelized and singularized controller name - * @access protected */ - function _modelName($name) { + protected function _modelName($name) { return Inflector::camelize(Inflector::singularize($name)); } @@ -563,9 +555,8 @@ function _modelName($name) { * * @param string $name Controller class name * @return string Singular model key - * @access protected */ - function _modelKey($name) { + protected function _modelKey($name) { return Inflector::underscore(Inflector::singularize($name)) . '_id'; } @@ -574,9 +565,8 @@ function _modelKey($name) { * * @param string $key Foreign key * @return string Model name - * @access protected */ - function _modelNameFromKey($key) { + protected function _modelNameFromKey($key) { return Inflector::camelize(str_replace('_id', '', $key)); } @@ -585,9 +575,8 @@ function _modelNameFromKey($key) { * * @param string $name * @return string $name - * @access protected */ - function _singularName($name) { + protected function _singularName($name) { return Inflector::variable(Inflector::singularize($name)); } @@ -596,9 +585,8 @@ function _singularName($name) { * * @param string $name Name to use * @return string Plural name for views - * @access protected */ - function _pluralName($name) { + protected function _pluralName($name) { return Inflector::variable(Inflector::pluralize($name)); } @@ -607,9 +595,8 @@ function _pluralName($name) { * * @param string $name Controller name * @return string Singular human name - * @access protected */ - function _singularHumanName($name) { + protected function _singularHumanName($name) { return Inflector::humanize(Inflector::underscore(Inflector::singularize($name))); } @@ -618,9 +605,8 @@ function _singularHumanName($name) { * * @param string $name Controller name * @return string Plural human name - * @access protected */ - function _pluralHumanName($name) { + protected function _pluralHumanName($name) { return Inflector::humanize(Inflector::underscore(Inflector::pluralize($name))); } diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index 083165da7..300c97dab 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -247,9 +247,8 @@ function getPath() { * * @param array $table Table schema array * @return string fields definitions - * @access protected */ - function _generateSchema($tableInfo) { + protected function _generateSchema($tableInfo) { $schema = $this->_Schema->generateTable('f', $tableInfo); return substr($schema, 10, -2); } @@ -259,9 +258,8 @@ function _generateSchema($tableInfo) { * * @param array $table Table schema array * @return array Array of records to use in the fixture. - * @access protected */ - function _generateRecords($tableInfo, $recordCount = 1) { + protected function _generateRecords($tableInfo, $recordCount = 1) { $records = array(); for ($i = 0; $i < $recordCount; $i++) { $record = array(); @@ -331,9 +329,8 @@ function _generateRecords($tableInfo, $recordCount = 1) { * * @param array $records Array of records to be converted to string * @return string A string value of the $records array. - * @access protected */ - function _makeRecordString($records) { + protected function _makeRecordString($records) { $out = "array(\n"; foreach ($records as $record) { $values = array(); @@ -355,9 +352,8 @@ function _makeRecordString($records) { * @param string $modelName name of the model to take records from. * @param string $useTable Name of table to use. * @return array Array of records. - * @access protected */ - function _getRecordsFromTable($modelName, $useTable = null) { + protected function _getRecordsFromTable($modelName, $useTable = null) { if ($this->interactive) { $condition = null; $prompt = __("Please provide a SQL fragment to use as conditions\nExample: WHERE 1=1 LIMIT 10", true); diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 74d32b7fc..6626031c0 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -294,9 +294,8 @@ public function generateFixtureList(&$subject) { * * @param Model $subject A Model class to scan for associations and pull fixtures off of. * @return void - * @access protected */ - function _processModel(&$subject) { + protected function _processModel(&$subject) { $this->_addFixture($subject->name); $associated = $subject->getAssociated(); foreach ($associated as $alias => $type) { @@ -319,9 +318,8 @@ function _processModel(&$subject) { * * @param Controller $subject A controller to pull model names off of. * @return void - * @access protected */ - function _processController(&$subject) { + protected function _processController(&$subject) { $subject->constructClasses(); $models = array(Inflector::classify($subject->name)); if (!empty($subject->uses)) { @@ -338,9 +336,8 @@ function _processController(&$subject) { * * @param string $name Name of the Model class that a fixture might be required for. * @return void - * @access protected */ - function _addFixture($name) { + protected function _addFixture($name) { $parent = get_parent_class($name); $prefix = 'app.'; if (strtolower($parent) != 'appmodel' && strtolower(substr($parent, -8)) == 'appmodel') { diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 3762ea3da..b0efa8b97 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -179,9 +179,8 @@ public function dispatch($url = null, $additionalParams = array()) { * @param array $params Parameters with at least the 'action' to invoke * @param boolean $missingAction Set to true if missing action should be rendered, false otherwise * @return string Output as sent by controller - * @access protected */ - function _invoke(&$controller, $params) { + protected function _invoke(&$controller, $params) { $controller->constructClasses(); $controller->startupProcess(); @@ -370,9 +369,8 @@ public function baseUrl() { * @param boolean $reverse If true all the params are shifted one forward, so plugin becomes * controller, controller becomes action etc. If false, plugin is made equal to controller * @return array Restructured array - * @access protected */ - function _restructureParams($params, $reverse = false) { + protected function _restructureParams($params, $reverse = false) { if ($reverse === true) { extract(Router::getArgs($params['action'])); $params = array_merge($params, array( @@ -648,9 +646,8 @@ public function asset($url) { * @param string $assetFile Path to the asset file in the file system * @param string $ext The extension of the file to determine its mime type * @return void - * @access protected */ - function _deliverAsset($assetFile, $ext) { + protected function _deliverAsset($assetFile, $ext) { $ob = @ini_get("zlib.output_compression") !== '1' && extension_loaded("zlib") && (strpos(env('HTTP_ACCEPT_ENCODING'), 'gzip') !== false); if ($ob && Configure::read('Asset.compress')) { ob_start(); diff --git a/cake/libs/cache.php b/cake/libs/cache.php index e5e2f28b6..9f8f1577a 100644 --- a/cake/libs/cache.php +++ b/cake/libs/cache.php @@ -136,9 +136,8 @@ function config($name = null, $settings = array()) { * * @param string $name Name of the config array that needs an engine instance built * @return void - * @access protected */ - function _buildEngine($name) { + protected function _buildEngine($name) { $config = $this->__config[$name]; list($plugin, $class) = pluginSplit($config['engine']); diff --git a/cake/libs/cake_log.php b/cake/libs/cake_log.php index 767912173..b748212e6 100644 --- a/cake/libs/cake_log.php +++ b/cake/libs/cake_log.php @@ -117,9 +117,8 @@ function config($key, $config) { * * @param string $loggerName the plugin.className of the logger class you want to build. * @return mixed boolean false on any failures, string of classname to use if search was successful. - * @access protected */ - function _getLogger($loggerName) { + protected function _getLogger($loggerName) { list($plugin, $loggerName) = pluginSplit($loggerName); if ($plugin) { @@ -173,9 +172,8 @@ function drop($streamName) { * Configures the automatic/default stream a FileLog. * * @return void - * @access protected */ - function _autoConfig() { + protected function _autoConfig() { if (!class_exists('FileLog')) { App::import('Core', 'log/FileLog'); } diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index a18753943..37895c459 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -587,9 +587,8 @@ function __startSession() { * Helper method to create a new session. * * @return void - * @access protected */ - function _checkValid() { + protected function _checkValid() { if ($this->read('Config')) { if ((Configure::read('Session.checkAgent') === false || $this->_userAgent == $this->read('Config.userAgent')) && $this->time <= $this->read('Config.time')) { $time = $this->read('Config.time'); diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php index b6f6b0c11..f7cb01c68 100644 --- a/cake/libs/controller/component.php +++ b/cake/libs/controller/component.php @@ -191,9 +191,8 @@ public function triggerCallback($callback, &$controller) { * @param object $object Object with a Components array * @param object $parent the parent of the current object * @return void - * @access protected */ - function _loadComponents(&$object, $parent = null) { + protected function _loadComponents(&$object, $parent = null) { $base = $this->__controllerVars['base']; $normal = Set::normalize($object->components); foreach ((array)$normal as $component => $config) { diff --git a/cake/libs/controller/components/acl.php b/cake/libs/controller/components/acl.php index 1690f5695..8a0db2112 100644 --- a/cake/libs/controller/components/acl.php +++ b/cake/libs/controller/components/acl.php @@ -71,9 +71,8 @@ public function startup(&$controller) { /** * Empty class defintion, to be overridden in subclasses. * - * @access protected */ - function _initACL() { + protected function _initACL() { } /** @@ -460,9 +459,8 @@ public function getAclLink($aro, $aco) { * * @param array $keys Permission model info * @return array ACO keys - * @access protected */ - function _getAcoKeys($keys) { + protected function _getAcoKeys($keys) { $newKeys = array(); $keys = array_keys($keys); foreach ($keys as $key) { diff --git a/cake/libs/controller/components/security.php b/cake/libs/controller/components/security.php index 5191db08f..52e80bb22 100644 --- a/cake/libs/controller/components/security.php +++ b/cake/libs/controller/components/security.php @@ -421,9 +421,8 @@ function blackHole(&$controller, $error = '') { * @param string $method The HTTP method to assign controller actions to * @param array $actions Controller actions to set the required HTTP method to. * @return void - * @access protected */ - function _requireMethod($method, $actions = array()) { + protected function _requireMethod($method, $actions = array()) { if (isset($actions[0]) && is_array($actions[0])) { $actions = $actions[0]; } @@ -435,9 +434,8 @@ function _requireMethod($method, $actions = array()) { * * @param object $controller Instantiating controller * @return bool true if $method is required - * @access protected */ - function _methodsRequired(&$controller) { + protected function _methodsRequired(&$controller) { foreach (array('Post', 'Get', 'Put', 'Delete') as $method) { $property = 'require' . $method; if (is_array($this->$property) && !empty($this->$property)) { @@ -460,9 +458,8 @@ function _methodsRequired(&$controller) { * * @param object $controller Instantiating controller * @return bool true if secure connection required - * @access protected */ - function _secureRequired(&$controller) { + protected function _secureRequired(&$controller) { if (is_array($this->requireSecure) && !empty($this->requireSecure)) { $requireSecure = array_map('strtolower', $this->requireSecure); @@ -482,9 +479,8 @@ function _secureRequired(&$controller) { * * @param object $controller Instantiating controller * @return bool true if authentication required - * @access protected */ - function _authRequired(&$controller) { + protected function _authRequired(&$controller) { if (is_array($this->requireAuth) && !empty($this->requireAuth) && !empty($controller->data)) { $requireAuth = array_map('strtolower', $this->requireAuth); @@ -518,9 +514,8 @@ function _authRequired(&$controller) { * * @param object $controller Instantiating controller * @return bool true if login is required - * @access protected */ - function _loginRequired(&$controller) { + protected function _loginRequired(&$controller) { if (is_array($this->requireLogin) && !empty($this->requireLogin)) { $requireLogin = array_map('strtolower', $this->requireLogin); @@ -566,9 +561,8 @@ function _loginRequired(&$controller) { * * @param object $controller Instantiating controller * @return bool true if submitted form is valid - * @access protected */ - function _validatePost(&$controller) { + protected function _validatePost(&$controller) { if (empty($controller->data)) { return true; } @@ -647,9 +641,8 @@ function _validatePost(&$controller) { * * @param object $controller Instantiating controller * @return bool Success - * @access protected */ - function _generateToken(&$controller) { + protected function _generateToken(&$controller) { if (isset($controller->params['requested']) && $controller->params['requested'] === 1) { if ($this->Session->check('_Token')) { $tokenData = unserialize($this->Session->read('_Token')); @@ -693,9 +686,8 @@ function _generateToken(&$controller) { * * @param array $options Default login options * @return void - * @access protected */ - function _setLoginDefaults(&$options) { + protected function _setLoginDefaults(&$options) { $options = array_merge(array( 'type' => 'basic', 'realm' => env('SERVER_NAME'), @@ -712,9 +704,8 @@ function _setLoginDefaults(&$options) { * @param string $method Method to execute * @param array $params Parameters to send to method * @return mixed Controller callback method's response - * @access protected */ - function _callback(&$controller, $method, $params = array()) { + protected function _callback(&$controller, $method, $params = array()) { if (is_callable(array($controller, $method))) { return call_user_func_array(array(&$controller, $method), empty($params) ? null : $params); } else { diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 73d01c6db..870f84961 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -394,9 +394,8 @@ function __construct() { * Merge components, helpers, and uses vars from AppController and PluginAppController. * * @return void - * @access protected */ - function __mergeVars() { + protected function __mergeVars() { $pluginName = Inflector::camelize($this->plugin); $pluginController = $pluginName . 'AppController'; diff --git a/cake/libs/controller/scaffold.php b/cake/libs/controller/scaffold.php index 14f9566c7..cf95783a0 100644 --- a/cake/libs/controller/scaffold.php +++ b/cake/libs/controller/scaffold.php @@ -206,9 +206,8 @@ function __construct(&$controller, $params) { * Outputs the content of a scaffold method passing it through the Controller::afterFilter() * * @return void - * @access protected */ - function _output() { + protected function _output() { $this->controller->afterFilter(); echo($this->controller->output); } @@ -550,9 +549,8 @@ class ScaffoldView extends ThemeView { * Override _getViewFileName * * @return string action - * @access protected */ - function _getViewFileName($name = null) { + protected function _getViewFileName($name = null) { if ($name === null) { $name = $this->action; } diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index 0653d2fe6..13b8b26ba 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -562,9 +562,8 @@ function __object($var) { * @param string $format Format to use, including 'js' for JavaScript-enhanced HTML, 'html' for * straight HTML output, or 'txt' for unformatted text. * @param array $strings Template strings to be used for the output format. - * @access protected */ - function output($format = null, $strings = array()) { + protected function output($format = null, $strings = array()) { $_this =& Debugger::getInstance(); $data = null; diff --git a/cake/libs/error.php b/cake/libs/error.php index 4163ae943..8ffe61ed8 100644 --- a/cake/libs/error.php +++ b/cake/libs/error.php @@ -433,9 +433,8 @@ public function missingModel($params) { /** * Output message * - * @access protected */ - function _outputMessage($template) { + protected function _outputMessage($template) { $this->controller->render($template); $this->controller->afterFilter(); echo $this->controller->output; diff --git a/cake/libs/http_socket.php b/cake/libs/http_socket.php index f70a057b6..de2bd32a0 100644 --- a/cake/libs/http_socket.php +++ b/cake/libs/http_socket.php @@ -430,9 +430,8 @@ public function url($url = null, $uriTemplate = null) { * * @param string $message Message to parse * @return array Parsed message (with indexed elements such as raw, status, header, body) - * @access protected */ - function _parseResponse($message) { + protected function _parseResponse($message) { if (is_array($message)) { return $message; } elseif (!is_string($message)) { @@ -494,9 +493,8 @@ function _parseResponse($message) { * @param string $body A string continaing the body to decode. * @param mixed $encoding Can be false in case no encoding is being used, or a string representing the encoding. * @return mixed Array of response headers and body or false. - * @access protected */ - function _decodeBody($body, $encoding = 'chunked') { + protected function _decodeBody($body, $encoding = 'chunked') { if (!is_string($body)) { return false; } @@ -520,9 +518,8 @@ function _decodeBody($body, $encoding = 'chunked') { * * @param string $body A string continaing the chunked body to decode. * @return mixed Array of response headers and body or false. - * @access protected */ - function _decodeChunkedBody($body) { + protected function _decodeChunkedBody($body) { if (!is_string($body)) { return false; } @@ -582,9 +579,8 @@ function _decodeChunkedBody($body) { * * @param mixed $uri URI, See HttpSocket::_parseUri() * @return array Current configuration settings - * @access protected */ - function _configUri($uri = null) { + protected function _configUri($uri = null) { if (empty($uri)) { return false; } @@ -616,9 +612,8 @@ function _configUri($uri = null) { * @param mixed $uri Either A $uri array, or a request string. Will use $this->config if left empty. * @param string $uriTemplate The Uri template/format to use. * @return mixed A fully qualified URL formated according to $uriTemplate, or false on failure - * @access protected */ - function _buildUri($uri = array(), $uriTemplate = '%scheme://%user:%pass@%host:%port/%path?%query#%fragment') { + protected function _buildUri($uri = array(), $uriTemplate = '%scheme://%user:%pass@%host:%port/%path?%query#%fragment') { if (is_string($uri)) { $uri = array('host' => $uri); } @@ -664,9 +659,8 @@ function _buildUri($uri = array(), $uriTemplate = '%scheme://%user:%pass@%host:% * @param string $uri URI to parse * @param mixed $base If true use default URI config, otherwise indexed array to set 'scheme', 'host', 'port', etc. * @return array Parsed URI - * @access protected */ - function _parseUri($uri = null, $base = array()) { + protected function _parseUri($uri = null, $base = array()) { $uriBase = array( 'scheme' => array('http', 'https'), 'host' => null, @@ -730,9 +724,8 @@ function _parseUri($uri = null, $base = array()) { * @param mixed $query A query string to parse into an array or an array to return directly "as is" * @return array The $query parsed into a possibly multi-level array. If an empty $query is * given, an empty array is returned. - * @access protected */ - function _parseQuery($query) { + protected function _parseQuery($query) { if (is_array($query)) { return $query; } @@ -788,9 +781,8 @@ function _parseQuery($query) { * @param array $request Needs to contain a 'uri' key. Should also contain a 'method' key, otherwise defaults to GET. * @param string $versionToken The version token to use, defaults to HTTP/1.1 * @return string Request line - * @access protected */ - function _buildRequestLine($request = array(), $versionToken = 'HTTP/1.1') { + protected function _buildRequestLine($request = array(), $versionToken = 'HTTP/1.1') { $asteriskMethods = array('OPTIONS'); if (is_string($request)) { @@ -822,9 +814,8 @@ function _buildRequestLine($request = array(), $versionToken = 'HTTP/1.1') { * * @param array $data Data to serialize * @return string Serialized variable - * @access protected */ - function _httpSerialize($data = array()) { + protected function _httpSerialize($data = array()) { if (is_string($data)) { return $data; } @@ -839,9 +830,8 @@ function _httpSerialize($data = array()) { * * @param array $header Header to build * @return string Header built from array - * @access protected */ - function _buildHeader($header, $mode = 'standard') { + protected function _buildHeader($header, $mode = 'standard') { if (is_string($header)) { return $header; } elseif (!is_array($header)) { @@ -868,9 +858,8 @@ function _buildHeader($header, $mode = 'standard') { * * @param array $header Header as an indexed array (field => value) * @return array Parsed header - * @access protected */ - function _parseHeader($header) { + protected function _parseHeader($header) { if (is_array($header)) { foreach ($header as $field => $value) { unset($header[$field]); diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index 7441e700c..5d70f7099 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -272,9 +272,8 @@ public function &getInstance() { * @param string $key Original value * @param string $value Inflected value * @return string Inflected value, from cache - * @access protected */ - function _cache($type, $key, $value = false) { + protected function _cache($type, $key, $value = false) { $key = '_' . $key; $type = '_' . $type; if ($value !== false) { diff --git a/cake/libs/model/behaviors/translate.php b/cake/libs/model/behaviors/translate.php index 7e15f2ef2..eaff98d10 100644 --- a/cake/libs/model/behaviors/translate.php +++ b/cake/libs/model/behaviors/translate.php @@ -332,9 +332,8 @@ public function afterDelete(&$model) { * Get selected locale for model * * @return mixed string or false - * @access protected */ - function _getLocale(&$model) { + protected function _getLocale(&$model) { if (!isset($model->locale) || is_null($model->locale)) { if (!class_exists('I18n')) { App::import('Core', 'i18n'); diff --git a/cake/libs/model/behaviors/tree.php b/cake/libs/model/behaviors/tree.php index fca1e906f..699021fef 100644 --- a/cake/libs/model/behaviors/tree.php +++ b/cake/libs/model/behaviors/tree.php @@ -798,9 +798,8 @@ public function verify(&$Model) { * @param AppModel $Model Model instance * @param mixed $parentId * @return boolean true on success, false on failure - * @access protected */ - function _setParent(&$Model, $parentId = null, $created = false) { + protected function _setParent(&$Model, $parentId = null, $created = false) { extract($this->settings[$Model->alias]); list($node) = array_values($Model->find('first', array( 'conditions' => array($scope, $Model->escapeField() => $Model->id), diff --git a/cake/libs/model/cake_schema.php b/cake/libs/model/cake_schema.php index e481c10bd..7ef7d8245 100644 --- a/cake/libs/model/cake_schema.php +++ b/cake/libs/model/cake_schema.php @@ -110,9 +110,8 @@ function __construct($options = array()) { * * @param array $data loaded object properties * @return void - * @access protected */ - function _build($data) { + protected function _build($data) { $file = null; foreach ($data as $key => $val) { if (!empty($val)) { diff --git a/cake/libs/model/datasources/dbo/dbo_mssql.php b/cake/libs/model/datasources/dbo/dbo_mssql.php index 082557d9a..875678bc7 100644 --- a/cake/libs/model/datasources/dbo/dbo_mssql.php +++ b/cake/libs/model/datasources/dbo/dbo_mssql.php @@ -187,9 +187,8 @@ function disconnect() { * * @param string $sql SQL statement * @return resource Result resource identifier - * @access protected */ - function _execute($sql) { + protected function _execute($sql) { $result = @mssql_query($sql, $this->connection); $this->__lastQueryHadError = ($result === false); return $result; @@ -701,9 +700,8 @@ function fetchResult() { * @param string $table * @param string $fields * @param array $values - * @access protected */ - function insertMulti($table, $fields, $values) { + protected function insertMulti($table, $fields, $values) { $primaryKey = $this->_getPrimaryKey($table); $hasPrimaryKey = $primaryKey != null && ( (is_array($fields) && in_array($primaryKey, $fields) diff --git a/cake/libs/model/datasources/dbo/dbo_mysql.php b/cake/libs/model/datasources/dbo/dbo_mysql.php index 75048237a..726062919 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysql.php +++ b/cake/libs/model/datasources/dbo/dbo_mysql.php @@ -582,9 +582,8 @@ function disconnect() { * * @param string $sql SQL statement * @return resource Result resource identifier - * @access protected */ - function _execute($sql) { + protected function _execute($sql) { return mysql_query($sql, $this->connection); } diff --git a/cake/libs/model/datasources/dbo/dbo_mysqli.php b/cake/libs/model/datasources/dbo/dbo_mysqli.php index 3c02f9eb1..c6d245c67 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysqli.php +++ b/cake/libs/model/datasources/dbo/dbo_mysqli.php @@ -106,9 +106,8 @@ function disconnect() { * * @param string $sql SQL statement * @return resource Result resource identifier - * @access protected */ - function _execute($sql) { + protected function _execute($sql) { if (preg_match('/^\s*call/i', $sql)) { return $this->_executeProcedure($sql); } @@ -120,9 +119,8 @@ function _execute($sql) { * * @param string $sql SQL statement (procedure call) * @return resource Result resource identifier for first recordset - * @access protected */ - function _executeProcedure($sql) { + protected function _executeProcedure($sql) { $answer = mysqli_multi_query($this->connection, $sql); $firstResult = mysqli_store_result($this->connection); diff --git a/cake/libs/model/datasources/dbo/dbo_oracle.php b/cake/libs/model/datasources/dbo/dbo_oracle.php index 3ad8a5981..81c0434dd 100644 --- a/cake/libs/model/datasources/dbo/dbo_oracle.php +++ b/cake/libs/model/datasources/dbo/dbo_oracle.php @@ -259,9 +259,8 @@ public function disconnect() { * * @param string $sql * @return false if sql is nor a SELECT - * @access protected */ - function _scrapeSQL($sql) { + protected function _scrapeSQL($sql) { $sql = str_replace("\"", '', $sql); $preFrom = preg_split('/\bFROM\b/', $sql); $preFrom = $preFrom[0]; @@ -330,9 +329,8 @@ public function lastNumRows() { * * @param string $sql SQL statement * @return resource Result resource identifier or null - * @access protected */ - function _execute($sql) { + protected function _execute($sql) { $this->_statementId = @ociparse($this->connection, $sql); if (!$this->_statementId) { $this->_setError($this->connection); diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 0075410de..dc10498fa 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -1556,9 +1556,8 @@ public function update(&$model, $fields = array(), $values = null, $conditions = * @param boolean $quoteValues If values should be quoted, or treated as SQL snippets * @param boolean $alias Include the model alias in the field name * @return array Fields and values, quoted and preparted - * @access protected */ - function _prepareUpdateFields(&$model, $fields, $quoteValues = true, $alias = false) { + protected function _prepareUpdateFields(&$model, $fields, $quoteValues = true, $alias = false) { $quotedAlias = $this->startQuote . $model->alias . $this->endQuote; $updates = array(); @@ -1624,9 +1623,8 @@ public function delete(&$model, $conditions = null) { * @param Model $model * @param mixed $conditions * @return array List of record IDs - * @access protected */ - function _matchRecords(&$model, $conditions = null) { + protected function _matchRecords(&$model, $conditions = null) { if ($conditions === true) { $conditions = $this->conditions(true); } elseif ($conditions === null) { @@ -1670,9 +1668,8 @@ function _matchRecords(&$model, $conditions = null) { * * @param object $model * @return array - * @access protected */ - function _getJoins($model) { + protected function _getJoins($model) { $join = array(); $joins = array_merge($model->getAssociated('hasOne'), $model->getAssociated('belongsTo')); @@ -2528,9 +2525,8 @@ public function boolean($data) { * @param string $table * @param string $fields * @param array $values - * @access protected */ - function insertMulti($table, $fields, $values) { + protected function insertMulti($table, $fields, $values) { $table = $this->fullTableName($table); if (is_array($fields)) { $fields = implode(', ', array_map(array(&$this, 'name'), $fields)); diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 425e282ee..790f22b93 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -490,9 +490,8 @@ function __construct($id = false, $table = null, $ds = null) { * @param string $method Name of method to call. * @param array $params Parameters for the method. * @return mixed Whatever is returned by called method - * @access protected */ - function call__($method, $params) { + protected function call__($method, $params) { $result = $this->Behaviors->dispatchMethod($this, $method, $params); if ($result !== array('unhandled')) { @@ -1511,9 +1510,8 @@ public function updateCounterCache($keys = array(), $created = false) { * @param array $data The fields of the record that will be updated * @return array Returns updated foreign key values, along with an 'old' key containing the old * values, or empty if no foreign keys are updated. - * @access protected */ - function _prepareUpdateFields($data) { + protected function _prepareUpdateFields($data) { $foreignKeys = array(); foreach ($this->belongsTo as $assoc => $info) { if ($info['counterCache']) { @@ -1819,9 +1817,8 @@ function delete($id = null, $cascade = true) { * @param string $id ID of record that was deleted * @param boolean $cascade Set to true to delete records that depend on this record * @return void - * @access protected */ - function _deleteDependent($id, $cascade) { + protected function _deleteDependent($id, $cascade) { if (!empty($this->__backAssociation)) { $savedAssociatons = $this->__backAssociation; $this->__backAssociation = array(); @@ -1861,9 +1858,8 @@ function _deleteDependent($id, $cascade) { * * @param string $id ID of record that was deleted * @return void - * @access protected */ - function _deleteLinks($id) { + protected function _deleteLinks($id) { foreach ($this->hasAndBelongsToMany as $assoc => $data) { $joinModel = $data['with']; $records = $this->{$joinModel}->find('all', array( @@ -2208,9 +2204,8 @@ function _findList($state, $query, $results = array()) { * @param mixed $query * @param array $results * @return array - * @access protected */ - function _findNeighbors($state, $query, $results = array()) { + protected function _findNeighbors($state, $query, $results = array()) { if ($state == 'before') { $query = array_merge(array('recursive' => 0), $query); extract($query); @@ -2267,9 +2262,8 @@ function _findNeighbors($state, $query, $results = array()) { * @param mixed $query * @param array $results * @return array Threaded results - * @access protected */ - function _findThreaded($state, $query, $results = array()) { + protected function _findThreaded($state, $query, $results = array()) { if ($state == 'before') { return $query; } elseif ($state == 'after') { diff --git a/cake/libs/object.php b/cake/libs/object.php index c87c5621e..39e92d632 100644 --- a/cake/libs/object.php +++ b/cake/libs/object.php @@ -156,9 +156,8 @@ public function log($msg, $type = LOG_ERROR) { * * @param array $properties An associative array containing properties and corresponding values. * @return void - * @access protected */ - function _set($properties = array()) { + protected function _set($properties = array()) { if (is_array($properties) && !empty($properties)) { $vars = get_object_vars($this); foreach ($properties as $key => $val) { @@ -236,9 +235,8 @@ function _persist($name, $return = null, &$object, $type = null) { * @param string $name name used for object to cache * @param object $object the object to persist * @return boolean true on save, throws error if file can not be created - * @access protected */ - function _savePersistent($name, &$object) { + protected function _savePersistent($name, &$object) { $file = 'persistent' . DS . strtolower($name) . '.php'; $objectArray = array(&$object); $data = str_replace('\\', '\\\\', serialize($objectArray)); diff --git a/cake/libs/router.php b/cake/libs/router.php index eb6e5c666..7b9600a1a 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -1321,9 +1321,8 @@ public function compile() { * properties to compile a regular expression that can be used to parse request strings. * * @return void - * @access protected */ - function _writeRoute() { + protected function _writeRoute() { if (empty($this->template) || ($this->template === '/')) { $this->_compiledRoute = '#^/*$#'; $this->keys = array(); @@ -1522,9 +1521,8 @@ public function match($url) { * * @param array $params The params to convert to a string url. * @return string Composed route string. - * @access protected */ - function _writeUrl($params) { + protected function _writeUrl($params) { if (isset($params['plugin'], $params['controller']) && $params['plugin'] === $params['controller']) { unset($params['controller']); } diff --git a/cake/libs/validation.php b/cake/libs/validation.php index ba75979e6..60e3191c5 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -562,9 +562,8 @@ public function ip($check, $type = 'both') { * * @param string $check IP Address to test * @return boolean Success - * @access protected */ - function _ipv4($check) { + protected function _ipv4($check) { if (function_exists('filter_var')) { return filter_var($check, FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV4)) !== false; } @@ -579,9 +578,8 @@ function _ipv4($check) { * * @param string $check IP Address to test * @return boolean Success - * @access protected */ - function _ipv6($check) { + protected function _ipv6($check) { if (function_exists('filter_var')) { return filter_var($check, FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV6)) !== false; } @@ -912,9 +910,8 @@ function _pass($method, $check, $classPrefix) { * Runs a regular expression match. * * @return boolean Success of match - * @access protected */ - function _check() { + protected function _check() { $_this =& Validation::getInstance(); if (preg_match($_this->regex, $_this->check)) { $_this->error[] = false; @@ -931,9 +928,8 @@ function _check() { * * @param array $params Parameters sent to validation method * @return void - * @access protected */ - function _extract($params) { + protected function _extract($params) { $_this =& Validation::getInstance(); extract($params, EXTR_OVERWRITE); @@ -959,9 +955,8 @@ function _extract($params) { * * @see http://en.wikipedia.org/wiki/Luhn_algorithm * @return boolean Success - * @access protected */ - function _luhn() { + protected function _luhn() { $_this =& Validation::getInstance(); if ($_this->deep !== true) { return true; diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index 714dace7e..822f25043 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -146,9 +146,8 @@ class Helper extends Overloadable { /** * Default overload methods * - * @access protected */ - function get__($name) {} + protected function get__($name) {} function set__($name, $value) {} function call__($method, $params) { trigger_error(sprintf(__('Method %1$s::%2$s does not exist', true), get_class($this), $method), E_USER_WARNING); @@ -714,9 +713,8 @@ function value($options = array(), $field = null, $key = 'value') { * @param string $field The field name to initialize. * @param array $options Array of options to use while initializing an input field. * @return array Array options for the form input. - * @access protected */ - function _initInputField($field, $options = array()) { + protected function _initInputField($field, $options = array()) { if ($field !== null) { $this->setEntity($field); } diff --git a/cake/libs/view/helpers/ajax.php b/cake/libs/view/helpers/ajax.php index 840cd9e9f..f4072d3f6 100644 --- a/cake/libs/view/helpers/ajax.php +++ b/cake/libs/view/helpers/ajax.php @@ -914,9 +914,8 @@ function _buildObserver($klass, $name, $options = null) { * * @param array $options Option array where a callback is specified * @return array Options with their callbacks properly set - * @access protected */ - function _buildCallbacks($options) { + protected function _buildCallbacks($options) { $callbacks = array(); foreach ($this->callbacks as $callback) { diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 1e612c157..6f80ed252 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -95,9 +95,8 @@ class FormHelper extends AppHelper { * $this->fieldset. * * @return Model Returns a model instance - * @access protected */ - function &_introspectModel($model) { + protected function &_introspectModel($model) { $object = null; if (is_string($model) && strpos($model, '.') !== false) { $path = explode('.', $model); @@ -140,9 +139,8 @@ function &_introspectModel($model) { * Returns if a field is required to be filled based on validation properties from the validating object * * @return boolean true if field is required to be filled, false otherwise - * @access protected */ - function _isRequiredField($validateProperties) { + protected function _isRequiredField($validateProperties) { $required = false; if (is_array($validateProperties)) { @@ -900,9 +898,8 @@ public function input($fieldName, $options = array()) { * @param array $options The array of options you want to extract. * @param mixed $default The default option value * @return the contents of the option or default - * @access protected */ - function _extractOption($name, $options, $default = null) { + protected function _extractOption($name, $options, $default = null) { if (array_key_exists($name, $options)) { return $options[$name]; } @@ -914,9 +911,8 @@ function _extractOption($name, $options, $default = null) { * * @param array $options Options for the label element. * @return string Generated label element - * @access protected */ - function _inputLabel($fieldName, $label, $options) { + protected function _inputLabel($fieldName, $label, $options) { $labelAttributes = $this->domId(array(), 'for'); if ($options['type'] === 'date' || $options['type'] === 'datetime') { if (isset($options['dateFormat']) && $options['dateFormat'] === 'NONE') { @@ -1864,9 +1860,8 @@ public function dateTime($fieldName, $dateFormat = 'DMY', $timeFormat = '12', $s * @param array $options * @param string $key * @return array - * @access protected */ - function _name($options = array(), $field = null, $key = 'name') { + protected function _name($options = array(), $field = null, $key = 'name') { if ($this->requestType == 'get') { if ($options === null) { $options = array(); @@ -2104,9 +2099,8 @@ function __generateOptions($name, $options = array()) { * @param string $field Name of the field to initialize options for. * @param array $options Array of options to append options into. * @return array Array of options for the input. - * @access protected */ - function _initInputField($field, $options = array()) { + protected function _initInputField($field, $options = array()) { if (isset($options['secure'])) { $secure = $options['secure']; unset($options['secure']); diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index fdec2db04..d98532c16 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -268,9 +268,8 @@ public function getBuffer($clear = true) { * Generates the object string for variables passed to javascript. * * @return string Generated JSON object of all set vars - * @access protected */ - function _createVars() { + protected function _createVars() { if (!empty($this->__jsVars)) { $setVar = (strpos($this->setVariable, '.')) ? $this->setVariable : 'window.' . $this->setVariable; $this->buffer($setVar . ' = ' . $this->object($this->__jsVars) . ';', true); @@ -400,9 +399,8 @@ public function submit($caption = null, $options = array()) { * @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 js options and Htmloptions - * @access protected */ - function _getHtmlOptions($options, $additional = array()) { + protected function _getHtmlOptions($options, $additional = array()) { $htmlKeys = array_merge(array('class', 'id', 'escape', 'onblur', 'onfocus', 'rel', 'title'), $additional); $htmlOptions = array(); foreach ($htmlKeys as $key) { @@ -656,9 +654,8 @@ public function escape($string) { * * @param string $string The string that needs to be utf8->hex encoded * @return void - * @access protected */ - function _utf8ToHex($string) { + protected function _utf8ToHex($string) { $length = strlen($string); $return = ''; for ($i = 0; $i < $length; ++$i) { @@ -972,9 +969,8 @@ public function serializeForm() { * @param array $options Options to be converted * @param array $safeKeys Keys that should not be escaped. * @return string Parsed JSON options without enclosing { }. - * @access protected */ - function _parseOptions($options, $safeKeys = array()) { + protected function _parseOptions($options, $safeKeys = array()) { $out = array(); $safeKeys = array_flip($safeKeys); foreach ($options as $key => $value) { @@ -994,9 +990,8 @@ function _parseOptions($options, $safeKeys = array()) { * @param string $method Name of method whose options are being worked with. * @param array $options Array of options to map. * @return array Array of mapped options. - * @access protected */ - function _mapOptions($method, $options) { + protected function _mapOptions($method, $options) { if (!isset($this->_optionMap[$method])) { return $options; } @@ -1017,9 +1012,8 @@ function _mapOptions($method, $options) { * @param array $options Array of options being parsed * @param string $callbacks Additional Keys that contain callbacks * @return array Array of options with callbacks added. - * @access protected */ - function _prepareCallbacks($method, $options, $callbacks = array()) { + protected function _prepareCallbacks($method, $options, $callbacks = array()) { $wrapCallbacks = true; if (isset($options['wrapCallbacks'])) { $wrapCallbacks = $options['wrapCallbacks']; @@ -1054,9 +1048,8 @@ function _prepareCallbacks($method, $options, $callbacks = array()) { * @param string $method Name of method processing options for. * @param array $options Array of options to process. * @return string Parsed options string. - * @access protected */ - function _processOptions($method, $options) { + protected function _processOptions($method, $options) { $options = $this->_mapOptions($method, $options); $options = $this->_prepareCallbacks($method, $options); $options = $this->_parseOptions($options, array_keys($this->_callbackArguments[$method])); @@ -1068,9 +1061,8 @@ function _processOptions($method, $options) { * * @param array $parameters Array of parameters to convert to a query string * @return string Querystring fragment - * @access protected */ - function _toQuerystring($parameters) { + protected function _toQuerystring($parameters) { $out = ''; $keys = array_keys($parameters); $count = count($parameters); diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index ca641e67b..906416367 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -386,9 +386,8 @@ public function url($options = array(), $asArray = false, $model = null) { /** * Protected method for generating prev/next links * - * @access protected */ - function __pagingLink($which, $title = null, $options = array(), $disabledTitle = null, $disabledOptions = array()) { + protected function __pagingLink($which, $title = null, $options = array(), $disabledTitle = null, $disabledOptions = array()) { $check = 'has' . $which; $_defaults = array( 'url' => array(), 'step' => 1, 'escape' => true, @@ -464,9 +463,8 @@ public function hasPage($model = null, $page = 1) { * @param string $model Model name to get parameters for. * @param integer $page Page number you are checking. * @return boolean Whether model has $page - * @access protected */ - function __hasPage($model, $page) { + protected function __hasPage($model, $page) { $params = $this->params($model); if (!empty($params)) { if ($params["{$page}Page"] == true) { diff --git a/cake/libs/view/media.php b/cake/libs/view/media.php index ba6412e64..225b2dabe 100644 --- a/cake/libs/view/media.php +++ b/cake/libs/view/media.php @@ -225,9 +225,8 @@ function render() { * Method to set headers * @param mixed $header * @param boolean $boolean - * @access protected */ - function _header($header, $boolean = true) { + protected function _header($header, $boolean = true) { if (is_array($header)) { foreach ($header as $string => $boolean) { if (is_numeric($string)) { @@ -244,9 +243,8 @@ function _header($header, $boolean = true) { /** * Method to output headers - * @access protected */ - function _output() { + protected function _output() { foreach ($this->_headers as $key => $value) { $header = key($value); header($header, $value[$header]); diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index 70ab8080f..c5678ced2 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -681,9 +681,8 @@ public function error($code, $name, $message) { * @param boolean $loadHelpers Boolean to indicate that helpers should be loaded. * @param boolean $cached Whether or not to trigger the creation of a cache file. * @return string Rendered output - * @access protected */ - function _render($___viewFn, $___dataForView, $loadHelpers = true, $cached = false) { + protected function _render($___viewFn, $___dataForView, $loadHelpers = true, $cached = false) { $loadedHelpers = array(); if ($this->helpers != false && $loadHelpers === true) { @@ -747,9 +746,8 @@ function _render($___viewFn, $___dataForView, $loadHelpers = true, $cached = fal * @param array $helpers List of helpers to load. * @param string $parent holds name of helper, if loaded helper has helpers * @return array Array containing the loaded helpers. - * @access protected */ - function &_loadHelpers(&$loaded, $helpers, $parent = null) { + protected function &_loadHelpers(&$loaded, $helpers, $parent = null) { foreach ($helpers as $i => $helper) { $options = array(); @@ -814,9 +812,8 @@ function &_loadHelpers(&$loaded, $helpers, $parent = null) { * * @param string $name Controller action to find template filename for * @return string Template filename - * @access protected */ - function _getViewFileName($name = null) { + protected function _getViewFileName($name = null) { $subDir = null; if (!is_null($this->subDir)) { @@ -874,9 +871,8 @@ function _getViewFileName($name = null) { * * @param string $name The name of the layout to find. * @return string Filename for layout file (.ctp). - * @access protected */ - function _getLayoutFileName($name = null) { + protected function _getLayoutFileName($name = null) { if ($name === null) { $name = $this->layout; } @@ -907,9 +903,8 @@ function _getLayoutFileName($name = null) { * * @param string $viewFileName the filename that should exist * @return false - * @access protected */ - function _missingView($file, $error = 'missingView') { + protected function _missingView($file, $error = 'missingView') { if ($error === 'missingView') { $this->cakeError('missingView', array( 'className' => $this->name, @@ -934,9 +929,8 @@ function _missingView($file, $error = 'missingView') { * @param string $plugin Optional plugin name to scan for view files. * @param boolean $cached Set to true to force a refresh of view paths. * @return array paths - * @access protected */ - function _paths($plugin = null, $cached = true) { + protected function _paths($plugin = null, $cached = true) { if ($plugin === null && $cached === true && !empty($this->__paths)) { return $this->__paths; } diff --git a/cake/libs/xml.php b/cake/libs/xml.php index d6d83847f..66f26e44f 100644 --- a/cake/libs/xml.php +++ b/cake/libs/xml.php @@ -742,9 +742,8 @@ function __toString() { * if given the $recursive parameter. * * @param boolean $recursive Recursively delete elements. - * @access protected */ - function _killParent($recursive = true) { + protected function _killParent($recursive = true) { unset($this->__parent, $this->_log); if ($recursive && $this->hasChildren()) { for ($i = 0; $i < count($this->children); $i++) { diff --git a/cake/tests/cases/console/cake.test.php b/cake/tests/cases/console/cake.test.php index d4335bc61..8d1771f69 100644 --- a/cake/tests/cases/console/cake.test.php +++ b/cake/tests/cases/console/cake.test.php @@ -82,9 +82,8 @@ class TestShellDispatcher extends ShellDispatcher { * _initEnvironment method * * @return void - * @access protected */ - function _initEnvironment() { + protected function _initEnvironment() { } /** @@ -122,9 +121,8 @@ public function clear() { * _stop method * * @return void - * @access protected */ - function _stop($status = 0) { + protected function _stop($status = 0) { $this->stopped = 'Stopped with status: ' . $status; return $status; } @@ -144,9 +142,8 @@ public function getShell($plugin = null) { * * @param mixed $plugin * @return mixed - * @access protected */ - function _getShell($plugin = null) { + protected function _getShell($plugin = null) { if (isset($this->TestShell)) { return $this->TestShell; } diff --git a/cake/tests/cases/console/libs/shell.test.php b/cake/tests/cases/console/libs/shell.test.php index 59a875700..449125f87 100644 --- a/cake/tests/cases/console/libs/shell.test.php +++ b/cake/tests/cases/console/libs/shell.test.php @@ -66,9 +66,8 @@ class TestShell extends Shell { * * @param integer $status * @return void - * @access protected */ - function _stop($status = 0) { + protected function _stop($status = 0) { $this->stopped = $status; } } diff --git a/cake/tests/cases/console/libs/tasks/project.test.php b/cake/tests/cases/console/libs/tasks/project.test.php index 9eea4535b..6cc39ceda 100644 --- a/cake/tests/cases/console/libs/tasks/project.test.php +++ b/cake/tests/cases/console/libs/tasks/project.test.php @@ -80,9 +80,8 @@ public function endTest() { * creates a test project that is used for testing project task. * * @return void - * @access protected */ - function _setupTestProject() { + protected function _setupTestProject() { $skel = CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS . 'skel'; $this->Task->setReturnValueAt(0, 'in', 'y'); $this->Task->setReturnValueAt(1, 'in', 'n'); diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index d25dfd46c..fb190e909 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -119,9 +119,8 @@ public function doSomethingElse() { * Example protected method * * @return void - * @access protected */ - function _innerMethod() { + protected function _innerMethod() { } } diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index 971dd21ed..b18eceff0 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -40,9 +40,8 @@ class TestDispatcher extends Dispatcher { * @param mixed $params * @param mixed $missingAction * @return void - * @access protected */ - function _invoke(&$controller, $params) { + protected function _invoke(&$controller, $params) { restore_error_handler(); if ($result = parent::_invoke($controller, $params)) { if ($result[0] === 'missingAction') { @@ -68,9 +67,8 @@ public function cakeError($filename, $params) { * _stop method * * @return void - * @access protected */ - function _stop() { + protected function _stop() { return true; } } @@ -184,9 +182,8 @@ public function index() { * protected method * * @return void - * @access protected */ - function _protected() { + protected function _protected() { return true; } diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index 4ec1fa4c0..6e9a38d72 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -58,9 +58,8 @@ public function testCase(&$testCase) { * @param array $params * @param boolean $missingAction * @return Controller - * @access protected */ - function _invoke(&$controller, $params, $missingAction = false) { + protected function _invoke(&$controller, $params, $missingAction = false) { $this->controller =& $controller; if (isset($this->testCase) && method_exists($this->testCase, 'startController')) { @@ -682,9 +681,8 @@ public function assertTags($string, $expected, $fullDebug = false) { * Initialize DB connection. * * @return void - * @access protected */ - function _initDb() { + protected function _initDb() { $testDbAvailable = in_array('test', array_keys(ConnectionManager::enumConnectionObjects())); $_prefix = null; @@ -718,9 +716,8 @@ function _initDb() { * Load fixtures specified in public $fixtures. * * @return void - * @access protected */ - function _loadFixtures() { + protected function _loadFixtures() { if (!isset($this->fixtures) || empty($this->fixtures)) { return; } diff --git a/cake/tests/lib/reporter/cake_base_reporter.php b/cake/tests/lib/reporter/cake_base_reporter.php index 2ff79b81c..5b001db13 100644 --- a/cake/tests/lib/reporter/cake_base_reporter.php +++ b/cake/tests/lib/reporter/cake_base_reporter.php @@ -150,9 +150,8 @@ function paintMethodEnd($method) { * but in a separate function to reduce dependancies. * * @return float Time in microseconds - * @access protected */ - function _getTime() { + protected function _getTime() { list($usec, $sec) = explode(' ', microtime()); return ((float)$sec + (float)$usec); } diff --git a/cake/tests/lib/reporter/cake_cli_reporter.php b/cake/tests/lib/reporter/cake_cli_reporter.php index 304f4b5ab..2087cc611 100644 --- a/cake/tests/lib/reporter/cake_cli_reporter.php +++ b/cake/tests/lib/reporter/cake_cli_reporter.php @@ -163,9 +163,8 @@ class_exists('CodeCoverageManager') * Get the time and memory stats for this test case/group * * @return string String content to display - * @access protected */ - function _timeStats() { + protected function _timeStats() { $out = 'Time taken by tests (in seconds): ' . $this->_timeDuration . "\n"; if (function_exists('memory_get_peak_usage')) { $out .= 'Peak memory use: (in bytes): ' . number_format(memory_get_peak_usage()) . "\n"; diff --git a/cake/tests/lib/reporter/cake_html_reporter.php b/cake/tests/lib/reporter/cake_html_reporter.php index 8ae2385d6..d39ba914e 100755 --- a/cake/tests/lib/reporter/cake_html_reporter.php +++ b/cake/tests/lib/reporter/cake_html_reporter.php @@ -351,9 +351,8 @@ public function paintFormattedMessage($message) { * * @param string $message Plain text or Unicode message. * @return string Browser readable message. - * @access protected */ - function _htmlEntities($message) { + protected function _htmlEntities($message) { return htmlentities($message, ENT_COMPAT, $this->_characterSet); } } diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index 7dc3f6675..61e45effd 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -220,9 +220,8 @@ function &getTestCaseList() { * Builds the list of test cases from a given directory * * @param string $directory Directory to get test case list from. - * @access protected */ - function &_getTestCaseList($directory = '.') { + protected function &_getTestCaseList($directory = '.') { $fileList =& $this->_getTestFileList($directory); $testCases = array(); foreach ($fileList as $testCaseFile) { @@ -235,9 +234,8 @@ function &_getTestCaseList($directory = '.') { * Returns a list of test files from a given directory * * @param string $directory Directory to get test case files from. - * @access protected */ - function &_getTestFileList($directory = '.') { + protected function &_getTestFileList($directory = '.') { $return = $this->_getRecursiveFileList($directory, array(&$this, '_isTestCaseFile')); return $return; } @@ -258,9 +256,8 @@ function &getGroupTestList() { * Returns a list of group test files from a given directory * * @param string $directory The directory to get group test files from. - * @access protected */ - function &_getTestGroupFileList($directory = '.') { + protected function &_getTestGroupFileList($directory = '.') { $return = $this->_getRecursiveFileList($directory, array(&$this, '_isTestGroupFile')); return $return; } @@ -269,9 +266,8 @@ function &_getTestGroupFileList($directory = '.') { * Returns a list of group test files from a given directory * * @param string $directory The directory to get group tests from. - * @access protected */ - function &_getTestGroupList($directory = '.') { + protected function &_getTestGroupList($directory = '.') { $fileList =& $this->_getTestGroupFileList($directory); $groupTests = array(); @@ -286,9 +282,8 @@ function &_getTestGroupList($directory = '.') { * Returns a list of class names from a group test file * * @param string $groupTestFile The groupTest file to scan for TestSuite classnames. - * @access protected */ - function &_getGroupTestClassNames($groupTestFile) { + protected function &_getGroupTestClassNames($groupTestFile) { $file = implode("\n", file($groupTestFile)); preg_match("~lass\s+?(.*)\s+?extends TestSuite~", $file, $matches); if (!empty($matches)) { @@ -305,9 +300,8 @@ function &_getGroupTestClassNames($groupTestFile) { * * @param string $directory The directory to scan for files. * @param mixed $fileTestFunction - * @access protected */ - function &_getRecursiveFileList($directory = '.', $fileTestFunction) { + protected function &_getRecursiveFileList($directory = '.', $fileTestFunction) { $fileList = array(); if (!is_dir($directory)) { return $fileList; @@ -331,9 +325,8 @@ function &_getRecursiveFileList($directory = '.', $fileTestFunction) { * * @param string $file * @return boolean Whether $file is a test case. - * @access protected */ - function _isTestCaseFile($file) { + protected function _isTestCaseFile($file) { return $this->_hasExpectedExtension($file, $this->_testExtension); } @@ -342,9 +335,8 @@ function _isTestCaseFile($file) { * * @param string $file * @return boolean Whether $file is a group - * @access protected */ - function _isTestGroupFile($file) { + protected function _isTestGroupFile($file) { return $this->_hasExpectedExtension($file, $this->_groupExtension); } @@ -354,9 +346,8 @@ function _isTestGroupFile($file) { * @param string $file * @param string $extension * @return void - * @access protected */ - function _hasExpectedExtension($file, $extension) { + protected function _hasExpectedExtension($file, $extension) { return $extension == strtolower(substr($file, (0 - strlen($extension)))); } @@ -365,9 +356,8 @@ function _hasExpectedExtension($file, $extension) { * * @param string $type either 'cases' or 'groups' * @return string The path tests are located on - * @access protected */ - function _getTestsPath($type = 'cases') { + protected function _getTestsPath($type = 'cases') { if (!empty($this->appTest)) { if ($type == 'cases') { $result = APP_TEST_CASES; From e05d670982197c96e0c12879ed8cce9320ace718 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Mon, 5 Apr 2010 13:24:24 +1000 Subject: [PATCH 1886/2083] Remove PHP4 option in overloadable class include. --- cake/libs/overloadable.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cake/libs/overloadable.php b/cake/libs/overloadable.php index 28c244ca1..177ef8ef8 100644 --- a/cake/libs/overloadable.php +++ b/cake/libs/overloadable.php @@ -29,9 +29,5 @@ * Load the interface class based on the version of PHP. * */ -if (!PHP5) { - require(LIBS . 'overloadable_php4.php'); -} else { - require(LIBS . 'overloadable_php5.php'); -} +require(LIBS . 'overloadable_php5.php'); ?> \ No newline at end of file From 34077c992b648f43bb852800993c780ebba7af74 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Mon, 5 Apr 2010 15:03:07 +1000 Subject: [PATCH 1887/2083] Removed PHP4 Overloadable class. --- cake/libs/overloadable_php4.php | 165 -------------------------------- 1 file changed, 165 deletions(-) delete mode 100644 cake/libs/overloadable_php4.php diff --git a/cake/libs/overloadable_php4.php b/cake/libs/overloadable_php4.php deleted file mode 100644 index 175a9bbf4..000000000 --- a/cake/libs/overloadable_php4.php +++ /dev/null @@ -1,165 +0,0 @@ -<?php -/** - * Overload abstraction interface. Merges differences between PHP4 and 5. - * - * PHP versions 4 and 5 - * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @package cake - * @subpackage cake.cake.libs - * @since CakePHP(tm) v 1.2 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) - */ - -/** - * Overloadable class selector - * - * Load the interface class based on the version of PHP. - * - * @package cake - * @subpackage cake.cake.libs - */ -class Overloadable extends Object { - -/** - * Constructor. - * - * @access private - */ - function __construct() { - $this->overload(); - parent::__construct(); - } - -/** - * Overload implementation. - * - */ - public function overload() { - if (function_exists('overload')) { - if (func_num_args() > 0) { - foreach (func_get_args() as $class) { - if (is_object($class)) { - overload(get_class($class)); - } elseif (is_string($class)) { - overload($class); - } - } - } else { - overload(get_class($this)); - } - } - } - -/** - * Magic method handler. - * - * @param string $method Method name - * @param array $params Parameters to send to method - * @param mixed $return Where to store return value from method - * @return boolean Success - * @access private - */ - function __call($method, $params, &$return) { - if (!method_exists($this, 'call__')) { - trigger_error(sprintf(__('Magic method handler call__ not defined in %s', true), get_class($this)), E_USER_ERROR); - } - $return = $this->call__($method, $params); - return true; - } -} -Overloadable::overload('Overloadable'); - -/** - * Overloadable2 class selector - * - * Load the interface class based on the version of PHP. - * - * @package cake - * @subpackage cake.cake.libs - */ -class Overloadable2 extends Object { - -/** - * Constructor - * - * @access private - */ - function __construct() { - $this->overload(); - parent::__construct(); - } - -/** - * Overload implementation. - * - */ - public function overload() { - if (function_exists('overload')) { - if (func_num_args() > 0) { - foreach (func_get_args() as $class) { - if (is_object($class)) { - overload(get_class($class)); - } elseif (is_string($class)) { - overload($class); - } - } - } else { - overload(get_class($this)); - } - } - } - -/** - * Magic method handler. - * - * @param string $method Method name - * @param array $params Parameters to send to method - * @param mixed $return Where to store return value from method - * @return boolean Success - * @access private - */ - function __call($method, $params, &$return) { - if (!method_exists($this, 'call__')) { - trigger_error(sprintf(__('Magic method handler call__ not defined in %s', true), get_class($this)), E_USER_ERROR); - } - $return = $this->call__($method, $params); - return true; - } - -/** - * Getter. - * - * @param mixed $name What to get - * @param mixed $value Where to store returned value - * @return boolean Success - * @access private - */ - function __get($name, &$value) { - $value = $this->get__($name); - return true; - } - -/** - * Setter. - * - * @param mixed $name What to set - * @param mixed $value Value to set - * @return boolean Success - * @access private - */ - function __set($name, $value) { - $this->set__($name, $value); - return true; - } -} -Overloadable::overload('Overloadable2'); - -?> \ No newline at end of file From 57b52cf5771d1494ab90763a4a97914532bcecf0 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Mon, 5 Apr 2010 16:39:29 +1000 Subject: [PATCH 1888/2083] Fix access not being specified on certain methods in Helper. --- cake/libs/view/helper.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index 822f25043..1fec867e0 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -148,8 +148,8 @@ class Helper extends Overloadable { * */ protected function get__($name) {} - function set__($name, $value) {} - function call__($method, $params) { + protected function set__($name, $value) {} + protected function call__($method, $params) { trigger_error(sprintf(__('Method %1$s::%2$s does not exist', true), get_class($this), $method), E_USER_WARNING); } @@ -548,7 +548,7 @@ public function field() { * @param integer $modelID Unique index identifying this record within the form * @return boolean True on errors. */ - function tagIsInvalid($model = null, $field = null, $modelID = null) { + public function tagIsInvalid($model = null, $field = null, $modelID = null) { $view =& ClassRegistry::getObject('view'); $errors = $this->validationErrors; $entity = $view->entity(); @@ -568,7 +568,7 @@ function tagIsInvalid($model = null, $field = null, $modelID = null) { * was supplied, a string will be returned. * @todo Refactor this method to not have as many input/output options. */ - function domId($options = null, $id = 'id') { + public function domId($options = null, $id = 'id') { $view =& ClassRegistry::getObject('view'); if (is_array($options) && array_key_exists($id, $options) && $options[$id] === null) { @@ -604,7 +604,7 @@ function domId($options = null, $id = 'id') { * @access protected * @todo Refactor this method to not have as many input/output options. */ - function _name($options = array(), $field = null, $key = 'name') { + protected function _name($options = array(), $field = null, $key = 'name') { $view =& ClassRegistry::getObject('view'); if ($options === null) { $options = array(); @@ -650,7 +650,7 @@ function _name($options = array(), $field = null, $key = 'name') { * @access public * @todo Refactor this method to not have as many input/output options. */ - function value($options = array(), $field = null, $key = 'value') { + public function value($options = array(), $field = null, $key = 'value') { if ($options === null) { $options = array(); } elseif (is_string($options)) { @@ -754,7 +754,7 @@ public function addClass($options = array(), $class = null, $key = 'class') { * @return string * @deprecated This method will be removed in future versions. */ - function output($str) { + public function output($str) { return $str; } From b65395c15554ce75587f82a291f3612ce8516827 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Mon, 5 Apr 2010 16:40:40 +1000 Subject: [PATCH 1889/2083] Moved PHP5 Overloadable class to Overloadable. --- cake/libs/overloadable.php | 76 ++++++++++++++++++++++- cake/libs/overloadable_php5.php | 107 -------------------------------- 2 files changed, 75 insertions(+), 108 deletions(-) delete mode 100644 cake/libs/overloadable_php5.php diff --git a/cake/libs/overloadable.php b/cake/libs/overloadable.php index 177ef8ef8..f70a8373a 100644 --- a/cake/libs/overloadable.php +++ b/cake/libs/overloadable.php @@ -21,13 +21,87 @@ /** * Overloadable class selector * + * Load the interface class based on the version of PHP. + * * @package cake * @subpackage cake.cake.libs */ +class Overloadable extends Object { + +/** + * Overload implementation. No need for implementation in PHP5. + * + */ + public function overload() { } + +/** + * Magic method handler. + * + * @param string $method Method name + * @param array $params Parameters to send to method + * @return mixed Return value from method + * @access private + */ + function __call($method, $params) { + if (!method_exists($this, 'call__')) { + trigger_error(sprintf(__('Magic method handler call__ not defined in %s', true), get_class($this)), E_USER_ERROR); + } + return $this->call__($method, $params); + } +} /** + * Overloadable2 class selector + * * Load the interface class based on the version of PHP. * + * @package cake + */ +class Overloadable2 extends Object { + +/** + * Overload implementation. No need for implementation in PHP5. + * + */ + public function overload() { } + +/** + * Magic method handler. + * + * @param string $method Method name + * @param array $params Parameters to send to method + * @return mixed Return value from method + * @access private + */ + function __call($method, $params) { + if (!method_exists($this, 'call__')) { + trigger_error(sprintf(__('Magic method handler call__ not defined in %s', true), get_class($this)), E_USER_ERROR); + } + return $this->call__($method, $params); + } + +/** + * Getter. + * + * @param mixed $name What to get + * @param mixed $value Where to store returned value + * @return boolean Success + * @access private + */ + function __get($name) { + return $this->get__($name); + } + +/** + * Setter. + * + * @param mixed $name What to set + * @param mixed $value Value to set + * @return boolean Success + * @access private */ -require(LIBS . 'overloadable_php5.php'); + function __set($name, $value) { + return $this->set__($name, $value); + } +} ?> \ No newline at end of file diff --git a/cake/libs/overloadable_php5.php b/cake/libs/overloadable_php5.php deleted file mode 100644 index f70a8373a..000000000 --- a/cake/libs/overloadable_php5.php +++ /dev/null @@ -1,107 +0,0 @@ -<?php -/** - * Overload abstraction interface. Merges differences between PHP4 and 5. - * - * PHP versions 4 and 5 - * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @package cake - * @subpackage cake.cake.libs - * @since CakePHP(tm) v 1.2 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) - */ - -/** - * Overloadable class selector - * - * Load the interface class based on the version of PHP. - * - * @package cake - * @subpackage cake.cake.libs - */ -class Overloadable extends Object { - -/** - * Overload implementation. No need for implementation in PHP5. - * - */ - public function overload() { } - -/** - * Magic method handler. - * - * @param string $method Method name - * @param array $params Parameters to send to method - * @return mixed Return value from method - * @access private - */ - function __call($method, $params) { - if (!method_exists($this, 'call__')) { - trigger_error(sprintf(__('Magic method handler call__ not defined in %s', true), get_class($this)), E_USER_ERROR); - } - return $this->call__($method, $params); - } -} - -/** - * Overloadable2 class selector - * - * Load the interface class based on the version of PHP. - * - * @package cake - */ -class Overloadable2 extends Object { - -/** - * Overload implementation. No need for implementation in PHP5. - * - */ - public function overload() { } - -/** - * Magic method handler. - * - * @param string $method Method name - * @param array $params Parameters to send to method - * @return mixed Return value from method - * @access private - */ - function __call($method, $params) { - if (!method_exists($this, 'call__')) { - trigger_error(sprintf(__('Magic method handler call__ not defined in %s', true), get_class($this)), E_USER_ERROR); - } - return $this->call__($method, $params); - } - -/** - * Getter. - * - * @param mixed $name What to get - * @param mixed $value Where to store returned value - * @return boolean Success - * @access private - */ - function __get($name) { - return $this->get__($name); - } - -/** - * Setter. - * - * @param mixed $name What to set - * @param mixed $value Value to set - * @return boolean Success - * @access private - */ - function __set($name, $value) { - return $this->set__($name, $value); - } -} -?> \ No newline at end of file From e0534a7a703658fcf4d5607befdd45727eb89b32 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Mon, 5 Apr 2010 16:43:20 +1000 Subject: [PATCH 1890/2083] Remove PHP4 code from dynamic call, and change call__ to __call. --- cake/libs/model/model.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 790f22b93..9c60d5eb4 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -491,7 +491,7 @@ function __construct($id = false, $table = null, $ds = null) { * @param array $params Parameters for the method. * @return mixed Whatever is returned by called method */ - protected function call__($method, $params) { + public function __call($method, $params) { $result = $this->Behaviors->dispatchMethod($this, $method, $params); if ($result !== array('unhandled')) { @@ -500,9 +500,6 @@ protected function call__($method, $params) { $db =& ConnectionManager::getDataSource($this->useDbConfig); $return = $db->query($method, $params, $this); - if (!PHP5) { - $this->resetAssociations(); - } return $return; } From 5f2d091810e30b1369ee8200a7f621e7295baa90 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Mon, 5 Apr 2010 16:43:47 +1000 Subject: [PATCH 1891/2083] Cleanup some whitespace. --- cake/libs/model/model.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 9c60d5eb4..5e807f456 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -493,13 +493,11 @@ function __construct($id = false, $table = null, $ds = null) { */ public function __call($method, $params) { $result = $this->Behaviors->dispatchMethod($this, $method, $params); - if ($result !== array('unhandled')) { return $result; } $db =& ConnectionManager::getDataSource($this->useDbConfig); $return = $db->query($method, $params, $this); - return $return; } From f5fa56ff3cbf5ec396c8a46358186347484a209b Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Mon, 5 Apr 2010 16:45:14 +1000 Subject: [PATCH 1892/2083] Remove Overloadable from Helper class. --- cake/libs/view/helper.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index 1fec867e0..162573039 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -20,11 +20,6 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -/** - * Included libs - */ -App::import('Core', 'Overloadable'); - /** * Abstract base class for all other Helpers in CakePHP. * Provides common methods and features. @@ -32,7 +27,7 @@ * @package cake * @subpackage cake.cake.libs.view */ -class Helper extends Overloadable { +class Helper { /** * List of helpers used by this helper @@ -147,9 +142,7 @@ class Helper extends Overloadable { * Default overload methods * */ - protected function get__($name) {} - protected function set__($name, $value) {} - protected function call__($method, $params) { + protected function __call($method, $params) { trigger_error(sprintf(__('Method %1$s::%2$s does not exist', true), get_class($this), $method), E_USER_WARNING); } From 34c7c1551fbed289ebdf52b1116ec3ca696c70de Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Mon, 5 Apr 2010 17:30:24 +1000 Subject: [PATCH 1893/2083] Added default constructor. --- cake/libs/view/helper.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index 162573039..51504525f 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -138,6 +138,14 @@ class Helper { */ private $__cleaned = null; +/** + * Default Constructor + * + */ + public function __construct() { + // Nothing to see here. + } + /** * Default overload methods * From 51d71b45411413ebef8ba8df11a4c4a471e50c38 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Mon, 5 Apr 2010 21:15:17 +1000 Subject: [PATCH 1894/2083] Adjust view __scripts to be a protected instance variable, and add test methods for View addScript tests. --- cake/libs/view/view.php | 12 ++++++------ cake/tests/cases/libs/view/view.test.php | 21 ++++++++++++++++----- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index c5678ced2..6071affae 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -285,9 +285,9 @@ class View extends Object { * Scripts (and/or other <head /> tags) for the layout * * @var array - * @access private + * @access protected */ - private $__scripts = array(); + protected $_scripts = array(); /** * Holds an array of paths. @@ -461,7 +461,7 @@ public function renderLayout($content_for_layout, $layout = null) { $dataForLayout = array_merge($this->viewVars, array( 'content_for_layout' => $content_for_layout, - 'scripts_for_layout' => implode("\n\t", $this->__scripts), + 'scripts_for_layout' => implode("\n\t", $this->_scripts), )); if (!isset($dataForLayout['title_for_layout'])) { @@ -579,11 +579,11 @@ public function getVar($var) { */ public function addScript($name, $content = null) { if (empty($content)) { - if (!in_array($name, array_values($this->__scripts))) { - $this->__scripts[] = $name; + if (!in_array($name, array_values($this->_scripts))) { + $this->_scripts[] = $name; } } else { - $this->__scripts[$name] = $content; + $this->_scripts[$name] = $content; } } diff --git a/cake/tests/cases/libs/view/view.test.php b/cake/tests/cases/libs/view/view.test.php index 887e67cd5..6fc2b1675 100644 --- a/cake/tests/cases/libs/view/view.test.php +++ b/cake/tests/cases/libs/view/view.test.php @@ -162,6 +162,16 @@ function cakeError($method, $messages) { $error =& new ViewTestErrorHandler($method, $messages); return $error; } + +/** + * Test only function to return instance scripts. + * + * @return array Scripts + * @access public + */ + function scripts() { + return $this->_scripts; + } } /** @@ -457,12 +467,13 @@ function testUUIDGeneration() { * @return void */ function testAddInlineScripts() { - $this->View->addScript('prototype.js'); - $this->View->addScript('prototype.js'); - $this->assertEqual($this->View->__scripts, array('prototype.js')); + $View = new TestView($this->Controller); + $View->addScript('prototype.js'); + $View->addScript('prototype.js'); + $this->assertEqual($View->scripts(), array('prototype.js')); - $this->View->addScript('mainEvent', 'Event.observe(window, "load", function() { doSomething(); }, true);'); - $this->assertEqual($this->View->__scripts, array('prototype.js', 'mainEvent' => 'Event.observe(window, "load", function() { doSomething(); }, true);')); + $View->addScript('mainEvent', 'Event.observe(window, "load", function() { doSomething(); }, true);'); + $this->assertEqual($View->scripts(), array('prototype.js', 'mainEvent' => 'Event.observe(window, "load", function() { doSomething(); }, true);')); } /** From 518cab91e58c9dc1c18d8d629e152b8a8903f852 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 5 Apr 2010 21:43:16 -0400 Subject: [PATCH 1895/2083] Fixing discrepancy between how belongsTo and hasOne assocations are treated in relation to their fields being added into the queryData. hasOne and belongsTo associations now behave the same. Fixes #379 --- cake/libs/model/behaviors/containable.php | 12 ++-- .../libs/model/behaviors/containable.test.php | 65 +++++++++++++++++-- 2 files changed, 67 insertions(+), 10 deletions(-) diff --git a/cake/libs/model/behaviors/containable.php b/cake/libs/model/behaviors/containable.php index be0890940..31cd48672 100644 --- a/cake/libs/model/behaviors/containable.php +++ b/cake/libs/model/behaviors/containable.php @@ -183,11 +183,13 @@ function beforeFind(&$Model, $query) { } $query['fields'] = (array)$query['fields']; - if (!empty($Model->belongsTo)) { - foreach ($Model->belongsTo as $assoc => $data) { - if (!empty($data['fields'])) { - foreach ((array) $data['fields'] as $field) { - $query['fields'][] = (strpos($field, '.') === false ? $assoc . '.' : '') . $field; + foreach (array('hasOne', 'belongsTo') as $type) { + if (!empty($Model->{$type})) { + foreach ($Model->{$type} as $assoc => $data) { + if (!empty($data['fields'])) { + foreach ((array) $data['fields'] as $field) { + $query['fields'][] = (strpos($field, '.') === false ? $assoc . '.' : '') . $field; + } } } } diff --git a/cake/tests/cases/libs/model/behaviors/containable.test.php b/cake/tests/cases/libs/model/behaviors/containable.test.php index 898747b02..9cf034dcd 100644 --- a/cake/tests/cases/libs/model/behaviors/containable.test.php +++ b/cake/tests/cases/libs/model/behaviors/containable.test.php @@ -2883,7 +2883,10 @@ function testFindEmbeddedThirdLevelNonReset() { * @return void */ function testEmbeddedFindFields() { - $result = $this->Article->find('all', array('contain' => array('User(user)'), 'fields' => array('title'))); + $result = $this->Article->find('all', array( + 'contain' => array('User(user)'), + 'fields' => array('title') + )); $expected = array( array('Article' => array('title' => 'First Article'), 'User' => array('user' => 'mariano', 'id' => 1)), array('Article' => array('title' => 'Second Article'), 'User' => array('user' => 'larry', 'id' => 3)), @@ -2891,7 +2894,10 @@ function testEmbeddedFindFields() { ); $this->assertEqual($result, $expected); - $result = $this->Article->find('all', array('contain' => array('User(id, user)'), 'fields' => array('title'))); + $result = $this->Article->find('all', array( + 'contain' => array('User(id, user)'), + 'fields' => array('title') + )); $expected = array( array('Article' => array('title' => 'First Article'), 'User' => array('user' => 'mariano', 'id' => 1)), array('Article' => array('title' => 'Second Article'), 'User' => array('user' => 'larry', 'id' => 3)), @@ -2899,7 +2905,12 @@ function testEmbeddedFindFields() { ); $this->assertEqual($result, $expected); - $result = $this->Article->find('all', array('contain' => array('Comment(comment, published)' => 'Attachment(attachment)', 'User(user)'), 'fields' => array('title'))); + $result = $this->Article->find('all', array( + 'contain' => array( + 'Comment(comment, published)' => 'Attachment(attachment)', 'User(user)' + ), + 'fields' => array('title') + )); if (!empty($result)) { foreach($result as $i=>$article) { foreach($article['Comment'] as $j=>$comment) { @@ -2937,6 +2948,38 @@ function testEmbeddedFindFields() { $this->assertEqual($result, $expected); } +/** + * test that hasOne and belongsTo fields act the same in a contain array. + * + * @return void + */ + function testHasOneFieldsInContain() { + $this->Article->unbindModel(array( + 'hasMany' => array('Comment') + ), true); + unset($this->Article->Comment); + $this->Article->bindModel(array( + 'hasOne' => array('Comment') + )); + + $result = $this->Article->find('all', array( + 'fields' => array('title', 'body'), + 'contain' => array( + 'Comment' => array( + 'fields' => array('comment') + ), + 'User' => array( + 'fields' => array('user') + ) + ) + )); + $this->assertTrue(isset($result[0]['Article']['title']), 'title missing %s'); + $this->assertTrue(isset($result[0]['Article']['body']), 'body missing %s'); + $this->assertTrue(isset($result[0]['Comment']['comment']), 'comment missing %s'); + $this->assertTrue(isset($result[0]['User']['user']), 'body missing %s'); + $this->assertFalse(isset($result[0]['Comment']['published']), 'published found %s'); + $this->assertFalse(isset($result[0]['User']['password']), 'password found %s'); + } /** * testFindConditionalBinding method * @@ -2944,7 +2987,13 @@ function testEmbeddedFindFields() { * @return void */ function testFindConditionalBinding() { - $this->Article->contain(array('User(user)', 'Tag' => array('fields' => array('tag', 'created'), 'conditions' => array('created >=' => '2007-03-18 12:24')))); + $this->Article->contain(array( + 'User(user)', + 'Tag' => array( + 'fields' => array('tag', 'created'), + 'conditions' => array('created >=' => '2007-03-18 12:24') + ) + )); $result = $this->Article->find('all', array('fields' => array('title'))); $expected = array( array( @@ -3021,7 +3070,13 @@ function testFindConditionalBinding() { ); $this->assertEqual($result, $expected); - $this->Article->contain(array('User(id,user)', 'Tag' => array('fields' => array('tag', 'created'), 'conditions' => array('created >=' => '2007-03-18 12:24')))); + $this->Article->contain(array( + 'User(id,user)', + 'Tag' => array( + 'fields' => array('tag', 'created'), + 'conditions' => array('created >=' => '2007-03-18 12:24') + ) + )); $result = $this->Article->find('all', array('fields' => array('title'))); $expected = array( array( From b3f860b762c301f1f042f53573bbd5d4863dd5fa Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Wed, 7 Apr 2010 02:20:05 +0530 Subject: [PATCH 1896/2083] Adding test case for Validation::url(). Disproves #552 --- cake/tests/cases/libs/validation.test.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cake/tests/cases/libs/validation.test.php b/cake/tests/cases/libs/validation.test.php index 7f51544e3..0472afa0a 100644 --- a/cake/tests/cases/libs/validation.test.php +++ b/cake/tests/cases/libs/validation.test.php @@ -1784,12 +1784,12 @@ function testIpv6() { * * @return void * @access public - */ + */ function testIpBoth() { $this->assertTrue(Validation::ip('0.0.0.0')); $this->assertTrue(Validation::ip('192.168.1.156')); $this->assertTrue(Validation::ip('255.255.255.255')); - + $this->assertFalse(Validation::ip('127.0.0')); $this->assertFalse(Validation::ip('127.0.0.a')); $this->assertFalse(Validation::ip('127.0.0.256')); @@ -1876,6 +1876,7 @@ function testUrl() { $this->assertFalse(Validation::url('www.cakephp.org', true)); $this->assertTrue(Validation::url('http://www.cakephp.org', true)); $this->assertTrue(Validation::url('http://example.com/~userdir/')); + $this->assertTrue(Validation::url('http://www.jaist.ac.jp/~hoangle/filesj/index.html')); $this->assertTrue(Validation::url('http://cakephp.org:80')); $this->assertTrue(Validation::url('http://cakephp.org:443')); From 07efd76b4272ca3cf02817d794d973257d490760 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 6 Apr 2010 22:44:23 -0400 Subject: [PATCH 1897/2083] Fixing tests that started failing because of removal of short routes on reverse routing. --- cake/tests/cases/libs/router.test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 4617fa244..9b02c6511 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -741,7 +741,7 @@ function testUrlGenerationPlugins() { 'lang' => 'en', 'controller' => 'shows', 'action' => 'index', 'page' => '1', )); - $expected = '/en/shows/page:1'; + $expected = '/en/shows/shows/page:1'; $this->assertEqual($result, $expected); } @@ -1125,7 +1125,7 @@ function testPrefixRoutingAndPlugins() { Router::parse('/'); $result = Router::url(array('plugin' => 'test_plugin', 'controller' => 'test_plugin', 'action' => 'index')); - $expected = '/admin/test_plugin'; + $expected = '/admin/test_plugin/test_plugin'; $this->assertEqual($result, $expected); Router::reload(); From 131578cb4257e384ec473deacb0a8fd4a19e86b0 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 6 Apr 2010 23:05:04 -0400 Subject: [PATCH 1898/2083] Implementing PluginShortRoute and some tests for its methods. --- cake/libs/router.php | 42 +++++++++++++++++++ cake/tests/cases/libs/router.test.php | 60 +++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) diff --git a/cake/libs/router.php b/cake/libs/router.php index e95549ddd..ede6ce170 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -1585,4 +1585,46 @@ function _writeUrl($params) { return $out; } } + +/** + * Plugin short route, that copies the plugin param to the controller parameters + * It is used for supporting /:plugin routes. + * + * @package cake.libs + */ +class PluginShortRoute extends CakeRoute { +/** + * Parses a string url into an array. If a plugin key is found, it will be copied to the + * controller parameter + * + * @param string $url The url to parse + * @return mixed false on failure, or an array of request parameters + */ + function parse($url) { + $params = parent::parse($url); + if (!$params) { + return false; + } + $params['controller'] = $params['plugin']; + return $params; + } + +/** + * Reverse route plugin shortcut urls. If the plugin and controller + * are not the same the match is an auto fail. + * + * @param array $url Array of parameters to convert to a string. + * @return mixed either false or a string url. + */ + function match($url) { + if (isset($url['controller']) && isset($url['plugin']) && $url['plugin'] != $url['controller']) { + return false; + } + $this->defaults['controller'] = $url['controller']; + $result = parent::match($url); + unset($this->defaults['controller']); + return $result; + } +} + ?> \ No newline at end of file diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 9b02c6511..91cbfe72c 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -2416,4 +2416,64 @@ function testParse() { } } +/** + * test case for PluginShortRoute + * + * @package cake.tests.libs + */ +class PluginShortRouteTestCase extends CakeTestCase { +/** + * startTest method + * + * @access public + * @return void + */ + function startTest() { + $this->_routing = Configure::read('Routing'); + Configure::write('Routing', array('admin' => null, 'prefixes' => array())); + Router::reload(); + } + +/** + * end the test and reset the environment + * + * @return void + **/ + function endTest() { + Configure::write('Routing', $this->_routing); + } + +/** + * test the parsing of routes. + * + * @return void + */ + function testParsing() { + $route =& new PluginShortRoute('/:plugin', array('action' => 'index'), array('plugin' => 'foo|bar')); + + $result = $route->parse('/foo'); + $this->assertEqual($result['plugin'], 'foo'); + $this->assertEqual($result['controller'], 'foo'); + $this->assertEqual($result['action'], 'index'); + + $result = $route->parse('/wrong'); + $this->assertFalse($result, 'Wrong plugin name matched %s'); + } + +/** + * test the reverse routing of the plugin shortcut urls. + * + * @return void + */ + function testMatch() { + $route =& new PluginShortRoute('/:plugin', array('action' => 'index'), array('plugin' => 'foo|bar')); + + $result = $route->match(array('plugin' => 'foo', 'controller' => 'posts', 'action' => 'index')); + $this->assertFalse($result, 'plugin controller mismatch was converted. %s'); + + $result = $route->match(array('plugin' => 'foo', 'controller' => 'foo', 'action' => 'index')); + $this->assertEqual($result, '/foo'); + } +} + ?> \ No newline at end of file From 7668894888bc992426f1715a6093c3c7b53bb3bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Wed, 7 Apr 2010 09:51:29 -0430 Subject: [PATCH 1899/2083] Fixing error introduced by previous commit --- cake/libs/model/datasources/dbo/dbo_postgres.php | 2 +- .../libs/model/datasources/dbo/dbo_postgres.test.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index 6c0f4a3d2..18212d902 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -493,7 +493,7 @@ function __quoteFunctionField($match) { $match[1] = trim(str_replace('DISTINCT', '', $match[1])); } if (strpos($match[1], '.') === false) { - $match[1] = $this->name($alias . '.' . $match[1]); + $match[1] = $this->name($match[1]); } else { $parts = explode('.', $match[1]); if (!Set::numeric($parts)) { diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php index 89be2bfa4..8f69e9ec1 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php @@ -795,6 +795,14 @@ function testQuoteDistinctInFunction() { $result = $this->db->fields($Article, null, array('COUNT(DISTINCT Article.id)')); $expected = array('COUNT(DISTINCT "Article"."id")'); $this->assertEqual($result, $expected); + + $result = $this->db->fields($Article, null, array('COUNT(DISTINCT id)')); + $expected = array('COUNT(DISTINCT "id")'); + $this->assertEqual($result, $expected); + + $result = $this->db->fields($Article, null, array('COUNT(DISTINCT FUNC(id))')); + $expected = array('COUNT(DISTINCT FUNC("id"))'); + $this->assertEqual($result, $expected); } } ?> \ No newline at end of file From 81dc0d42b904f5d90db43fbd2d3345d708c8b66a Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 8 Apr 2010 00:03:46 -0400 Subject: [PATCH 1900/2083] Adding PluginShortRoute into default connected routes. Fixes issues with the framework having built in 404s. Adding tests for the default connected routes. --- cake/libs/router.php | 5 ++++- cake/tests/cases/libs/router.test.php | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index ede6ce170..2239d59e5 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -572,7 +572,8 @@ function __connectDefaultRoutes() { foreach ($plugins as $key => $value) { $plugins[$key] = Inflector::underscore($value); } - $match = array('plugin' => implode('|', $plugins)); + $pluginPattern = implode('|', $plugins); + $match = array('plugin' => $pluginPattern); foreach ($this->__prefixes as $prefix) { $params = array('prefix' => $prefix, $prefix => true); @@ -580,6 +581,8 @@ function __connectDefaultRoutes() { $this->connect("/{$prefix}/:plugin/:controller", $indexParams, $match); $this->connect("/{$prefix}/:plugin/:controller/:action/*", $params, $match); } + $shortParams = array('routeClass' => 'PluginShortRoute', 'plugin' => $pluginPattern); + $this->connect('/:plugin', array('action' => 'index'), $shortParams); $this->connect('/:plugin/:controller', array('action' => 'index'), $match); $this->connect('/:plugin/:controller/:action/*', array(), $match); } diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 91cbfe72c..6e0689abe 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -1943,6 +1943,7 @@ function testConnectDefaultRoutes() { ) ), true); App::objects('plugin', null, false); + Router::reload(); $plugins = App::objects('plugin'); $plugin = Inflector::underscore($plugins[0]); @@ -1955,6 +1956,17 @@ function testConnectDefaultRoutes() { 'named' => array(), 'pass' => array() ); $this->assertEqual($result, $expected); + + $result = Router::url(array('plugin' => 'test_plugin', 'controller' => 'test_plugin', 'action' => 'index')); + $this->assertEqual($result, '/test_plugin'); + + $result = Router::parse('/test_plugin'); + $expected = array( + 'plugin' => 'test_plugin', 'controller' => 'test_plugin', 'action' => 'index', + 'named' => array(), 'pass' => array() + ); + + $this->assertEqual($result, $expected, 'Plugin shortcut route broken. %s'); } /** From 59f7cb47d34f70a6d61947fedf8b18c1a74a24d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Thu, 8 Apr 2010 18:23:07 -0430 Subject: [PATCH 1901/2083] Improving test coverage on FormHelper to show the usage of the 'secure' key for inputs. Fixing issue with select inputs that does not honor the value of 'secure' --- cake/libs/view/helpers/form.php | 9 +++++-- .../cases/libs/view/helpers/form.test.php | 27 ++++++++++++++++++- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index f92197190..c134d755f 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -1412,6 +1412,9 @@ function select($fieldName, $options = array(), $selected = null, $attributes = $escapeOptions = $attributes['escape']; unset($attributes['escape']); } + if (isset($attributes['secure'])) { + $secure = $attributes['secure']; + } if (isset($attributes['empty'])) { $showEmpty = $attributes['empty']; unset($attributes['empty']); @@ -1452,7 +1455,9 @@ function select($fieldName, $options = array(), $selected = null, $attributes = } if (!empty($tag) || isset($template)) { - $this->__secure(); + if (!isset($secure) || $secure == true) { + $this->__secure(); + } $select[] = sprintf($tag, $attributes['name'], $this->_parseAttributes( $attributes, array('name', 'value')) ); @@ -2169,4 +2174,4 @@ function _initInputField($field, $options = array()) { } } -?> \ No newline at end of file +?> diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 6948e1fc8..d65135981 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -1224,6 +1224,31 @@ function testFormSecuredRadio() { $this->assertEqual($this->Form->fields, $expected); } +/** + * testDisableSecurityUsingForm method + * + * @access public + * @return void + */ + function testDisableSecurityUsingForm() { + $this->Form->params['_Token']['key'] = 'testKey'; + $this->Form->params['_Token']['disabledFields'] = array(); + $this->Form->create(); + + $this->Form->hidden('Addresses.id', array('value' => '123456')); + $this->Form->input('Addresses.title'); + $this->Form->input('Addresses.first_name', array('secure' => false)); + $this->Form->input('Addresses.city', array('type' => 'textarea', 'secure' => false)); + $this->Form->input('Addresses.zip', array( + 'type' => 'select', 'options' => array(1,2), 'secure' => false + )); + + $result = $this->Form->fields; + $expected = array( + 'Addresses.id' => '123456', 'Addresses.title', + ); + $this->assertEqual($result, $expected); + } /** * testPasswordValidation method * @@ -6173,4 +6198,4 @@ function testInputTemplate() { $this->assertTags($result, $expected); } } -?> \ No newline at end of file +?> From 9d3a2c61d415cb422a19cb6d218d73a2ebc97a36 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 8 Apr 2010 22:40:45 -0400 Subject: [PATCH 1902/2083] Removing test that is no longer relevant due to changes in Router. --- .../libs/view/helpers/paginator.test.php | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/cake/tests/cases/libs/view/helpers/paginator.test.php b/cake/tests/cases/libs/view/helpers/paginator.test.php index 9f1c2d02e..65c716b2c 100644 --- a/cake/tests/cases/libs/view/helpers/paginator.test.php +++ b/cake/tests/cases/libs/view/helpers/paginator.test.php @@ -218,29 +218,6 @@ function testSortLinks() { $this->assertPattern('/\/accounts\/index\/param\/page:1\/sort:title\/direction:desc" class="asc">Title<\/a>$/', $result); } -/** - * test sort() works with plugin shortcut routes. - * - * @return void - */ - function testSortWithPluginShortcuts() { - Router::reload(); - Router::parse('/'); - Router::setRequestInfo(array( - array('plugin' => 'test_plugin', 'controller' => 'test_plugin', 'action' => 'something', 'pass' => array(), 'form' => array(), 'url' => array('url' => 'test_plugin/something')), - array('base' => '/', 'here' => '/test_plugin/', 'webroot' => '/') - )); - - $result = $this->Paginator->sort('title'); - $expected = array( - 'a' => array('href' => '/test_plugin/something/page:1/sort:title/direction:asc'), - 'Title', - '/a' - ); - $this->assertTags($result, $expected); - } - - /** * testSortLinksUsingDirectionOption method * From 03e3c3249f57e185f74db6a973929e53a414efb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Thu, 8 Apr 2010 22:15:49 -0430 Subject: [PATCH 1903/2083] Removing whitespace at the end of the file --- cake/libs/view/helpers/form.php | 2 +- cake/tests/cases/libs/view/helpers/form.test.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index c134d755f..856d2efa2 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -2174,4 +2174,4 @@ function _initInputField($field, $options = array()) { } } -?> +?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index d65135981..756a2ff69 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -6198,4 +6198,4 @@ function testInputTemplate() { $this->assertTags($result, $expected); } } -?> +?> \ No newline at end of file From 9f601ea334e6bd7b1b2b426f1c0b0a6a5340d2a1 Mon Sep 17 00:00:00 2001 From: sdoney <sdoney@gmail.com> Date: Sun, 4 Apr 2010 23:31:50 -0400 Subject: [PATCH 1904/2083] Adding/Updating @link tags pointing to cookbook sections Signed-off-by: Mark Story <mark@mark-story.com> --- cake/basics.php | 3 +++ cake/console/libs/schema.php | 2 +- cake/libs/configure.php | 2 +- cake/libs/controller/app_controller.php | 1 + cake/libs/controller/pages_controller.php | 1 + cake/libs/model/behaviors/acl.php | 2 ++ cake/libs/model/behaviors/containable.php | 2 ++ cake/libs/model/behaviors/translate.php | 1 + cake/libs/model/behaviors/tree.php | 13 +++++++++++++ cake/libs/model/model.php | 2 +- 10 files changed, 26 insertions(+), 3 deletions(-) diff --git a/cake/basics.php b/cake/basics.php index e58eec6e6..d259edf91 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -52,6 +52,7 @@ function clone($object) * `config('config1', 'config2');` * * @return boolean Success + * @link http://book.cakephp.org/view/1125/config */ function config() { $args = func_get_args(); @@ -82,6 +83,7 @@ function config() { * * @param string $name Filename without the .php part * @deprecated Will be removed in 2.0 + * @link http://book.cakephp.org/view/1140/uses */ function uses() { $args = func_get_args(); @@ -99,6 +101,7 @@ function uses() { * @param boolean $showHtml If set to true, the method prints the debug data in a screen-friendly way. * @param boolean $showFrom If set to true, the method prints from where the function was called. * @link http://book.cakephp.org/view/1190/Basic-Debugging + * @link http://book.cakephp.org/view/1128/debug */ function debug($var = false, $showHtml = false, $showFrom = true) { if (Configure::read() > 0) { diff --git a/cake/console/libs/schema.php b/cake/console/libs/schema.php index b8efe2a55..e83585417 100644 --- a/cake/console/libs/schema.php +++ b/cake/console/libs/schema.php @@ -28,7 +28,7 @@ * * @package cake * @subpackage cake.cake.console.libs - * @link http://book.cakephp.org/view/1523s/Schema-management-and-migrations + * @link http://book.cakephp.org/view/1523/Schema-management-and-migrations */ class SchemaShell extends Shell { diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 802ed1c3b..d42e0eafa 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -439,7 +439,7 @@ function __loadBootstrap($boot) { /** * Class/file loader and path management. * - * @link http://book.cakephp.org/view/499/The-App-Class + * @link http://book.cakephp.org/view/933/The-App-Class * @since CakePHP(tm) v 1.2.0.6001 * @package cake * @subpackage cake.cake.libs diff --git a/cake/libs/controller/app_controller.php b/cake/libs/controller/app_controller.php index ef3fe6c35..5abaac2ad 100644 --- a/cake/libs/controller/app_controller.php +++ b/cake/libs/controller/app_controller.php @@ -30,6 +30,7 @@ * * @package cake * @subpackage cake.cake.libs.controller + * @link http://book.cakephp.org/view/957/The-App-Controller */ class AppController extends Controller { } diff --git a/cake/libs/controller/pages_controller.php b/cake/libs/controller/pages_controller.php index b26f71a74..d22e1bb9a 100644 --- a/cake/libs/controller/pages_controller.php +++ b/cake/libs/controller/pages_controller.php @@ -27,6 +27,7 @@ * * @package cake * @subpackage cake.cake.libs.controller + * @link http://book.cakephp.org/view/958/The-Pages-Controller */ class PagesController extends AppController { diff --git a/cake/libs/model/behaviors/acl.php b/cake/libs/model/behaviors/acl.php index 3bc033b61..94f8025e6 100644 --- a/cake/libs/model/behaviors/acl.php +++ b/cake/libs/model/behaviors/acl.php @@ -25,6 +25,7 @@ * * @package cake * @subpackage cake.cake.libs.model.behaviors + * @link http://book.cakephp.org/view/1320/ACL */ class AclBehavior extends ModelBehavior { @@ -69,6 +70,7 @@ function setup(&$model, $config = array()) { * @param mixed $ref * @return array * @access public + * @link http://book.cakephp.org/view/1322/node */ function node(&$model, $ref = null) { $type = $this->__typeMaps[strtolower($this->settings[$model->name]['type'])]; diff --git a/cake/libs/model/behaviors/containable.php b/cake/libs/model/behaviors/containable.php index 31cd48672..170c78f5f 100644 --- a/cake/libs/model/behaviors/containable.php +++ b/cake/libs/model/behaviors/containable.php @@ -26,6 +26,7 @@ * * @package cake * @subpackage cake.cake.console.libs + * @link http://book.cakephp.org/view/1323/Containable */ class ContainableBehavior extends ModelBehavior { @@ -234,6 +235,7 @@ function afterFind(&$Model, $results, $primary) { * @param object $Model Model on which binding restriction is being applied * @return void * @access public + * @link http://book.cakephp.org/view/1323/Containable#Using-Containable-1324 */ function contain(&$Model) { $args = func_get_args(); diff --git a/cake/libs/model/behaviors/translate.php b/cake/libs/model/behaviors/translate.php index f9cfed4ca..8b79938a0 100644 --- a/cake/libs/model/behaviors/translate.php +++ b/cake/libs/model/behaviors/translate.php @@ -23,6 +23,7 @@ * * @package cake * @subpackage cake.cake.libs.model.behaviors + * @link http://book.cakephp.org/view/1328/Translate */ class TranslateBehavior extends ModelBehavior { diff --git a/cake/libs/model/behaviors/tree.php b/cake/libs/model/behaviors/tree.php index 349dcd5eb..44f97ac19 100644 --- a/cake/libs/model/behaviors/tree.php +++ b/cake/libs/model/behaviors/tree.php @@ -28,6 +28,7 @@ * @see http://en.wikipedia.org/wiki/Tree_traversal * @package cake * @subpackage cake.cake.libs.model.behaviors + * @link http://book.cakephp.org/view/1339/Tree */ class TreeBehavior extends ModelBehavior { @@ -206,6 +207,7 @@ function beforeSave(&$Model) { * @param boolean $direct whether to count direct, or all, children * @return integer number of child nodes * @access public + * @link http://book.cakephp.org/view/1347/Counting-children */ function childcount(&$Model, $id = null, $direct = false) { if (is_array($id)) { @@ -252,6 +254,7 @@ function childcount(&$Model, $id = null, $direct = false) { * @param integer $recursive The number of levels deep to fetch associated records * @return array Array of child nodes * @access public + * @link http://book.cakephp.org/view/1346/Children */ function children(&$Model, $id = null, $direct = false, $fields = null, $order = null, $limit = null, $page = 1, $recursive = null) { if (is_array($id)) { @@ -309,6 +312,7 @@ function children(&$Model, $id = null, $direct = false, $fields = null, $order = * @param integer $recursive The number of levels deep to fetch associated records * @return array An associative array of records, where the id is the key, and the display field is the value * @access public + * @link http://book.cakephp.org/view/1348/generatetreelist */ function generatetreelist(&$Model, $conditions = null, $keyPath = null, $valuePath = null, $spacer = '_', $recursive = null) { $overrideRecursive = $recursive; @@ -364,6 +368,7 @@ function generatetreelist(&$Model, $conditions = null, $keyPath = null, $valuePa * @param integer $recursive The number of levels deep to fetch associated records * @return array Array of data for the parent node * @access public + * @link http://book.cakephp.org/view/1349/getparentnode */ function getparentnode(&$Model, $id = null, $fields = null, $recursive = null) { if (is_array($id)) { @@ -397,6 +402,7 @@ function getparentnode(&$Model, $id = null, $fields = null, $recursive = null) { * @param integer $recursive The number of levels deep to fetch associated records * @return array Array of nodes from top most parent to current node * @access public + * @link http://book.cakephp.org/view/1350/getpath */ function getpath(&$Model, $id = null, $fields = null, $recursive = null) { if (is_array($id)) { @@ -434,6 +440,7 @@ function getpath(&$Model, $id = null, $fields = null, $recursive = null) { * @param mixed $number how many places to move the node or true to move to last position * @return boolean true on success, false on failure * @access public + * @link http://book.cakephp.org/view/1352/moveDown */ function movedown(&$Model, $id = null, $number = 1) { if (is_array($id)) { @@ -492,6 +499,7 @@ function movedown(&$Model, $id = null, $number = 1) { * @param mixed $number how many places to move the node, or true to move to first position * @return boolean true on success, false on failure * @access public + * @link http://book.cakephp.org/view/1353/moveUp */ function moveup(&$Model, $id = null, $number = 1) { if (is_array($id)) { @@ -556,6 +564,7 @@ function moveup(&$Model, $id = null, $number = 1) { * delete, or the id of the parent to set as the parent_id * @return boolean true on success, false on failure * @access public + * @link http://book.cakephp.org/view/1628/Recover */ function recover(&$Model, $mode = 'parent', $missingParentAction = null) { if (is_array($mode)) { @@ -634,6 +643,8 @@ function recover(&$Model, $mode = 'parent', $missingParentAction = null) { * @param AppModel $Model Model instance * @param array $options array of options to use in reordering. * @return boolean true on success, false on failure + * @link http://book.cakephp.org/view/1355/reorder + * @link http://book.cakephp.org/view/1629/Reorder */ function reorder(&$Model, $options = array()) { $options = array_merge(array('id' => null, 'field' => $Model->displayField, 'order' => 'ASC', 'verify' => true), $options); @@ -673,6 +684,7 @@ function reorder(&$Model, $options = array()) { * @param boolean $delete whether to delete the node after reparenting children (if any) * @return boolean true on success, false on failure * @access public + * @link http://book.cakephp.org/view/1354/removeFromTree */ function removefromtree(&$Model, $id = null, $delete = false) { if (is_array($id)) { @@ -741,6 +753,7 @@ function removefromtree(&$Model, $id = null, $delete = false) { * @return mixed true if the tree is valid or empty, otherwise an array of (error type [index, node], * [incorrect left/right index,node id], message) * @access public + * @link http://book.cakephp.org/view/1630/Verify */ function verify(&$Model) { extract($this->settings[$Model->alias]); diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index b5f36d9da..bdecc9f5a 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -41,7 +41,7 @@ * * @package cake * @subpackage cake.cake.libs.model - * @link http://book.cakephp.org/view/66/Models + * @link http://book.cakephp.org/view/1000/Models */ class Model extends Overloadable { From 94603b2cb702665c214444fbf3a8cea7b9535d73 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 9 Apr 2010 13:19:47 +1000 Subject: [PATCH 1905/2083] Making dispatcher constructor public and removing return statement. --- cake/dispatcher.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/dispatcher.php b/cake/dispatcher.php index b0efa8b97..25794bca5 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -72,12 +72,12 @@ class Dispatcher extends Object { /** * Constructor. */ - function __construct($url = null, $base = false) { + public function __construct($url = null, $base = false) { if ($base !== false) { Configure::write('App.base', $base); } if ($url !== null) { - return $this->dispatch($url); + $this->dispatch($url); } } From 1d39b937858cb7bbaad299a208968c59c1a2f102 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 9 Apr 2010 13:24:23 +1000 Subject: [PATCH 1906/2083] Change access modifier on _stop() to protected. --- cake/libs/object.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/object.php b/cake/libs/object.php index 39e92d632..0c633555b 100644 --- a/cake/libs/object.php +++ b/cake/libs/object.php @@ -128,7 +128,7 @@ public function dispatchMethod($method, $params = array()) { * @param $status see http://php.net/exit for values * @return void */ - public function _stop($status = 0) { + protected function _stop($status = 0) { exit($status); } From 19b66b86173bf42eb9316fc6eccd6131f60bb99c Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 9 Apr 2010 13:30:58 +1000 Subject: [PATCH 1907/2083] Change luhn validation to public. --- cake/libs/validation.php | 12 +++--- cake/tests/cases/libs/validation.test.php | 46 +++++++++++------------ 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/cake/libs/validation.php b/cake/libs/validation.php index 60e3191c5..1c4c50c10 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -210,7 +210,7 @@ public function blank($check) { * @param string $regex A custom regex can also be passed, this will be used instead of the defined regex values * @return boolean Success * @access public - * @see Validation::_luhn() + * @see Validation::luhn() */ function cc($check, $type = 'fast', $deep = false, $regex = null) { $_this =& Validation::getInstance(); @@ -231,7 +231,7 @@ function cc($check, $type = 'fast', $deep = false, $regex = null) { if (!is_null($_this->regex)) { if ($_this->_check()) { - return $_this->_luhn(); + return $_this->luhn(); } } $cards = array( @@ -258,7 +258,7 @@ function cc($check, $type = 'fast', $deep = false, $regex = null) { $_this->regex = $cards['all'][strtolower($value)]; if ($_this->_check()) { - return $_this->_luhn(); + return $_this->luhn(); } } } elseif ($_this->type == 'all') { @@ -266,14 +266,14 @@ function cc($check, $type = 'fast', $deep = false, $regex = null) { $_this->regex = $value; if ($_this->_check()) { - return $_this->_luhn(); + return $_this->luhn(); } } } else { $_this->regex = $cards['fast']; if ($_this->_check()) { - return $_this->_luhn(); + return $_this->luhn(); } } } @@ -956,7 +956,7 @@ protected function _extract($params) { * @see http://en.wikipedia.org/wiki/Luhn_algorithm * @return boolean Success */ - protected function _luhn() { + public function luhn() { $_this =& Validation::getInstance(); if ($_this->deep !== true) { return true; diff --git a/cake/tests/cases/libs/validation.test.php b/cake/tests/cases/libs/validation.test.php index b708d7742..1aec086e2 100644 --- a/cake/tests/cases/libs/validation.test.php +++ b/cake/tests/cases/libs/validation.test.php @@ -707,73 +707,73 @@ function testLuhn() { //American Express $this->Validation->check = '370482756063980'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); //BankCard $this->Validation->check = '5610745867413420'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); //Diners Club 14 $this->Validation->check = '30155483651028'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); //2004 MasterCard/Diners Club Alliance International 14 $this->Validation->check = '36747701998969'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); //2004 MasterCard/Diners Club Alliance US & Canada 16 $this->Validation->check = '5597511346169950'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); //Discover $this->Validation->check = '6011802876467237'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); //enRoute $this->Validation->check = '201496944158937'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); //JCB 15 digit $this->Validation->check = '210034762247893'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); //JCB 16 digit $this->Validation->check = '3096806857839939'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); //Maestro (debit card) $this->Validation->check = '5020147409985219'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); //Mastercard $this->Validation->check = '5580424361774366'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); //Solo 16 $this->Validation->check = '6767432107064987'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); //Solo 18 $this->Validation->check = '676714834398858593'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); //Solo 19 $this->Validation->check = '6767838565218340113'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); //Switch 16 $this->Validation->check = '5641829171515733'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); //Switch 18 $this->Validation->check = '493622764224625174'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); //Switch 19 $this->Validation->check = '6759603460617628716'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); //VISA 13 digit $this->Validation->check = '4024007174754'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); //VISA 16 digit $this->Validation->check = '4916375389940009'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); //Visa Electron $this->Validation->check = '4175003346287100'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); //Voyager $this->Validation->check = '869940697287073'; - $this->assertTrue($this->Validation->_luhn()); + $this->assertTrue($this->Validation->luhn()); $this->Validation->check = '0000000000000000'; - $this->assertFalse($this->Validation->_luhn()); + $this->assertFalse($this->Validation->luhn()); $this->Validation->check = '869940697287173'; - $this->assertFalse($this->Validation->_luhn()); + $this->assertFalse($this->Validation->luhn()); } /** From 59fb1344551a291c603bb47894e56ae55967efd8 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 9 Apr 2010 13:33:25 +1000 Subject: [PATCH 1908/2083] Change private methods to specify access, and add proected on methods that missed mass updates. --- cake/libs/validation.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cake/libs/validation.php b/cake/libs/validation.php index 1c4c50c10..f758f7ef1 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -890,9 +890,8 @@ public function userDefined($check, $object, $method, $args = null) { * @param mixed $check The value to check or an array of parameters for the method to be called. * @param string $classPrefix The prefix for the class to do the validation. * @return mixed Return of Passed method, false on failure - * @access protected - **/ - function _pass($method, $check, $classPrefix) { + */ + protected function _pass($method, $check, $classPrefix) { $className = ucwords($classPrefix) . 'Validation'; if (!class_exists($className)) { trigger_error(sprintf(__('Could not find %s class, unable to complete validation.', true), $className), E_USER_WARNING); @@ -985,7 +984,7 @@ public function luhn() { * @return void * @access private */ - function __populateIp() { + private function __populateIp() { if (!isset($this->__pattern['IPv6'])) { $pattern = '((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}'; $pattern .= '(:|((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})'; @@ -1016,7 +1015,7 @@ function __populateIp() { * @return void * @access private */ - function __reset() { + private function __reset() { $this->check = null; $this->regex = null; $this->country = null; From c38249ac286d3b04b602df564ce874acdde17eb5 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Thu, 8 Apr 2010 23:36:04 -0400 Subject: [PATCH 1909/2083] Updating HtmlHelper + JavascriptHelper to call assetTimestamp() after webroot(). This allows theme files in webroot/theme to be correctly timestamped. Updating tests to reflect changes in behaviour. Fixes #244 --- cake/libs/view/helper.php | 3 +- cake/libs/view/helpers/html.php | 6 ++-- cake/libs/view/helpers/javascript.php | 2 +- cake/tests/cases/libs/view/helper.test.php | 4 +++ .../cases/libs/view/helpers/html.test.php | 29 ++++++++++++++----- 5 files changed, 32 insertions(+), 12 deletions(-) diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index 5f8ff75c0..bb1e80429 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -245,7 +245,8 @@ function assetTimestamp($path) { Configure::read('Asset.timestamp') === 'force' ); if (strpos($path, '?') === false && $timestampEnabled) { - $path .= '?' . @filemtime(WWW_ROOT . str_replace('/', DS, $path)); + $filepath = preg_replace('/^' . preg_quote($this->webroot, '/') . '/', '', $path); + $path .= '?' . @filemtime(WWW_ROOT . str_replace('/', DS, $filepath)); } return $path; } diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php index 840c7f3ea..6663abc72 100644 --- a/cake/libs/view/helpers/html.php +++ b/cake/libs/view/helpers/html.php @@ -358,7 +358,7 @@ function css($path, $rel = null, $options = array()) { $path .= '.css'; } } - $url = $this->webroot($this->assetTimestamp($path)); + $url = $this->assetTimestamp($this->webroot($path)); if (Configure::read('Asset.filter.css')) { $pos = strpos($url, CSS_URL); @@ -434,7 +434,7 @@ function script($url, $options = array()) { if (strpos($url, '?') === false && strpos($url, '.js') === false) { $url .= '.js'; } - $url = $this->webroot($this->assetTimestamp($url)); + $url = $this->assetTimestamp($this->webroot($url)); if (Configure::read('Asset.filter.js')) { $url = str_replace(JS_URL, 'cjs/', $url); @@ -608,7 +608,7 @@ function image($path, $options = array()) { if ($path[0] !== '/') { $path = IMAGES_URL . $path; } - $path = $this->webroot($this->assetTimestamp($path)); + $path = $this->assetTimestamp($this->webroot($path)); } if (!isset($options['alt'])) { diff --git a/cake/libs/view/helpers/javascript.php b/cake/libs/view/helpers/javascript.php index de42a6799..f1269367d 100644 --- a/cake/libs/view/helpers/javascript.php +++ b/cake/libs/view/helpers/javascript.php @@ -265,7 +265,7 @@ function link($url, $inline = true) { $url .= '.js'; } } - $url = $this->webroot($this->assetTimestamp($url)); + $url = $this->assetTimestamp($this->webroot($url)); if (Configure::read('Asset.filter.js')) { $pos = strpos($url, JS_URL); diff --git a/cake/tests/cases/libs/view/helper.test.php b/cake/tests/cases/libs/view/helper.test.php index 804f325c5..f8454739d 100644 --- a/cake/tests/cases/libs/view/helper.test.php +++ b/cake/tests/cases/libs/view/helper.test.php @@ -467,6 +467,10 @@ function testAssetTimestamp() { $result = $this->Helper->assetTimestamp(CSS_URL . 'cake.generic.css?someparam'); $this->assertEqual($result, CSS_URL . 'cake.generic.css?someparam'); + $this->Helper->webroot = '/some/dir/'; + $result = $this->Helper->assetTimestamp('/some/dir/' . CSS_URL . 'cake.generic.css'); + $this->assertPattern('/' . preg_quote(CSS_URL . 'cake.generic.css?', '/') . '[0-9]+/', $result); + Configure::write('debug', $_debug); Configure::write('Asset.timestamp', $_timestamp); } diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/cake/tests/cases/libs/view/helpers/html.test.php index 17011ae5c..8800e6eec 100644 --- a/cake/tests/cases/libs/view/helpers/html.test.php +++ b/cake/tests/cases/libs/view/helpers/html.test.php @@ -304,14 +304,15 @@ function testImageTag() { function testImageWithTimestampping() { Configure::write('Asset.timestamp', 'force'); + $this->Html->webroot = '/'; $result = $this->Html->image('cake.icon.png'); - $this->assertTags($result, array('img' => array('src' => 'preg:/img\/cake\.icon\.png\?\d+/', 'alt' => ''))); + $this->assertTags($result, array('img' => array('src' => 'preg:/\/img\/cake\.icon\.png\?\d+/', 'alt' => ''))); Configure::write('debug', 0); Configure::write('Asset.timestamp', 'force'); $result = $this->Html->image('cake.icon.png'); - $this->assertTags($result, array('img' => array('src' => 'preg:/img\/cake\.icon\.png\?\d+/', 'alt' => ''))); + $this->assertTags($result, array('img' => array('src' => 'preg:/\/img\/cake\.icon\.png\?\d+/', 'alt' => ''))); $webroot = $this->Html->webroot; $this->Html->webroot = '/testing/longer/'; @@ -331,30 +332,42 @@ function testImageWithTimestampping() { * @link https://trac.cakephp.org/ticket/6490 */ function testImageTagWithTheme() { + if ($this->skipIf(!is_writable(WWW_ROOT . 'theme'), 'Cannot write to webroot/theme')) { + return; + } + App::import('Core', 'File'); + + $testfile = WWW_ROOT . 'theme' . DS . 'test_theme' . DS . 'img' . DS . '__cake_test_image.gif'; + $file =& new File($testfile, true); + App::build(array( 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS) )); Configure::write('Asset.timestamp', true); Configure::write('debug', 1); - + + $this->Html->webroot = '/'; $this->Html->theme = 'test_theme'; - $result = $this->Html->image('cake.power.gif'); + $result = $this->Html->image('__cake_test_image.gif'); $this->assertTags($result, array( 'img' => array( - 'src' => 'preg:/theme\/test_theme\/img\/cake\.power\.gif\?\d+/', + 'src' => 'preg:/\/theme\/test_theme\/img\/__cake_test_image\.gif\?\d+/', 'alt' => '' ))); $webroot = $this->Html->webroot; $this->Html->webroot = '/testing/'; - $result = $this->Html->image('cake.power.gif'); + $result = $this->Html->image('__cake_test_image.gif'); $this->assertTags($result, array( 'img' => array( - 'src' => 'preg:/\/testing\/theme\/test_theme\/img\/cake\.power\.gif\?\d+/', + 'src' => 'preg:/\/testing\/theme\/test_theme\/img\/__cake_test_image\.gif\?\d+/', 'alt' => '' ))); $this->Html->webroot = $webroot; + + $dir =& new Folder(WWW_ROOT . 'theme' . DS . 'test_theme'); + $dir->delete(); } /** @@ -364,6 +377,7 @@ function testImageTagWithTheme() { * @return void */ function testThemeAssetsInMainWebrootPath() { + Configure::write('Asset.timestamp', false); App::build(array( 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS) )); @@ -542,6 +556,7 @@ function testScriptTimestamping() { * @return void */ function testScript() { + Configure::write('Asset.timestamp', false); $result = $this->Html->script('foo'); $expected = array( 'script' => array('type' => 'text/javascript', 'src' => 'js/foo.js') From ea635d6bea76029b4ba72833671a8c977b57f815 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 9 Apr 2010 20:41:28 +1000 Subject: [PATCH 1910/2083] Fix protected call for _build on CakeSchema, and associated references. --- cake/libs/model/cake_schema.php | 8 ++++---- cake/tests/lib/cake_test_fixture.php | 6 ++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/cake/libs/model/cake_schema.php b/cake/libs/model/cake_schema.php index 7ef7d8245..db8619c32 100644 --- a/cake/libs/model/cake_schema.php +++ b/cake/libs/model/cake_schema.php @@ -102,7 +102,7 @@ function __construct($options = array()) { } $options = array_merge(get_object_vars($this), $options); - $this->_build($options); + $this->build($options); } /** @@ -111,7 +111,7 @@ function __construct($options = array()) { * @param array $data loaded object properties * @return void */ - protected function _build($data) { + public function build($data) { $file = null; foreach ($data as $key => $val) { if (!empty($val)) { @@ -162,7 +162,7 @@ public function &load($options = array()) { $options = array('path' => $options); } - $this->_build($options); + $this->build($options); extract(get_object_vars($this)); $class = $name .'Schema'; @@ -318,7 +318,7 @@ public function read($options = array()) { public function write($object, $options = array()) { if (is_object($object)) { $object = get_object_vars($object); - $this->_build($object); + $this->build($object); } if (is_array($object)) { diff --git a/cake/tests/lib/cake_test_fixture.php b/cake/tests/lib/cake_test_fixture.php index dffa4988e..ade734660 100644 --- a/cake/tests/lib/cake_test_fixture.php +++ b/cake/tests/lib/cake_test_fixture.php @@ -36,14 +36,12 @@ class CakeTestFixture extends Object { /** * Cake's DBO driver (e.g: DboMysql). * - * @access public */ public $db = null; /** * Full Table Name * - * @access public */ public $table = null; @@ -131,7 +129,7 @@ public function create(&$db) { return false; } - $this->Schema->_build(array($this->table => $this->fields)); + $this->Schema->build(array($this->table => $this->fields)); return ( $db->execute($db->createSchema($this->Schema), array('log' => false)) !== false ); @@ -144,7 +142,7 @@ public function create(&$db) { * @return boolean True on success, false on failure */ public function drop(&$db) { - $this->Schema->_build(array($this->table => $this->fields)); + $this->Schema->build(array($this->table => $this->fields)); return ( $db->execute($db->dropSchema($this->Schema), array('log' => false)) !== false ); From ac81ba75cb5f3b969cb76406f7bc30c15c56ba23 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 9 Apr 2010 21:17:55 +1000 Subject: [PATCH 1911/2083] Added timezone setting to allow tests to pass in all timezones. --- cake/tests/cases/libs/view/helpers/time.test.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cake/tests/cases/libs/view/helpers/time.test.php b/cake/tests/cases/libs/view/helpers/time.test.php index e865bf296..f0ad6beae 100644 --- a/cake/tests/cases/libs/view/helpers/time.test.php +++ b/cake/tests/cases/libs/view/helpers/time.test.php @@ -661,7 +661,9 @@ function testConvertSpecifiers() { 'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS) ), true); Configure::write('Config.language', 'time_test'); + $time = 1263487419; // Thu Jan 14 11:43:39 2010 + date_default_timezone_set('Etc/GMT+5'); $result = $this->Time->convertSpecifiers('%a', $time); $expected = 'jue'; From cb0ae6ed762e5662e0fa566e8edfd565ab2fcdaf Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 9 Apr 2010 21:20:01 +1000 Subject: [PATCH 1912/2083] Fixed TimeHelper tests. Force setting of timezone to GMT+5 to ensure tests are passing. --- cake/tests/cases/libs/view/helpers/time.test.php | 1 + 1 file changed, 1 insertion(+) diff --git a/cake/tests/cases/libs/view/helpers/time.test.php b/cake/tests/cases/libs/view/helpers/time.test.php index e865bf296..f8bb88d32 100644 --- a/cake/tests/cases/libs/view/helpers/time.test.php +++ b/cake/tests/cases/libs/view/helpers/time.test.php @@ -662,6 +662,7 @@ function testConvertSpecifiers() { ), true); Configure::write('Config.language', 'time_test'); $time = 1263487419; // Thu Jan 14 11:43:39 2010 + date_default_timezone_set('Etc/GMT+5'); $result = $this->Time->convertSpecifiers('%a', $time); $expected = 'jue'; From 90a468bf9fe85aff7c9dbbafa032e1841a1b0b2d Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 9 Apr 2010 22:06:06 +1000 Subject: [PATCH 1913/2083] Removing mention of external site from test cases. --- cake/tests/cases/libs/validation.test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/validation.test.php b/cake/tests/cases/libs/validation.test.php index 0472afa0a..28fad3178 100644 --- a/cake/tests/cases/libs/validation.test.php +++ b/cake/tests/cases/libs/validation.test.php @@ -1876,7 +1876,7 @@ function testUrl() { $this->assertFalse(Validation::url('www.cakephp.org', true)); $this->assertTrue(Validation::url('http://www.cakephp.org', true)); $this->assertTrue(Validation::url('http://example.com/~userdir/')); - $this->assertTrue(Validation::url('http://www.jaist.ac.jp/~hoangle/filesj/index.html')); + $this->assertTrue(Validation::url('http://example.com/~userdir/subdir/index.html')); $this->assertTrue(Validation::url('http://cakephp.org:80')); $this->assertTrue(Validation::url('http://cakephp.org:443')); From 60bb9a9b5666f0a47612fc0ad7534f8d43cff5d8 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 9 Apr 2010 22:06:44 +1000 Subject: [PATCH 1914/2083] Spacing doc blocks. --- cake/libs/router.php | 1 + 1 file changed, 1 insertion(+) diff --git a/cake/libs/router.php b/cake/libs/router.php index 2239d59e5..014c990b3 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -1596,6 +1596,7 @@ function _writeUrl($params) { * @package cake.libs */ class PluginShortRoute extends CakeRoute { + /** * Parses a string url into an array. If a plugin key is found, it will be copied to the * controller parameter From 75c741f5a61aa17794bc5f93bcfcb9b270b44ed4 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 9 Apr 2010 22:55:43 +1000 Subject: [PATCH 1915/2083] Fix scaffold test on console, replaced 'var' with 'public'. --- cake/tests/cases/console/libs/tasks/controller.test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index cdd10dcef..2cd0d9892 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -259,7 +259,7 @@ public function testBake() { $result = $this->Task->bake('Articles', 'scaffold', $helpers, $components); $this->assertPattern('/class ArticlesController extends AppController/', $result); - $this->assertPattern('/var \$scaffold/', $result); + $this->assertPattern('/public \$scaffold/', $result); $this->assertNoPattern('/helpers/', $result); $this->assertNoPattern('/components/', $result); From b22b3b1f4147212aa665674c30542736077404ac Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Fri, 9 Apr 2010 22:58:06 +1000 Subject: [PATCH 1916/2083] Fix a bunch of fixture tests testing for access modifiers. --- .../cases/console/libs/tasks/fixture.test.php | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/cake/tests/cases/console/libs/tasks/fixture.test.php b/cake/tests/cases/console/libs/tasks/fixture.test.php index 381080c24..34ca63b1a 100644 --- a/cake/tests/cases/console/libs/tasks/fixture.test.php +++ b/cake/tests/cases/console/libs/tasks/fixture.test.php @@ -144,8 +144,8 @@ public function testImportRecordsFromDatabaseWithConditions() { $result = $this->Task->bake('Article', false, array('fromTable' => true, 'schema' => 'Article', 'records' => false)); $this->assertPattern('/class ArticleFixture extends CakeTestFixture/', $result); - $this->assertPattern('/var \$records/', $result); - $this->assertPattern('/var \$import/', $result); + $this->assertPattern('/public \$records/', $result); + $this->assertPattern('/public \$import/', $result); $this->assertPattern("/'title' => 'First Article'/", $result, 'Missing import data %s'); $this->assertPattern('/Second Article/', $result, 'Missing import data %s'); $this->assertPattern('/Third Article/', $result, 'Missing import data %s'); @@ -265,28 +265,28 @@ public function testBake() { $result = $this->Task->bake('Article'); $this->assertPattern('/class ArticleFixture extends CakeTestFixture/', $result); - $this->assertPattern('/var \$fields/', $result); - $this->assertPattern('/var \$records/', $result); - $this->assertNoPattern('/var \$import/', $result); + $this->assertPattern('/public \$fields/', $result); + $this->assertPattern('/public \$records/', $result); + $this->assertNoPattern('/public \$import/', $result); $result = $this->Task->bake('Article', 'comments'); $this->assertPattern('/class ArticleFixture extends CakeTestFixture/', $result); - $this->assertPattern('/var \$name \= \'Article\';/', $result); - $this->assertPattern('/var \$table \= \'comments\';/', $result); - $this->assertPattern('/var \$fields = array\(/', $result); + $this->assertPattern('/public \$name \= \'Article\';/', $result); + $this->assertPattern('/public \$table \= \'comments\';/', $result); + $this->assertPattern('/public \$fields = array\(/', $result); $result = $this->Task->bake('Article', 'comments', array('records' => true)); - $this->assertPattern("/var \\\$import \= array\('records' \=\> true\);/", $result); - $this->assertNoPattern('/var \$records/', $result); + $this->assertPattern("/public \\\$import \= array\('records' \=\> true\);/", $result); + $this->assertNoPattern('/public \$records/', $result); $result = $this->Task->bake('Article', 'comments', array('schema' => 'Article')); - $this->assertPattern("/var \\\$import \= array\('model' \=\> 'Article'\);/", $result); - $this->assertNoPattern('/var \$fields/', $result); + $this->assertPattern("/public \\\$import \= array\('model' \=\> 'Article'\);/", $result); + $this->assertNoPattern('/public \$fields/', $result); $result = $this->Task->bake('Article', 'comments', array('schema' => 'Article', 'records' => true)); - $this->assertPattern("/var \\\$import \= array\('model' \=\> 'Article'\, 'records' \=\> true\);/", $result); - $this->assertNoPattern('/var \$fields/', $result); - $this->assertNoPattern('/var \$records/', $result); + $this->assertPattern("/public \\\$import \= array\('model' \=\> 'Article'\, 'records' \=\> true\);/", $result); + $this->assertNoPattern('/public \$fields/', $result); + $this->assertNoPattern('/public \$records/', $result); } /** From ceb2a1d4ed7ed61b502a9f09bfda69c1a7428fb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Fri, 9 Apr 2010 09:40:27 -0430 Subject: [PATCH 1917/2083] Removing date_default_timezone_set, as it is only available in php 5+ Hoping for the days were this type of commit is no longer needed --- cake/tests/cases/libs/view/helpers/time.test.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cake/tests/cases/libs/view/helpers/time.test.php b/cake/tests/cases/libs/view/helpers/time.test.php index f8bb88d32..1131303f7 100644 --- a/cake/tests/cases/libs/view/helpers/time.test.php +++ b/cake/tests/cases/libs/view/helpers/time.test.php @@ -662,7 +662,7 @@ function testConvertSpecifiers() { ), true); Configure::write('Config.language', 'time_test'); $time = 1263487419; // Thu Jan 14 11:43:39 2010 - date_default_timezone_set('Etc/GMT+5'); + $time = strtotime('-5 hours', $time); $result = $this->Time->convertSpecifiers('%a', $time); $expected = 'jue'; @@ -753,6 +753,7 @@ function testI18nFormat() { ), true); Configure::write('Config.language', 'time_test'); $time = 1263495568; //Thu Jan 14 13:59:28 2010 + $time = strtotime('-5 hours', $time); $result = $this->Time->i18nFormat($time); $expected = '14/01/10'; @@ -783,4 +784,4 @@ function testFormatNewSyntax() { $this->assertEqual($this->Time->format($time, '%c'), $this->Time->i18nFormat($time, '%c')); } } -?> \ No newline at end of file +?> From 1c5898d94b177368633278f59ec47a2a95570116 Mon Sep 17 00:00:00 2001 From: Matt Curry <matt@pseudocoder.com> Date: Fri, 9 Apr 2010 13:53:16 -0400 Subject: [PATCH 1918/2083] Don't get User model if not needed. Fixes #563 Signed-off-by: Mark Story <mark@mark-story.com> --- cake/libs/controller/components/auth.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index 1376b960e..fe468770c 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -922,10 +922,13 @@ function hashPasswords($data) { return $this->authenticate->hashPasswords($data); } - $model =& $this->getModel(); - if (is_array($data) && isset($data[$model->alias])) { - if (isset($data[$model->alias][$this->fields['username']]) && isset($data[$model->alias][$this->fields['password']])) { - $data[$model->alias][$this->fields['password']] = $this->password($data[$model->alias][$this->fields['password']]); + if (is_array($data)) { + $model =& $this->getModel(); + + if(isset($data[$model->alias])) { + if (isset($data[$model->alias][$this->fields['username']]) && isset($data[$model->alias][$this->fields['password']])) { + $data[$model->alias][$this->fields['password']] = $this->password($data[$model->alias][$this->fields['password']]); + } } } return $data; From fbaabad6bb5d6135a050c046f66e24263cb71e22 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 10 Apr 2010 11:17:24 -0400 Subject: [PATCH 1919/2083] Fixing issues where route parameters that overlapped could cause route compilation errors. Tests added. Fixes #565 --- cake/libs/router.php | 15 +++++++-------- cake/tests/cases/libs/router.test.php | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index 014c990b3..1db29f2dc 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -1348,11 +1348,12 @@ function _writeRoute() { return; } $route = $this->template; - $names = $replacements = $search = array(); + $names = $routeParams = array(); $parsed = preg_quote($this->template, '#'); preg_match_all('#:([A-Za-z0-9_-]+[A-Z0-9a-z])#', $route, $namedElements); foreach ($namedElements[1] as $i => $name) { + $search = '\\' . $namedElements[0][$i]; if (isset($this->options[$name])) { $option = null; if ($name !== 'plugin' && array_key_exists($name, $this->defaults)) { @@ -1360,15 +1361,12 @@ function _writeRoute() { } $slashParam = '/\\' . $namedElements[0][$i]; if (strpos($parsed, $slashParam) !== false) { - $replacements[] = '(?:/(?P<' . $name . '>' . $this->options[$name] . ')' . $option . ')' . $option; - $search[] = $slashParam; + $routeParams[$slashParam] = '(?:/(?P<' . $name . '>' . $this->options[$name] . ')' . $option . ')' . $option; } else { - $search[] = '\\' . $namedElements[0][$i]; - $replacements[] = '(?:(?P<' . $name . '>' . $this->options[$name] . ')' . $option . ')' . $option; + $routeParams[$search] = '(?:(?P<' . $name . '>' . $this->options[$name] . ')' . $option . ')' . $option; } } else { - $replacements[] = '(?:(?P<' . $name . '>[^/]+))'; - $search[] = '\\' . $namedElements[0][$i]; + $routeParams[$search] = '(?:(?P<' . $name . '>[^/]+))'; } $names[] = $name; } @@ -1376,7 +1374,8 @@ function _writeRoute() { $parsed = preg_replace('#/\\\\\*$#', '(?:/(?P<_args_>.*))?', $parsed); $this->_greedy = true; } - $parsed = str_replace($search, $replacements, $parsed); + krsort($routeParams); + $parsed = str_replace(array_keys($routeParams), array_values($routeParams), $parsed); $this->_compiledRoute = '#^' . $parsed . '[/]*$#'; $this->keys = $names; } diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 6e0689abe..88ce0baf8 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -2119,6 +2119,21 @@ function testBasicRouteCompiling() { $this->assertPattern($result, '/test_plugin/posts/edit/5/name:value/nick:name'); } +/** + * test that route parameters that overlap don't cause errors. + * + * @return void + */ + function testRouteParameterOverlap() { + $route =& new CakeRoute('/invoices/add/:idd/:id', array('controller' => 'invoices', 'action' => 'add')); + $result = $route->compile(); + $this->assertPattern($result, '/invoices/add/1/3'); + + $route =& new CakeRoute('/invoices/add/:id/:idd', array('controller' => 'invoices', 'action' => 'add')); + $result = $route->compile(); + $this->assertPattern($result, '/invoices/add/1/3'); + } + /** * test compiling routes with keys that have patterns * From 6c357ee555261054f379801d99c59dd18db3b51f Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 10 Apr 2010 16:57:50 -0400 Subject: [PATCH 1920/2083] Adding tests from 'tfs' fixes inconsistencies in extracting elements with one path selector. Fixes #555 --- cake/libs/set.php | 14 ++++---- cake/tests/cases/libs/set.test.php | 58 +++++++++++++++++++++++++++++- 2 files changed, 64 insertions(+), 8 deletions(-) diff --git a/cake/libs/set.php b/cake/libs/set.php index 9c7baa901..995f28f5b 100644 --- a/cake/libs/set.php +++ b/cake/libs/set.php @@ -447,18 +447,18 @@ function extract($path, $data = null, $options = array()) { $ctext = array($context['key']); if (!is_numeric($key)) { $ctext[] = $token; - $token = array_shift($tokens); - if (isset($items[$token])) { - $ctext[] = $token; - $item = $items[$token]; + $tok = array_shift($tokens); + if (isset($items[$tok])) { + $ctext[] = $tok; + $item = $items[$tok]; $matches[] = array( 'trace' => array_merge($context['trace'], $ctext), - 'key' => $token, + 'key' => $tok, 'item' => $item, ); break; - } else { - array_unshift($tokens, $token); + } elseif ($tok !== null) { + array_unshift($tokens, $tok); } } else { $key = $token; diff --git a/cake/tests/cases/libs/set.test.php b/cake/tests/cases/libs/set.test.php index 5fb0c5c4d..c2f378649 100644 --- a/cake/tests/cases/libs/set.test.php +++ b/cake/tests/cases/libs/set.test.php @@ -923,7 +923,6 @@ function testExtractParentSelector() { ) ) ); - $expected = array(array('Category' => $tree[1]['Category'])); $r = Set::extract('/Category[name=Category 2]', $tree); $this->assertEqual($r, $expected); @@ -1081,6 +1080,14 @@ function testExtractWithNonZeroArrays() { $r = Set::extract('/User/id', $nonZero); $this->assertEqual($r, $expected); + $expected = array( + array('User' => array('id' => 1, 'name' => 'John')), + array('User' => array('id' => 2, 'name' => 'Bob')), + array('User' => array('id' => 3, 'name' => 'Tony')), + ); + $result = Set::extract('/User', $nonZero); + $this->assertEqual($result, $expected); + $nonSequential = array( 'User' => array( 0 => array('id' => 1), @@ -1142,6 +1149,55 @@ function testExtractWithArrays() { $this->assertEqual(Set::extract('/Level1/Level2', $data), array(array('Level2' => array('test1', 'test2')))); $this->assertEqual(Set::extract('/Level1/Level2bis', $data), array(array('Level2bis' => array('test3', 'test4')))); } + +/** + * test extract() with elements that have non-array children. + * + * @return void + */ + function testExtractWithNonArrayElements() { + $data = array( + 'node' => array( + array('foo'), + 'bar' + ) + ); + $result = Set::extract('/node', $data); + $expected = array( + array('node' => array('foo')), + 'bar' + ); + $this->assertEqual($result, $expected); + + $data = array( + 'node' => array( + 'foo' => array('bar'), + 'bar' => array('foo') + ) + ); + $result = Set::extract('/node', $data); + $expected = array( + array('foo' => array('bar')), + array('bar' => array('foo')), + ); + $this->assertEqual($result, $expected); + + $data = array( + 'node' => array( + 'foo' => array( + 'bar' + ), + 'bar' => 'foo' + ) + ); + $result = Set::extract('/node', $data); + $expected = array( + array('foo' => array('bar')), + 'foo' + ); + $this->assertEqual($result, $expected); + } + /** * testMatches method * From c082ee6b9bbd7fc820e229a1c157bb2762a7a2b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hilton=20Gon=C3=A7alves?= <hilton.goncalves@yahoo.com.br> Date: Thu, 8 Apr 2010 06:45:07 -0700 Subject: [PATCH 1921/2083] Update Default transliteration map used for Inflector::slug Makes slugging of uppercase characters more consistent with lower case ones. Fixes #560 --- cake/libs/inflector.php | 60 +++++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 14 deletions(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index a6ba66361..aae738b0d 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -179,20 +179,52 @@ class Inflector { * @access protected */ var $_transliteration = array( - '/à|á|Ã¥|â/' => 'a', - '/è|é|ê|ẽ|ë/' => 'e', - '/ì|í|î/' => 'i', - '/ò|ó|ô|ø/' => 'o', - '/ù|ú|ů|û/' => 'u', - '/ç/' => 'c', - '/ñ/' => 'n', - '/ä|æ/' => 'ae', - '/ö/' => 'oe', - '/ü/' => 'ue', - '/Ä/' => 'Ae', - '/Ü/' => 'Ue', - '/Ö/' => 'Oe', - '/ß/' => 'ss' + '/À|Ã|Â|Ã|Ä|Ã…|Ǻ|Ä€|Ä‚|Ä„|Ç/' => 'A', + '/à|á|â|ã|ä|Ã¥|Ç»|Ä|ă|Ä…|ÇŽ|ª/' => 'a', + '/Ç|Ć|Ĉ|ÄŠ|ÄŒ/' => 'C', + '/ç|ć|ĉ|Ä‹|Ä/' => 'c', + '/Ã|ÄŽ|Ä/' => 'D', + '/ð|Ä|Ä‘/' => 'd', + '/È|É|Ê|Ë|Ä’|Ä”|Ä–|Ę|Äš/' => 'E', + '/è|é|ê|ë|Ä“|Ä•|Ä—|Ä™|Ä›|&/' => 'e', + '/Äœ|Äž|Ä |Ä¢/' => 'G', + '/Ä|ÄŸ|Ä¡|Ä£/' => 'g', + '/Ĥ|Ħ/' => 'H', + '/Ä¥|ħ/' => 'h', + '/ÃŒ|Ã|ÃŽ|Ã|Ĩ|Ī|Ĭ|Ç|Ä®|İ/' => 'I', + '/ì|í|î|ï|Ä©|Ä«|Ä­|Ç|į|ı/' => 'i', + '/Ä´/' => 'J', + '/ĵ/' => 'j', + '/Ķ/' => 'K', + '/Ä·/' => 'k', + '/Ĺ|Ä»|Ľ|Ä¿|Å/' => 'L', + '/ĺ|ļ|ľ|Å€|Å‚/' => 'l', + '/Ñ|Ń|Å…|Ň/' => 'N', + '/ñ|Å„|ņ|ň|ʼn/' => 'n', + '/Ã’|Ó|Ô|Õ|Ö|ÅŒ|ÅŽ|Ç‘|Å|Æ |Ø|Ǿ/' => 'O', + '/ò|ó|ô|õ|ö|Å|Å|Ç’|Å‘|Æ¡|ø|Ç¿|º/' => 'o', + '/Å”|Å–|Ř/' => 'R', + '/Å•|Å—|Å™/' => 'r', + '/Åš|Åœ|Åž|Å /' => 'S', + '/Å›|Å|ÅŸ|Å¡|Å¿/' => 's', + '/Å¢|Ť|Ŧ/' => 'T', + '/Å£|Å¥|ŧ/' => 't', + '/Ù|Ú|Û|Ü|Ũ|Ū|Ŭ|Å®|Ű|Ų|Ư|Ç“|Ç•|Ç—|Ç™|Ç›/' => 'U', + '/ù|ú|û|ü|Å©|Å«|Å­|ů|ű|ų|ư|Ç”|Ç–|ǘ|Çš|Çœ/' => 'u', + '/Ã|Ÿ|Ŷ/' => 'Y', + '/ý|ÿ|Å·/' => 'y', + '/Å´/' => 'W', + '/ŵ/' => 'w', + '/Ź|Å»|Ž/' => 'Z', + '/ź|ż|ž/' => 'z', + '/Æ|Ǽ/' => 'AE', + '/æ|ǽ/' => 'ae', + '/ß/'=> 'ss', + '/IJ/' => 'IJ', + '/ij/' => 'ij', + '/Å’/' => 'OE', + '/Å“/' => 'oe', + '/Æ’/' => 'f' ); /** From f6525e054f25ed9a4086116135cdb82a75bfd65f Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Sun, 11 Apr 2010 04:42:17 +0530 Subject: [PATCH 1922/2083] Updating transliteration map used by Inflector::slug to preserve some of the older mappings as previous commit broke test cases --- cake/libs/inflector.php | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index aae738b0d..a5f341a6c 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -179,18 +179,24 @@ class Inflector { * @access protected */ var $_transliteration = array( + '/ä|æ|ǽ/' => 'ae', + '/ö|Å“/' => 'oe', + '/ü/' => 'ue', + '/Ä/' => 'Ae', + '/Ü/' => 'Ue', + '/Ö/' => 'Oe', '/À|Ã|Â|Ã|Ä|Ã…|Ǻ|Ä€|Ä‚|Ä„|Ç/' => 'A', - '/à|á|â|ã|ä|Ã¥|Ç»|Ä|ă|Ä…|ÇŽ|ª/' => 'a', + '/à|á|â|ã|Ã¥|Ç»|Ä|ă|Ä…|ÇŽ|ª/' => 'a', '/Ç|Ć|Ĉ|ÄŠ|ÄŒ/' => 'C', '/ç|ć|ĉ|Ä‹|Ä/' => 'c', '/Ã|ÄŽ|Ä/' => 'D', '/ð|Ä|Ä‘/' => 'd', '/È|É|Ê|Ë|Ä’|Ä”|Ä–|Ę|Äš/' => 'E', '/è|é|ê|ë|Ä“|Ä•|Ä—|Ä™|Ä›|&/' => 'e', - '/Äœ|Äž|Ä |Ä¢/' => 'G', - '/Ä|ÄŸ|Ä¡|Ä£/' => 'g', - '/Ĥ|Ħ/' => 'H', - '/Ä¥|ħ/' => 'h', + '/Äœ|Äž|Ä |Ä¢/' => 'G', + '/Ä|ÄŸ|Ä¡|Ä£/' => 'g', + '/Ĥ|Ħ/' => 'H', + '/Ä¥|ħ/' => 'h', '/ÃŒ|Ã|ÃŽ|Ã|Ĩ|Ī|Ĭ|Ç|Ä®|İ/' => 'I', '/ì|í|î|ï|Ä©|Ä«|Ä­|Ç|į|ı/' => 'i', '/Ä´/' => 'J', @@ -201,29 +207,27 @@ class Inflector { '/ĺ|ļ|ľ|Å€|Å‚/' => 'l', '/Ñ|Ń|Å…|Ň/' => 'N', '/ñ|Å„|ņ|ň|ʼn/' => 'n', - '/Ã’|Ó|Ô|Õ|Ö|ÅŒ|ÅŽ|Ç‘|Å|Æ |Ø|Ǿ/' => 'O', - '/ò|ó|ô|õ|ö|Å|Å|Ç’|Å‘|Æ¡|ø|Ç¿|º/' => 'o', + '/Ã’|Ó|Ô|Õ|ÅŒ|ÅŽ|Ç‘|Å|Æ |Ø|Ǿ/' => 'O', + '/ò|ó|ô|õ|Å|Å|Ç’|Å‘|Æ¡|ø|Ç¿|º/' => 'o', '/Å”|Å–|Ř/' => 'R', '/Å•|Å—|Å™/' => 'r', '/Åš|Åœ|Åž|Å /' => 'S', '/Å›|Å|ÅŸ|Å¡|Å¿/' => 's', '/Å¢|Ť|Ŧ/' => 'T', '/Å£|Å¥|ŧ/' => 't', - '/Ù|Ú|Û|Ü|Ũ|Ū|Ŭ|Å®|Ű|Ų|Ư|Ç“|Ç•|Ç—|Ç™|Ç›/' => 'U', - '/ù|ú|û|ü|Å©|Å«|Å­|ů|ű|ų|ư|Ç”|Ç–|ǘ|Çš|Çœ/' => 'u', - '/Ã|Ÿ|Ŷ/' => 'Y', - '/ý|ÿ|Å·/' => 'y', + '/Ù|Ú|Û|Ũ|Ū|Ŭ|Å®|Ű|Ų|Ư|Ç“|Ç•|Ç—|Ç™|Ç›/' => 'U', + '/ù|ú|û|Å©|Å«|Å­|ů|ű|ų|ư|Ç”|Ç–|ǘ|Çš|Çœ/' => 'u', + '/Ã|Ÿ|Ŷ/' => 'Y', + '/ý|ÿ|Å·/' => 'y', '/Å´/' => 'W', '/ŵ/' => 'w', '/Ź|Å»|Ž/' => 'Z', '/ź|ż|ž/' => 'z', '/Æ|Ǽ/' => 'AE', - '/æ|ǽ/' => 'ae', '/ß/'=> 'ss', '/IJ/' => 'IJ', '/ij/' => 'ij', '/Å’/' => 'OE', - '/Å“/' => 'oe', '/Æ’/' => 'f' ); From 4b919382bbf9190b086c0cc1b0dcc798331c9bf0 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Sun, 11 Apr 2010 09:19:30 +1000 Subject: [PATCH 1923/2083] Fix Console Model test to correct index changes for validation. --- cake/tests/cases/console/libs/tasks/model.test.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cake/tests/cases/console/libs/tasks/model.test.php b/cake/tests/cases/console/libs/tasks/model.test.php index 57d94da5f..eb86b7702 100644 --- a/cake/tests/cases/console/libs/tasks/model.test.php +++ b/cake/tests/cases/console/libs/tasks/model.test.php @@ -215,9 +215,9 @@ public function testFieldValidationGuessing() { public function testInteractiveFieldValidation() { $this->Task->initValidations(); $this->Task->interactive = true; - $this->Task->setReturnValueAt(0, 'in', '19'); + $this->Task->setReturnValueAt(0, 'in', '20'); $this->Task->setReturnValueAt(1, 'in', 'y'); - $this->Task->setReturnValueAt(2, 'in', '15'); + $this->Task->setReturnValueAt(2, 'in', '16'); $this->Task->setReturnValueAt(3, 'in', 'n'); $result = $this->Task->fieldValidation('text', array('type' => 'string', 'length' => 10, 'null' => false)); @@ -234,7 +234,7 @@ function testInteractiveFieldValidationWithBogusResponse() { $this->Task->initValidations(); $this->Task->interactive = true; $this->Task->setReturnValueAt(0, 'in', '999999'); - $this->Task->setReturnValueAt(1, 'in', '19'); + $this->Task->setReturnValueAt(1, 'in', '20'); $this->Task->setReturnValueAt(2, 'in', 'n'); $this->Task->expectAt(4, 'out', array(new PatternExpectation('/make a valid/'))); From ed02b0f54beef361c6c69bbd5a409ca656f27a29 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Sun, 11 Apr 2010 09:40:54 +1000 Subject: [PATCH 1924/2083] Fixing access modifier test on Test task. --- cake/tests/cases/console/libs/tasks/test.test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index fb190e909..41adf48cb 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -482,7 +482,7 @@ public function testBakeControllerTest() { $this->assertPattern('/class TestTaskCommentsControllerTestCase extends CakeTestCase/', $result); $this->assertPattern('/class TestTestTaskCommentsController extends TestTaskCommentsController/', $result); - $this->assertPattern('/var \$autoRender = false/', $result); + $this->assertPattern('/public \$autoRender = false/', $result); $this->assertPattern('/function redirect\(\$url, \$status = null, \$exit = true\)/', $result); $this->assertPattern('/function startTest\(\)/', $result); From e1253f0bb5162e86f586f2ae4f8473154d8035da Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 10 Apr 2010 21:12:48 -0400 Subject: [PATCH 1925/2083] Including a plugin short route for prefixes as well. There were failing Dispatcher tests relying on this. --- cake/libs/router.php | 3 ++- cake/tests/cases/libs/router.test.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index 1db29f2dc..8a55b488c 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -574,14 +574,15 @@ function __connectDefaultRoutes() { } $pluginPattern = implode('|', $plugins); $match = array('plugin' => $pluginPattern); + $shortParams = array('routeClass' => 'PluginShortRoute', 'plugin' => $pluginPattern); foreach ($this->__prefixes as $prefix) { $params = array('prefix' => $prefix, $prefix => true); $indexParams = $params + array('action' => 'index'); + $this->connect("/{$prefix}/:plugin", $indexParams, $shortParams); $this->connect("/{$prefix}/:plugin/:controller", $indexParams, $match); $this->connect("/{$prefix}/:plugin/:controller/:action/*", $params, $match); } - $shortParams = array('routeClass' => 'PluginShortRoute', 'plugin' => $pluginPattern); $this->connect('/:plugin', array('action' => 'index'), $shortParams); $this->connect('/:plugin/:controller', array('action' => 'index'), $match); $this->connect('/:plugin/:controller/:action/*', array(), $match); diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 88ce0baf8..6bdecd5df 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -1125,7 +1125,7 @@ function testPrefixRoutingAndPlugins() { Router::parse('/'); $result = Router::url(array('plugin' => 'test_plugin', 'controller' => 'test_plugin', 'action' => 'index')); - $expected = '/admin/test_plugin/test_plugin'; + $expected = '/admin/test_plugin'; $this->assertEqual($result, $expected); Router::reload(); From 955192a4ca11f03a0a95ff59630ba01740a85a9d Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 10 Apr 2010 21:14:18 -0400 Subject: [PATCH 1926/2083] Updating dispatcher tests to reflect changes in default plugin routes. Removing tests for routes that have been removed. --- cake/tests/cases/dispatcher.test.php | 46 ++-------------------------- 1 file changed, 2 insertions(+), 44 deletions(-) diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index 03128d4c3..8be94da50 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -1517,7 +1517,7 @@ function testAutomaticPluginControllerDispatch() { $Dispatcher =& new TestDispatcher(); $Dispatcher->base = false; - $url = 'my_plugin/add/param:value/param2:value2'; + $url = 'my_plugin/my_plugin/add/param:value/param2:value2'; $controller = $Dispatcher->dispatch($url, array('return' => 1)); @@ -1553,7 +1553,7 @@ function testAutomaticPluginControllerDispatch() { $Dispatcher =& new TestDispatcher(); $Dispatcher->base = false; - $url = 'admin/my_plugin/add/5/param:value/param2:value2'; + $url = 'admin/my_plugin/my_plugin/add/5/param:value/param2:value2'; $controller = $Dispatcher->dispatch($url, array('return' => 1)); $this->assertEqual($controller->params['plugin'], 'my_plugin'); @@ -1621,48 +1621,6 @@ function testAutomaticPluginDispatchWithShortAccess() { $this->assertEqual($controller->params['plugin'], 'my_plugin'); $this->assertEqual($controller->params['action'], 'index'); $this->assertFalse(isset($controller->params['pass'][0])); - - $url = 'my_plugin/my_plugin/add'; - $controller = $Dispatcher->dispatch($url, array('return' => 1)); - $this->assertFalse(isset($controller->params['pass'][0])); - - $Dispatcher =& new TestDispatcher(); - $Dispatcher->base = false; - - $url = 'my_plugin/my_plugin/add/0'; - $controller = $Dispatcher->dispatch($url, array('return' => 1)); - $this->assertTrue(isset($controller->params['pass'][0])); - - $Dispatcher =& new TestDispatcher(); - $Dispatcher->base = false; - - $url = 'my_plugin/add'; - $controller = $Dispatcher->dispatch($url, array('return' => 1)); - $this->assertFalse(isset($controller->params['pass'][0])); - $this->assertEqual($controller->params['controller'], 'my_plugin'); - $this->assertEqual($controller->params['action'], 'add'); - $this->assertEqual($controller->params['plugin'], 'my_plugin'); - - $Dispatcher =& new TestDispatcher(); - $Dispatcher->base = false; - - $url = 'my_plugin/add/0'; - $controller = $Dispatcher->dispatch($url, array('return' => 1)); - $this->assertEqual($controller->params['controller'], 'my_plugin'); - $this->assertEqual($controller->params['plugin'], 'my_plugin'); - $this->assertEqual($controller->params['action'], 'add'); - $this->assertIdentical('0', $controller->params['pass'][0]); - - $Dispatcher =& new TestDispatcher(); - $Dispatcher->base = false; - - $url = 'my_plugin/add/1'; - $controller = $Dispatcher->dispatch($url, array('return' => 1)); - - $this->assertEqual($controller->params['controller'], 'my_plugin'); - $this->assertEqual($controller->params['plugin'], 'my_plugin'); - $this->assertEqual($controller->params['action'], 'add'); - $this->assertIdentical('1', $controller->params['pass'][0]); } /** From 561e5fa5564aa45f7e1ed77a84830bfdea6392ec Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 10 Apr 2010 21:15:56 -0400 Subject: [PATCH 1927/2083] Adding an additional test for plugin + prefix routing. --- cake/tests/cases/libs/router.test.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 6bdecd5df..c7549da5e 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -1149,6 +1149,12 @@ function testPrefixRoutingAndPlugins() { $expected = '/admin/test_plugin/show_tickets/edit/6'; $this->assertEqual($result, $expected); + $result = Router::url(array( + 'plugin' => 'test_plugin', 'controller' => 'show_tickets', 'action' => 'index', 'admin' => true + )); + $expected = '/admin/test_plugin/show_tickets'; + $this->assertEqual($result, $expected); + App::build(array('plugins' => $paths)); } From 431b1f23284e5d9554171ee871f322149aa05f88 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sat, 10 Apr 2010 21:21:53 -0400 Subject: [PATCH 1928/2083] Removing parameter mangling that is no longer needed. --- cake/dispatcher.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cake/dispatcher.php b/cake/dispatcher.php index da301e473..7ede6203a 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -380,7 +380,6 @@ function &__getController() { if (!$ctrlClass) { return $controller; } - $name = $ctrlClass; $ctrlClass .= 'Controller'; if (class_exists($ctrlClass)) { $controller =& new $ctrlClass(); @@ -398,13 +397,10 @@ function &__getController() { function __loadController($params) { $pluginName = $pluginPath = $controller = null; if (!empty($params['plugin'])) { - $pluginName = Inflector::camelize($params['plugin']); + $pluginName = $controller = Inflector::camelize($params['plugin']); $pluginPath = $pluginName . '.'; - $this->params['controller'] = $params['plugin']; - $controller = $pluginName; } if (!empty($params['controller'])) { - $this->params['controller'] = $params['controller']; $controller = Inflector::camelize($params['controller']); } if ($pluginPath . $controller) { From 4cb06d83ea53d785b43907afb36fd55823e4dd14 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Sun, 11 Apr 2010 15:18:55 +1000 Subject: [PATCH 1929/2083] Fix CakeSession tests so they dont call protected methods. --- cake/tests/cases/libs/cake_session.test.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cake/tests/cases/libs/cake_session.test.php b/cake/tests/cases/libs/cake_session.test.php index 2730d4212..589925c11 100644 --- a/cake/tests/cases/libs/cake_session.test.php +++ b/cake/tests/cases/libs/cake_session.test.php @@ -74,8 +74,7 @@ function endCase() { */ function setUp() { $this->Session =& new TestCakeSession(); - $this->Session->start(); - $this->Session->_checkValid(); + $this->Session->destroy(); } /** From 2e3d45c3de627e9a5b777de59578c48b9ccc25ef Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Sun, 11 Apr 2010 15:22:25 +1000 Subject: [PATCH 1930/2083] Added public access to public method in CakeTestFixture --- cake/tests/lib/cake_test_fixture.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cake/tests/lib/cake_test_fixture.php b/cake/tests/lib/cake_test_fixture.php index ade734660..5c2c7170f 100644 --- a/cake/tests/lib/cake_test_fixture.php +++ b/cake/tests/lib/cake_test_fixture.php @@ -52,7 +52,6 @@ class CakeTestFixture extends Object { public function __construct() { App::import('Model', 'CakeSchema'); $this->Schema = new CakeSchema(array('name' => 'TestSuite', 'connection' => 'test_suite')); - $this->init(); } @@ -60,10 +59,8 @@ public function __construct() { * Initialize the fixture. * * @param object Cake's DBO driver (e.g: DboMysql). - * @access public - * */ - function init() { + public function init() { if (isset($this->import) && (is_string($this->import) || is_array($this->import))) { $import = array_merge( array('connection' => 'default', 'records' => false), From a4cf737947a158d77f15736b3ac7be4bf941e3f5 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Sun, 11 Apr 2010 15:25:18 +1000 Subject: [PATCH 1931/2083] Fixing access specified on DboSource. --- cake/libs/model/datasources/dbo_source.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index 3d1c8fa0c..e83067f55 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -419,7 +419,7 @@ public function fetchAll($sql, $cache = true, $modelName = null) { * @param array $resut REference to the fetched row * @return void */ - function fetchVirtualField(&$result) { + public function fetchVirtualField(&$result) { if (isset($result[0]) && is_array($result[0])) { foreach ($result[0] as $field => $value) { if (strpos($field, '__') === false) { @@ -464,7 +464,7 @@ public function field($name, $sql) { * * @return void */ - function flushMethodCache() { + public function flushMethodCache() { $this->methodCache = array(); } @@ -480,7 +480,7 @@ function flushMethodCache() { * @param mixed $value The value to cache into memory. * @return mixed Either null on failure, or the value if its set. */ - function cacheMethod($method, $key, $value = null) { + public function cacheMethod($method, $key, $value = null) { if ($this->cacheMethods === false) { return $value; } @@ -590,7 +590,7 @@ public function getLog($sorted = false, $clear = true) { * @param boolean $sorted Get the queries sorted by time taken, defaults to false. * @return void */ - function showLog($sorted = false) { + public function showLog($sorted = false) { $log = $this->getLog($sorted, false); if (empty($log['log'])) { return; @@ -735,7 +735,7 @@ public function create(&$model, $fields = null, $values = null) { * @param integer $recursive Number of levels of association * @return mixed boolean false on error/failure. An array of results on success. */ - function read(&$model, $queryData = array(), $recursive = null) { + public function read(&$model, $queryData = array(), $recursive = null) { $queryData = $this->__scrubQueryData($queryData); $null = null; @@ -875,7 +875,7 @@ function __filterResults(&$results, &$model, $filtered = array()) { * @param integer $recursive Number of levels of association * @param array $stack */ - function queryAssociation(&$model, &$linkModel, $type, $association, $assocData, &$queryData, $external = false, &$resultSet, $recursive, $stack) { + public function queryAssociation(&$model, &$linkModel, $type, $association, $assocData, &$queryData, $external = false, &$resultSet, $recursive, $stack) { if ($query = $this->generateAssociationQuery($model, $linkModel, $type, $association, $assocData, $queryData, $external, $resultSet)) { if (!isset($resultSet) || !is_array($resultSet)) { if (Configure::read() > 0) { @@ -1378,7 +1378,7 @@ public function getConstraint($type, $model, $linkModel, $alias, $assoc, $alias2 * @see DboSource::renderJoinStatement() * @see DboSource::buildStatement() */ - function buildJoinStatement($join) { + public function buildJoinStatement($join) { $data = array_merge(array( 'type' => null, 'alias' => null, @@ -1404,7 +1404,7 @@ function buildJoinStatement($join) { * @access public * @see DboSource::renderStatement() */ - function buildStatement($query, &$model) { + public function buildStatement($query, &$model) { $query = array_merge(array('offset' => null, 'joins' => array()), $query); if (!empty($query['joins'])) { $count = count($query['joins']); @@ -1862,7 +1862,7 @@ public function __scrubQueryData($data) { * @param mixed $fields virtual fields to be used on query * @return array */ - function _constructVirtualFields(&$model, $alias, $fields) { + protected function _constructVirtualFields(&$model, $alias, $fields) { $virtual = array(); foreach ($fields as $field) { $virtualField = $this->name("{$alias}__{$field}"); @@ -2527,7 +2527,7 @@ public function boolean($data) { * @param string $fields * @param array $values */ - protected function insertMulti($table, $fields, $values) { + public function insertMulti($table, $fields, $values) { $table = $this->fullTableName($table); if (is_array($fields)) { $fields = implode(', ', array_map(array(&$this, 'name'), $fields)); From af71787b6776c6bdbfb2f0e2996a37cc8c5f09ff Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 11 Apr 2010 11:17:33 -0400 Subject: [PATCH 1932/2083] Fixing title_for_layout not being set in apps made with bake. Fixes #567 --- cake/console/templates/skel/controllers/pages_controller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/console/templates/skel/controllers/pages_controller.php b/cake/console/templates/skel/controllers/pages_controller.php index 29ffb561f..b087b8df6 100644 --- a/cake/console/templates/skel/controllers/pages_controller.php +++ b/cake/console/templates/skel/controllers/pages_controller.php @@ -76,9 +76,9 @@ public function display() { $subpage = $path[1]; } if (!empty($path[$count - 1])) { - $title = Inflector::humanize($path[$count - 1]); + $title_for_layout = Inflector::humanize($path[$count - 1]); } - $this->set(compact('page', 'subpage', 'title')); + $this->set(compact('page', 'subpage', 'title_for_layout')); $this->render(implode('/', $path)); } } From 540157bbfda860eabbe966044c3188e72d02556a Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 11 Apr 2010 11:17:33 -0400 Subject: [PATCH 1933/2083] Fixing title_for_layout not being set in apps made with bake. Fixes #567 --- cake/console/templates/skel/controllers/pages_controller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/console/templates/skel/controllers/pages_controller.php b/cake/console/templates/skel/controllers/pages_controller.php index 795202c93..74c0db051 100644 --- a/cake/console/templates/skel/controllers/pages_controller.php +++ b/cake/console/templates/skel/controllers/pages_controller.php @@ -76,9 +76,9 @@ function display() { $subpage = $path[1]; } if (!empty($path[$count - 1])) { - $title = Inflector::humanize($path[$count - 1]); + $title_for_layout = Inflector::humanize($path[$count - 1]); } - $this->set(compact('page', 'subpage', 'title')); + $this->set(compact('page', 'subpage', 'title_for_layout')); $this->render(implode('/', $path)); } } From 42bc252460d5b43eb575d9650a7d3d01d7601df1 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 11 Apr 2010 11:41:10 -0400 Subject: [PATCH 1934/2083] Fixing return value of CakeSession::__startSession(). Once headers were sent any further session objects would think that the session was not successfully started. Fixes issues in Helper group test. Also fixes #568 --- cake/libs/cake_session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index c63c6a8a3..65e492a26 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -583,7 +583,7 @@ function __startSession() { if (empty($_SESSION)) { $_SESSION = array(); } - return false; + return true; } elseif (!isset($_SESSION)) { session_cache_limiter ("must-revalidate"); session_start(); From 404401b4de87fbd3cfde09d539b7d44c9c80e3da Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Sun, 11 Apr 2010 23:13:18 -0400 Subject: [PATCH 1935/2083] Moving action modification when a prefix is detected so it affects all url arrays. Previously it was only applied to parameters in the current request. This fixes inconsistencies between request parameters and url parameters. Fixes #570 --- cake/libs/router.php | 6 +++--- cake/tests/cases/libs/router.test.php | 28 ++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/cake/libs/router.php b/cake/libs/router.php index 8a55b488c..5f6dccadb 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -770,9 +770,6 @@ function url($url = null, $full = false) { } else { $params = end($self->__params); } - if (isset($params['prefix']) && strpos($params['action'], $params['prefix']) === 0) { - $params['action'] = substr($params['action'], strlen($params['prefix']) + 1); - } } $path = array('base' => null); @@ -818,6 +815,9 @@ function url($url = null, $full = false) { } elseif (isset($url[$prefix]) && !$url[$prefix]) { unset($url[$prefix]); } + if (isset($url[$prefix]) && strpos($url['action'], $prefix) === 0) { + $url['action'] = substr($url['action'], strlen($prefix) + 1); + } } $url += array('controller' => $params['controller'], 'plugin' => $params['plugin']); diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index c7549da5e..a68b83a88 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -1741,7 +1741,7 @@ function testUrlWritingWithPrefixes() { Router::setRequestInfo(array( array('controller' => 'users', 'action' => 'login', 'company' => true, 'form' => array(), 'url' => array(), 'plugin' => null), - array('base' => '/', 'here' => '/', 'webroot' => '/base/', 'passedArgs' => array(), 'argSeparator' => ':', 'namedArgs' => array()) + array('base' => '/', 'here' => '/', 'webroot' => '/base/') )); $result = Router::url(array('controller' => 'users', 'action' => 'login', 'company' => false)); @@ -1749,6 +1749,32 @@ function testUrlWritingWithPrefixes() { $this->assertEqual($result, $expected); } +/** + * test url generation with prefixes and custom routes + * + * @return void + */ + function testUrlWritingWithPrefixesAndCustomRoutes() { + Router::connect( + '/admin/login', + array('controller' => 'users', 'action' => 'login', 'prefix' => 'admin', 'admin' => true) + ); + Router::setRequestInfo(array( + array('controller' => 'posts', 'action' => 'index', 'admin' => true, 'prefix' => 'admin', + 'form' => array(), 'url' => array(), 'plugin' => null + ), + array('base' => '/', 'here' => '/', 'webroot' => '/') + )); + $result = Router::url(array('controller' => 'users', 'action' => 'login', 'admin' => true)); + $this->assertEqual($result, '/admin/login'); + + $result = Router::url(array('controller' => 'users', 'action' => 'login')); + $this->assertEqual($result, '/admin/login'); + + $result = Router::url(array('controller' => 'users', 'action' => 'admin_login')); + $this->assertEqual($result, '/admin/login'); + } + /** * testPassedArgsOrder method * From baaae6cdb79d368cf864777dd7133208d55f09c4 Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Mon, 12 Apr 2010 22:57:31 +0530 Subject: [PATCH 1936/2083] Minor optimization in TreeBehavior::getparentnode() to avoid fetching unneeded associated records. Closes #572 --- cake/libs/model/behaviors/tree.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/model/behaviors/tree.php b/cake/libs/model/behaviors/tree.php index 44f97ac19..77ebf0889 100644 --- a/cake/libs/model/behaviors/tree.php +++ b/cake/libs/model/behaviors/tree.php @@ -382,7 +382,7 @@ function getparentnode(&$Model, $id = null, $fields = null, $recursive = null) { if (!is_null($overrideRecursive)) { $recursive = $overrideRecursive; } - $parentId = $Model->read($parent, $id); + $parentId = $Model->find('first', array('conditions' => array($Model->primaryKey => $id), 'fields' => array($parent), 'recursive' => -1)); if ($parentId) { $parentId = $parentId[$Model->alias][$parent]; From df76ff47e3bc0551922e56530887612df27b45c2 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Tue, 13 Apr 2010 12:20:58 +1000 Subject: [PATCH 1937/2083] Fix TimeHelper tests failing due to timezone changes. --- cake/tests/cases/libs/view/helpers/time.test.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cake/tests/cases/libs/view/helpers/time.test.php b/cake/tests/cases/libs/view/helpers/time.test.php index 1131303f7..ba7b12f87 100644 --- a/cake/tests/cases/libs/view/helpers/time.test.php +++ b/cake/tests/cases/libs/view/helpers/time.test.php @@ -662,7 +662,8 @@ function testConvertSpecifiers() { ), true); Configure::write('Config.language', 'time_test'); $time = 1263487419; // Thu Jan 14 11:43:39 2010 - $time = strtotime('-5 hours', $time); + $offset = 5 * 60 * 60; + $time = $time - date('Z') - $offset - (date('I', $time) * 60 * 60); $result = $this->Time->convertSpecifiers('%a', $time); $expected = 'jue'; @@ -753,7 +754,8 @@ function testI18nFormat() { ), true); Configure::write('Config.language', 'time_test'); $time = 1263495568; //Thu Jan 14 13:59:28 2010 - $time = strtotime('-5 hours', $time); + $offset = 5 * 60 * 60; + $time = $time - date('Z') - $offset - (date('I', $time) * 60 * 60); $result = $this->Time->i18nFormat($time); $expected = '14/01/10'; From e2b5470d19b12cfe31211e16e3e0bc783c5b29da Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Mon, 12 Apr 2010 22:27:18 -0400 Subject: [PATCH 1938/2083] Updating version numbers to 1.3.0-RC4 --- cake/VERSION.txt | 2 +- cake/config/config.php | 2 +- cake/libs/view/pages/home.ctp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cake/VERSION.txt b/cake/VERSION.txt index 1c1107e4d..6d2b7a2db 100644 --- a/cake/VERSION.txt +++ b/cake/VERSION.txt @@ -18,4 +18,4 @@ // @license MIT License (http://www.opensource.org/licenses/mit-license.php) // +--------------------------------------------------------------------------------------------+ // //////////////////////////////////////////////////////////////////////////////////////////////////// -1.3.0-RC3 \ No newline at end of file +1.3.0-RC4 diff --git a/cake/config/config.php b/cake/config/config.php index 8f51b3984..f71dfa725 100644 --- a/cake/config/config.php +++ b/cake/config/config.php @@ -17,5 +17,5 @@ * @since CakePHP(tm) v 1.1.11.4062 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -return $config['Cake.version'] = '1.3.0-RC3'; +return $config['Cake.version'] = '1.3.0-RC4'; ?> \ No newline at end of file diff --git a/cake/libs/view/pages/home.ctp b/cake/libs/view/pages/home.ctp index dad169919..d9692ccb1 100644 --- a/cake/libs/view/pages/home.ctp +++ b/cake/libs/view/pages/home.ctp @@ -21,7 +21,7 @@ if (Configure::read() == 0): endif; ?> <h2><?php echo sprintf(__('Release Notes for CakePHP %s.', true), Configure::version()); ?></h2> -<a href="http://cakephp.lighthouseapp.com/projects/42648/changelog-1-3-0-RC3"><?php __('Read the changelog'); ?> </a> +<a href="http://cakephp.lighthouseapp.com/projects/42648/changelog-1-3-0-RC4"><?php __('Read the changelog'); ?> </a> <?php if (Configure::read() > 0): Debugger::checkSecurityKeys(); From 4982705d0723df5c7413ed610f50afb73bcbed82 Mon Sep 17 00:00:00 2001 From: predominant <graham@grahamweldon.com> Date: Tue, 13 Apr 2010 15:06:44 +1000 Subject: [PATCH 1939/2083] More time helper test jiggering. Some peope still experiencing issues. --- cake/tests/cases/libs/view/helpers/time.test.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cake/tests/cases/libs/view/helpers/time.test.php b/cake/tests/cases/libs/view/helpers/time.test.php index ba7b12f87..47c26c169 100644 --- a/cake/tests/cases/libs/view/helpers/time.test.php +++ b/cake/tests/cases/libs/view/helpers/time.test.php @@ -661,9 +661,7 @@ function testConvertSpecifiers() { 'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS) ), true); Configure::write('Config.language', 'time_test'); - $time = 1263487419; // Thu Jan 14 11:43:39 2010 - $offset = 5 * 60 * 60; - $time = $time - date('Z') - $offset - (date('I', $time) * 60 * 60); + $time = strtotime('Thu Jan 14 11:43:39 2010'); $result = $this->Time->convertSpecifiers('%a', $time); $expected = 'jue'; @@ -753,9 +751,7 @@ function testI18nFormat() { 'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale' . DS) ), true); Configure::write('Config.language', 'time_test'); - $time = 1263495568; //Thu Jan 14 13:59:28 2010 - $offset = 5 * 60 * 60; - $time = $time - date('Z') - $offset - (date('I', $time) * 60 * 60); + $time = strtotime('Thu Jan 14 13:59:28 2010'); $result = $this->Time->i18nFormat($time); $expected = '14/01/10'; From 9d2819970d2a7a2c6c4e1ca8d0ef357a134fe19d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Tue, 13 Apr 2010 01:08:31 -0430 Subject: [PATCH 1940/2083] Fixing schema generation for postgres. Now character varying without lenght is translated to "text", to avoid sql errors. Closes #564 --- cake/libs/model/datasources/dbo/dbo_postgres.php | 7 ++++++- .../cases/libs/model/datasources/dbo/dbo_postgres.test.php | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index 18212d902..8ed4cefbc 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -231,7 +231,12 @@ function &describe(&$model) { if (!empty($c['char_length'])) { $length = intval($c['char_length']); } elseif (!empty($c['oct_length'])) { - $length = intval($c['oct_length']); + if ($c['type'] == 'character varying') { + $length = null; + $c['type'] = 'text'; + } else { + $length = intval($c['oct_length']); + } } else { $length = $this->length($c['type']); } diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php index 8f69e9ec1..f67caa272 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php @@ -567,6 +567,7 @@ function testCakeSchema() { $db1->query('CREATE TABLE ' . $db1->fullTableName('datatypes') . ' ( id serial NOT NULL, "varchar" character varying(40) NOT NULL, + "full_length" character varying NOT NULL, "timestamp" timestamp without time zone, date date, CONSTRAINT test_suite_data_types_pkey PRIMARY KEY (id) @@ -579,7 +580,9 @@ function testCakeSchema() { )); $schema->tables = array('datatypes' => $result['tables']['datatypes']); $result = $db1->createSchema($schema, 'datatypes'); + $this->assertNoPattern('/timestamp DEFAULT/', $result); + $this->assertPattern('/\"full_length\"\s*text\s.*,/', $result); $this->assertPattern('/timestamp\s*,/', $result); $db1->query('DROP TABLE ' . $db1->fullTableName('datatypes')); From a6b83cdd939cb4fbb39eed4971ed8952b7488478 Mon Sep 17 00:00:00 2001 From: Mariano Iglesias <mariano@cricava.com> Date: Tue, 13 Apr 2010 15:33:24 -0300 Subject: [PATCH 1941/2083] Fixing issue where TextHelper::autoLinkUrls was failing on some expressions --- cake/libs/view/helpers/text.php | 15 +++------- .../cases/libs/view/helpers/text.test.php | 30 +++++++++++++++++++ 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/cake/libs/view/helpers/text.php b/cake/libs/view/helpers/text.php index 0e877e892..4e8fa232e 100644 --- a/cake/libs/view/helpers/text.php +++ b/cake/libs/view/helpers/text.php @@ -117,17 +117,10 @@ function stripLinks($text) { * @access public * @link http://book.cakephp.org/view/1469/Text#autoLinkUrls-1619 */ - function autoLinkUrls($text, $options = array()) { - $linkOptions = 'array('; - foreach ($options as $option => $value) { - $value = var_export($value, true); - $linkOptions .= "'$option' => $value, "; - } - $linkOptions .= ')'; - - $text = preg_replace_callback('#(?<!href="|">)((?:http|https|ftp|nntp)://[^ <]+)#i', create_function('$matches', - '$Html = new HtmlHelper(); $Html->tags = $Html->loadConfig(); return $Html->link($matches[0], $matches[0],' . $linkOptions . ');'), $text); - + function autoLinkUrls($text, $htmlOptions = array()) { + $options = var_export($htmlOptions, true); + $text = preg_replace_callback('#(?<!href="|">)((?:https?|ftp|nntp)://[^\s<>()]+)#i', create_function('$matches', + '$Html = new HtmlHelper(); $Html->tags = $Html->loadConfig(); return $Html->link($matches[0], $matches[0],' . $options . ');'), $text); return preg_replace_callback('#(?<!href="|">)(?<!http://|https://|ftp://|nntp://)(www\.[^\n\%\ <]+[^<\n\%\,\.\ <])(?<!\))#i', create_function('$matches', '$Html = new HtmlHelper(); $Html->tags = $Html->loadConfig(); return $Html->link($matches[0], "http://" . strtolower($matches[0]),' . $linkOptions . ');'), $text); } diff --git a/cake/tests/cases/libs/view/helpers/text.test.php b/cake/tests/cases/libs/view/helpers/text.test.php index 042cce533..a2a6531b1 100644 --- a/cake/tests/cases/libs/view/helpers/text.test.php +++ b/cake/tests/cases/libs/view/helpers/text.test.php @@ -207,6 +207,36 @@ function testAutoLink() { $result = $this->Text->autoLink($text); $expected = 'Text with a partial <a href="http://www.cakephp.org">www.cakephp.org</a> URL and <a href="mailto:test@cakephp\.org">test@cakephp\.org</a> email address'; $this->assertPattern('#^' . $expected . '$#', $result); + + $text = 'This is a test text with URL http://www.cakephp.org'; + $expected = 'This is a test text with URL <a href="http://www.cakephp.org">http://www.cakephp.org</a>'; + $result = $this->Text->autoLink($text); + $this->assertEqual($result, $expected); + + $text = 'This is a test text with URL http://www.cakephp.org and some more text'; + $expected = 'This is a test text with URL <a href="http://www.cakephp.org">http://www.cakephp.org</a> and some more text'; + $result = $this->Text->autoLink($text); + $this->assertEqual($result, $expected); + + $text = "This is a test text with URL http://www.cakephp.org\tand some more text"; + $expected = "This is a test text with URL <a href=\"http://www.cakephp.org\">http://www.cakephp.org</a>\tand some more text"; + $result = $this->Text->autoLink($text); + $this->assertEqual($result, $expected); + + $text = 'This is a test text with URL http://www.cakephp.org(and some more text)'; + $expected = 'This is a test text with URL <a href="http://www.cakephp.org">http://www.cakephp.org</a>(and some more text)'; + $result = $this->Text->autoLink($text); + $this->assertEqual($result, $expected); + + $text = 'This is a test text with URL http://www.cakephp.org'; + $expected = 'This is a test text with URL <a href="http://www.cakephp.org" class="link">http://www.cakephp.org</a>'; + $result = $this->Text->autoLink($text, array('class'=>'link')); + $this->assertEqual($result, $expected); + + $text = 'This is a test text with URL http://www.cakephp.org'; + $expected = 'This is a test text with URL <a href="http://www.cakephp.org" class="link" id="MyLink">http://www.cakephp.org</a>'; + $result = $this->Text->autoLink($text, array('class'=>'link', 'id'=>'MyLink')); + $this->assertEqual($result, $expected); } /** From 388bca4acd6681d8bfb7d76683d16dc5812d4009 Mon Sep 17 00:00:00 2001 From: Mariano Iglesias <mariano@cricava.com> Date: Tue, 13 Apr 2010 15:46:12 -0300 Subject: [PATCH 1942/2083] Fixing syntax error generated by last merge conflict --- cake/libs/view/helpers/text.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/text.php b/cake/libs/view/helpers/text.php index 4e8fa232e..16294fa3f 100644 --- a/cake/libs/view/helpers/text.php +++ b/cake/libs/view/helpers/text.php @@ -121,8 +121,9 @@ function autoLinkUrls($text, $htmlOptions = array()) { $options = var_export($htmlOptions, true); $text = preg_replace_callback('#(?<!href="|">)((?:https?|ftp|nntp)://[^\s<>()]+)#i', create_function('$matches', '$Html = new HtmlHelper(); $Html->tags = $Html->loadConfig(); return $Html->link($matches[0], $matches[0],' . $options . ');'), $text); + return preg_replace_callback('#(?<!href="|">)(?<!http://|https://|ftp://|nntp://)(www\.[^\n\%\ <]+[^<\n\%\,\.\ <])(?<!\))#i', - create_function('$matches', '$Html = new HtmlHelper(); $Html->tags = $Html->loadConfig(); return $Html->link($matches[0], "http://" . strtolower($matches[0]),' . $linkOptions . ');'), $text); + create_function('$matches', '$Html = new HtmlHelper(); $Html->tags = $Html->loadConfig(); return $Html->link($matches[0], "http://" . strtolower($matches[0]),' . $options . ');'), $text); } /** From 940ce8b06e1c89339f07e8da8531171b719db473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Tue, 13 Apr 2010 15:34:13 -0430 Subject: [PATCH 1943/2083] Adding some test coverage on MediaView. Now MediaView does not exit after successful render, closes #569 --- cake/libs/view/media.php | 38 ++++- cake/tests/cases/libs/view/media.test.php | 181 ++++++++++++++++++++++ 2 files changed, 213 insertions(+), 6 deletions(-) create mode 100644 cake/tests/cases/libs/view/media.test.php diff --git a/cake/libs/view/media.php b/cake/libs/view/media.php index 8e88fb321..b71d6c0bc 100644 --- a/cake/libs/view/media.php +++ b/cake/libs/view/media.php @@ -206,17 +206,16 @@ function render() { 'Content-Length: ' . $fileSize)); } $this->_output(); - @ob_end_clean(); + $this->_clearBuffer(); - while (!feof($handle) && connection_status() == 0 && !connection_aborted()) { + while (!feof($handle) && $this->_isActive()) { set_time_limit(0); $buffer = fread($handle, $chunkSize); echo $buffer; - @flush(); - @ob_flush(); + $this->_flushBuffer(); } fclose($handle); - exit(0); + return; } return false; } @@ -252,5 +251,32 @@ function _output() { header($header, $value[$header]); } } + +/** + * Returns true if connectios is still active + * @return boolean + * @access protected + */ + function _isActive() { + return connection_status() == 0 && !connection_aborted(); + } + +/** + * Clears the contents of the topmost output buffer and discards them + * @return boolean + * @access protected + */ + function _clearBuffer() { + return @ob_end_clean(); + } + +/** + * Flushes the contents of the output buffer + * @access protected + */ + function _flushBuffer() { + @flush(); + @ob_flush(); + } } -?> \ No newline at end of file +?> diff --git a/cake/tests/cases/libs/view/media.test.php b/cake/tests/cases/libs/view/media.test.php new file mode 100644 index 000000000..5e1f382b2 --- /dev/null +++ b/cake/tests/cases/libs/view/media.test.php @@ -0,0 +1,181 @@ +<?php +/** + * ThemeViewTest file + * + * PHP versions 4 and 5 + * + * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> + * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * + * Licensed under The Open Group Test Suite License + * Redistributions of files must retain the above copyright notice. + * + * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) + * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests + * @package cake + * @subpackage cake.tests.cases.libs + * @since CakePHP(tm) v 1.2.0.4206 + * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License + */ +App::import('Core', array('Media', 'Controller')); + +if (!class_exists('ErrorHandler')) { + App::import('Core', array('Error')); +} +if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) { + define('CAKEPHP_UNIT_TEST_EXECUTION', 1); +} + +/** + * ThemePostsController class + * + * @package cake + * @subpackage cake.tests.cases.libs.view + */ +class MediaController extends Controller { + +/** + * name property + * + * @var string 'Media' + * @access public + */ + var $name = 'Media'; + +/** + * index download + * + * @access public + * @return void + */ + function download() { + $path = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'vendors' . DS .'css' . DS; + $id = 'test_asset.css'; + $extension = 'css'; + $this->set(compact('path', 'id', 'extension')); + } +} + +/** + * TestMediaView class + * + * @package cake + * @subpackage cake.tests.cases.libs.view + */ +class TestMediaView extends MediaView { + +/** + * headers public property as a copy from protected property _headers + * + * @var array + * @access public + */ + var $headers = array(); + +/** + * active property to mock the status of a remote conenction + * + * @var boolean true + * @access public + */ + var $active = true; + + function _output() { + $this->headers = $this->_headers; + } + +/** + * _isActive method. Usted de $active property to mock an active (true) connection, + * or an aborted (false) one + * + * @access protected + * @return void + */ + function _isActive() { + return $this->active; + } + +/** + * _clearBuffer method + * + * @access protected + * @return void + */ + function _clearBuffer() { + return true; + } + +/** + * _flushBuffer method + * + * @access protected + * @return void + */ + function _flushBuffer() { + } +} + +/** + * ThemeViewTest class + * + * @package cake + * @subpackage cake.tests.cases.libs + */ +class MediaViewTest extends CakeTestCase { + +/** + * startTest method + * + * @access public + * @return void + */ + function startTest() { + Router::reload(); + $this->Controller =& new Controller(); + $this->MediaController =& new MediaController(); + $this->MediaController->viewPath = 'posts'; + $this->MediaController->download(); + $this->MediaView =& new TestMediaView($this->MediaController); + } + +/** + * endTest method + * + * @access public + * @return void + */ + function endTest() { + unset($this->MediaView); + unset($this->MediaController); + unset($this->Controller); + ClassRegistry::flush(); + } + +/** + * testRender method + * + * @access public + * @return void + */ + function testRender() { + ob_start(); + $result = $this->MediaView->render(); + $output = ob_get_clean(); + + $this->assertTrue($result !== false); + $this->assertEqual($output, 'this is the test asset css file'); + } + +/** + * testConnectionAborted method + * + * @access public + * @return void + */ + function testConnectionAborted() { + $this->MediaView->active = false; + $result = $this->MediaView->render(); + $this->assertFalse($result); + } +} +?> From 0300fc1c31634afcd327484978b9b30eb6ba8838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= <jose.zap@gmail.com> Date: Tue, 13 Apr 2010 16:52:39 -0430 Subject: [PATCH 1944/2083] If connection is aborted, now MediaView returns false after stopping the transfer --- cake/libs/view/media.php | 8 ++++++-- cake/tests/cases/libs/view/media.test.php | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cake/libs/view/media.php b/cake/libs/view/media.php index b71d6c0bc..666c87516 100644 --- a/cake/libs/view/media.php +++ b/cake/libs/view/media.php @@ -208,7 +208,11 @@ function render() { $this->_output(); $this->_clearBuffer(); - while (!feof($handle) && $this->_isActive()) { + while (!feof($handle)) { + if (!$this->_isActive()) { + fclose($handle); + return false; + } set_time_limit(0); $buffer = fread($handle, $chunkSize); echo $buffer; @@ -253,7 +257,7 @@ function _output() { } /** - * Returns true if connectios is still active + * Returns true if connection is still active * @return boolean * @access protected */ diff --git a/cake/tests/cases/libs/view/media.test.php b/cake/tests/cases/libs/view/media.test.php index 5e1f382b2..76d3aeb3d 100644 --- a/cake/tests/cases/libs/view/media.test.php +++ b/cake/tests/cases/libs/view/media.test.php @@ -73,7 +73,7 @@ class TestMediaView extends MediaView { var $headers = array(); /** - * active property to mock the status of a remote conenction + * active property to mock the status of a remote connection * * @var boolean true * @access public From 958578c7467381e25fb1b8ae8b61b29bd327fab7 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Tue, 13 Apr 2010 23:54:21 -0400 Subject: [PATCH 1945/2083] Fixing magic method visibility on Helper. --- cake/libs/view/helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index 67df05061..9cc6cff22 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -150,7 +150,7 @@ public function __construct() { * Default overload methods * */ - protected function __call($method, $params) { + public function __call($method, $params) { trigger_error(sprintf(__('Method %1$s::%2$s does not exist', true), get_class($this), $method), E_USER_WARNING); } From 508e0a2d9a5bdc39407be2d6b2f0ea692f147a8b Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 14 Apr 2010 00:01:40 -0400 Subject: [PATCH 1946/2083] Removing all the deprecated PHP4 compatibility functions, and the shortform aliases. Removing associated tests. --- cake/basics.php | 289 ------------------------------- cake/tests/cases/basics.test.php | 44 ----- 2 files changed, 333 deletions(-) diff --git a/cake/basics.php b/cake/basics.php index d259edf91..ca8e12538 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -31,19 +31,6 @@ define('MONTH', 2592000); define('YEAR', 31536000); -/** - * Patch for PHP < 5.0 - */ -if (!function_exists('clone')) { - if (version_compare(PHP_VERSION, '5.0') < 0) { - eval (' - function clone($object) - { - return $object; - }'); - } -} - /** * Loads configuration files. Receives a set of configuration files * to load. @@ -163,37 +150,6 @@ function sortByKey(&$array, $sortby, $order = 'asc', $type = SORT_NUMERIC) { return $out; } } -if (!function_exists('array_combine')) { - -/** - * Combines given identical arrays by using the first array's values as keys, - * and the second one's values as values. (Implemented for backwards compatibility with PHP4) - * - * @param array $a1 Array to use for keys - * @param array $a2 Array to use for values - * @return mixed Outputs either combined array or false. - * @deprecated Will be removed in 2.0 - */ - function array_combine($a1, $a2) { - $a1 = array_values($a1); - $a2 = array_values($a2); - $c1 = count($a1); - $c2 = count($a2); - - if ($c1 != $c2) { - return false; - } - if ($c1 <= 0) { - return false; - } - $output = array(); - - for ($i = 0; $i < $c1; $i++) { - $output[$a1[$i]] = $a2[$i]; - } - return $output; - } -} /** * Convenience method for htmlspecialchars. @@ -244,104 +200,6 @@ function pluginSplit($name, $dotAppend = false, $plugin = null) { return array($plugin, $name); } -/** - * Returns an array of all the given parameters. - * - * Example: - * - * `a('a', 'b')` - * - * Would return: - * - * `array('a', 'b')` - * - * @return array Array of given parameters - * @link http://book.cakephp.org/view/1122/a - * @deprecated Will be removed in 2.0 - */ - function a() { - $args = func_get_args(); - return $args; - } - -/** - * Constructs associative array from pairs of arguments. - * - * Example: - * - * `aa('a','b')` - * - * Would return: - * - * `array('a'=>'b')` - * - * @return array Associative array - * @link http://book.cakephp.org/view/1123/aa - * @deprecated Will be removed in 2.0 - */ - function aa() { - $args = func_get_args(); - $argc = count($args); - for ($i = 0; $i < $argc; $i++) { - if ($i + 1 < $argc) { - $a[$args[$i]] = $args[$i + 1]; - } else { - $a[$args[$i]] = null; - } - $i++; - } - return $a; - } - -/** - * Convenience method for echo(). - * - * @param string $text String to echo - * @link http://book.cakephp.org/view/1129/e - * @deprecated Will be removed in 2.0 - */ - function e($text) { - echo $text; - } - -/** - * Convenience method for strtolower(). - * - * @param string $str String to lowercase - * @return string Lowercased string - * @link http://book.cakephp.org/view/1134/low - * @deprecated Will be removed in 2.0 - */ - function low($str) { - return strtolower($str); - } - -/** - * Convenience method for strtoupper(). - * - * @param string $str String to uppercase - * @return string Uppercased string - * @link http://book.cakephp.org/view/1139/up - * @deprecated Will be removed in 2.0 - */ - function up($str) { - return strtoupper($str); - } - -/** - * Convenience method for str_replace(). - * - * @param string $search String to be replaced - * @param string $replace String to insert - * @param string $subject String to search - * @return string Replaced string - * @link http://book.cakephp.org/view/1137/r - * @deprecated Will be removed in 2.0 - */ - function r($search, $replace, $subject) { - return str_replace($search, $replace, $subject); - } - /** * Print_r convenience function, which prints out <PRE> tags around * the output of given array. Similar to debug(). @@ -472,36 +330,6 @@ function env($key) { } return null; } -if (!function_exists('file_put_contents')) { - -/** - * Writes data into file. - * - * If file exists, it will be overwritten. If data is an array, it will be implode()ed with an empty string. - * - * @param string $fileName File name. - * @param mixed $data String or array. - * @return boolean Success - * @deprecated Will be removed in 2.0 - */ - function file_put_contents($fileName, $data) { - if (is_array($data)) { - $data = implode('', $data); - } - $res = @fopen($fileName, 'w+b'); - - if ($res) { - $write = @fwrite($res, $data); - if ($write === false) { - return false; - } else { - @fclose($res); - return $write; - } - } - return false; - } -} /** * Reads/writes temporary data to cache files or session. @@ -847,62 +675,6 @@ function __c($msg, $category, $return = false) { } } -/** - * Computes the difference of arrays using keys for comparison. - * - * @param array First array - * @param array Second array - * @return array Array with different keys - * @deprecated Will be removed in 2.0 - */ - if (!function_exists('array_diff_key')) { - function array_diff_key() { - $valuesDiff = array(); - - $argc = func_num_args(); - if ($argc < 2) { - return false; - } - - $args = func_get_args(); - foreach ($args as $param) { - if (!is_array($param)) { - return false; - } - } - - foreach ($args[0] as $valueKey => $valueData) { - for ($i = 1; $i < $argc; $i++) { - if (array_key_exists($valueKey, $args[$i])) { - continue 2; - } - } - $valuesDiff[$valueKey] = $valueData; - } - return $valuesDiff; - } - } - -/** - * Computes the intersection of arrays using keys for comparison - * - * @param array First array - * @param array Second array - * @return array Array with interesected keys - * @deprecated Will be removed in 2.0 - */ - if (!function_exists('array_intersect_key')) { - function array_intersect_key($arr1, $arr2) { - $res = array(); - foreach ($arr1 as $key => $value) { - if (array_key_exists($key, $arr2)) { - $res[$key] = $arr1[$key]; - } - } - return $res; - } - } - /** * Shortcut to Log::write. * @@ -952,65 +724,4 @@ function convertSlash($string) { return $string; } -/** - * Implements http_build_query for PHP4. - * - * @param string $data Data to set in query string - * @param string $prefix If numeric indices, prepend this to index for elements in base array. - * @param string $argSep String used to separate arguments - * @param string $baseKey Base key - * @return string URL encoded query string - * @see http://php.net/http_build_query - * @deprecated Will be removed in 2.0 - */ - if (!function_exists('http_build_query')) { - function http_build_query($data, $prefix = null, $argSep = null, $baseKey = null) { - if (empty($argSep)) { - $argSep = ini_get('arg_separator.output'); - } - if (is_object($data)) { - $data = get_object_vars($data); - } - $out = array(); - - foreach ((array)$data as $key => $v) { - if (is_numeric($key) && !empty($prefix)) { - $key = $prefix . $key; - } - $key = urlencode($key); - - if (!empty($baseKey)) { - $key = $baseKey . '[' . $key . ']'; - } - - if (is_array($v) || is_object($v)) { - $out[] = http_build_query($v, $prefix, $argSep, $key); - } else { - $out[] = $key . '=' . urlencode($v); - } - } - return implode($argSep, $out); - } - } - -/** - * Wraps ternary operations. If $condition is a non-empty value, $val1 is returned, otherwise $val2. - * Don't use for isset() conditions, or wrap your variable with @ operator: - * Example: - * - * `ife(isset($variable), @$variable, 'default');` - * - * @param mixed $condition Conditional expression - * @param mixed $val1 Value to return in case condition matches - * @param mixed $val2 Value to return if condition doesn't match - * @return mixed $val1 or $val2, depending on whether $condition evaluates to a non-empty expression. - * @link http://book.cakephp.org/view/1133/ife - * @deprecated Will be removed in 2.0 - */ - function ife($condition, $val1 = null, $val2 = null) { - if (!empty($condition)) { - return $val1; - } - return $val2; - } ?> \ No newline at end of file diff --git a/cake/tests/cases/basics.test.php b/cake/tests/cases/basics.test.php index 96c9c447a..1956fb626 100644 --- a/cake/tests/cases/basics.test.php +++ b/cake/tests/cases/basics.test.php @@ -202,31 +202,6 @@ public function testH() { $this->assertEqual($expected, $result); } -/** - * Test a() - * - * @return void - */ - public function testA() { - $result = a('this', 'that', 'bar'); - $this->assertEqual(array('this', 'that', 'bar'), $result); - } - -/** - * Test aa() - * - * @return void - */ - public function testAa() { - $result = aa('a', 'b', 'c', 'd'); - $expected = array('a' => 'b', 'c' => 'd'); - $this->assertEqual($expected, $result); - - $result = aa('a', 'b', 'c', 'd', 'e'); - $expected = array('a' => 'b', 'c' => 'd', 'e' => null); - $this->assertEqual($result, $expected); - } - /** * Test am() * @@ -735,25 +710,6 @@ public function testStripslashesDeepSybase() { $this->assertEqual(stripslashes_deep($nested), $expected); } -/** - * test ife() - * - * @return void - */ - public function testIfe() { - $this->assertEqual(ife(true, 'a', 'b'), 'a'); - $this->assertEqual(ife(' ', 'a', 'b'), 'a'); - $this->assertEqual(ife('test', 'a', 'b'), 'a'); - $this->assertEqual(ife(23, 'a', 'b'), 'a'); - $this->assertEqual(ife(array('t' => 'est'), 'a', 'b'), 'a'); - - $this->assertEqual(ife(false, 'a', 'b'), 'b'); - $this->assertEqual(ife(null, 'a', 'b'), 'b'); - $this->assertEqual(ife('', 'a', 'b'), 'b'); - $this->assertEqual(ife(0, 'a', 'b'), 'b'); - $this->assertEqual(ife(array(), 'a', 'b'), 'b'); - } - /** * test pluginSplit * From c4d57bd6e7ceb245ac496f67bef7ccae7b9b949b Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 14 Apr 2010 00:13:33 -0400 Subject: [PATCH 1947/2083] Removing AjaxHelper and JavascriptHelper as they were deprecated in 1.3 and are replaced by JsHelper + HtmlHelper. --- cake/libs/view/helpers/ajax.php | 1035 ----------------- cake/libs/view/helpers/javascript.php | 722 ------------ .../cases/libs/view/helpers/ajax.test.php | 909 --------------- .../libs/view/helpers/javascript.test.php | 896 -------------- 4 files changed, 3562 deletions(-) delete mode 100644 cake/libs/view/helpers/ajax.php delete mode 100644 cake/libs/view/helpers/javascript.php delete mode 100644 cake/tests/cases/libs/view/helpers/ajax.test.php delete mode 100644 cake/tests/cases/libs/view/helpers/javascript.test.php diff --git a/cake/libs/view/helpers/ajax.php b/cake/libs/view/helpers/ajax.php deleted file mode 100644 index f32f9df13..000000000 --- a/cake/libs/view/helpers/ajax.php +++ /dev/null @@ -1,1035 +0,0 @@ -<?php -/** - * Helper for AJAX operations. - * - * Helps doing AJAX using the Prototype library. - * - * PHP versions 4 and 5 - * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @package cake - * @subpackage cake.cake.libs.view.helpers - * @since CakePHP(tm) v 0.10.0.1076 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) - */ - -/** - * AjaxHelper helper library. - * - * Helps doing AJAX using the Prototype library. - * - * @package cake - * @subpackage cake.cake.libs.view.helpers - * @link http://book.cakephp.org/view/1358/AJAX - */ -class AjaxHelper extends AppHelper { - -/** - * Included helpers. - * - * @var array - */ - public $helpers = array('Html', 'Javascript', 'Form'); - -/** - * HtmlHelper instance - * - * @var HtmlHelper - * @access public - */ - public $Html = null; - -/** - * JavaScriptHelper instance - * - * @var JavaScriptHelper - * @access public - */ - public $Javascript = null; - -/** - * Names of Javascript callback functions. - * - * @var array - */ - public $callbacks = array( - 'complete', 'create', 'exception', 'failure', 'interactive', 'loading', - 'loaded', 'success', 'uninitialized' - ); - -/** - * Names of AJAX options. - * - * @var array - */ - public $ajaxOptions = array( - 'after', 'asynchronous', 'before', 'confirm', 'condition', 'contentType', 'encoding', - 'evalScripts', 'failure', 'fallback', 'form', 'indicator', 'insertion', 'interactive', - 'loaded', 'loading', 'method', 'onCreate', 'onComplete', 'onException', 'onFailure', - 'onInteractive', 'onLoaded', 'onLoading', 'onSuccess', 'onUninitialized', 'parameters', - 'position', 'postBody', 'requestHeaders', 'success', 'type', 'update', 'with' - ); - -/** - * Options for draggable. - * - * @var array - */ - public $dragOptions = array( - 'handle', 'revert', 'snap', 'zindex', 'constraint', 'change', 'ghosting', - 'starteffect', 'reverteffect', 'endeffect', 'scroll', 'scrollSensitivity', - 'onStart', 'onDrag', 'onEnd' - ); - -/** - * Options for droppable. - * - * @var array - */ - public $dropOptions = array( - 'accept', 'containment', 'greedy', 'hoverclass', 'onHover', 'onDrop', 'overlap' - ); - -/** - * Options for sortable. - * - * @var array - */ - public $sortOptions = array( - 'constraint', 'containment', 'dropOnEmpty', 'ghosting', 'handle', 'hoverclass', 'onUpdate', - 'onChange', 'only', 'overlap', 'scroll', 'scrollSensitivity', 'scrollSpeed', 'tag', 'tree', - 'treeTag', 'update' - ); - -/** - * Options for slider. - * - * @var array - */ - public $sliderOptions = array( - 'alignX', 'alignY', 'axis', 'disabled', 'handleDisabled', 'handleImage', 'increment', - 'maximum', 'minimum', 'onChange', 'onSlide', 'range', 'sliderValue', 'values' - ); - -/** - * Options for in-place editor. - * - * @var array - */ - public $editorOptions = array( - 'okText', 'cancelText', 'savingText', 'formId', 'externalControl', 'rows', 'cols', 'size', - 'highlightcolor', 'highlightendcolor', 'savingClassName', 'formClassName', 'loadTextURL', - 'loadingText', 'callback', 'ajaxOptions', 'clickToEditText', 'collection', 'okControl', - 'cancelControl', 'submitOnBlur' - ); - -/** - * Options for auto-complete editor. - * - * @var array - */ - public $autoCompleteOptions = array( - 'afterUpdateElement', 'callback', 'frequency', 'indicator', 'minChars', 'onShow', 'onHide', - 'parameters', 'paramName', 'tokens', 'updateElement' - ); - -/** - * Output buffer for Ajax update content - * - * @var array - */ - private $__ajaxBuffer = array(); - -/** - * Returns link to remote action - * - * Returns a link to a remote action defined by <i>options[url]</i> - * (using the url() format) that's called in the background using - * XMLHttpRequest. The result of that request can then be inserted into a - * DOM object whose id can be specified with <i>options[update]</i>. - * - * Examples: - * <code> - * link("Delete this post", - * array("update" => "posts", "url" => "delete/{$postid->id}")); - * link(imageTag("refresh"), - * array("update" => "emails", "url" => "list_emails" )); - * </code> - * - * By default, these remote requests are processed asynchronous during - * which various callbacks can be triggered (for progress indicators and - * the likes). - * - * Example: - * <code> - * link (word, - * array("url" => "undo", "n" => word_counter), - * array("complete" => "undoRequestCompleted(request)")); - * </code> - * - * The callbacks that may be specified are: - * - * - <i>loading</i>:: Called when the remote document is being - * loaded with data by the browser. - * - <i>loaded</i>:: Called when the browser has finished loading - * the remote document. - * - <i>interactive</i>:: Called when the user can interact with the - * remote document, even though it has not - * finished loading. - * - <i>complete</i>:: Called when the XMLHttpRequest is complete. - * - * If you for some reason or another need synchronous processing (that'll - * block the browser while the request is happening), you can specify - * <i>options[type] = synchronous</i>. - * - * You can customize further browser side call logic by passing - * in Javascript code snippets via some optional parameters. In - * their order of use these are: - * - * - <i>confirm</i>:: Adds confirmation dialog. - * -<i>condition</i>:: Perform remote request conditionally - * by this expression. Use this to - * describe browser-side conditions when - * request should not be initiated. - * - <i>before</i>:: Called before request is initiated. - * - <i>after</i>:: Called immediately after request was - * initiated and before <i>loading</i>. - * - * @param string $title Title of link - * @param mixed $url Cake-relative URL or array of URL parameters, or external URL (starts with http://) - * @param array $options Options for JavaScript function - * @param string $confirm Confirmation message. Calls up a JavaScript confirm() message. - * - * @return string HTML code for link to remote action - * @link http://book.cakephp.org/view/1363/link - */ - function link($title, $url = null, $options = array(), $confirm = null) { - if (!isset($url)) { - $url = $title; - } - if (!isset($options['url'])) { - $options['url'] = $url; - } - - if (isset($confirm)) { - $options['confirm'] = $confirm; - unset($confirm); - } - $htmlOptions = $this->__getHtmlOptions($options, array('url')); - $options += array('safe' => true); - - unset($options['escape']); - if (empty($options['fallback']) || !isset($options['fallback'])) { - $options['fallback'] = $url; - } - $htmlDefaults = array('id' => 'link' . intval(mt_rand()), 'onclick' => ''); - $htmlOptions = array_merge($htmlDefaults, $htmlOptions); - - $htmlOptions['onclick'] .= ' event.returnValue = false; return false;'; - $return = $this->Html->link($title, $url, $htmlOptions); - $callback = $this->remoteFunction($options); - $script = $this->Javascript->event("'{$htmlOptions['id']}'", "click", $callback); - - if (is_string($script)) { - $return .= $script; - } - return $return; - } - -/** - * Creates JavaScript function for remote AJAX call - * - * This function creates the javascript needed to make a remote call - * it is primarily used as a helper for AjaxHelper::link. - * - * @param array $options options for javascript - * @return string html code for link to remote action - * @see AjaxHelper::link() for docs on options parameter. - * @link http://book.cakephp.org/view/1364/remoteFunction - */ - function remoteFunction($options) { - if (isset($options['update'])) { - if (!is_array($options['update'])) { - $func = "new Ajax.Updater('{$options['update']}',"; - } else { - $func = "new Ajax.Updater(document.createElement('div'),"; - } - if (!isset($options['requestHeaders'])) { - $options['requestHeaders'] = array(); - } - if (is_array($options['update'])) { - $options['update'] = implode(' ', $options['update']); - } - $options['requestHeaders']['X-Update'] = $options['update']; - } else { - $func = "new Ajax.Request("; - } - - $url = isset($options['url']) ? $options['url'] : ""; - if (empty($options['safe'])) { - $url = $this->url($url); - } else { - $url = Router::url($url); - } - - $func .= "'" . $url . "'"; - $func .= ", " . $this->__optionsForAjax($options) . ")"; - - if (isset($options['before'])) { - $func = "{$options['before']}; $func"; - } - if (isset($options['after'])) { - $func = "$func; {$options['after']};"; - } - if (isset($options['condition'])) { - $func = "if ({$options['condition']}) { $func; }"; - } - - if (isset($options['confirm'])) { - $func = "if (confirm('" . $this->Javascript->escapeString($options['confirm']) - . "')) { $func; } else { event.returnValue = false; return false; }"; - } - return $func; - } - -/** - * Periodically call remote url via AJAX. - * - * Periodically calls the specified url (<i>options[url]</i>) every <i>options[frequency]</i> - * seconds (default is 10). Usually used to update a specified div (<i>options[update]</i>) with - * the results of the remote call. The options for specifying the target with url and defining - * callbacks is the same as AjaxHelper::link(). - * - * @param array $options Callback options - * @return string Javascript code - * @see AjaxHelper::link() - * @link http://book.cakephp.org/view/1365/remoteTimer - */ - function remoteTimer($options = null) { - $frequency = (isset($options['frequency'])) ? $options['frequency'] : 10; - $callback = $this->remoteFunction($options); - $code = "new PeriodicalExecuter(function() {{$callback}}, $frequency)"; - return $this->Javascript->codeBlock($code); - } - -/** - * Returns form tag that will submit using Ajax. - * - * Returns a form tag that will submit using XMLHttpRequest in the background instead of the regular - * reloading POST arrangement. Even though it's using Javascript to serialize the form elements, - * the form submission will work just like a regular submission as viewed by the receiving side - * (all elements available in params). The options for defining callbacks is the same - * as AjaxHelper::link(). - * - * @param mixed $params Either a string identifying the form target, or an array of method parameters, including: - * - 'params' => Acts as the form target - * - 'type' => 'post' or 'get' - * - 'options' => An array containing all HTML and script options used to - * generate the form tag and Ajax request. - * @param array $type How form data is posted: 'get' or 'post' - * @param array $options Callback/HTML options - * @return string JavaScript/HTML code - * @see AjaxHelper::link() - * @link http://book.cakephp.org/view/1366/form - */ - function form($params = null, $type = 'post', $options = array()) { - $model = false; - if (is_array($params)) { - extract($params, EXTR_OVERWRITE); - } - - if (empty($options['url'])) { - $options['url'] = array('action' => $params); - } - - $htmlDefaults = array( - 'id' => 'form' . intval(mt_rand()), - 'onsubmit' => "event.returnValue = false; return false;", - 'type' => $type - ); - $htmlOptions = $this->__getHtmlOptions($options, array('model', 'with')); - $htmlOptions = array_merge($htmlDefaults, $htmlOptions); - - $defaults = array('model' => $model, 'with' => "Form.serialize('{$htmlOptions['id']}')"); - $options = array_merge($defaults, $options); - $callback = $this->remoteFunction($options); - - $form = $this->Form->create($options['model'], $htmlOptions); - $script = $this->Javascript->event("'" . $htmlOptions['id']. "'", 'submit', $callback); - return $form . $script; - } - -/** - * Returns a button input tag that will submit using Ajax - * - * Returns a button input tag that will submit form using XMLHttpRequest in the background instead - * of regular reloading POST arrangement. <i>options</i> argument is the same as - * in AjaxHelper::form(). - * - * @param string $title Input button title - * @param array $options Callback options - * @return string Ajaxed input button - * @see AjaxHelper::form() - * @link http://book.cakephp.org/view/1367/submit - */ - function submit($title = 'Submit', $options = array()) { - $htmlOptions = $this->__getHtmlOptions($options); - $htmlOptions['value'] = $title; - - if (!isset($options['with'])) { - $options['with'] = 'Form.serialize(Event.element(event).form)'; - } - if (!isset($htmlOptions['id'])) { - $htmlOptions['id'] = 'submit' . intval(mt_rand()); - } - - $htmlOptions['onclick'] = "event.returnValue = false; return false;"; - $callback = $this->remoteFunction($options); - - $form = $this->Form->submit($title, $htmlOptions); - $script = $this->Javascript->event('"' . $htmlOptions['id'] . '"', 'click', $callback); - return $form . $script; - } - -/** - * Observe field and call ajax on change. - * - * Observes the field with the DOM ID specified by <i>field</i> and makes - * an Ajax when its contents have changed. - * - * Required +options+ are: - * - <i>frequency</i>:: The frequency (in seconds) at which changes to - * this field will be detected. - * - <i>url</i>:: @see url() -style options for the action to call - * when the field has changed. - * - * Additional options are: - * - <i>update</i>:: Specifies the DOM ID of the element whose - * innerHTML should be updated with the - * XMLHttpRequest response text. - * - <i>with</i>:: A Javascript expression specifying the - * parameters for the XMLHttpRequest. This defaults - * to Form.Element.serialize('$field'), which can be - * accessed from params['form']['field_id']. - * - * Additionally, you may specify any of the options documented in - * @see linkToRemote(). - * - * @param string $field DOM ID of field to observe - * @param array $options ajax options - * @return string ajax script - * @link http://book.cakephp.org/view/1368/observeField - */ - function observeField($field, $options = array()) { - if (!isset($options['with'])) { - $options['with'] = 'Form.Element.serialize(\'' . $field . '\')'; - } - $observer = 'Observer'; - if (!isset($options['frequency']) || intval($options['frequency']) == 0) { - $observer = 'EventObserver'; - } - return $this->Javascript->codeBlock( - $this->_buildObserver('Form.Element.' . $observer, $field, $options) - ); - } - -/** - * Observe entire form and call ajax on change. - * - * Like @see observeField(), but operates on an entire form identified by the - * DOM ID <b>form</b>. <b>options</b> are the same as <b>observeField</b>, except - * the default value of the <i>with</i> option evaluates to the - * serialized (request string) value of the form. - * - * @param string $form DOM ID of form to observe - * @param array $options ajax options - * @return string ajax script - * @link http://book.cakephp.org/view/1369/observeForm - */ - function observeForm($form, $options = array()) { - if (!isset($options['with'])) { - $options['with'] = 'Form.serialize(\'' . $form . '\')'; - } - $observer = 'Observer'; - if (!isset($options['frequency']) || intval($options['frequency']) == 0) { - $observer = 'EventObserver'; - } - return $this->Javascript->codeBlock( - $this->_buildObserver('Form.' . $observer, $form, $options) - ); - } - -/** - * Create a text field with Autocomplete. - * - * Creates an autocomplete field with the given ID and options. - * - * options['with'] defaults to "Form.Element.serialize('$field')", - * but can be any valid javascript expression defining the additional fields. - * - * @param string $field DOM ID of field to observe - * @param string $url URL for the autocomplete action - * @param array $options Ajax options - * @return string Ajax script - * @link http://book.cakephp.org/view/1370/autoComplete - */ - function autoComplete($field, $url = "", $options = array()) { - $var = ''; - if (isset($options['var'])) { - $var = 'var ' . $options['var'] . ' = '; - unset($options['var']); - } - - if (!isset($options['id'])) { - $options['id'] = Inflector::camelize(str_replace(".", "_", $field)); - } - - $divOptions = array( - 'id' => $options['id'] . "_autoComplete", - 'class' => isset($options['class']) ? $options['class'] : 'auto_complete' - ); - - if (isset($options['div_id'])) { - $divOptions['id'] = $options['div_id']; - unset($options['div_id']); - } - - $htmlOptions = $this->__getHtmlOptions($options); - $htmlOptions['autocomplete'] = "off"; - - foreach ($this->autoCompleteOptions as $opt) { - unset($htmlOptions[$opt]); - } - - if (isset($options['tokens'])) { - if (is_array($options['tokens'])) { - $options['tokens'] = $this->Javascript->object($options['tokens']); - } else { - $options['tokens'] = '"' . $options['tokens'] . '"'; - } - } - - $options = $this->_optionsToString($options, array('paramName', 'indicator')); - $options = $this->_buildOptions($options, $this->autoCompleteOptions); - - $text = $this->Form->text($field, $htmlOptions); - $div = $this->Html->div(null, '', $divOptions); - $script = "{$var}new Ajax.Autocompleter('{$htmlOptions['id']}', '{$divOptions['id']}', '"; - $script .= $this->Html->url($url) . "', {$options});"; - - return "{$text}\n{$div}\n" . $this->Javascript->codeBlock($script); - } - -/** - * Creates an Ajax-updateable DIV element - * - * @param string $id options for javascript - * @return string HTML code - */ - function div($id, $options = array()) { - if (env('HTTP_X_UPDATE') != null) { - $this->Javascript->enabled = false; - $divs = explode(' ', env('HTTP_X_UPDATE')); - - if (in_array($id, $divs)) { - @ob_end_clean(); - ob_start(); - return ''; - } - } - $attr = $this->_parseAttributes(array_merge($options, array('id' => $id))); - return sprintf($this->Html->tags['blockstart'], $attr); - } - -/** - * Closes an Ajax-updateable DIV element - * - * @param string $id The DOM ID of the element - * @return string HTML code - */ - function divEnd($id) { - if (env('HTTP_X_UPDATE') != null) { - $divs = explode(' ', env('HTTP_X_UPDATE')); - if (in_array($id, $divs)) { - $this->__ajaxBuffer[$id] = ob_get_contents(); - ob_end_clean(); - ob_start(); - return ''; - } - } - return $this->Html->tags['blockend']; - } - -/** - * Detects Ajax requests - * - * @return boolean True if the current request is a Prototype Ajax update call - * @link http://book.cakephp.org/view/1371/isAjax - */ - function isAjax() { - return (isset($this->params['isAjax']) && $this->params['isAjax'] === true); - } - -/** - * Creates a draggable element. For a reference on the options for this function, - * check out http://github.com/madrobby/scriptaculous/wikis/draggable - * - * @param unknown_type $id - * @param array $options - * @return unknown - * @link http://book.cakephp.org/view/1372/drag-drop - */ - function drag($id, $options = array()) { - $var = ''; - if (isset($options['var'])) { - $var = 'var ' . $options['var'] . ' = '; - unset($options['var']); - } - $options = $this->_buildOptions( - $this->_optionsToString($options, array('handle', 'constraint')), $this->dragOptions - ); - return $this->Javascript->codeBlock("{$var}new Draggable('$id', " .$options . ");"); - } - -/** - * For a reference on the options for this function, check out - * http://github.com/madrobby/scriptaculous/wikis/droppables - * - * @param unknown_type $id - * @param array $options - * @return string - * @link http://book.cakephp.org/view/1372/drag-drop - */ - function drop($id, $options = array()) { - $optionsString = array('overlap', 'hoverclass'); - if (!isset($options['accept']) || !is_array($options['accept'])) { - $optionsString[] = 'accept'; - } else if (isset($options['accept'])) { - $options['accept'] = $this->Javascript->object($options['accept']); - } - $options = $this->_buildOptions( - $this->_optionsToString($options, $optionsString), $this->dropOptions - ); - return $this->Javascript->codeBlock("Droppables.add('{$id}', {$options});"); - } - -/** - * Make an element with the given $id droppable, and trigger an Ajax call when a draggable is - * dropped on it. - * - * For a reference on the options for this function, check out - * http://wiki.script.aculo.us/scriptaculous/show/Droppables.add - * - * @param string $id - * @param array $options - * @param array $ajaxOptions - * @return string JavaScript block to create a droppable element - */ - function dropRemote($id, $options = array(), $ajaxOptions = array()) { - $callback = $this->remoteFunction($ajaxOptions); - $options['onDrop'] = "function(element, droppable, event) {{$callback}}"; - $optionsString = array('overlap', 'hoverclass'); - - if (!isset($options['accept']) || !is_array($options['accept'])) { - $optionsString[] = 'accept'; - } else if (isset($options['accept'])) { - $options['accept'] = $this->Javascript->object($options['accept']); - } - - $options = $this->_buildOptions( - $this->_optionsToString($options, $optionsString), - $this->dropOptions - ); - return $this->Javascript->codeBlock("Droppables.add('{$id}', {$options});"); - } - -/** - * Makes a slider control. - * - * @param string $id DOM ID of slider handle - * @param string $trackId DOM ID of slider track - * @param array $options Array of options to control the slider - * @link http://github.com/madrobby/scriptaculous/wikis/slider - * @link http://book.cakephp.org/view/1373/slider - */ - function slider($id, $trackId, $options = array()) { - if (isset($options['var'])) { - $var = 'var ' . $options['var'] . ' = '; - unset($options['var']); - } else { - $var = 'var ' . $id . ' = '; - } - - $options = $this->_optionsToString($options, array( - 'axis', 'handleImage', 'handleDisabled' - )); - $callbacks = array('change', 'slide'); - - foreach ($callbacks as $callback) { - if (isset($options[$callback])) { - $call = $options[$callback]; - $options['on' . ucfirst($callback)] = "function(value) {{$call}}"; - unset($options[$callback]); - } - } - - if (isset($options['values']) && is_array($options['values'])) { - $options['values'] = $this->Javascript->object($options['values']); - } - - $options = $this->_buildOptions($options, $this->sliderOptions); - $script = "{$var}new Control.Slider('$id', '$trackId', $options);"; - return $this->Javascript->codeBlock($script); - } - -/** - * Makes an Ajax In Place editor control. - * - * @param string $id DOM ID of input element - * @param string $url Postback URL of saved data - * @param array $options Array of options to control the editor, including ajaxOptions (see link). - * @link http://github.com/madrobby/scriptaculous/wikis/ajax-inplaceeditor - * @link http://book.cakephp.org/view/1374/editor - */ - function editor($id, $url, $options = array()) { - $url = $this->url($url); - $options['ajaxOptions'] = $this->__optionsForAjax($options); - - foreach ($this->ajaxOptions as $opt) { - if (isset($options[$opt])) { - unset($options[$opt]); - } - } - - if (isset($options['callback'])) { - $options['callback'] = 'function(form, value) {' . $options['callback'] . '}'; - } - - $type = 'InPlaceEditor'; - if (isset($options['collection']) && is_array($options['collection'])) { - $options['collection'] = $this->Javascript->object($options['collection']); - $type = 'InPlaceCollectionEditor'; - } - - $var = ''; - if (isset($options['var'])) { - $var = 'var ' . $options['var'] . ' = '; - unset($options['var']); - } - - $options = $this->_optionsToString($options, array( - 'okText', 'cancelText', 'savingText', 'formId', 'externalControl', 'highlightcolor', - 'highlightendcolor', 'savingClassName', 'formClassName', 'loadTextURL', 'loadingText', - 'clickToEditText', 'okControl', 'cancelControl' - )); - $options = $this->_buildOptions($options, $this->editorOptions); - $script = "{$var}new Ajax.{$type}('{$id}', '{$url}', {$options});"; - return $this->Javascript->codeBlock($script); - } - -/** - * Makes a list or group of floated objects sortable. - * - * @param string $id DOM ID of parent - * @param array $options Array of options to control sort. - * @link http://github.com/madrobby/scriptaculous/wikis/sortable - * @link http://book.cakephp.org/view/1375/sortable - */ - function sortable($id, $options = array()) { - if (!empty($options['url'])) { - if (empty($options['with'])) { - $options['with'] = "Sortable.serialize('$id')"; - } - $options['onUpdate'] = 'function(sortable) {' . $this->remoteFunction($options) . '}'; - } - $block = true; - - if (isset($options['block'])) { - $block = $options['block']; - unset($options['block']); - } - $strings = array( - 'tag', 'constraint', 'only', 'handle', 'hoverclass', 'tree', - 'treeTag', 'update', 'overlap' - ); - $scrollIsObject = ( - isset($options['scroll']) && - $options['scroll'] != 'window' && - strpos($options['scroll'], '$(') !== 0 - ); - - if ($scrollIsObject) { - $strings[] = 'scroll'; - } - - $options = $this->_optionsToString($options, $strings); - $options = array_merge($options, $this->_buildCallbacks($options)); - $options = $this->_buildOptions($options, $this->sortOptions); - $result = "Sortable.create('$id', $options);"; - - if (!$block) { - return $result; - } - return $this->Javascript->codeBlock($result); - } - -/** - * Private helper function for Javascript. - * - * @param array $options Set of options - * @access private - */ - function __optionsForAjax($options) { - if (isset($options['indicator'])) { - if (isset($options['loading'])) { - $loading = $options['loading']; - - if (!empty($loading) && substr(trim($loading), -1, 1) != ';') { - $options['loading'] .= '; '; - } - $options['loading'] .= "Element.show('{$options['indicator']}');"; - } else { - $options['loading'] = "Element.show('{$options['indicator']}');"; - } - if (isset($options['complete'])) { - $complete = $options['complete']; - - if (!empty($complete) && substr(trim($complete), -1, 1) != ';') { - $options['complete'] .= '; '; - } - $options['complete'] .= "Element.hide('{$options['indicator']}');"; - } else { - $options['complete'] = "Element.hide('{$options['indicator']}');"; - } - unset($options['indicator']); - } - - $jsOptions = array_merge( - array('asynchronous' => 'true', 'evalScripts' => 'true'), - $this->_buildCallbacks($options) - ); - - $options = $this->_optionsToString($options, array( - 'contentType', 'encoding', 'fallback', 'method', 'postBody', 'update', 'url' - )); - $jsOptions = array_merge($jsOptions, array_intersect_key($options, array_flip(array( - 'contentType', 'encoding', 'method', 'postBody' - )))); - - foreach ($options as $key => $value) { - switch ($key) { - case 'type': - $jsOptions['asynchronous'] = ($value == 'synchronous') ? 'false' : 'true'; - break; - case 'evalScripts': - $jsOptions['evalScripts'] = ($value) ? 'true' : 'false'; - break; - case 'position': - $pos = Inflector::camelize($options['position']); - $jsOptions['insertion'] = "Insertion.{$pos}"; - break; - case 'with': - $jsOptions['parameters'] = $options['with']; - break; - case 'form': - $jsOptions['parameters'] = 'Form.serialize(this)'; - break; - case 'requestHeaders': - $keys = array(); - foreach ($value as $key => $val) { - $keys[] = "'" . $key . "'"; - $keys[] = "'" . $val . "'"; - } - $jsOptions['requestHeaders'] = '[' . implode(', ', $keys) . ']'; - break; - } - } - return $this->_buildOptions($jsOptions, $this->ajaxOptions); - } - -/** - * Private Method to return a string of html options - * option data as a JavaScript options hash. - * - * @param array $options Options in the shape of keys and values - * @param array $extra Array of legal keys in this options context - * @return array Array of html options - * @access private - */ - function __getHtmlOptions($options, $extra = array()) { - foreach (array_merge($this->ajaxOptions, $this->callbacks, $extra) as $key) { - if (isset($options[$key])) { - unset($options[$key]); - } - } - return $options; - } - -/** - * Returns a string of JavaScript with the given option data as a JavaScript options hash. - * - * @param array $options Options in the shape of keys and values - * @param array $acceptable Array of legal keys in this options context - * @return string String of Javascript array definition - */ - function _buildOptions($options, $acceptable) { - if (is_array($options)) { - $out = array(); - - foreach ($options as $k => $v) { - if (in_array($k, $acceptable)) { - if ($v === true) { - $v = 'true'; - } elseif ($v === false) { - $v = 'false'; - } - $out[] = "$k:$v"; - } elseif ($k === 'with' && in_array('parameters', $acceptable)) { - $out[] = "parameters:${v}"; - } - } - - $out = implode(', ', $out); - $out = '{' . $out . '}'; - return $out; - } else { - return false; - } - } - -/** - * Return JavaScript text for an observer... - * - * @param string $klass Name of JavaScript class - * @param string $name - * @param array $options Ajax options - * @return string Formatted JavaScript - */ - function _buildObserver($klass, $name, $options = null) { - if (!isset($options['with']) && isset($options['update'])) { - $options['with'] = 'value'; - } - - $callback = $this->remoteFunction($options); - $hasFrequency = !(!isset($options['frequency']) || intval($options['frequency']) == 0); - $frequency = $hasFrequency ? $options['frequency'] . ', ' : ''; - - return "new $klass('$name', {$frequency}function(element, value) {{$callback}})"; - } - -/** - * Return Javascript text for callbacks. - * - * @param array $options Option array where a callback is specified - * @return array Options with their callbacks properly set - */ - protected function _buildCallbacks($options) { - $callbacks = array(); - - foreach ($this->callbacks as $callback) { - if (isset($options[$callback])) { - $name = 'on' . ucfirst($callback); - $code = $options[$callback]; - switch ($name) { - case 'onComplete': - $callbacks[$name] = "function(request, json) {" . $code . "}"; - break; - case 'onCreate': - $callbacks[$name] = "function(request, xhr) {" . $code . "}"; - break; - case 'onException': - $callbacks[$name] = "function(request, exception) {" . $code . "}"; - break; - default: - $callbacks[$name] = "function(request) {" . $code . "}"; - break; - } - if (isset($options['bind'])) { - $bind = $options['bind']; - - $hasBinding = ( - (is_array($bind) && in_array($callback, $bind)) || - (is_string($bind) && strpos($bind, $callback) !== false) - ); - - if ($hasBinding) { - $callbacks[$name] .= ".bind(this)"; - } - } - } - } - return $callbacks; - } - -/** - * Returns a string of JavaScript with a string representation of given options array. - * - * @param array $options Ajax options array - * @param array $stringOpts Options as strings in an array - * @access private - * @return array - */ - function _optionsToString($options, $stringOpts = array()) { - foreach ($stringOpts as $option) { - $hasOption = ( - isset($options[$option]) && !empty($options[$option]) && - is_string($options[$option]) && $options[$option][0] != "'" - ); - - if ($hasOption) { - if ($options[$option] === true || $options[$option] === 'true') { - $options[$option] = 'true'; - } elseif ($options[$option] === false || $options[$option] === 'false') { - $options[$option] = 'false'; - } else { - $options[$option] = "'{$options[$option]}'"; - } - } - } - return $options; - } - -/** - * Executed after a view has rendered, used to include bufferred code - * blocks. - * - */ - public function afterRender() { - if (env('HTTP_X_UPDATE') != null && !empty($this->__ajaxBuffer)) { - @ob_end_clean(); - - $data = array(); - $divs = explode(' ', env('HTTP_X_UPDATE')); - $keys = array_keys($this->__ajaxBuffer); - - if (count($divs) == 1 && in_array($divs[0], $keys)) { - echo $this->__ajaxBuffer[$divs[0]]; - } else { - foreach ($this->__ajaxBuffer as $key => $val) { - if (in_array($key, $divs)) { - $data[] = $key . ':"' . rawurlencode($val) . '"'; - } - } - $out = 'var __ajaxUpdater__ = {' . implode(", \n", $data) . '};' . "\n"; - $out .= 'for (n in __ajaxUpdater__) { if (typeof __ajaxUpdater__[n] == "string"'; - $out .= ' && $(n)) Element.update($(n), unescape(decodeURIComponent('; - $out .= '__ajaxUpdater__[n]))); }'; - echo $this->Javascript->codeBlock($out, false); - } - $scripts = $this->Javascript->getCache(); - - if (!empty($scripts)) { - echo $this->Javascript->codeBlock($scripts, false); - } - $this->_stop(); - } - } -} -?> \ No newline at end of file diff --git a/cake/libs/view/helpers/javascript.php b/cake/libs/view/helpers/javascript.php deleted file mode 100644 index ded6bffff..000000000 --- a/cake/libs/view/helpers/javascript.php +++ /dev/null @@ -1,722 +0,0 @@ -<?php -/** - * Javascript Helper class file. - * - * PHP versions 4 and 5 - * - * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The MIT License - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link http://cakephp.org CakePHP(tm) Project - * @package cake - * @subpackage cake.cake.libs.view.helpers - * @since CakePHP(tm) v 0.10.0.1076 - * @license MIT License (http://www.opensource.org/licenses/mit-license.php) - */ - -/** - * Javascript Helper class for easy use of JavaScript. - * - * JavascriptHelper encloses all methods needed while working with JavaScript. - * - * @package cake - * @subpackage cake.cake.libs.view.helpers - * @link http://book.cakephp.org/view/1450/Javascript - */ -class JavascriptHelper extends AppHelper { - -/** - * Determines whether native JSON extension is used for encoding. Set by object constructor. - * - * @var boolean - * @access public - */ - public $useNative = false; - -/** - * If true, automatically writes events to the end of a script or to an external JavaScript file - * at the end of page execution - * - * @var boolean - * @access public - */ - public $enabled = true; - -/** - * Indicates whether <script /> blocks should be written 'safely,' i.e. wrapped in CDATA blocks - * - * @var boolean - * @access public - */ - public $safe = false; - -/** - * HTML tags used by this helper. - * - * @var array - * @access public - */ - public $tags = array( - 'javascriptstart' => '<script type="text/javascript">', - 'javascriptend' => '</script>', - 'javascriptblock' => '<script type="text/javascript">%s</script>', - 'javascriptlink' => '<script type="text/javascript" src="%s"></script>' - ); - -/** - * Holds options passed to codeBlock(), saved for when block is dumped to output - * - * @var array - * @access protected - * @see JavascriptHelper::codeBlock() - */ - protected $_blockOptions = array(); - -/** - * Caches events written by event() for output at the end of page execution - * - * @var array - * @access protected - * @see JavascriptHelper::event() - */ - protected $_cachedEvents = array(); - -/** - * Indicates whether generated events should be cached for later output (can be written at the - * end of the page, in the <head />, or to an external file). - * - * @var boolean - * @access protected - * @see JavascriptHelper::event() - * @see JavascriptHelper::writeEvents() - */ - protected $_cacheEvents = false; - -/** - * Indicates whether cached events should be written to an external file - * - * @var boolean - * @access protected - * @see JavascriptHelper::event() - * @see JavascriptHelper::writeEvents() - */ - protected $_cacheToFile = false; - -/** - * Indicates whether *all* generated JavaScript should be cached for later output - * - * @var boolean - * @access protected - * @see JavascriptHelper::codeBlock() - * @see JavascriptHelper::blockEnd() - */ - protected $_cacheAll = false; - -/** - * Contains event rules attached with CSS selectors. Used with the event:Selectors JavaScript - * library. - * - * @var array - * @access protected - * @see JavascriptHelper::event() - * @link http://alternateidea.com/event-selectors/ - */ - protected $_rules = array(); - -/** - * @var string - * @access private - */ - private $__scriptBuffer = null; - -/** - * Constructor. Checks for presence of native PHP JSON extension to use for object encoding - * - */ - public function __construct($options = array()) { - if (!empty($options)) { - foreach ($options as $key => $val) { - if (is_numeric($key)) { - $key = $val; - $val = true; - } - switch ($key) { - case 'cache': - - break; - case 'safe': - $this->safe = $val; - break; - } - } - } - $this->useNative = function_exists('json_encode'); - return parent::__construct($options); - } - -/** - * Returns a JavaScript script tag. - * - * Options: - * - * - allowCache: boolean, designates whether this block is cacheable using the - * current cache settings. - * - safe: boolean, whether this block should be wrapped in CDATA tags. Defaults - * to helper's object configuration. - * - inline: whether the block should be printed inline, or written - * to cached for later output (i.e. $scripts_for_layout). - * - * @param string $script The JavaScript to be wrapped in SCRIPT tags. - * @param array $options Set of options: - * @return string The full SCRIPT element, with the JavaScript inside it, or null, - * if 'inline' is set to false. - */ - function codeBlock($script = null, $options = array()) { - if (!empty($options) && !is_array($options)) { - $options = array('allowCache' => $options); - } elseif (empty($options)) { - $options = array(); - } - $defaultOptions = array('allowCache' => true, 'safe' => true, 'inline' => true); - $options = array_merge($defaultOptions, $options); - - if (empty($script)) { - $this->__scriptBuffer = @ob_get_contents(); - $this->_blockOptions = $options; - $this->inBlock = true; - @ob_end_clean(); - ob_start(); - return null; - } - if ($this->_cacheEvents && $this->_cacheAll && $options['allowCache']) { - $this->_cachedEvents[] = $script; - return null; - } - if ($options['safe'] || $this->safe) { - $script = "\n" . '//<![CDATA[' . "\n" . $script . "\n" . '//]]>' . "\n"; - } - if ($options['inline']) { - return sprintf($this->tags['javascriptblock'], $script); - } else { - $view =& ClassRegistry::getObject('view'); - $view->addScript(sprintf($this->tags['javascriptblock'], $script)); - } - } - -/** - * Ends a block of cached JavaScript code - * - * @return mixed - */ - function blockEnd() { - if (!isset($this->inBlock) || !$this->inBlock) { - return; - } - $script = @ob_get_contents(); - @ob_end_clean(); - ob_start(); - echo $this->__scriptBuffer; - $this->__scriptBuffer = null; - $options = $this->_blockOptions; - $this->_blockOptions = array(); - $this->inBlock = false; - - if (empty($script)) { - return null; - } - - return $this->codeBlock($script, $options); - } - -/** - * Returns a JavaScript include tag (SCRIPT element). If the filename is prefixed with "/", - * the path will be relative to the base path of your application. Otherwise, the path will - * be relative to your JavaScript path, usually webroot/js. - * - * @param mixed $url String URL to JavaScript file, or an array of URLs. - * @param boolean $inline If true, the <script /> tag will be printed inline, - * otherwise it will be printed in the <head />, using $scripts_for_layout - * @see JS_URL - * @return string - */ - function link($url, $inline = true) { - if (is_array($url)) { - $out = ''; - foreach ($url as $i) { - $out .= "\n\t" . $this->link($i, $inline); - } - if ($inline) { - return $out . "\n"; - } - return; - } - - if (strpos($url, '://') === false) { - if ($url[0] !== '/') { - $url = JS_URL . $url; - } - if (strpos($url, '?') === false) { - if (substr($url, -3) !== '.js') { - $url .= '.js'; - } - } - $url = $this->assetTimestamp($this->webroot($url)); - - if (Configure::read('Asset.filter.js')) { - $pos = strpos($url, JS_URL); - if ($pos !== false) { - $url = substr($url, 0, $pos) . 'cjs/' . substr($url, $pos + strlen(JS_URL)); - } - } - } - $out = sprintf($this->tags['javascriptlink'], $url); - - if ($inline) { - return $out; - } else { - $view =& ClassRegistry::getObject('view'); - $view->addScript($out); - } - } - -/** - * Escape carriage returns and single and double quotes for JavaScript segments. - * - * @param string $script string that might have javascript elements - * @return string escaped string - */ - function escapeScript($script) { - $script = str_replace(array("\r\n", "\n", "\r"), '\n', $script); - $script = str_replace(array('"', "'"), array('\"', "\\'"), $script); - return $script; - } - -/** - * Escape a string to be JavaScript friendly. - * - * List of escaped ellements: - * + "\r\n" => '\n' - * + "\r" => '\n' - * + "\n" => '\n' - * + '"' => '\"' - * + "'" => "\\'" - * - * @param string $script String that needs to get escaped. - * @return string Escaped string. - */ - function escapeString($string) { - App::import('Core', 'Multibyte'); - $escape = array("\r\n" => "\n", "\r" => "\n"); - $string = str_replace(array_keys($escape), array_values($escape), $string); - return $this->_utf8ToHex($string); - } - -/** - * Encode a string into JSON. Converts and escapes necessary characters. - * - * @return void - */ - function _utf8ToHex($string) { - $length = strlen($string); - $return = ''; - for ($i = 0; $i < $length; ++$i) { - $ord = ord($string{$i}); - switch (true) { - case $ord == 0x08: - $return .= '\b'; - break; - case $ord == 0x09: - $return .= '\t'; - break; - case $ord == 0x0A: - $return .= '\n'; - break; - case $ord == 0x0C: - $return .= '\f'; - break; - case $ord == 0x0D: - $return .= '\r'; - break; - case $ord == 0x22: - case $ord == 0x2F: - case $ord == 0x5C: - case $ord == 0x27: - $return .= '\\' . $string{$i}; - break; - case (($ord >= 0x20) && ($ord <= 0x7F)): - $return .= $string{$i}; - break; - case (($ord & 0xE0) == 0xC0): - if ($i + 1 >= $length) { - $i += 1; - $return .= '?'; - break; - } - $charbits = $string{$i} . $string{$i + 1}; - $char = Multibyte::utf8($charbits); - $return .= sprintf('\u%04s', dechex($char[0])); - $i += 1; - break; - case (($ord & 0xF0) == 0xE0): - if ($i + 2 >= $length) { - $i += 2; - $return .= '?'; - break; - } - $charbits = $string{$i} . $string{$i + 1} . $string{$i + 2}; - $char = Multibyte::utf8($charbits); - $return .= sprintf('\u%04s', dechex($char[0])); - $i += 2; - break; - case (($ord & 0xF8) == 0xF0): - if ($i + 3 >= $length) { - $i += 3; - $return .= '?'; - break; - } - $charbits = $string{$i} . $string{$i + 1} . $string{$i + 2} . $string{$i + 3}; - $char = Multibyte::utf8($charbits); - $return .= sprintf('\u%04s', dechex($char[0])); - $i += 3; - break; - case (($ord & 0xFC) == 0xF8): - if ($i + 4 >= $length) { - $i += 4; - $return .= '?'; - break; - } - $charbits = $string{$i} . $string{$i + 1} . $string{$i + 2} . $string{$i + 3} . $string{$i + 4}; - $char = Multibyte::utf8($charbits); - $return .= sprintf('\u%04s', dechex($char[0])); - $i += 4; - break; - case (($ord & 0xFE) == 0xFC): - if ($i + 5 >= $length) { - $i += 5; - $return .= '?'; - break; - } - $charbits = $string{$i} . $string{$i + 1} . $string{$i + 2} . $string{$i + 3} . $string{$i + 4} . $string{$i + 5}; - $char = Multibyte::utf8($charbits); - $return .= sprintf('\u%04s', dechex($char[0])); - $i += 5; - break; - } - } - return $return; - } - -/** - * Attach an event to an element. Used with the Prototype library. - * - * @param string $object Object to be observed - * @param string $event event to observe - * @param string $observer function to call - * @param array $options Set options: useCapture, allowCache, safe - * @return boolean true on success - */ - function event($object, $event, $observer = null, $options = array()) { - if (!empty($options) && !is_array($options)) { - $options = array('useCapture' => $options); - } else if (empty($options)) { - $options = array(); - } - - $defaultOptions = array('useCapture' => false); - $options = array_merge($defaultOptions, $options); - - if ($options['useCapture'] == true) { - $options['useCapture'] = 'true'; - } else { - $options['useCapture'] = 'false'; - } - $isObject = ( - strpos($object, 'window') !== false || strpos($object, 'document') !== false || - strpos($object, '$(') !== false || strpos($object, '"') !== false || - strpos($object, '\'') !== false - ); - - if ($isObject) { - $b = "Event.observe({$object}, '{$event}', function(event) { {$observer} }, "; - $b .= "{$options['useCapture']});"; - } elseif ($object[0] == '\'') { - $b = "Event.observe(" . substr($object, 1) . ", '{$event}', function(event) { "; - $b .= "{$observer} }, {$options['useCapture']});"; - } else { - $chars = array('#', ' ', ', ', '.', ':'); - $found = false; - foreach ($chars as $char) { - if (strpos($object, $char) !== false) { - $found = true; - break; - } - } - if ($found) { - $this->_rules[$object] = $event; - } else { - $b = "Event.observe(\$('{$object}'), '{$event}', function(event) { "; - $b .= "{$observer} }, {$options['useCapture']});"; - } - } - - if (isset($b) && !empty($b)) { - if ($this->_cacheEvents === true) { - $this->_cachedEvents[] = $b; - return; - } else { - return $this->codeBlock($b, array_diff_key($options, $defaultOptions)); - } - } - } - -/** - * Cache JavaScript events created with event() - * - * @param boolean $file If true, code will be written to a file - * @param boolean $all If true, all code written with JavascriptHelper will be sent to a file - * @return null - */ - function cacheEvents($file = false, $all = false) { - $this->_cacheEvents = true; - $this->_cacheToFile = $file; - $this->_cacheAll = $all; - } - -/** - * Gets (and clears) the current JavaScript event cache - * - * @param boolean $clear - * @return string - */ - function getCache($clear = true) { - $out = ''; - $rules = array(); - - if (!empty($this->_rules)) { - foreach ($this->_rules as $sel => $event) { - $rules[] = "\t'{$sel}': function(element, event) {\n\t\t{$event}\n\t}"; - } - } - $data = implode("\n", $this->_cachedEvents); - - if (!empty($rules)) { - $data .= "\nvar Rules = {\n" . implode(",\n\n", $rules) . "\n}"; - $data .= "\nEventSelectors.start(Rules);\n"; - } - if ($clear) { - $this->_rules = array(); - $this->_cacheEvents = false; - $this->_cachedEvents = array(); - } - return $data; - } - -/** - * Write cached JavaScript events - * - * @param boolean $inline If true, returns JavaScript event code. Otherwise it is added to the - * output of $scripts_for_layout in the layout. - * @param array $options Set options for codeBlock - * @return string - */ - function writeEvents($inline = true, $options = array()) { - $out = ''; - $rules = array(); - - if (!$this->_cacheEvents) { - return; - } - $data = $this->getCache(); - - if (empty($data)) { - return; - } - - if ($this->_cacheToFile) { - $filename = md5($data); - if (!file_exists(JS . $filename . '.js')) { - cache(str_replace(WWW_ROOT, '', JS) . $filename . '.js', $data, '+999 days', 'public'); - } - $out = $this->link($filename); - } else { - $out = $this->codeBlock("\n" . $data . "\n", $options); - } - - if ($inline) { - return $out; - } else { - $view =& ClassRegistry::getObject('view'); - $view->addScript($out); - } - } - -/** - * Includes the Prototype Javascript library (and anything else) inside a single script tag. - * - * Note: The recommended approach is to copy the contents of - * javascripts into your application's - * public/javascripts/ directory, and use @see javascriptIncludeTag() to - * create remote script links. - * - * @param string $script Script file to include - * @param array $options Set options for codeBlock - * @return string script with all javascript in/javascripts folder - */ - function includeScript($script = "", $options = array()) { - if ($script == "") { - $files = scandir(JS); - $javascript = ''; - - foreach ($files as $file) { - if (substr($file, -3) == '.js') { - $javascript .= file_get_contents(JS . "{$file}") . "\n\n"; - } - } - } else { - $javascript = file_get_contents(JS . "$script.js") . "\n\n"; - } - return $this->codeBlock("\n\n" . $javascript, $options); - } - -/** - * Generates a JavaScript object in JavaScript Object Notation (JSON) - * from an array - * - * ### Options - * - * - block - Wraps the return value in a script tag if true. Default is false - * - prefix - Prepends the string to the returned data. Default is '' - * - postfix - Appends the string to the returned data. Default is '' - * - stringKeys - A list of array keys to be treated as a string. - * - quoteKeys - If false treats $stringKeys as a list of keys **not** to be quoted. Default is true. - * - q - The type of quote to use. Default is '"'. This option only affects the keys, not the values. - * - * @param array $data Data to be converted - * @param array $options Set of options: block, prefix, postfix, stringKeys, quoteKeys, q - * @return string A JSON code block - */ - function object($data = array(), $options = array()) { - if (!empty($options) && !is_array($options)) { - $options = array('block' => $options); - } else if (empty($options)) { - $options = array(); - } - - $defaultOptions = array( - 'block' => false, 'prefix' => '', 'postfix' => '', - 'stringKeys' => array(), 'quoteKeys' => true, 'q' => '"' - ); - $options = array_merge($defaultOptions, $options, array_filter(compact(array_keys($defaultOptions)))); - - if (is_object($data)) { - $data = get_object_vars($data); - } - - $out = $keys = array(); - $numeric = true; - - if ($this->useNative) { - $rt = json_encode($data); - } else { - if (is_null($data)) { - return 'null'; - } - if (is_bool($data)) { - return $data ? 'true' : 'false'; - } - - if (is_array($data)) { - $keys = array_keys($data); - } - - if (!empty($keys)) { - $numeric = (array_values($keys) === array_keys(array_values($keys))); - } - - foreach ($data as $key => $val) { - if (is_array($val) || is_object($val)) { - $val = $this->object( - $val, - array_merge($options, array('block' => false, 'prefix' => '', 'postfix' => '')) - ); - } else { - $quoteStrings = ( - !count($options['stringKeys']) || - ($options['quoteKeys'] && in_array($key, $options['stringKeys'], true)) || - (!$options['quoteKeys'] && !in_array($key, $options['stringKeys'], true)) - ); - $val = $this->value($val, $quoteStrings); - } - if (!$numeric) { - $val = $options['q'] . $this->value($key, false) . $options['q'] . ':' . $val; - } - $out[] = $val; - } - - if (!$numeric) { - $rt = '{' . implode(',', $out) . '}'; - } else { - $rt = '[' . implode(',', $out) . ']'; - } - } - $rt = $options['prefix'] . $rt . $options['postfix']; - - if ($options['block']) { - $rt = $this->codeBlock($rt, array_diff_key($options, $defaultOptions)); - } - - return $rt; - } - -/** - * Converts a PHP-native variable of any type to a JSON-equivalent representation - * - * @param mixed $val A PHP variable to be converted to JSON - * @param boolean $quoteStrings If false, leaves string values unquoted - * @return string a JavaScript-safe/JSON representation of $val - */ - function value($val, $quoteStrings = true) { - switch (true) { - case (is_array($val) || is_object($val)): - $val = $this->object($val); - break; - case ($val === null): - $val = 'null'; - break; - case (is_bool($val)): - $val = !empty($val) ? 'true' : 'false'; - break; - case (is_int($val)): - $val = $val; - break; - case (is_float($val)): - $val = sprintf("%.11f", $val); - break; - default: - $val = $this->escapeString($val); - if ($quoteStrings) { - $val = '"' . $val . '"'; - } - break; - } - return $val; - } - -/** - * AfterRender callback. Writes any cached events to the view, or to a temp file. - * - * @return null - */ - function afterRender() { - if (!$this->enabled) { - return; - } - echo $this->writeEvents(true); - } -} - -?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/ajax.test.php b/cake/tests/cases/libs/view/helpers/ajax.test.php deleted file mode 100644 index cc1fb9321..000000000 --- a/cake/tests/cases/libs/view/helpers/ajax.test.php +++ /dev/null @@ -1,909 +0,0 @@ -<?php -/** - * AjaxHelperTest file - * - * PHP versions 4 and 5 - * - * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) - * - * Licensed under The Open Group Test Suite License - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) - * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake - * @subpackage cake.tests.cases.libs.view.helpers - * @since CakePHP(tm) v 1.2.0.4206 - * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License - */ -if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) { - define('CAKEPHP_UNIT_TEST_EXECUTION', 1); -} -App::import('Helper', array('Html', 'Form', 'Javascript', 'Ajax')); -/** - * AjaxTestController class - * - * @package cake - * @subpackage cake.tests.cases.libs.view.helpers - */ -class AjaxTestController extends Controller { -/** - * name property - * - * @var string 'AjaxTest' - * @access public - */ - public $name = 'AjaxTest'; -/** - * uses property - * - * @var mixed null - * @access public - */ - public $uses = null; -} -/** - * PostAjaxTest class - * - * @package cake - * @subpackage cake.tests.cases.libs.view.helpers - */ -class PostAjaxTest extends Model { -/** - * primaryKey property - * - * @var string 'id' - * @access public - */ - public $primaryKey = 'id'; -/** - * useTable property - * - * @var bool false - * @access public - */ - public $useTable = false; -/** - * schema method - * - * @access public - * @return void - */ - function schema() { - return array( - 'id' => array('type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'), - 'name' => array('type' => 'string', 'null' => '', 'default' => '', 'length' => '255'), - 'created' => array('type' => 'date', 'null' => '1', 'default' => '', 'length' => ''), - 'updated' => array('type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null) - ); - } -} -/** - * TestAjaxHelper class - * - * @package cake - * @subpackage cake.tests.cases.libs.view.helpers - */ -class TestAjaxHelper extends AjaxHelper { -/** - * stop method - * - * @access public - * @return void - */ - function _stop() { - } -} -/** - * TestJavascriptHelper class - * - * @package cake - * @subpackage cake.tests.cases.libs.view.helpers - */ -class TestJavascriptHelper extends JavascriptHelper { -/** - * codeBlocks property - * - * @var mixed - * @access public - */ - public $codeBlocks; -/** - * codeBlock method - * - * @param mixed $parameter - * @access public - * @return void - */ - function codeBlock($parameter) { - if (empty($this->codeBlocks)) { - $this->codeBlocks = array(); - } - $this->codeBlocks[] = $parameter; - } -} -/** - * AjaxTest class - * - * @package cake - * @subpackage cake.tests.cases.libs.view.helpers - */ -class AjaxHelperTest extends CakeTestCase { -/** - * Regexp for CDATA start block - * - * @var string - */ - public $cDataStart = 'preg:/^\/\/<!\[CDATA\[[\n\r]*/'; -/** - * Regexp for CDATA end block - * - * @var string - */ - public $cDataEnd = 'preg:/[^\]]*\]\]\>[\s\r\n]*/'; -/** - * setUp method - * - * @access public - * @return void - */ - function setUp() { - Router::reload(); - $this->Ajax =& new TestAjaxHelper(); - $this->Ajax->Html =& new HtmlHelper(); - $this->Ajax->Form =& new FormHelper(); - $this->Ajax->Javascript =& new JavascriptHelper(); - $this->Ajax->Form->Html =& $this->Ajax->Html; - $view =& new View(new AjaxTestController()); - ClassRegistry::addObject('view', $view); - ClassRegistry::addObject('PostAjaxTest', new PostAjaxTest()); - - $this->Ajax->Form->params = array( - 'plugin' => null, - 'action' => 'view', - 'controller' => 'users' - ); - } -/** - * tearDown method - * - * @access public - * @return void - */ - function tearDown() { - unset($this->Ajax); - ClassRegistry::flush(); - } -/** - * testEvalScripts method - * - * @access public - * @return void - */ - function testEvalScripts() { - $result = $this->Ajax->link('Test Link', 'http://www.cakephp.org', array('id' => 'link1', 'update' => 'content', 'evalScripts' => false)); - $expected = array( - 'a' => array('id' => 'link1', 'onclick' => ' event.returnValue = false; return false;', 'href' => 'http://www.cakephp.org'), - 'Test Link', - '/a', - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "Event.observe('link1', 'click', function(event) { new Ajax.Updater('content','http://www.cakephp.org', {asynchronous:true, evalScripts:false, requestHeaders:['X-Update', 'content']}) }, false);", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->link('Test Link', 'http://www.cakephp.org', array('id' => 'link1', 'update' => 'content')); - $expected = array( - 'a' => array('id' => 'link1', 'onclick' => ' event.returnValue = false; return false;', 'href' => 'http://www.cakephp.org'), - 'Test Link', - '/a', - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "Event.observe('link1', 'click', function(event) { new Ajax.Updater('content','http://www.cakephp.org', {asynchronous:true, evalScripts:true, requestHeaders:['X-Update', 'content']}) }, false);", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - } -/** - * testAutoComplete method - * - * @access public - * @return void - */ - function testAutoComplete() { - $result = $this->Ajax->autoComplete('PostAjaxTest.title' , '/posts', array('minChars' => 2)); - $this->assertPattern('/^<input[^<>]+name="data\[PostAjaxTest\]\[title\]"[^<>]+autocomplete="off"[^<>]+\/>/', $result); - $this->assertPattern('/<div[^<>]+id="PostAjaxTestTitle_autoComplete"[^<>]*><\/div>/', $result); - $this->assertPattern('/<div[^<>]+class="auto_complete"[^<>]*><\/div>/', $result); - $this->assertPattern('/<\/div>\s+<script type="text\/javascript">\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*' . str_replace('/', '\\/', preg_quote('new Ajax.Autocompleter(\'PostAjaxTestTitle\', \'PostAjaxTestTitle_autoComplete\', \'/posts\',')) . '/', $result); - $this->assertPattern('/' . str_replace('/', '\\/', preg_quote('new Ajax.Autocompleter(\'PostAjaxTestTitle\', \'PostAjaxTestTitle_autoComplete\', \'/posts\', {minChars:2});')) . '/', $result); - $this->assertPattern('/<\/script>$/', $result); - - $result = $this->Ajax->autoComplete('PostAjaxTest.title' , '/posts', array('paramName' => 'parameter')); - $this->assertPattern('/^<input[^<>]+name="data\[PostAjaxTest\]\[title\]"[^<>]+autocomplete="off"[^<>]+\/>/', $result); - $this->assertPattern('/<div[^<>]+id="PostAjaxTestTitle_autoComplete"[^<>]*><\/div>/', $result); - $this->assertPattern('/<div[^<>]+class="auto_complete"[^<>]*><\/div>/', $result); - $this->assertPattern('/<\/div>\s+<script type="text\/javascript">\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*' . str_replace('/', '\\/', preg_quote('new Ajax.Autocompleter(\'PostAjaxTestTitle\', \'PostAjaxTestTitle_autoComplete\', \'/posts\',')) . '/', $result); - $this->assertPattern('/' . str_replace('/', '\\/', preg_quote('new Ajax.Autocompleter(\'PostAjaxTestTitle\', \'PostAjaxTestTitle_autoComplete\', \'/posts\', {paramName:\'parameter\'});')) . '/', $result); - $this->assertPattern('/<\/script>$/', $result); - - $result = $this->Ajax->autoComplete('PostAjaxTest.title' , '/posts', array('paramName' => 'parameter', 'updateElement' => 'elementUpdated', 'afterUpdateElement' => 'function (input, element) { alert("updated"); }')); - $this->assertPattern('/^<input[^<>]+name="data\[PostAjaxTest\]\[title\]"[^<>]+autocomplete="off"[^<>]+\/>/', $result); - $this->assertPattern('/<div[^<>]+id="PostAjaxTestTitle_autoComplete"[^<>]*><\/div>/', $result); - $this->assertPattern('/<div[^<>]+class="auto_complete"[^<>]*><\/div>/', $result); - $this->assertPattern('/<\/div>\s+<script type="text\/javascript">\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*' . str_replace('/', '\\/', preg_quote('new Ajax.Autocompleter(\'PostAjaxTestTitle\', \'PostAjaxTestTitle_autoComplete\', \'/posts\',')) . '/', $result); - $this->assertPattern('/' . str_replace('/', '\\/', preg_quote('new Ajax.Autocompleter(\'PostAjaxTestTitle\', \'PostAjaxTestTitle_autoComplete\', \'/posts\', {paramName:\'parameter\', updateElement:elementUpdated, afterUpdateElement:function (input, element) { alert("updated"); }});')) . '/', $result); - $this->assertPattern('/<\/script>$/', $result); - - $result = $this->Ajax->autoComplete('PostAjaxTest.title' , '/posts', array('callback' => 'function (input, queryString) { alert("requesting"); }')); - $this->assertPattern('/^<input[^<>]+name="data\[PostAjaxTest\]\[title\]"[^<>]+autocomplete="off"[^<>]+\/>/', $result); - $this->assertPattern('/<div[^<>]+id="PostAjaxTestTitle_autoComplete"[^<>]*><\/div>/', $result); - $this->assertPattern('/<div[^<>]+class="auto_complete"[^<>]*><\/div>/', $result); - $this->assertPattern('/<\/div>\s+<script type="text\/javascript">\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*' . str_replace('/', '\\/', preg_quote('new Ajax.Autocompleter(\'PostAjaxTestTitle\', \'PostAjaxTestTitle_autoComplete\', \'/posts\',')) . '/', $result); - $this->assertPattern('/' . str_replace('/', '\\/', preg_quote('new Ajax.Autocompleter(\'PostAjaxTestTitle\', \'PostAjaxTestTitle_autoComplete\', \'/posts\', {callback:function (input, queryString) { alert("requesting"); }});')) . '/', $result); - $this->assertPattern('/<\/script>$/', $result); - - $result = $this->Ajax->autoComplete("PostAjaxText.title", "/post", array("parameters" => "'key=value&key2=value2'")); - $this->assertPattern('/{parameters:\'key=value&key2=value2\'}/', $result); - - $result = $this->Ajax->autoComplete("PostAjaxText.title", "/post", array("with" => "'key=value&key2=value2'")); - $this->assertPattern('/{parameters:\'key=value&key2=value2\'}/', $result); - - } -/** - * testAsynchronous method - * - * @access public - * @return void - */ - function testAsynchronous() { - $result = $this->Ajax->link('Test Link', '/', array('id' => 'link1', 'update' => 'content', 'type' => 'synchronous')); - $expected = array( - 'a' => array('id' => 'link1', 'onclick' => ' event.returnValue = false; return false;', 'href' => '/'), - 'Test Link', - '/a', - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "Event.observe('link1', 'click', function(event) { new Ajax.Updater('content','/', {asynchronous:false, evalScripts:true, requestHeaders:['X-Update', 'content']}) }, false);", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - } -/** - * testDraggable method - * - * @access public - * @return void - */ - function testDraggable() { - $result = $this->Ajax->drag('id', array('handle' => 'other_id')); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "new Draggable('id', {handle:'other_id'});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->drag('id', array('onDrag' => 'doDrag', 'onEnd' => 'doEnd')); - $this->assertPattern('/onDrag:doDrag/', $result); - $this->assertPattern('/onEnd:doEnd/', $result); - } -/** - * testDroppable method - * - * @access public - * @return void - */ - function testDroppable() { - $result = $this->Ajax->drop('droppable', array('accept' => 'crap')); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "Droppables.add('droppable', {accept:'crap'});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->dropRemote('droppable', array('accept' => 'crap'), array('url' => '/posts')); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "Droppables.add('droppable', {accept:'crap', onDrop:function(element, droppable, event) {new Ajax.Request('/posts', {asynchronous:true, evalScripts:true})}});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->dropRemote('droppable', array('accept' => array('crap1', 'crap2')), array('url' => '/posts')); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "Droppables.add('droppable', {accept:[\"crap1\",\"crap2\"], onDrop:function(element, droppable, event) {new Ajax.Request('/posts', {asynchronous:true, evalScripts:true})}});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->dropRemote('droppable', array('accept' => 'crap'), array('url' => '/posts', 'with' => '{drag_id:element.id,drop_id:dropon.id,event:event.whatever_you_want}')); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "Droppables.add('droppable', {accept:'crap', onDrop:function(element, droppable, event) {new Ajax.Request('/posts', {asynchronous:true, evalScripts:true, parameters:{drag_id:element.id,drop_id:dropon.id,event:event.whatever_you_want}})}});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - } -/** - * testForm method - * - * @access public - * @return void - */ - function testForm() { - $result = $this->Ajax->form('showForm', 'post', array('model' => 'Form', 'url' => array('action' => 'showForm', 'controller' => 'forms'), 'update' => 'form_box')); - $this->assertNoPattern('/model=/', $result); - - $result = $this->Ajax->form('showForm', 'post', array('name'=> 'SomeFormName', 'id' => 'MyFormID', 'url' => array('action' => 'showForm', 'controller' => 'forms'), 'update' => 'form_box')); - $this->assertPattern('/id="MyFormID"/', $result); - $this->assertPattern('/name="SomeFormName"/', $result); - } -/** - * testSortable method - * - * @access public - * @return void - */ - function testSortable() { - $result = $this->Ajax->sortable('ull', array('constraint' => false, 'ghosting' => true)); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "Sortable.create('ull', {constraint:false, ghosting:true});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->sortable('ull', array('constraint' => 'false', 'ghosting' => 'true')); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "Sortable.create('ull', {constraint:false, ghosting:true});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->sortable('ull', array('constraint'=>'false', 'ghosting'=>'true', 'update' => 'myId')); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "Sortable.create('ull', {constraint:false, ghosting:true, update:'myId'});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->sortable('faqs', array('url'=>'http://www.cakephp.org', - 'update' => 'faqs', - 'tag' => 'tbody', - 'handle' => 'grip', - 'before' => "Element.hide('message')", - 'complete' => "Element.show('message');" - )); - $expected = 'Sortable.create(\'faqs\', {update:\'faqs\', tag:\'tbody\', handle:\'grip\', onUpdate:function(sortable) {Element.hide(\'message\'); new Ajax.Updater(\'faqs\',\'http://www.cakephp.org\', {asynchronous:true, evalScripts:true, onComplete:function(request, json) {Element.show(\'message\');}, parameters:Sortable.serialize(\'faqs\'), requestHeaders:[\'X-Update\', \'faqs\']})}});'; - $this->assertPattern('/^<script[^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*' . str_replace('/', '\\/', preg_quote($expected)) . '\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - - $result = $this->Ajax->sortable('div', array('overlap' => 'foo')); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "Sortable.create('div', {overlap:'foo'});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->sortable('div', array('block' => false)); - $expected = "Sortable.create('div', {});"; - $this->assertEqual($result, $expected); - - $result = $this->Ajax->sortable('div', array('block' => false, 'scroll' => 'someID')); - $expected = "Sortable.create('div', {scroll:'someID'});"; - $this->assertEqual($result, $expected); - - $result = $this->Ajax->sortable('div', array('block' => false, 'scroll' => 'window')); - $expected = "Sortable.create('div', {scroll:window});"; - $this->assertEqual($result, $expected); - - $result = $this->Ajax->sortable('div', array('block' => false, 'scroll' => "$('someElement')")); - $expected = "Sortable.create('div', {scroll:$('someElement')});"; - $this->assertEqual($result, $expected); - } -/** - * testSubmitWithIndicator method - * - * @access public - * @return void - */ - function testSubmitWithIndicator() { - $result = $this->Ajax->submit('Add', array('div' => false, 'url' => "http://www.cakephp.org", 'indicator' => 'loading', 'loading' => "doSomething()", 'complete' => 'doSomethingElse() ')); - $this->assertPattern('/onLoading:function\(request\) {doSomething\(\);\s+Element.show\(\'loading\'\);}/', $result); - $this->assertPattern('/onComplete:function\(request, json\) {doSomethingElse\(\) ;\s+Element.hide\(\'loading\'\);}/', $result); - } -/** - * testLink method - * - * @access public - * @return void - */ - function testLink() { - $result = $this->Ajax->link('Ajax Link', 'http://www.cakephp.org/downloads'); - $this->assertPattern('/^<a[^<>]+>Ajax Link<\/a><script [^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*[^<>]+\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/^<a[^<>]+href="http:\/\/www.cakephp.org\/downloads"[^<>]*>/', $result); - $this->assertPattern('/^<a[^<>]+id="link\d+"[^<>]*>/', $result); - $this->assertPattern('/^<a[^<>]+onclick="\s*event.returnValue = false;\s*return false;"[^<>]*>/', $result); - $this->assertPattern('/<script[^<>]+type="text\/javascript"[^<>]*>/', $result); - $this->assertNoPattern('/^<a\s+[^<>]*url="[^"]*"[^<>]*>/', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/Event.observe\(\'link\d+\',\s*\'click\',\s*function\(event\)\s*{.+},\s*false\);\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/function\(event\)\s*{\s*new Ajax\.Request\(\'http:\/\/www.cakephp.org\/downloads\',\s*{asynchronous:true, evalScripts:true}\)\s*},\s*false\);/', $result); - - $result = $this->Ajax->link('Ajax Link', 'http://www.cakephp.org/downloads', array('confirm' => 'Are you sure & positive?')); - $this->assertPattern('/^<a[^<>]+>Ajax Link<\/a><script [^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*[^<>]+\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/^<a[^<>]+href="http:\/\/www.cakephp.org\/downloads"[^<>]*>/', $result); - $this->assertPattern('/^<a[^<>]+id="link\d+"[^<>]*>/', $result); - $this->assertPattern('/^<a[^<>]+onclick="\s*event.returnValue = false;\s*return false;"[^<>]*>/', $result); - $this->assertPattern('/<script[^<>]+type="text\/javascript"[^<>]*>/', $result); - $this->assertNoPattern('/^<a\s+[^<>]*url="[^"]*"[^<>]*>/', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/Event.observe\(\'link\d+\',\s*\'click\',\s*function\(event\)\s*{.+},\s*false\);\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/function\(event\)\s*{\s*if \(confirm\(\'Are you sure & positive\?\'\)\) {\s*new Ajax\.Request\(\'http:\/\/www.cakephp.org\/downloads\',\s*{asynchronous:true, evalScripts:true}\);\s*}\s*else\s*{\s*event.returnValue = false;\s*return false;\s*}\s*},\s*false\);/', $result); - - $result = $this->Ajax->link('Ajax Link', 'http://www.cakephp.org/downloads', array('update' => 'myDiv')); - $this->assertPattern('/^<a[^<>]+>Ajax Link<\/a><script [^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*[^<>]+\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/^<a[^<>]+href="http:\/\/www.cakephp.org\/downloads"[^<>]*>/', $result); - $this->assertPattern('/^<a[^<>]+id="link\d+"[^<>]*>/', $result); - $this->assertPattern('/^<a[^<>]+onclick="\s*event.returnValue = false;\s*return false;"[^<>]*>/', $result); - $this->assertPattern('/<script[^<>]+type="text\/javascript"[^<>]*>/', $result); - $this->assertNoPattern('/^<a\s+[^<>]*url="[^"]*"[^<>]*>/', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/Event.observe\(\'link\d+\',\s*\'click\',\s*function\(event\)\s*{.+},\s*false\);\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/function\(event\)\s*{\s*new Ajax\.Updater\(\'myDiv\',\s*\'http:\/\/www.cakephp.org\/downloads\',\s*{asynchronous:true, evalScripts:true, requestHeaders:\[\'X-Update\', \'myDiv\'\]}\)\s*},\s*false\);/', $result); - - $result = $this->Ajax->link('Ajax Link', 'http://www.cakephp.org/downloads', array('update' => 'myDiv', 'id' => 'myLink')); - $this->assertPattern('/^<a[^<>]+>Ajax Link<\/a><script [^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*[^<>]+\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/^<a[^<>]+href="http:\/\/www.cakephp.org\/downloads"[^<>]*>/', $result); - $this->assertPattern('/^<a[^<>]+id="myLink"[^<>]*>/', $result); - $this->assertPattern('/^<a[^<>]+onclick="\s*event.returnValue = false;\s*return false;"[^<>]*>/', $result); - $this->assertPattern('/<script[^<>]+type="text\/javascript"[^<>]*>/', $result); - $this->assertNoPattern('/^<a\s+[^<>]*url="[^"]*"[^<>]*>/', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/Event.observe\(\'myLink\',\s*\'click\',\s*function\(event\)\s*{.+},\s*false\);\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/function\(event\)\s*{\s*new Ajax\.Updater\(\'myDiv\',\s*\'http:\/\/www.cakephp.org\/downloads\',\s*{asynchronous:true, evalScripts:true, requestHeaders:\[\'X-Update\', \'myDiv\'\]}\)\s*},\s*false\);/', $result); - - $result = $this->Ajax->link('Ajax Link', 'http://www.cakephp.org/downloads', array('update' => 'myDiv', 'id' => 'myLink', 'complete' => 'myComplete();')); - $this->assertPattern('/^<a[^<>]+>Ajax Link<\/a><script [^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*[^<>]+\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/^<a[^<>]+href="http:\/\/www.cakephp.org\/downloads"[^<>]*>/', $result); - $this->assertPattern('/^<a[^<>]+id="myLink"[^<>]*>/', $result); - $this->assertPattern('/^<a[^<>]+onclick="\s*event.returnValue = false;\s*return false;"[^<>]*>/', $result); - $this->assertPattern('/<script[^<>]+type="text\/javascript"[^<>]*>/', $result); - $this->assertNoPattern('/^<a\s+[^<>]*url="[^"]*"[^<>]*>/', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/Event.observe\(\'myLink\',\s*\'click\',\s*function\(event\)\s*{.+},\s*false\);\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/function\(event\)\s*{\s*new Ajax\.Updater\(\'myDiv\',\s*\'http:\/\/www.cakephp.org\/downloads\',\s*{asynchronous:true, evalScripts:true, onComplete:function\(request, json\) {myComplete\(\);}, requestHeaders:\[\'X-Update\', \'myDiv\'\]}\)\s*},\s*false\);/', $result); - - $result = $this->Ajax->link('Ajax Link', 'http://www.cakephp.org/downloads', array('update' => 'myDiv', 'id' => 'myLink', 'loading' => 'myLoading();', 'complete' => 'myComplete();')); - $this->assertPattern('/^<a[^<>]+>Ajax Link<\/a><script [^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*[^<>]+\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/^<a[^<>]+href="http:\/\/www.cakephp.org\/downloads"[^<>]*>/', $result); - $this->assertPattern('/^<a[^<>]+id="myLink"[^<>]*>/', $result); - $this->assertPattern('/^<a[^<>]+onclick="\s*event.returnValue = false;\s*return false;"[^<>]*>/', $result); - $this->assertPattern('/<script[^<>]+type="text\/javascript"[^<>]*>/', $result); - $this->assertNoPattern('/^<a\s+[^<>]*url="[^"]*"[^<>]*>/', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/Event.observe\(\'myLink\',\s*\'click\',\s*function\(event\)\s*{.+},\s*false\);\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/function\(event\)\s*{\s*new Ajax\.Updater\(\'myDiv\',\s*\'http:\/\/www.cakephp.org\/downloads\',\s*{asynchronous:true, evalScripts:true, onComplete:function\(request, json\) {myComplete\(\);}, onLoading:function\(request\) {myLoading\(\);}, requestHeaders:\[\'X-Update\', \'myDiv\'\]}\)\s*},\s*false\);/', $result); - - $result = $this->Ajax->link('Ajax Link', 'http://www.cakephp.org/downloads', array('update' => 'myDiv', 'encoding' => 'utf-8')); - $this->assertPattern('/^<a[^<>]+>Ajax Link<\/a><script [^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*[^<>]+\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/^<a[^<>]+href="http:\/\/www.cakephp.org\/downloads"[^<>]*>/', $result); - $this->assertPattern('/^<a[^<>]+onclick="\s*event.returnValue = false;\s*return false;"[^<>]*>/', $result); - $this->assertPattern('/<script[^<>]+type="text\/javascript"[^<>]*>/', $result); - $this->assertNoPattern('/^<a\s+[^<>]*url="[^"]*"[^<>]*>/', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/Event.observe\(\'\w+\',\s*\'click\',\s*function\(event\)\s*{.+},\s*false\);\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/function\(event\)\s*{\s*new Ajax\.Updater\(\'myDiv\',\s*\'http:\/\/www.cakephp.org\/downloads\',\s*{asynchronous:true, evalScripts:true, encoding:\'utf-8\', requestHeaders:\[\'X-Update\', \'myDiv\'\]}\)\s*},\s*false\);/', $result); - - $result = $this->Ajax->link('Ajax Link', 'http://www.cakephp.org/downloads', array('update' => 'myDiv', 'success' => 'success();')); - $this->assertPattern('/^<a[^<>]+>Ajax Link<\/a><script [^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*[^<>]+\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/^<a[^<>]+href="http:\/\/www.cakephp.org\/downloads"[^<>]*>/', $result); - $this->assertPattern('/^<a[^<>]+onclick="\s*event.returnValue = false;\s*return false;"[^<>]*>/', $result); - $this->assertPattern('/<script[^<>]+type="text\/javascript"[^<>]*>/', $result); - $this->assertNoPattern('/^<a\s+[^<>]*url="[^"]*"[^<>]*>/', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/Event.observe\(\'\w+\',\s*\'click\',\s*function\(event\)\s*{.+},\s*false\);\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/function\(event\)\s*{\s*new Ajax\.Updater\(\'myDiv\',\s*\'http:\/\/www.cakephp.org\/downloads\',\s*{asynchronous:true, evalScripts:true, onSuccess:function\(request\) {success\(\);}, requestHeaders:\[\'X-Update\', \'myDiv\'\]}\)\s*},\s*false\);/', $result); - - $result = $this->Ajax->link('Ajax Link', 'http://www.cakephp.org/downloads', array('update' => 'myDiv', 'failure' => 'failure();')); - $this->assertPattern('/^<a[^<>]+>Ajax Link<\/a><script [^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*[^<>]+\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/^<a[^<>]+href="http:\/\/www.cakephp.org\/downloads"[^<>]*>/', $result); - $this->assertPattern('/^<a[^<>]+onclick="\s*event.returnValue = false;\s*return false;"[^<>]*>/', $result); - $this->assertPattern('/<script[^<>]+type="text\/javascript"[^<>]*>/', $result); - $this->assertNoPattern('/^<a\s+[^<>]*url="[^"]*"[^<>]*>/', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/Event.observe\(\'\w+\',\s*\'click\',\s*function\(event\)\s*{.+},\s*false\);\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/function\(event\)\s*{\s*new Ajax\.Updater\(\'myDiv\',\s*\'http:\/\/www.cakephp.org\/downloads\',\s*{asynchronous:true, evalScripts:true, onFailure:function\(request\) {failure\(\);}, requestHeaders:\[\'X-Update\', \'myDiv\'\]}\)\s*},\s*false\);/', $result); - - $result = $this->Ajax->link('Ajax Link', '/test', array('complete' => 'test')); - $this->assertPattern('/^<a[^<>]+>Ajax Link<\/a><script [^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*[^<>]+\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern("/Event.observe\('link[0-9]+', [\w\d,'\(\)\s{}]+Ajax\.Request\([\w\d\s,'\(\){}:\/]+onComplete:function\(request, json\) {test}/", $result); - $this->assertNoPattern('/^<a[^<>]+complete="test"[^<>]*>Ajax Link<\/a>/', $result); - $this->assertNoPattern('/^<a\s+[^<>]*url="[^"]*"[^<>]*>/', $result); - - $result = $this->Ajax->link( - 'Ajax Link', - array('controller' => 'posts', 'action' => 'index', '?' => array('one' => '1', 'two' => '2')), - array('update' => 'myDiv', 'id' => 'myLink') - ); - $this->assertPattern('#/posts\?one\=1\&two\=2#', $result); - } -/** - * testRemoteTimer method - * - * @access public - * @return void - */ - function testRemoteTimer() { - $result = $this->Ajax->remoteTimer(array('url' => 'http://www.cakephp.org')); - $this->assertPattern('/^<script[^<>]+type="text\/javascript"[^<>]*>.+<\/script>$/s', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/^<script[^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*new PeriodicalExecuter\(function\(\) {.+}, 10\)\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/' . str_replace('/', '\\/', preg_quote('new Ajax.Request(\'http://www.cakephp.org\', {asynchronous:true, evalScripts:true})')) . '/', $result); - - $result = $this->Ajax->remoteTimer(array('url' => 'http://www.cakephp.org', 'frequency' => 25)); - $this->assertPattern('/^<script[^<>]+type="text\/javascript"[^<>]*>.+<\/script>$/s', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/^<script[^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*new PeriodicalExecuter\(function\(\) {.+}, 25\)\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/' . str_replace('/', '\\/', preg_quote('new Ajax.Request(\'http://www.cakephp.org\', {asynchronous:true, evalScripts:true})')) . '/', $result); - - $result = $this->Ajax->remoteTimer(array('url' => 'http://www.cakephp.org', 'complete' => 'complete();')); - $this->assertPattern('/^<script[^<>]+type="text\/javascript"[^<>]*>.+<\/script>$/s', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/^<script[^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*new PeriodicalExecuter\(function\(\) {.+}, 10\)\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/' . str_replace('/', '\\/', preg_quote('new Ajax.Request(\'http://www.cakephp.org\', {asynchronous:true, evalScripts:true, onComplete:function(request, json) {complete();}})')) . '/', $result); - - $result = $this->Ajax->remoteTimer(array('url' => 'http://www.cakephp.org', 'complete' => 'complete();', 'create' => 'create();')); - $this->assertPattern('/^<script[^<>]+type="text\/javascript"[^<>]*>.+<\/script>$/s', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/^<script[^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*new PeriodicalExecuter\(function\(\) {.+}, 10\)\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/' . str_replace('/', '\\/', preg_quote('new Ajax.Request(\'http://www.cakephp.org\', {asynchronous:true, evalScripts:true, onComplete:function(request, json) {complete();}, onCreate:function(request, xhr) {create();}})')) . '/', $result); - - $result = $this->Ajax->remoteTimer(array('url' => 'http://www.cakephp.org', 'exception' => 'alert(exception);')); - $this->assertPattern('/^<script[^<>]+type="text\/javascript"[^<>]*>.+<\/script>$/s', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/^<script[^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*new PeriodicalExecuter\(function\(\) {.+}, 10\)\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/' . str_replace('/', '\\/', preg_quote('new Ajax.Request(\'http://www.cakephp.org\', {asynchronous:true, evalScripts:true, onException:function(request, exception) {alert(exception);}})')) . '/', $result); - - $result = $this->Ajax->remoteTimer(array('url' => 'http://www.cakephp.org', 'contentType' => 'application/x-www-form-urlencoded')); - $this->assertPattern('/^<script[^<>]+type="text\/javascript"[^<>]*>.+<\/script>$/s', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/^<script[^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*new PeriodicalExecuter\(function\(\) {.+}, 10\)\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/' . str_replace('/', '\\/', preg_quote('new Ajax.Request(\'http://www.cakephp.org\', {asynchronous:true, evalScripts:true, contentType:\'application/x-www-form-urlencoded\'})')) . '/', $result); - - $result = $this->Ajax->remoteTimer(array('url' => 'http://www.cakephp.org', 'method' => 'get', 'encoding' => 'utf-8')); - $this->assertPattern('/^<script[^<>]+type="text\/javascript"[^<>]*>.+<\/script>$/s', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/^<script[^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*new PeriodicalExecuter\(function\(\) {.+}, 10\)\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/' . str_replace('/', '\\/', preg_quote('new Ajax.Request(\'http://www.cakephp.org\', {asynchronous:true, evalScripts:true, method:\'get\', encoding:\'utf-8\'})')) . '/', $result); - - $result = $this->Ajax->remoteTimer(array('url' => 'http://www.cakephp.org', 'postBody' => 'var1=value1')); - $this->assertPattern('/^<script[^<>]+type="text\/javascript"[^<>]*>.+<\/script>$/s', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/^<script[^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*new PeriodicalExecuter\(function\(\) {.+}, 10\)\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/' . str_replace('/', '\\/', preg_quote('new Ajax.Request(\'http://www.cakephp.org\', {asynchronous:true, evalScripts:true, postBody:\'var1=value1\'})')) . '/', $result); - } -/** - * testObserveField method - * - * @access public - * @return void - */ - function testObserveField() { - $result = $this->Ajax->observeField('field', array('url' => 'http://www.cakephp.org')); - $this->assertPattern('/^<script[^<>]+type="text\/javascript"[^<>]*>.+<\/script>$/s', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/^<script[^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*new Form.Element.EventObserver\(\'field\', function\(element, value\) {.+}\)\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/' . str_replace('/', '\\/', preg_quote('new Ajax.Request(\'http://www.cakephp.org\', {asynchronous:true, evalScripts:true, parameters:Form.Element.serialize(\'field\')})')) . '/', $result); - - $result = $this->Ajax->observeField('field', array('url' => 'http://www.cakephp.org', 'frequency' => 15)); - $this->assertPattern('/^<script[^<>]+type="text\/javascript"[^<>]*>.+<\/script>$/s', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/^<script[^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*new Form.Element.Observer\(\'field\', 15, function\(element, value\) {.+}\)\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/' . str_replace('/', '\\/', preg_quote('new Ajax.Request(\'http://www.cakephp.org\', {asynchronous:true, evalScripts:true, parameters:Form.Element.serialize(\'field\')})')) . '/', $result); - - $result = $this->Ajax->observeField('field', array('url' => 'http://www.cakephp.org', 'update' => 'divId')); - $this->assertPattern('/^<script[^<>]+type="text\/javascript"[^<>]*>.+<\/script>$/s', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/^<script[^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*new Form.Element.EventObserver\(\'field\', function\(element, value\) {.+}\)\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/' . str_replace('/', '\\/', preg_quote('new Ajax.Updater(\'divId\',\'http://www.cakephp.org\', {asynchronous:true, evalScripts:true, parameters:Form.Element.serialize(\'field\'), requestHeaders:[\'X-Update\', \'divId\']})')) . '/', $result); - - $result = $this->Ajax->observeField('field', array('url' => 'http://www.cakephp.org', 'update' => 'divId', 'with' => 'Form.Element.serialize(\'otherField\')')); - $this->assertPattern('/^<script[^<>]+type="text\/javascript"[^<>]*>.+<\/script>$/s', $result); - $this->assertNoPattern('/<script[^<>]+[^type]=[^<>]*>/', $result); - $this->assertPattern('/^<script[^<>]+>\s*' . str_replace('/', '\\/', preg_quote('//<![CDATA[')) . '\s*new Form.Element.EventObserver\(\'field\', function\(element, value\) {.+}\)\s*' . str_replace('/', '\\/', preg_quote('//]]>')) . '\s*<\/script>$/', $result); - $this->assertPattern('/' . str_replace('/', '\\/', preg_quote('new Ajax.Updater(\'divId\',\'http://www.cakephp.org\', {asynchronous:true, evalScripts:true, parameters:Form.Element.serialize(\'otherField\'), requestHeaders:[\'X-Update\', \'divId\']})')) . '/', $result); - } -/** - * testObserveForm method - * - * @access public - * @return void - */ - function testObserveForm() { - $result = $this->Ajax->observeForm('form', array('url' => 'http://www.cakephp.org')); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "new Form.EventObserver('form', function(element, value) {new Ajax.Request('http://www.cakephp.org', {asynchronous:true, evalScripts:true, parameters:Form.serialize('form')})})", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->observeForm('form', array('url' => 'http://www.cakephp.org', 'frequency' => 15)); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "new Form.Observer('form', 15, function(element, value) {new Ajax.Request('http://www.cakephp.org', {asynchronous:true, evalScripts:true, parameters:Form.serialize('form')})})", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->observeForm('form', array('url' => 'http://www.cakephp.org', 'update' => 'divId')); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "new Form.EventObserver('form', function(element, value) {new Ajax.Updater('divId','http://www.cakephp.org', {asynchronous:true, evalScripts:true, parameters:Form.serialize('form'), requestHeaders:['X-Update', 'divId']})}", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->observeForm('form', array('url' => 'http://www.cakephp.org', 'update' => 'divId', 'with' => "Form.serialize('otherForm')")); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "new Form.EventObserver('form', function(element, value) {new Ajax.Updater('divId','http://www.cakephp.org', {asynchronous:true, evalScripts:true, parameters:Form.serialize('otherForm'), requestHeaders:['X-Update', 'divId']})}", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - } -/** - * testSlider method - * - * @access public - * @return void - */ - function testSlider() { - $result = $this->Ajax->slider('sliderId', 'trackId'); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "var sliderId = new Control.Slider('sliderId', 'trackId', {});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->slider('sliderId', 'trackId', array('axis' => 'vertical')); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "var sliderId = new Control.Slider('sliderId', 'trackId', {axis:'vertical'});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->slider('sliderId', 'trackId', array('axis' => 'vertical', 'minimum' => 60, 'maximum' => 288, 'alignX' => -28, 'alignY' => -5, 'disabled' => true)); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "var sliderId = new Control.Slider('sliderId', 'trackId', {axis:'vertical', minimum:60, maximum:288, alignX:-28, alignY:-5, disabled:true});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->slider('sliderId', 'trackId', array('change' => "alert('changed');")); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "var sliderId = new Control.Slider('sliderId', 'trackId', {onChange:function(value) {alert('changed');}});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->slider('sliderId', 'trackId', array('change' => "alert('changed');", 'slide' => "alert('sliding');")); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "var sliderId = new Control.Slider('sliderId', 'trackId', {onChange:function(value) {alert('changed');}, onSlide:function(value) {alert('sliding');}});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->slider('sliderId', 'trackId', array('values' => array(10, 20, 30))); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "var sliderId = new Control.Slider('sliderId', 'trackId', {values:[10,20,30]});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->slider('sliderId', 'trackId', array('range' => '$R(10, 30)')); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "var sliderId = new Control.Slider('sliderId', 'trackId', {range:\$R(10, 30)});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - } -/** - * testRemoteFunction method - * - * @access public - * @return void - */ - function testRemoteFunction() { - $result = $this->Ajax->remoteFunction(array('complete' => 'testComplete();')); - $expected = "new Ajax.Request('/', {asynchronous:true, evalScripts:true, onComplete:function(request, json) {testComplete();}})"; - $this->assertEqual($result, $expected); - - $result = $this->Ajax->remoteFunction(array('update' => 'myDiv')); - $expected = "new Ajax.Updater('myDiv','/', {asynchronous:true, evalScripts:true, requestHeaders:['X-Update', 'myDiv']})"; - $this->assertEqual($result, $expected); - - $result = $this->Ajax->remoteFunction(array('update' => array('div1', 'div2'))); - $expected = "new Ajax.Updater(document.createElement('div'),'/', {asynchronous:true, evalScripts:true, requestHeaders:['X-Update', 'div1 div2']})"; - $this->assertEqual($result, $expected); - - $result = $this->Ajax->remoteFunction(array('update' => 'myDiv', 'confirm' => 'Are you sure?')); - $expected = "if (confirm('Are you sure?')) { new Ajax.Updater('myDiv','/', {asynchronous:true, evalScripts:true, requestHeaders:['X-Update', 'myDiv']}); } else { event.returnValue = false; return false; }"; - $this->assertEqual($result, $expected); - } -/** - * testDiv method - * - * @access public - * @return void - */ - function testDiv() { - ob_flush(); - $oldXUpdate = env('HTTP_X_UPDATE'); - - $result = $this->Ajax->div('myDiv'); - $this->assertTags($result, array('div' => array('id' => 'myDiv'))); - - $_SERVER['HTTP_X_UPDATE'] = null; - $result = $this->Ajax->divEnd('myDiv'); - $this->assertTags($result, '/div'); - - $_SERVER['HTTP_X_UPDATE'] = 'secondDiv'; - $result = $this->Ajax->div('myDiv'); - $this->assertTags($result, array('div' => array('id' => 'myDiv'))); - $result = $this->Ajax->divEnd('myDiv'); - $this->assertTags($result, '/div'); - - $_SERVER['HTTP_X_UPDATE'] = 'secondDiv myDiv anotherDiv'; - $result = $this->Ajax->div('myDiv'); - $this->assertTrue(empty($result)); - - $result = $this->Ajax->divEnd('myDiv'); - $this->assertTrue(empty($result)); - - $_SERVER['HTTP_X_UPDATE'] = $oldXUpdate; - } -/** - * testAfterRender method - * - * @access public - * @return void - */ - function testAfterRender() { - $oldXUpdate = env('HTTP_X_UPDATE'); - $this->Ajax->Javascript =& new TestJavascriptHelper(); - - $_SERVER['HTTP_X_UPDATE'] = 'secondDiv myDiv anotherDiv'; - $result = $this->Ajax->div('myDiv'); - $this->assertTrue(empty($result)); - - echo 'Contents of myDiv'; - - $result = $this->Ajax->divEnd('myDiv'); - $this->assertTrue(empty($result)); - - ob_start(); - $this->Ajax->afterRender(); - - $result = array_shift($this->Ajax->Javascript->codeBlocks); - $this->assertPattern('/^\s*' . str_replace('/', '\\/', preg_quote('var __ajaxUpdater__ = {myDiv:"Contents%20of%20myDiv"};')) . '\s*' . str_replace('/', '\\/', preg_quote('for (n in __ajaxUpdater__) { if (typeof __ajaxUpdater__[n] == "string" && $(n)) Element.update($(n), unescape(decodeURIComponent(__ajaxUpdater__[n]))); }')) . '\s*$/s', $result); - - $_SERVER['HTTP_X_UPDATE'] = $oldXUpdate; - } -/** - * testEditor method - * - * @access public - * @return void - */ - function testEditor() { - $result = $this->Ajax->editor('myDiv', '/'); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "new Ajax.InPlaceEditor('myDiv', '/', {ajaxOptions:{asynchronous:true, evalScripts:true}});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->editor('myDiv', '/', array('complete' => 'testComplete();')); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "new Ajax.InPlaceEditor('myDiv', '/', {ajaxOptions:{asynchronous:true, evalScripts:true, onComplete:function(request, json) {testComplete();}}});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->editor('myDiv', '/', array('callback' => 'callback();')); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "new Ajax.InPlaceEditor('myDiv', '/', {callback:function(form, value) {callback();}, ajaxOptions:{asynchronous:true, evalScripts:true}});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->editor('myDiv', '/', array('collection' => array(1 => 'first', 2 => 'second'))); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "new Ajax.InPlaceCollectionEditor('myDiv', '/', {collection:{\"1\":\"first\",\"2\":\"second\"}, ajaxOptions:{asynchronous:true, evalScripts:true}});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Ajax->editor('myDiv', '/', array('var' => 'myVar')); - $expected = array( - array('script' => array('type' => 'text/javascript')), - $this->cDataStart, - "var myVar = new Ajax.InPlaceEditor('myDiv', '/', {ajaxOptions:{asynchronous:true, evalScripts:true}});", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - } -} -?> \ No newline at end of file diff --git a/cake/tests/cases/libs/view/helpers/javascript.test.php b/cake/tests/cases/libs/view/helpers/javascript.test.php deleted file mode 100644 index 5768f28d0..000000000 --- a/cake/tests/cases/libs/view/helpers/javascript.test.php +++ /dev/null @@ -1,896 +0,0 @@ -<?php -/** - * JavascriptHelperTest file - * - * PHP versions 4 and 5 - * - * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite> - * Copyright 2006-2010, Cake Software Foundation, Inc. - * - * Licensed under The Open Group Test Suite License - * Redistributions of files must retain the above copyright notice. - * - * @copyright Copyright 2006-2010, Cake Software Foundation, Inc. - * @link https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests - * @package cake - * @subpackage cake.tests.cases.libs.view.helpers - * @since CakePHP(tm) v 1.2.0.4206 - * @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License - */ -App::import('Core', array('Controller', 'View', 'ClassRegistry', 'View')); -App::import('Helper', array('Javascript', 'Html', 'Form')); - -/** - * TheJsTestController class - * - * @package cake - * @subpackage cake.tests.cases.libs.view.helpers - */ -class TheJsTestController extends Controller { - -/** - * name property - * - * @var string 'TheTest' - * @access public - */ - public $name = 'TheTest'; - -/** - * uses property - * - * @var mixed null - * @access public - */ - public $uses = null; -} - -/** - * TheView class - * - * @package cake - * @subpackage cake.tests.cases.libs.view.helpers - */ -class TheView extends View { - -/** - * scripts method - * - * @access public - * @return void - */ - function scripts() { - return $this->__scripts; - } -} - -/** - * TestJavascriptObject class - * - * @package cake - * @subpackage cake.tests.cases.libs.view.helpers - */ -class TestJavascriptObject { - -/** - * property1 property - * - * @var string 'value1' - * @access public - */ - public $property1 = 'value1'; - -/** - * property2 property - * - * @var int 2 - * @access public - */ - public $property2 = 2; -} - -/** - * JavascriptTest class - * - * @package test_suite - * @subpackage test_suite.cases.libs - * @since CakePHP Test Suite v 1.0.0.0 - */ -class JavascriptTest extends CakeTestCase { - -/** - * Regexp for CDATA start block - * - * @var string - */ - public $cDataStart = 'preg:/^\/\/<!\[CDATA\[[\n\r]*/'; - -/** - * Regexp for CDATA end block - * - * @var string - */ - public $cDataEnd = 'preg:/[^\]]*\]\]\>[\s\r\n]*/'; - -/** - * setUp method - * - * @access public - * @return void - */ - function startTest() { - $this->Javascript =& new JavascriptHelper(); - $this->Javascript->Html =& new HtmlHelper(); - $this->Javascript->Form =& new FormHelper(); - $this->View =& new TheView(new TheJsTestController()); - ClassRegistry::addObject('view', $this->View); - } - -/** - * tearDown method - * - * @access public - * @return void - */ - function endTest() { - unset($this->Javascript->Html); - unset($this->Javascript->Form); - unset($this->Javascript); - ClassRegistry::removeObject('view'); - unset($this->View); - } - -/** - * testConstruct method - * - * @access public - * @return void - */ - function testConstruct() { - $Javascript =& new JavascriptHelper(array('safe')); - $this->assertTrue($Javascript->safe); - - $Javascript =& new JavascriptHelper(array('safe' => false)); - $this->assertFalse($Javascript->safe); - } - -/** - * testLink method - * - * @access public - * @return void - */ - function testLink() { - Configure::write('Asset.timestamp', false); - $result = $this->Javascript->link('script.js'); - $expected = '<script type="text/javascript" src="js/script.js"></script>'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->link('script'); - $expected = '<script type="text/javascript" src="js/script.js"></script>'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->link('scriptaculous.js?load=effects'); - $expected = '<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->link('some.json.libary'); - $expected = '<script type="text/javascript" src="js/some.json.libary.js"></script>'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->link('jquery-1.1.2'); - $expected = '<script type="text/javascript" src="js/jquery-1.1.2.js"></script>'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->link('jquery-1.1.2'); - $expected = '<script type="text/javascript" src="js/jquery-1.1.2.js"></script>'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->link('/plugin/js/jquery-1.1.2'); - $expected = '<script type="text/javascript" src="/plugin/js/jquery-1.1.2.js"></script>'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->link('/some_other_path/myfile.1.2.2.min.js'); - $expected = '<script type="text/javascript" src="/some_other_path/myfile.1.2.2.min.js"></script>'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->link('some_other_path/myfile.1.2.2.min.js'); - $expected = '<script type="text/javascript" src="js/some_other_path/myfile.1.2.2.min.js"></script>'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->link('some_other_path/myfile.1.2.2.min'); - $expected = '<script type="text/javascript" src="js/some_other_path/myfile.1.2.2.min.js"></script>'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->link('http://example.com/jquery.js'); - $expected = '<script type="text/javascript" src="http://example.com/jquery.js"></script>'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->link(array('prototype.js', 'scriptaculous.js')); - $this->assertPattern('/^\s*<script\s+type="text\/javascript"\s+src=".*js\/prototype\.js"[^<>]*><\/script>/', $result); - $this->assertPattern('/<\/script>\s*<script[^<>]+>/', $result); - $this->assertPattern('/<script\s+type="text\/javascript"\s+src=".*js\/scriptaculous\.js"[^<>]*><\/script>\s*$/', $result); - - $result = $this->Javascript->link('jquery-1.1.2', false); - $resultScripts = $this->View->scripts(); - reset($resultScripts); - $expected = '<script type="text/javascript" src="js/jquery-1.1.2.js"></script>'; - $this->assertNull($result); - $this->assertEqual(count($resultScripts), 1); - $this->assertEqual(current($resultScripts), $expected); - } - -/** - * testFilteringAndTimestamping method - * - * @access public - * @return void - */ - function testFilteringAndTimestamping() { - if ($this->skipIf(!is_writable(JS), 'JavaScript directory not writable, skipping JS asset timestamp tests. %s')) { - return; - } - - cache(str_replace(WWW_ROOT, '', JS) . '__cake_js_test.js', 'alert("test")', '+999 days', 'public'); - $timestamp = substr(strtotime('now'), 0, 8); - - Configure::write('Asset.timestamp', true); - $result = $this->Javascript->link('__cake_js_test'); - $this->assertPattern('/^<script[^<>]+src=".*js\/__cake_js_test\.js\?' . $timestamp . '[0-9]{2}"[^<>]*>/', $result); - - $debug = Configure::read('debug'); - Configure::write('debug', 0); - $result = $this->Javascript->link('__cake_js_test'); - $expected = '<script type="text/javascript" src="js/__cake_js_test.js"></script>'; - $this->assertEqual($result, $expected); - - Configure::write('Asset.timestamp', 'force'); - $result = $this->Javascript->link('__cake_js_test'); - $this->assertPattern('/^<script[^<>]+src=".*js\/__cake_js_test.js\?' . $timestamp . '[0-9]{2}"[^<>]*>/', $result); - - Configure::write('debug', $debug); - Configure::write('Asset.timestamp', false); - - $old = Configure::read('Asset.filter.js'); - - Configure::write('Asset.filter.js', 'js.php'); - $result = $this->Javascript->link('__cake_js_test'); - $this->assertPattern('/^<script[^<>]+src=".*cjs\/__cake_js_test\.js"[^<>]*>/', $result); - - Configure::write('Asset.filter.js', true); - $result = $this->Javascript->link('jquery-1.1.2'); - $expected = '<script type="text/javascript" src="cjs/jquery-1.1.2.js"></script>'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->link('folderjs/jquery-1.1.2'); - $expected = '<script type="text/javascript" src="cjs/folderjs/jquery-1.1.2.js"></script>'; - $this->assertEqual($result, $expected); - - if ($old === null) { - Configure::delete('Asset.filter.js'); - } - - $debug = Configure::read('debug'); - $webroot = $this->Javascript->webroot; - - Configure::write('debug', 0); - Configure::write('Asset.timestamp', 'force'); - - $this->Javascript->webroot = '/testing/'; - $result = $this->Javascript->link('__cake_js_test'); - $this->assertPattern('/^<script[^<>]+src="\/testing\/js\/__cake_js_test\.js\?\d+"[^<>]*>/', $result); - - $this->Javascript->webroot = '/testing/longer/'; - $result = $this->Javascript->link('__cake_js_test'); - $this->assertPattern('/^<script[^<>]+src="\/testing\/longer\/js\/__cake_js_test\.js\?\d+"[^<>]*>/', $result); - - $this->Javascript->webroot = $webroot; - Configure::write('debug', $debug); - - unlink(JS . '__cake_js_test.js'); - } - -/** - * testValue method - * - * @access public - * @return void - */ - function testValue() { - $result = $this->Javascript->value(array('title' => 'New thing', 'indexes' => array(5, 6, 7, 8))); - $expected = '{"title":"New thing","indexes":[5,6,7,8]}'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->value(null); - $this->assertEqual($result, 'null'); - - $result = $this->Javascript->value(true); - $this->assertEqual($result, 'true'); - - $result = $this->Javascript->value(false); - $this->assertEqual($result, 'false'); - - $result = $this->Javascript->value(5); - $this->assertEqual($result, '5'); - - $result = $this->Javascript->value(floatval(5.3)); - $this->assertPattern('/^5.3[0]+$/', $result); - - $result = $this->Javascript->value(''); - $expected = '""'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->value('CakePHP' . "\n" . 'Rapid Development Framework'); - $expected = '"CakePHP\\nRapid Development Framework"'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->value('CakePHP' . "\r\n" . 'Rapid Development Framework' . "\r" . 'For PHP'); - $expected = '"CakePHP\\nRapid Development Framework\\nFor PHP"'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->value('CakePHP: "Rapid Development Framework"'); - $expected = '"CakePHP: \\"Rapid Development Framework\\""'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->value('CakePHP: \'Rapid Development Framework\''); - $expected = '"CakePHP: \\\'Rapid Development Framework\\\'"'; - $this->assertEqual($result, $expected); - } - -/** - * testObjectGeneration method - * - * @access public - * @return void - */ - function testObjectGeneration() { - $object = array('title' => 'New thing', 'indexes' => array(5, 6, 7, 8)); - $result = $this->Javascript->object($object); - $expected = '{"title":"New thing","indexes":[5,6,7,8]}'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->object(array('default' => 0)); - $expected = '{"default":0}'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->object(array( - '2007' => array( - 'Spring' => array('1' => array('id' => 1, 'name' => 'Josh'), '2' => array('id' => 2, 'name' => 'Becky')), - 'Fall' => array('1' => array('id' => 1, 'name' => 'Josh'), '2' => array('id' => 2, 'name' => 'Becky')) - ), '2006' => array( - 'Spring' => array('1' => array('id' => 1, 'name' => 'Josh'), '2' => array('id' => 2, 'name' => 'Becky')), - 'Fall' => array('1' => array('id' => 1, 'name' => 'Josh'), '2' => array('id' => 2, 'name' => 'Becky') - )) - )); - $expected = '{"2007":{"Spring":{"1":{"id":1,"name":"Josh"},"2":{"id":2,"name":"Becky"}},"Fall":{"1":{"id":1,"name":"Josh"},"2":{"id":2,"name":"Becky"}}},"2006":{"Spring":{"1":{"id":1,"name":"Josh"},"2":{"id":2,"name":"Becky"}},"Fall":{"1":{"id":1,"name":"Josh"},"2":{"id":2,"name":"Becky"}}}}'; - $this->assertEqual($result, $expected); - - if (ini_get('precision') >= 12) { - $number = 3.141592653589; - if (!$this->Javascript->useNative) { - $number = sprintf("%.11f", $number); - } - - $result = $this->Javascript->object(array('Object' => array(true, false, 1, '02101', 0, -1, 3.141592653589, "1"))); - $expected = '{"Object":[true,false,1,"02101",0,-1,' . $number . ',"1"]}'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->object(array('Object' => array(true => true, false, -3.141592653589, -10))); - $expected = '{"Object":{"1":true,"2":false,"3":' . (-1 * $number) . ',"4":-10}}'; - $this->assertEqual($result, $expected); - } - - $result = $this->Javascript->object(new TestJavascriptObject()); - $expected = '{"property1":"value1","property2":2}'; - $this->assertEqual($result, $expected); - - $object = array('title' => 'New thing', 'indexes' => array(5, 6, 7, 8)); - $result = $this->Javascript->object($object, array('block' => true)); - $expected = array( - 'script' => array('type' => 'text/javascript'), - $this->cDataStart, - '{"title":"New thing","indexes":[5,6,7,8]}', - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $object = array('title' => 'New thing', 'indexes' => array(5, 6, 7, 8), 'object' => array('inner' => array('value' => 1))); - $result = $this->Javascript->object($object); - $expected = '{"title":"New thing","indexes":[5,6,7,8],"object":{"inner":{"value":1}}}'; - $this->assertEqual($result, $expected); - - foreach (array('true' => true, 'false' => false, 'null' => null) as $expected => $data) { - $result = $this->Javascript->object($data); - $this->assertEqual($result, $expected); - } - - $object = array('title' => 'New thing', 'indexes' => array(5, 6, 7, 8), 'object' => array('inner' => array('value' => 1))); - $result = $this->Javascript->object($object, array('prefix' => 'PREFIX', 'postfix' => 'POSTFIX')); - $this->assertPattern('/^PREFIX/', $result); - $this->assertPattern('/POSTFIX$/', $result); - $this->assertNoPattern('/.PREFIX./', $result); - $this->assertNoPattern('/.POSTFIX./', $result); - - if ($this->Javascript->useNative) { - $this->Javascript->useNative = false; - $this->testObjectGeneration(); - $this->Javascript->useNative = true; - } - } - -/** - * testObjectNonNative method - * - * @access public - * @return void - */ - function testObjectNonNative() { - $oldNative = $this->Javascript->useNative; - $this->Javascript->useNative = false; - - $object = array( - 'Object' => array( - 'key1' => 'val1', - 'key2' => 'val2', - 'key3' => 'val3' - ) - ); - - $expected = '{"Object":{"key1":val1,"key2":"val2","key3":val3}}'; - $result = $this->Javascript->object($object, array('quoteKeys' => false, 'stringKeys' => array('key1', 'key3'))); - $this->assertEqual($result, $expected); - - $this->Javascript->useNative = $oldNative; - } - -/** - * testScriptBlock method - * - * @access public - * @return void - */ - function testScriptBlock() { - $result = $this->Javascript->codeBlock('something'); - $expected = array( - 'script' => array('type' => 'text/javascript'), - $this->cDataStart, - 'something', - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Javascript->codeBlock('something', array('allowCache' => true, 'safe' => false)); - $expected = array( - 'script' => array('type' => 'text/javascript'), - 'something', - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Javascript->codeBlock('something', array('allowCache' => false, 'safe' => false)); - $expected = array( - 'script' => array('type' => 'text/javascript'), - 'something', - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Javascript->codeBlock('something', true); - $expected = array( - 'script' => array('type' => 'text/javascript'), - $this->cDataStart, - 'something', - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Javascript->codeBlock('something', false); - $expected = array( - 'script' => array('type' => 'text/javascript'), - $this->cDataStart, - 'something', - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Javascript->codeBlock('something', array('safe' => false)); - $expected = array( - 'script' => array('type' => 'text/javascript'), - 'something', - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Javascript->codeBlock('something', array('safe' => true)); - $expected = array( - 'script' => array('type' => 'text/javascript'), - $this->cDataStart, - 'something', - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Javascript->codeBlock(null, array('safe' => true, 'allowCache' => false)); - $this->assertNull($result); - echo 'this is some javascript'; - - $result = $this->Javascript->blockEnd(); - $expected = array( - 'script' => array('type' => 'text/javascript'), - $this->cDataStart, - 'this is some javascript', - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Javascript->codeBlock(); - $this->assertNull($result); - echo "alert('hey');"; - $result = $this->Javascript->blockEnd(); - - $expected = array( - 'script' => array('type' => 'text/javascript'), - $this->cDataStart, - "alert('hey');", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $this->Javascript->cacheEvents(false, true); - $this->assertFalse($this->Javascript->inBlock); - - $result = $this->Javascript->codeBlock(); - $this->assertIdentical($result, null); - $this->assertTrue($this->Javascript->inBlock); - echo 'alert("this is a buffered script");'; - - $result = $this->Javascript->blockEnd(); - $this->assertIdentical($result, null); - $this->assertFalse($this->Javascript->inBlock); - - $result = $this->Javascript->getCache(); - $this->assertEqual('alert("this is a buffered script");', $result); - } - -/** - * testOutOfLineScriptWriting method - * - * @access public - * @return void - */ - function testOutOfLineScriptWriting() { - echo $this->Javascript->codeBlock('$(document).ready(function() { });', array('inline' => false)); - - $this->Javascript->codeBlock(null, array('inline' => false)); - echo '$(function(){ });'; - $this->Javascript->blockEnd(); - $script = $this->View->scripts(); - - $this->assertEqual(count($script), 2); - $this->assertPattern('/' . preg_quote('$(document).ready(function() { });', '/') . '/', $script[0]); - $this->assertPattern('/' . preg_quote('$(function(){ });', '/') . '/', $script[1]); - } - -/** - * testEvent method - * - * @access public - * @return void - */ - function testEvent() { - $result = $this->Javascript->event('myId', 'click', 'something();'); - $expected = array( - 'script' => array('type' => 'text/javascript'), - $this->cDataStart, - "Event.observe($('myId'), 'click', function(event) { something(); }, false);", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Javascript->event('myId', 'click', 'something();', array('safe' => false)); - $expected = array( - 'script' => array('type' => 'text/javascript'), - "Event.observe($('myId'), 'click', function(event) { something(); }, false);", - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Javascript->event('myId', 'click'); - $expected = array( - 'script' => array('type' => 'text/javascript'), - $this->cDataStart, - "Event.observe($('myId'), 'click', function(event) { }, false);", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Javascript->event('myId', 'click', 'something();', false); - $expected = array( - 'script' => array('type' => 'text/javascript'), - $this->cDataStart, - "Event.observe($('myId'), 'click', function(event) { something(); }, false);", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Javascript->event('myId', 'click', 'something();', array('useCapture' => true)); - $expected = array( - 'script' => array('type' => 'text/javascript'), - $this->cDataStart, - "Event.observe($('myId'), 'click', function(event) { something(); }, true);", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Javascript->event('document', 'load'); - $expected = array( - 'script' => array('type' => 'text/javascript'), - $this->cDataStart, - "Event.observe(document, 'load', function(event) { }, false);", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Javascript->event('$(\'myId\')', 'click', 'something();', array('safe' => false)); - $expected = array( - 'script' => array('type' => 'text/javascript'), - "Event.observe($('myId'), 'click', function(event) { something(); }, false);", - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Javascript->event('\'document\'', 'load', 'something();', array('safe' => false)); - $expected = array( - 'script' => array('type' => 'text/javascript'), - "Event.observe('document', 'load', function(event) { something(); }, false);", - '/script' - ); - $this->assertTags($result, $expected); - - $this->Javascript->cacheEvents(); - $result = $this->Javascript->event('myId', 'click', 'something();'); - $this->assertNull($result); - - $result = $this->Javascript->getCache(); - $this->assertPattern('/^' . str_replace('/', '\\/', preg_quote('Event.observe($(\'myId\'), \'click\', function(event) { something(); }, false);')) . '$/s', $result); - - $result = $this->Javascript->event('#myId', 'alert(event);'); - $this->assertNull($result); - - $result = $this->Javascript->getCache(); - $this->assertPattern('/^\s*var Rules = {\s*\'#myId\': function\(element, event\)\s*{\s*alert\(event\);\s*}\s*}\s*EventSelectors\.start\(Rules\);\s*$/s', $result); - } - -/** - * testWriteEvents method - * - * @access public - * @return void - */ - function testWriteEvents() { - $this->Javascript->cacheEvents(); - $result = $this->Javascript->event('myId', 'click', 'something();'); - $this->assertNull($result); - - $result = $this->Javascript->writeEvents(); - $expected = array( - 'script' => array('type' => 'text/javascript'), - $this->cDataStart, - "Event.observe($('myId'), 'click', function(event) { something(); }, false);", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Javascript->getCache(); - $this->assertTrue(empty($result)); - - $this->Javascript->cacheEvents(); - $result = $this->Javascript->event('myId', 'click', 'something();'); - $this->assertNull($result); - - $result = $this->Javascript->writeEvents(false); - $resultScripts = $this->View->scripts(); - reset($resultScripts); - $this->assertNull($result); - $this->assertEqual(count($resultScripts), 1); - $result = current($resultScripts); - - $expected = array( - 'script' => array('type' => 'text/javascript'), - $this->cDataStart, - "Event.observe($('myId'), 'click', function(event) { something(); }, false);", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Javascript->getCache(); - $this->assertTrue(empty($result)); - } - -/** - * testEscapeScript method - * - * @access public - * @return void - */ - function testEscapeScript() { - $result = $this->Javascript->escapeScript(''); - $expected = ''; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->escapeScript('CakePHP' . "\n" . 'Rapid Development Framework'); - $expected = 'CakePHP\\nRapid Development Framework'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->escapeScript('CakePHP' . "\r\n" . 'Rapid Development Framework' . "\r" . 'For PHP'); - $expected = 'CakePHP\\nRapid Development Framework\\nFor PHP'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->escapeScript('CakePHP: "Rapid Development Framework"'); - $expected = 'CakePHP: \\"Rapid Development Framework\\"'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->escapeScript('CakePHP: \'Rapid Development Framework\''); - $expected = 'CakePHP: \\\'Rapid Development Framework\\\''; - $this->assertEqual($result, $expected); - } - -/** - * testEscapeString method - * - * @access public - * @return void - */ - function testEscapeString() { - $result = $this->Javascript->escapeString(''); - $expected = ''; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->escapeString('CakePHP' . "\n" . 'Rapid Development Framework'); - $expected = 'CakePHP\\nRapid Development Framework'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->escapeString('CakePHP' . "\r\n" . 'Rapid Development Framework' . "\r" . 'For PHP'); - $expected = 'CakePHP\\nRapid Development Framework\\nFor PHP'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->escapeString('CakePHP: "Rapid Development Framework"'); - $expected = 'CakePHP: \\"Rapid Development Framework\\"'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->escapeString('CakePHP: \'Rapid Development Framework\''); - $expected = "CakePHP: \\'Rapid Development Framework\\'"; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->escapeString('my \\"string\\"'); - $expected = 'my \\\\\\"string\\\\\\"'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->escapeString('my string\nanother line'); - $expected = 'my string\\\nanother line'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->escapeString('String with \n string that looks like newline'); - $expected = 'String with \\\n string that looks like newline'; - $this->assertEqual($result, $expected); - - $result = $this->Javascript->escapeString('String with \n string that looks like newline'); - $expected = 'String with \\\n string that looks like newline'; - $this->assertEqual($result, $expected); - } - -/** - * test string escaping and compare to json_encode() - * - * @return void - */ - function testStringJsonEncodeCompliance() { - if (!function_exists('json_encode')) { - return; - } - $this->Javascript->useNative = false; - $data = array(); - $data['mystring'] = "simple string"; - $this->assertEqual(json_encode($data), $this->Javascript->object($data)); - - $data['mystring'] = "strïng with spécial chârs"; - $this->assertEqual(json_encode($data), $this->Javascript->object($data)); - - $data['mystring'] = "a two lines\nstring"; - $this->assertEqual(json_encode($data), $this->Javascript->object($data)); - - $data['mystring'] = "a \t tabbed \t string"; - $this->assertEqual(json_encode($data), $this->Javascript->object($data)); - - $data['mystring'] = "a \"double-quoted\" string"; - $this->assertEqual(json_encode($data), $this->Javascript->object($data)); - - $data['mystring'] = 'a \\"double-quoted\\" string'; - $this->assertEqual(json_encode($data), $this->Javascript->object($data)); - } - -/** - * test that text encoded with Javascript::object decodes properly - * - * @return void - */ - function testObjectDecodeCompatibility() { - if (!function_exists('json_decode')) { - return; - } - $this->Javascript->useNative = false; - - $data = array("simple string"); - $result = $this->Javascript->object($data); - $this->assertEqual(json_decode($result), $data); - - $data = array('my \"string\"'); - $result = $this->Javascript->object($data); - $this->assertEqual(json_decode($result), $data); - - $data = array('my \\"string\\"'); - $result = $this->Javascript->object($data); - $this->assertEqual(json_decode($result), $data); - } - -/** - * testAfterRender method - * - * @access public - * @return void - */ - function testAfterRender() { - $this->Javascript->cacheEvents(); - $result = $this->Javascript->event('myId', 'click', 'something();'); - $this->assertNull($result); - - ob_start(); - $this->Javascript->afterRender(); - $result = ob_get_clean(); - - $expected = array( - 'script' => array('type' => 'text/javascript'), - $this->cDataStart, - "Event.observe($('myId'), 'click', function(event) { something(); }, false);", - $this->cDataEnd, - '/script' - ); - $this->assertTags($result, $expected); - - $result = $this->Javascript->getCache(); - $this->assertTrue(empty($result)); - - $old = $this->Javascript->enabled; - $this->Javascript->enabled = false; - - $this->Javascript->cacheEvents(); - $result = $this->Javascript->event('myId', 'click', 'something();'); - $this->assertNull($result); - - ob_start(); - $this->Javascript->afterRender(); - $result = ob_get_clean(); - - $this->assertTrue(empty($result)); - - $result = $this->Javascript->getCache(); - $this->assertPattern('/^' . str_replace('/', '\\/', preg_quote('Event.observe($(\'myId\'), \'click\', function(event) { something(); }, false);')) . '$/s', $result); - - $this->Javascript->enabled = $old; - } -} -?> \ No newline at end of file From cd42047dd595fbf8daa2e7cd77158d5b24f805e0 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 14 Apr 2010 00:23:15 -0400 Subject: [PATCH 1948/2083] Making CakeLog a static class, removing PHP4 workarounds and no longer needed singleton. Removes CakeLog::getInstance() --- cake/libs/cake_log.php | 50 +++++++++++++----------------------------- 1 file changed, 15 insertions(+), 35 deletions(-) diff --git a/cake/libs/cake_log.php b/cake/libs/cake_log.php index b748212e6..6d0f47ec3 100644 --- a/cake/libs/cake_log.php +++ b/cake/libs/cake_log.php @@ -54,21 +54,7 @@ class CakeLog { * @var array * @access protected */ - protected $_streams = array(); - -/** - * Get an instance - * - * @return void - * @static - */ - function &getInstance() { - static $instance = array(); - if (!isset($instance[0])) { - $instance[0] =& new CakeLog(); - } - return $instance[0]; - } + protected static $_streams = array(); /** * Configure and add a new logging stream to CakeLog @@ -101,13 +87,12 @@ function config($key, $config) { trigger_error(__('Missing logger classname', true), E_USER_WARNING); return false; } - $self =& CakeLog::getInstance(); - $className = $self->_getLogger($config['engine']); + $className = self::_getLogger($config['engine']); if (!$className) { return false; } unset($config['engine']); - $self->_streams[$key] = new $className($config); + self::$_streams[$key] = new $className($config); return true; } @@ -118,7 +103,7 @@ function config($key, $config) { * @param string $loggerName the plugin.className of the logger class you want to build. * @return mixed boolean false on any failures, string of classname to use if search was successful. */ - protected function _getLogger($loggerName) { + protected static function _getLogger($loggerName) { list($plugin, $loggerName) = pluginSplit($loggerName); if ($plugin) { @@ -149,9 +134,8 @@ protected function _getLogger($loggerName) { * @access public * @static */ - function configured() { - $self =& CakeLog::getInstance(); - return array_keys($self->_streams); + public static function configured() { + return array_keys(self::$_streams); } /** @@ -163,9 +147,8 @@ function configured() { * @access public * @static */ - function drop($streamName) { - $self =& CakeLog::getInstance(); - unset($self->_streams[$streamName]); + public static function drop($streamName) { + unset(self::$_streams[$streamName]); } /** @@ -173,11 +156,11 @@ function drop($streamName) { * * @return void */ - protected function _autoConfig() { + protected static function _autoConfig() { if (!class_exists('FileLog')) { App::import('Core', 'log/FileLog'); } - $this->_streams['default'] =& new FileLog(array('path' => LOGS)); + self::$_streams['default'] = new FileLog(array('path' => LOGS)); } /** @@ -206,7 +189,7 @@ protected function _autoConfig() { * @access public * @static */ - function write($type, $message) { + public static function write($type, $message) { if (!defined('LOG_ERROR')) { define('LOG_ERROR', 2); } @@ -225,13 +208,10 @@ function write($type, $message) { if (is_int($type) && isset($levels[$type])) { $type = $levels[$type]; } - $self =& CakeLog::getInstance(); - if (empty($self->_streams)) { - $self->_autoConfig(); + if (empty(self::$_streams)) { + self::_autoConfig(); } - $keys = array_keys($self->_streams); - foreach ($keys as $key) { - $logger =& $self->_streams[$key]; + foreach (self::$_streams as $key => $logger) { $logger->write($type, $message); } return true; @@ -250,7 +230,7 @@ function write($type, $message) { * @param array $context Context * @return void */ - function handleError($code, $description, $file = null, $line = null, $context = null) { + public static function handleError($code, $description, $file = null, $line = null, $context = null) { if ($code === 2048 || $code === 8192) { return; } From f13e70b9367c3104eb3508bb3ae5a27db0662564 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 14 Apr 2010 00:25:14 -0400 Subject: [PATCH 1949/2083] Changing object constructor. Adding visibility keyword. --- cake/libs/log/file_log.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/libs/log/file_log.php b/cake/libs/log/file_log.php index 53cb486bc..133000e18 100644 --- a/cake/libs/log/file_log.php +++ b/cake/libs/log/file_log.php @@ -46,7 +46,7 @@ class FileLog { * @param array $options Options for the FileLog, see above. * @return void */ - function FileLog($options = array()) { + function __construct($options = array()) { $options += array('path' => LOGS); $this->_path = $options['path']; } @@ -58,7 +58,7 @@ function FileLog($options = array()) { * @param string $message The message you want to log. * @return boolean success of write. */ - function write($type, $message) { + public function write($type, $message) { $debugTypes = array('notice', 'info', 'debug'); if ($type == 'error' || $type == 'warning') { From dbe4747addd38f4a0cf1b577b0868f06bbade804 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 14 Apr 2010 00:29:44 -0400 Subject: [PATCH 1950/2083] Making static methods static. --- cake/libs/sanitize.php | 20 ++++++++++---------- cake/libs/security.php | 10 +++++----- cake/libs/string.php | 8 ++++---- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/cake/libs/sanitize.php b/cake/libs/sanitize.php index a53711a67..f7fecaad1 100644 --- a/cake/libs/sanitize.php +++ b/cake/libs/sanitize.php @@ -40,7 +40,7 @@ class Sanitize { * @access public * @static */ - function paranoid($string, $allowed = array()) { + public static function paranoid($string, $allowed = array()) { $allow = null; if (!empty($allowed)) { foreach ($allowed as $value) { @@ -68,7 +68,7 @@ function paranoid($string, $allowed = array()) { * @access public * @static */ - function escape($string, $connection = 'default') { + public static function escape($string, $connection = 'default') { $db =& ConnectionManager::getDataSource($connection); if (is_numeric($string) || $string === null || is_bool($string)) { return $string; @@ -96,7 +96,7 @@ function escape($string, $connection = 'default') { * @access public * @static */ - function html($string, $options = array()) { + public static function html($string, $options = array()) { static $defaultCharset = false; if ($defaultCharset === false) { $defaultCharset = Configure::read('App.encoding'); @@ -127,7 +127,7 @@ function html($string, $options = array()) { * @access public * @static */ - function stripWhitespace($str) { + public static function stripWhitespace($str) { $r = preg_replace('/[\n\r\t]+/', '', $str); return preg_replace('/\s{2,}/', ' ', $r); } @@ -140,7 +140,7 @@ function stripWhitespace($str) { * @access public * @static */ - function stripImages($str) { + public static function stripImages($str) { $str = preg_replace('/(<a[^>]*>)(<img[^>]+alt=")([^"]*)("[^>]*>)(<\/a>)/i', '$1$3$5<br />', $str); $str = preg_replace('/(<img[^>]+alt=")([^"]*)("[^>]*>)/i', '$2<br />', $str); $str = preg_replace('/<img[^>]*>/i', '', $str); @@ -155,7 +155,7 @@ function stripImages($str) { * @access public * @static */ - function stripScripts($str) { + public static function stripScripts($str) { return preg_replace('/(<link[^>]+rel="[^"]*stylesheet"[^>]*>|<img[^>]*>|style="[^"]*")|<script[^>]*>.*?<\/script>|<style[^>]*>.*?<\/style>|<!--.*?-->/i', '', $str); } @@ -165,7 +165,7 @@ function stripScripts($str) { * @param string $str String to sanitize * @return string sanitized string */ - public function stripAll($str) { + public static function stripAll($str) { $str = Sanitize::stripWhitespace($str); $str = Sanitize::stripImages($str); $str = Sanitize::stripScripts($str); @@ -186,7 +186,7 @@ public function stripAll($str) { * @access public * @static */ - function stripTags() { + public static function stripTags() { $params = params(func_get_args()); $str = $params[0]; @@ -217,7 +217,7 @@ function stripTags() { * @access public * @static */ - function clean($data, $options = array()) { + public static function clean($data, $options = array()) { if (empty($data)) { return $data; } @@ -281,7 +281,7 @@ function clean($data, $options = array()) { * @access public * @static */ - function formatColumns(&$model) { + public static function formatColumns(&$model) { foreach ($model->data as $name => $values) { if ($name == $model->alias) { $curModel =& $model; diff --git a/cake/libs/security.php b/cake/libs/security.php index b6668c361..8e9b905c2 100644 --- a/cake/libs/security.php +++ b/cake/libs/security.php @@ -56,7 +56,7 @@ function &getInstance() { * @access public * @static */ - function inactiveMins() { + public static function inactiveMins() { switch (Configure::read('Security.level')) { case 'high': return 10; @@ -78,7 +78,7 @@ function inactiveMins() { * @access public * @static */ - function generateAuthKey() { + public static function generateAuthKey() { if (!class_exists('String')) { App::import('Core', 'String'); } @@ -110,7 +110,7 @@ function validateAuthKey($authKey) { * @access public * @static */ - function hash($string, $type = null, $salt = false) { + public static function hash($string, $type = null, $salt = false) { $_this =& Security::getInstance(); if ($salt) { @@ -154,7 +154,7 @@ function hash($string, $type = null, $salt = false) { * @static * @see Security::hash() */ - function setHash($hash) { + public static function setHash($hash) { $_this =& Security::getInstance(); $_this->hashType = $hash; } @@ -168,7 +168,7 @@ function setHash($hash) { * @access public * @static */ - function cipher($text, $key) { + public static function cipher($text, $key) { if (empty($key)) { trigger_error(__('You cannot use an empty key for Security::cipher()', true), E_USER_WARNING); return ''; diff --git a/cake/libs/string.php b/cake/libs/string.php index 119267e78..37d0d7eeb 100644 --- a/cake/libs/string.php +++ b/cake/libs/string.php @@ -34,7 +34,7 @@ class String { * @return RFC 4122 UUID * @static */ - function uuid() { + public static function uuid() { $node = env('SERVER_ADDR'); $pid = null; @@ -114,7 +114,7 @@ function uuid() { * @access public * @static */ - function tokenize($data, $separator = ',', $leftBound = '(', $rightBound = ')') { + public static function tokenize($data, $separator = ',', $leftBound = '(', $rightBound = ')') { if (empty($data) || is_array($data)) { return $data; } @@ -205,7 +205,7 @@ function tokenize($data, $separator = ',', $leftBound = '(', $rightBound = ')') * @access public * @static */ - function insert($str, $data, $options = array()) { + public static function insert($str, $data, $options = array()) { $defaults = array( 'before' => ':', 'after' => null, 'escape' => '\\', 'format' => null, 'clean' => false ); @@ -272,7 +272,7 @@ function insert($str, $data, $options = array()) { * @static * @see String::insert() */ - function cleanInsert($str, $options) { + public static function cleanInsert($str, $options) { $clean = $options['clean']; if (!$clean) { return $str; From 99e5f4a49f6300d29ea8231da8a79612f4b703ba Mon Sep 17 00:00:00 2001 From: ADmad <admad.coder@gmail.com> Date: Thu, 15 Apr 2010 01:56:38 +0530 Subject: [PATCH 1951/2083] Removing ampersand (&) from default transliteration map --- cake/libs/inflector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index a5f341a6c..3c99bf9fd 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -192,7 +192,7 @@ class Inflector { '/Ã|ÄŽ|Ä/' => 'D', '/ð|Ä|Ä‘/' => 'd', '/È|É|Ê|Ë|Ä’|Ä”|Ä–|Ę|Äš/' => 'E', - '/è|é|ê|ë|Ä“|Ä•|Ä—|Ä™|Ä›|&/' => 'e', + '/è|é|ê|ë|Ä“|Ä•|Ä—|Ä™|Ä›/' => 'e', '/Äœ|Äž|Ä |Ä¢/' => 'G', '/Ä|ÄŸ|Ä¡|Ä£/' => 'g', '/Ĥ|Ħ/' => 'H', From 8ef2a82a898dd0572a5aeb7d3f22d9be391274fa Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 14 Apr 2010 21:00:00 -0400 Subject: [PATCH 1952/2083] minor optimization to save one call to Helper::model() when creating forms. --- cake/libs/view/helpers/form.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 856d2efa2..1b2fca22b 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -216,8 +216,9 @@ function create($model = null, $options = array()) { $object =& $this->_introspectModel($model); $this->setEntity($model . '.', true); - if (isset($this->fieldset[$this->model()]['key'])) { - $data = $this->fieldset[$this->model()]; + $modelEntity = $this->model() + if (isset($this->fieldset[$modelEntity]['key'])) { + $data = $this->fieldset[$modelEntity]; $recordExists = ( isset($this->data[$model]) && !empty($this->data[$model][$data['key']]) From 4ef899fa54315357d58b905b75fc216fec276666 Mon Sep 17 00:00:00 2001 From: Mark Story <mark@mark-story.com> Date: Wed, 14 Apr 2010 22:41:12 -0400 Subject: [PATCH 1953/2083] Updating test suite to say 2.0! --- cake/tests/lib/templates/header.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/tests/lib/templates/header.php b/cake/tests/lib/templates/header.php index 5715d511f..38ad1a624 100644 --- a/cake/tests/lib/templates/header.php +++ b/cake/tests/lib/templates/header.php @@ -22,7 +22,7 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <title>CakePHP Test Suite 1.3 + CakePHP Test Suite 2.0