Permalink
Browse files

Merge branch '1.3-misc' into 1.3-merger

Conflicts:
	cake/tests/cases/libs/configure.test.php
  • Loading branch information...
2 parents e2c7cda + 0783176 commit acd2c156904a45c834eae18d24cdcff28431d0f1 @markstory markstory committed Nov 16, 2009
Showing with 1,694 additions and 933 deletions.
  1. +5 −13 app/config/core.php
  2. +22 −0 cake/basics.php
  3. +2 −7 cake/console/cake.php
  4. +3 −3 cake/console/libs/acl.php
  5. +1 −1 cake/console/libs/bake.php
  6. +6 −5 cake/console/libs/schema.php
  7. +2 −6 cake/console/libs/shell.php
  8. +6 −6 cake/console/libs/tasks/controller.php
  9. +2 −2 cake/console/libs/tasks/db_config.php
  10. +9 −9 cake/console/libs/tasks/fixture.php
  11. +19 −19 cake/console/libs/tasks/model.php
  12. +1 −1 cake/console/libs/tasks/plugin.php
  13. +1 −1 cake/console/libs/tasks/project.php
  14. +7 −7 cake/console/libs/tasks/template.php
  15. +20 −20 cake/console/libs/tasks/test.php
  16. +5 −5 cake/console/libs/tasks/view.php
  17. +64 −24 cake/libs/cache.php
  18. +14 −40 cake/libs/cake_log.php
  19. +1 −1 cake/libs/cake_session.php
  20. +4 −4 cake/libs/class_registry.php
  21. +32 −17 cake/libs/configure.php
  22. +3 −11 cake/libs/controller/component.php
  23. +1 −3 cake/libs/controller/components/acl.php
  24. +1 −1 cake/libs/controller/components/cookie.php
  25. +1 −3 cake/libs/controller/components/email.php
  26. +4 −11 cake/libs/controller/controller.php
  27. +5 −5 cake/libs/inflector.php
  28. +3 −3 cake/libs/log/file_log.php
  29. +2 −2 cake/libs/magic_db.php
  30. +3 −3 cake/libs/model/cake_schema.php
  31. +1 −1 cake/libs/model/datasources/datasource.php
  32. +1 −1 cake/libs/model/datasources/dbo/dbo_adodb.php
  33. +1 −1 cake/libs/model/datasources/dbo/dbo_db2.php
  34. +2 −2 cake/libs/model/datasources/dbo/dbo_firebird.php
  35. +1 −1 cake/libs/model/datasources/dbo/dbo_mssql.php
  36. +2 −2 cake/libs/model/datasources/dbo/dbo_mysql.php
  37. +1 −1 cake/libs/model/datasources/dbo/dbo_mysqli.php
  38. +1 −1 cake/libs/model/datasources/dbo/dbo_odbc.php
  39. +1 −1 cake/libs/model/datasources/dbo/dbo_postgres.php
  40. +1 −1 cake/libs/model/datasources/dbo/dbo_sqlite.php
  41. +1 −1 cake/libs/model/datasources/dbo/dbo_sybase.php
  42. +3 −3 cake/libs/model/datasources/dbo_source.php
  43. +6 −16 cake/libs/model/model.php
  44. +1 −4 cake/libs/model/model_behavior.php
  45. +3 −2 cake/libs/router.php
  46. +0 −2 cake/libs/security.php
  47. +52 −15 cake/libs/validation.php
  48. +4 −3 cake/libs/view/helper.php
  49. +4 −3 cake/libs/view/helpers/form.php
  50. +6 −6 cake/libs/view/helpers/html.php
  51. +1 −1 cake/libs/view/helpers/javascript.php
  52. +15 −15 cake/libs/view/helpers/jquery_engine.php
  53. +52 −53 cake/libs/view/helpers/js.php
  54. +13 −13 cake/libs/view/helpers/mootools_engine.php
  55. +3 −3 cake/libs/view/helpers/number.php
  56. +2 −2 cake/libs/view/helpers/paginator.php
  57. +14 −14 cake/libs/view/helpers/prototype_engine.php
  58. +1 −1 cake/libs/view/helpers/rss.php
  59. +3 −7 cake/libs/view/view.php
  60. +55 −26 cake/tests/cases/basics.test.php
  61. +19 −19 cake/tests/cases/console/cake.test.php
  62. +33 −14 cake/tests/cases/console/libs/acl.test.php
  63. +1 −1 cake/tests/cases/console/libs/api.test.php
  64. +10 −5 cake/tests/cases/console/libs/bake.test.php
  65. +34 −13 cake/tests/cases/console/libs/schema.test.php
  66. +5 −5 cake/tests/cases/console/libs/shell.test.php
  67. +34 −17 cake/tests/cases/console/libs/tasks/controller.test.php
  68. +6 −3 cake/tests/cases/console/libs/tasks/db_config.test.php
  69. +24 −12 cake/tests/cases/console/libs/tasks/fixture.test.php
  70. +51 −29 cake/tests/cases/console/libs/tasks/model.test.php
  71. +12 −6 cake/tests/cases/console/libs/tasks/plugin.test.php
  72. +16 −8 cake/tests/cases/console/libs/tasks/project.test.php
  73. +10 −5 cake/tests/cases/console/libs/tasks/template.test.php
  74. +173 −25 cake/tests/cases/console/libs/tasks/test.test.php
  75. +164 −22 cake/tests/cases/console/libs/tasks/view.test.php
  76. +63 −60 cake/tests/cases/dispatcher.test.php
  77. +68 −0 cake/tests/cases/libs/cache.test.php
  78. +30 −12 cake/tests/cases/libs/cake_log.test.php
  79. +2 −2 cake/tests/cases/libs/cake_test_case.test.php
  80. +1 −1 cake/tests/cases/libs/cake_test_fixture.test.php
  81. +2 −2 cake/tests/cases/libs/code_coverage_manager.test.php
  82. +47 −3 cake/tests/cases/libs/configure.test.php
  83. +1 −1 cake/tests/cases/libs/controller/component.test.php
  84. +6 −6 cake/tests/cases/libs/controller/components/auth.test.php
  85. +5 −5 cake/tests/cases/libs/controller/components/request_handler.test.php
  86. +2 −2 cake/tests/cases/libs/controller/components/security.test.php
  87. +4 −4 cake/tests/cases/libs/controller/controller.test.php
  88. +36 −33 cake/tests/cases/libs/controller/controller_merge_vars.test.php
  89. +11 −11 cake/tests/cases/libs/controller/scaffold.test.php
  90. +2 −2 cake/tests/cases/libs/error.test.php
  91. +1 −1 cake/tests/cases/libs/folder.test.php
  92. +1 −1 cake/tests/cases/libs/log/file_log.test.php
  93. +1 −1 cake/tests/cases/libs/magic_db.test.php
  94. +4 −4 cake/tests/cases/libs/model/cake_schema.test.php
  95. +1 −1 cake/tests/cases/libs/model/datasources/dbo/dbo_adodb.test.php
  96. +5 −5 cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php
  97. +1 −1 cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php
  98. +2 −2 cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php
  99. +3 −3 cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php
  100. +5 −5 cake/tests/cases/libs/model/datasources/dbo_source.test.php
  101. +2 −2 cake/tests/cases/libs/model/model_behavior.test.php
  102. +1 −1 cake/tests/cases/libs/model/model_delete.test.php
  103. +4 −4 cake/tests/cases/libs/model/model_integration.test.php
  104. +2 −2 cake/tests/cases/libs/model/model_read.test.php
  105. +1 −1 cake/tests/cases/libs/model/model_validation.test.php
  106. +5 −5 cake/tests/cases/libs/model/model_write.test.php
  107. +5 −5 cake/tests/cases/libs/model/models.php
  108. +5 −5 cake/tests/cases/libs/object.test.php
  109. +5 −5 cake/tests/cases/libs/router.test.php
  110. +1 −1 cake/tests/cases/libs/string.test.php
  111. +64 −1 cake/tests/cases/libs/validation.test.php
  112. +3 −3 cake/tests/cases/libs/view/helper.test.php
  113. +3 −3 cake/tests/cases/libs/view/helpers/cache.test.php
  114. +12 −12 cake/tests/cases/libs/view/helpers/form.test.php
  115. +6 −6 cake/tests/cases/libs/view/helpers/html.test.php
  116. +2 −2 cake/tests/cases/libs/view/helpers/javascript.test.php
  117. +13 −13 cake/tests/cases/libs/view/helpers/jquery_engine.test.php
  118. +24 −24 cake/tests/cases/libs/view/helpers/js.test.php
  119. +13 −13 cake/tests/cases/libs/view/helpers/mootools_engine.test.php
  120. +2 −2 cake/tests/cases/libs/view/helpers/paginator.test.php
  121. +13 −13 cake/tests/cases/libs/view/helpers/prototype_engine.test.php
  122. +1 −1 cake/tests/cases/libs/view/helpers/session.test.php
  123. +4 −4 cake/tests/cases/libs/view/view.test.php
  124. +3 −3 cake/tests/cases/libs/xml.test.php
  125. +6 −6 cake/tests/groups/console.group.php
  126. +3 −3 cake/tests/lib/cake_reporter.php
  127. +1 −2 cake/tests/lib/cake_test_case.php
  128. +1 −1 cake/tests/lib/cake_test_fixture.php
  129. +3 −3 cake/tests/lib/cake_text_reporter.php
  130. +22 −0 cake/tests/test_app/libs/cache/test_app_cache.php
  131. +23 −0 cake/tests/test_app/plugins/test_plugin/config/load.php
  132. +23 −0 cake/tests/test_app/plugins/test_plugin/config/more.load.php
  133. +22 −0 cake/tests/test_app/plugins/test_plugin/libs/cache/test_plugin_cache.php
View
@@ -70,21 +70,11 @@
//Configure::write('App.baseUrl', env('SCRIPT_NAME'));
/**
- * Uncomment the define below to use CakePHP admin routes.
- *
- * The value of the define determines the name of the route
- * and its associated controller actions:
- *
- * 'admin' -> admin_index() and /admin/controller/index
- * 'superuser' -> superuser_index() and /superuser/controller/index
- *
- * [Note Routing.admin is deprecated in 1.3. Use Routing.prefixes instead]
- */
- //Configure::write('Routing.admin', 'admin');
-
-/**
* Uncomment the define below to use CakePHP prefix routes.
*
+ * 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
* admin or other prefixed routes.
*
@@ -93,6 +83,8 @@
* Enables:
* `admin_index()` and `/admin/controller/index`
* `manager_index()` and `/manager/controller/index`
+ *
+ * [Note Routing.admin is deprecated in 1.3. Use Routing.prefixes instead]
*/
//Configure::write('Routing.prefixes', array('admin'));
View
@@ -213,6 +213,28 @@ function h($text, $charset = null) {
}
/**
+ * Splits a dot syntax plugin name into its plugin and classname.
+ * If $name does not have a dot, then index 0 will be null.
+ *
+ * Commonly used like `list($plugin, $name) = pluginSplit($name);`
+ *
+ * @param string $name The name you want to plugin split.
+ * @param boolean $dotAppend Set to true if you want the plugin to have a '.' appended to it.
+ * @param string $plugin Optional default plugin to use if no plugin is found. Defaults to null.
+ * @return array Array with 2 indexes. 0 => plugin name, 1 => classname
+ */
+ function pluginSplit($name, $dotAppend = false, $plugin = null) {
+ if (strpos($name, '.') !== false) {
+ $parts = explode('.', $name, 2);
+ if ($dotAppend) {
+ $parts[0] .= '.';
+ }
+ return $parts;
+ }
+ return array($plugin, $name);
+ }
+
+/**
* Returns an array of all the given parameters.
*
* Example:
View
@@ -317,13 +317,8 @@ function dispatch() {
$this->help();
return true;
}
-
- if (strpos($arg, '.') !== false) {
- list($plugin, $shell) = explode('.', $arg);
- } else {
- $plugin = null;
- $shell = $arg;
- }
+
+ list($plugin, $shell) = pluginSplit($arg);
$this->shell = $shell;
$this->shellName = Inflector::camelize($shell);
$this->shellClass = $this->shellName . 'Shell';
@@ -236,7 +236,7 @@ function getPath() {
* @param integer $indent indent level.
* @return void
* @access protected
- **/
+ */
function _outputNode($class, $node, $indent) {
$indent = str_repeat(' ', $indent);
$data = $node[$class];
@@ -521,7 +521,7 @@ function nodeExists() {
*
* @param string $identifier Identifier to parse
* @return mixed a string for aliases, and an array for model.foreignKey
- **/
+ */
function parseIdentifier($identifier) {
if (preg_match('/^([\w]+)\.(.*)$/', $identifier, $matches)) {
return array(
@@ -539,7 +539,7 @@ function parseIdentifier($identifier) {
* @param string $class Class type you want (Aro/Aco)
* @param mixed $identifier A mixed identifier for finding the node.
* @return int Integer of NodeId. Will trigger an error if nothing is found.
- **/
+ */
function _getNodeId($class, $identifier) {
$node = $this->Acl->{$class}->node($identifier);
if (empty($node)) {
@@ -57,7 +57,7 @@ function loadTasks() {
}
foreach($this->args as $i => $arg) {
if (strpos($arg, '.')) {
- list($this->params['plugin'], $this->args[$i]) = explode('.', $arg);
+ list($this->params['plugin'], $this->args[$i]) = pluginSplit($arg);
break;
}
}
@@ -63,9 +63,10 @@ function startup() {
} elseif (!empty($this->args[0])) {
$name = $this->params['name'] = $this->args[0];
}
+
if (strpos($name, '.')) {
- list($this->params['plugin'], $this->params['name']) = explode('.', $name);
- $name = $this->params['name'];
+ list($this->params['plugin'], $splitName) = pluginSplit($name);
+ $name = $this->params['name'] = $splitName;
}
if ($name) {
@@ -242,7 +243,7 @@ function dump() {
* Run database create commands. Alias for run create.
*
* @return void
- **/
+ */
function create() {
list($Schema, $table) = $this->_loadSchema();
$this->__create($Schema, $table);
@@ -252,7 +253,7 @@ function create() {
* Run database create commands. Alias for run create.
*
* @return void
- **/
+ */
function update() {
list($Schema, $table) = $this->_loadSchema();
$this->__update($Schema, $table);
@@ -262,7 +263,7 @@ function update() {
* Prepares the Schema objects for database operations.
*
* @return void
- **/
+ */
function _loadSchema() {
$name = $plugin = null;
if (isset($this->params['name'])) {
@@ -254,11 +254,7 @@ function _loadModels() {
$this->modelClass = $modelClassName;
foreach ($uses as $modelClass) {
- $plugin = null;
- if (strpos($modelClass, '.') !== false) {
- list($plugin, $modelClass) = explode('.', $modelClass);
- $plugin = $plugin . '.';
- }
+ list($plugin, $modelClass) = pluginSplit($modelClass, true);
if (PHP5) {
$this->{$modelClass} = ClassRegistry::init($plugin . $modelClass);
} else {
@@ -642,7 +638,7 @@ function _pluralHumanName($name) {
*
* @param string $pluginName Name of the plugin you want ie. DebugKit
* @return string $path path to the correct plugin.
- **/
+ */
function _pluginPath($pluginName) {
return App::pluginPath($pluginName);
}
@@ -113,7 +113,7 @@ function execute() {
*
* @access public
* @return void
- **/
+ */
function all() {
$this->interactive = false;
$this->listAll($this->connection, false);
@@ -219,7 +219,7 @@ function __interactive() {
* Confirm a to be baked controller with the user
*
* @return void
- **/
+ */
function confirmController($controllerName, $useDynamicScaffold, $helpers, $components) {
$this->out();
$this->hr();
@@ -257,7 +257,7 @@ function confirmController($controllerName, $useDynamicScaffold, $helpers, $comp
* Interact with the user and ask about which methods (admin or regular they want to bake)
*
* @return array Array containing (bakeRegular, bakeAdmin) answers
- **/
+ */
function _askAboutMethods() {
$wannaBakeCrud = $this->in(
__("Would you like to create some basic class methods \n(index(), add(), view(), edit())?", true),
@@ -348,7 +348,7 @@ function bakeTest($className) {
* Interact with the user and get a list of additional helpers
*
* @return array Helpers that the user wants to use.
- **/
+ */
function doHelpers() {
return $this->_doPropertyChoices(
__("Would you like this controller to use other helpers\nbesides HtmlHelper and FormHelper?", true),
@@ -360,7 +360,7 @@ function doHelpers() {
* Interact with the user and get a list of additional components
*
* @return array Components the user wants to use.
- **/
+ */
function doComponents() {
return $this->_doPropertyChoices(
__("Would you like this controller to use any components?", true),
@@ -374,7 +374,7 @@ function doComponents() {
* @param string $prompt A yes/no question to precede the list
* @param sting $example A question for a comma separated list, with examples.
* @return array Array of values for property.
- **/
+ */
function _doPropertyChoices($prompt, $example) {
$proceed = $this->in($prompt, array('y','n'), 'n');
$property = array();
@@ -53,7 +53,7 @@ class DbConfigTask extends Shell {
* Used for testing.
*
* @var string
- **/
+ */
var $databaseClassName = 'DATABASE_CONFIG';
/**
@@ -351,7 +351,7 @@ function bake($configs) {
* Get a user specified Connection name
*
* @return void
- **/
+ */
function getConfig() {
App::import('Model', 'ConnectionManager', false);
@@ -54,14 +54,14 @@ class FixtureTask extends Shell {
* The db connection being used for baking
*
* @var string
- **/
+ */
var $connection = null;
/**
* Schema instance
*
* @var object
- **/
+ */
var $_Schema = null;
/**
@@ -103,7 +103,7 @@ function execute() {
*
* @access public
* @return void
- **/
+ */
function all() {
$this->interactive = false;
$this->Model->interactive = false;
@@ -140,7 +140,7 @@ function __interactive() {
*
* @param string $modelName Name of model you are dealing with.
* @return array Array of import options.
- **/
+ */
function importOptions($modelName) {
$options = array();
$doSchema = $this->in(__('Would you like to import schema for this fixture?', true), array('y', 'n'), 'n');
@@ -230,7 +230,7 @@ function bake($model, $useTable = false, $importOptions = array()) {
* @param string $fixture Contents of the fixture file.
* @access public
* @return void
- **/
+ */
function generateFixtureFile($model, $otherVars) {
$defaults = array('table' => null, 'schema' => null, 'records' => null, 'import' => null, 'fields' => null);
$vars = array_merge($defaults, $otherVars);
@@ -255,7 +255,7 @@ function generateFixtureFile($model, $otherVars) {
*
* @param array $table Table schema array
* @return string fields definitions
- **/
+ */
function _generateSchema($tableInfo) {
$schema = $this->_Schema->generateTable('f', $tableInfo);
return substr($schema, 10, -2);
@@ -266,7 +266,7 @@ function _generateSchema($tableInfo) {
*
* @param array $table Table schema array
* @return array Array of records to use in the fixture.
- **/
+ */
function _generateRecords($tableInfo, $recordCount = 1) {
$records = array();
for ($i = 0; $i < $recordCount; $i++) {
@@ -337,7 +337,7 @@ 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.
- **/
+ */
function _makeRecordString($records) {
$out = "array(\n";
foreach ($records as $record) {
@@ -360,7 +360,7 @@ 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.
- **/
+ */
function _getRecordsFromTable($modelName, $useTable = null) {
if ($this->interactive) {
$condition = null;
Oops, something went wrong.

0 comments on commit acd2c15

Please sign in to comment.