Permalink
Browse files

Merge master in 1.3

  • Loading branch information...
1 parent 6cb8b3d commit 643651fe568923041619a4b95535c5bc9ff8ca0c gwoo committed Mar 19, 2009
Showing with 2,585 additions and 2,015 deletions.
  1. +1 −1 cake/VERSION.txt
  2. +10 −4 cake/console/cake.php
  3. +1 −1 cake/console/libs/acl.php
  4. +2 −2 cake/console/libs/shell.php
  5. +1 −1 cake/console/libs/tasks/extract.php
  6. +1 −1 cake/libs/cache.php
  7. +1 −1 cake/libs/cache/file.php
  8. +1 −1 cake/libs/cache/memcache.php
  9. +26 −0 cake/libs/controller/controller.php
  10. +1 −1 cake/libs/controller/scaffold.php
  11. +1 −1 cake/libs/error.php
  12. +2 −2 cake/libs/file.php
  13. +3 −2 cake/libs/folder.php
  14. +1 −1 cake/libs/i18n.php
  15. +2 −2 cake/libs/model/behavior.php
  16. +8 −7 cake/libs/model/connection_manager.php
  17. +9 −3 cake/libs/model/model.php
  18. +12 −6 cake/libs/object.php
  19. +3 −3 cake/libs/session.php
  20. +3 −3 cake/libs/set.php
  21. +3 −3 cake/libs/view/helpers/ajax.php
  22. +1 −1 cake/libs/view/helpers/cache.php
  23. +66 −22 cake/libs/view/media.php
  24. +11 −7 cake/tests/cases/basics.test.php
  25. +20 −22 cake/tests/cases/console/cake.test.php
  26. +7 −7 cake/tests/cases/console/libs/shell.test.php
  27. +8 −9 cake/tests/cases/console/libs/tasks/extract.test.php
  28. +4 −4 cake/tests/cases/console/libs/tasks/test.test.php
  29. +13 −18 cake/tests/cases/dispatcher.test.php
  30. +4 −4 cake/tests/cases/libs/cache.test.php
  31. +13 −13 cake/tests/cases/libs/cache/apc.test.php
  32. +11 −6 cake/tests/cases/libs/cache/file.test.php
  33. +4 −5 cake/tests/cases/libs/cache/memcache.test.php
  34. +13 −13 cake/tests/cases/libs/cache/xcache.test.php
  35. +4 −5 cake/tests/cases/libs/cake_log.test.php
  36. +29 −28 cake/tests/cases/libs/cake_test_case.test.php
  37. +29 −28 cake/tests/cases/libs/cake_test_fixture.test.php
  38. +10 −10 cake/tests/cases/libs/class_registry.test.php
  39. +12 −14 cake/tests/cases/libs/code_coverage_manager.test.php
  40. +5 −8 cake/tests/cases/libs/configure.test.php
  41. +40 −11 cake/tests/cases/libs/controller/component.test.php
  42. +12 −15 cake/tests/cases/libs/controller/components/acl.test.php
  43. +40 −31 cake/tests/cases/libs/controller/components/auth.test.php
  44. +60 −26 cake/tests/cases/libs/controller/components/cookie.test.php
  45. +29 −7 cake/tests/cases/libs/controller/components/email.test.php
  46. +39 −20 cake/tests/cases/libs/controller/components/request_handler.test.php
  47. +30 −16 cake/tests/cases/libs/controller/components/security.test.php
  48. +30 −8 cake/tests/cases/libs/controller/components/session.test.php
  49. +80 −20 cake/tests/cases/libs/controller/controller.test.php
  50. +4 −4 cake/tests/cases/libs/controller/pages_controller.test.php
  51. +33 −36 cake/tests/cases/libs/controller/scaffold.test.php
  52. +28 −28 cake/tests/cases/libs/debugger.test.php
  53. +13 −15 cake/tests/cases/libs/error.test.php
  54. +4 −5 cake/tests/cases/libs/file.test.php
  55. +36 −7 cake/tests/cases/libs/folder.test.php
  56. +46 −25 cake/tests/cases/libs/http_socket.test.php
  57. +10 −5 cake/tests/cases/libs/i18n.test.php
  58. +13 −13 cake/tests/cases/libs/inflector.test.php
  59. +3 −3 cake/tests/cases/libs/l10n.test.php
  60. +5 −13 cake/tests/cases/libs/magic_db.test.php
  61. +14 −19 cake/tests/cases/libs/model/behavior.test.php
  62. +52 −38 cake/tests/cases/libs/model/behaviors/acl.test.php
  63. +16 −11 cake/tests/cases/libs/model/behaviors/containable.test.php
  64. +5 −6 cake/tests/cases/libs/model/behaviors/translate.test.php
  65. +13 −13 cake/tests/cases/libs/model/behaviors/tree.test.php
  66. +11 −18 cake/tests/cases/libs/model/datasources/dbo/dbo_adodb.test.php
  67. +50 −29 cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php
  68. +72 −73 cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php
  69. +8 −11 cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php
  70. +2 −10 cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php
  71. +18 −23 cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php
  72. +11 −14 cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php
  73. +29 −26 cake/tests/cases/libs/model/datasources/dbo_source.test.php
  74. +39 −45 cake/tests/cases/libs/model/db_acl.test.php
  75. +52 −41 cake/tests/cases/libs/model/model.test.php
  76. +109 −110 cake/tests/cases/libs/model/models.php
  77. +28 −29 cake/tests/cases/libs/model/schema.test.php
  78. +4 −4 cake/tests/cases/libs/multibyte.test.php
  79. +145 −22 cake/tests/cases/libs/object.test.php
  80. +5 −5 cake/tests/cases/libs/overloadable.test.php
  81. +4 −6 cake/tests/cases/libs/router.test.php
  82. +5 −6 cake/tests/cases/libs/sanitize.test.php
  83. +4 −4 cake/tests/cases/libs/security.test.php
  84. +9 −4 cake/tests/cases/libs/session.test.php
  85. +9 −10 cake/tests/cases/libs/set.test.php
  86. +13 −13 cake/tests/cases/libs/socket.test.php
  87. +4 −4 cake/tests/cases/libs/string.test.php
  88. +24 −23 cake/tests/cases/libs/test_manager.test.php
  89. +7 −7 cake/tests/cases/libs/validation.test.php
  90. +20 −22 cake/tests/cases/libs/view/helper.test.php
  91. +25 −19 cake/tests/cases/libs/view/helpers/ajax.test.php
  92. +42 −34 cake/tests/cases/libs/view/helpers/cache.test.php
  93. +43 −34 cake/tests/cases/libs/view/helpers/form.test.php
  94. +12 −13 cake/tests/cases/libs/view/helpers/html.test.php
  95. +4 −5 cake/tests/cases/libs/view/helpers/javascript.test.php
  96. +12 −9 cake/tests/cases/libs/view/helpers/js.test.php
  97. +15 −18 cake/tests/cases/libs/view/helpers/number.test.php
  98. +15 −15 cake/tests/cases/libs/view/helpers/paginator.test.php
  99. +5 −6 cake/tests/cases/libs/view/helpers/rss.test.php
  100. +4 −5 cake/tests/cases/libs/view/helpers/session.test.php
  101. +14 −16 cake/tests/cases/libs/view/helpers/text.test.php
  102. +14 −16 cake/tests/cases/libs/view/helpers/time.test.php
  103. +13 −14 cake/tests/cases/libs/view/helpers/xml.test.php
  104. +16 −16 cake/tests/cases/libs/view/theme.test.php
  105. +16 −17 cake/tests/cases/libs/view/view.test.php
  106. +176 −164 cake/tests/cases/libs/xml.test.php
  107. +2 −2 cake/tests/fixtures/account_fixture.php
  108. +2 −2 cake/tests/fixtures/aco_action_fixture.php
  109. +2 −2 cake/tests/fixtures/aco_fixture.php
  110. +2 −2 cake/tests/fixtures/aco_two_fixture.php
  111. +2 −2 cake/tests/fixtures/advertisement_fixture.php
  112. +2 −2 cake/tests/fixtures/another_article_fixture.php
  113. +2 −2 cake/tests/fixtures/apple_fixture.php
  114. +2 −2 cake/tests/fixtures/aro_fixture.php
  115. +2 −2 cake/tests/fixtures/aro_two_fixture.php
  116. +2 −2 cake/tests/fixtures/aros_aco_fixture.php
  117. +2 −2 cake/tests/fixtures/aros_aco_two_fixture.php
  118. +2 −2 cake/tests/fixtures/article_featured_fixture.php
  119. +2 −2 cake/tests/fixtures/article_featureds_tags_fixture.php
  120. +2 −2 cake/tests/fixtures/article_fixture.php
  121. +2 −2 cake/tests/fixtures/articles_tag_fixture.php
  122. +2 −2 cake/tests/fixtures/attachment_fixture.php
  123. +2 −2 cake/tests/fixtures/auth_user_custom_field_fixture.php
  124. +2 −2 cake/tests/fixtures/auth_user_fixture.php
  125. +2 −2 cake/tests/fixtures/author_fixture.php
  126. +2 −2 cake/tests/fixtures/basket_fixture.php
  127. +2 −2 cake/tests/fixtures/bid_fixture.php
  128. +2 −2 cake/tests/fixtures/binary_test_fixture.php
  129. +2 −2 cake/tests/fixtures/book_fixture.php
  130. +2 −2 cake/tests/fixtures/cache_test_model_fixture.php
  131. +2 −2 cake/tests/fixtures/callback_fixture.php
  132. +2 −2 cake/tests/fixtures/category_fixture.php
  133. +2 −2 cake/tests/fixtures/category_thread_fixture.php
  134. +2 −2 cake/tests/fixtures/cd_fixture.php
  135. +8 −8 cake/tests/fixtures/comment_fixture.php
  136. +2 −2 cake/tests/fixtures/content_account_fixture.php
  137. +2 −2 cake/tests/fixtures/content_fixture.php
  138. +2 −2 cake/tests/fixtures/counter_cache_post_fixture.php
  139. +2 −2 cake/tests/fixtures/counter_cache_user_fixture.php
  140. +2 −2 cake/tests/fixtures/data_test_fixture.php
  141. +2 −2 cake/tests/fixtures/datatype_fixture.php
  142. +2 −2 cake/tests/fixtures/dependency_fixture.php
  143. +2 −2 cake/tests/fixtures/device_fixture.php
  144. +2 −2 cake/tests/fixtures/device_type_category_fixture.php
  145. +2 −2 cake/tests/fixtures/device_type_fixture.php
  146. +2 −2 cake/tests/fixtures/document_directory_fixture.php
  147. +2 −2 cake/tests/fixtures/document_fixture.php
  148. +2 −2 cake/tests/fixtures/exterior_type_category_fixture.php
  149. +2 −2 cake/tests/fixtures/feature_set_fixture.php
  150. +2 −2 cake/tests/fixtures/featured_fixture.php
  151. +2 −2 cake/tests/fixtures/film_file_fixture.php
  152. +1 −1 cake/tests/fixtures/flag_tree_fixture.php
  153. +2 −2 cake/tests/fixtures/fruit_fixture.php
  154. +2 −2 cake/tests/fixtures/fruits_uuid_tag_fixture.php
  155. +2 −2 cake/tests/fixtures/home_fixture.php
  156. +2 −2 cake/tests/fixtures/image_fixture.php
  157. +2 −2 cake/tests/fixtures/item_fixture.php
  158. +2 −2 cake/tests/fixtures/items_portfolio_fixture.php
  159. +2 −2 cake/tests/fixtures/join_a_b_fixture.php
  160. +2 −2 cake/tests/fixtures/join_a_c_fixture.php
  161. +2 −2 cake/tests/fixtures/join_a_fixture.php
  162. +2 −2 cake/tests/fixtures/join_b_fixture.php
  163. +2 −2 cake/tests/fixtures/join_c_fixture.php
  164. +2 −2 cake/tests/fixtures/join_thing_fixture.php
  165. +2 −2 cake/tests/fixtures/message_fixture.php
  166. +2 −2 cake/tests/fixtures/my_categories_my_products_fixture.php
  167. +2 −2 cake/tests/fixtures/my_categories_my_users_fixture.php
  168. +2 −2 cake/tests/fixtures/my_category_fixture.php
  169. +2 −2 cake/tests/fixtures/my_product_fixture.php
  170. +2 −2 cake/tests/fixtures/my_user_fixture.php
  171. +2 −2 cake/tests/fixtures/node_fixture.php
  172. +1 −1 cake/tests/fixtures/number_tree_fixture.php
  173. +2 −2 cake/tests/fixtures/numeric_article_fixture.php
  174. +2 −2 cake/tests/fixtures/overall_favorite_fixture.php
  175. +2 −2 cake/tests/fixtures/person_fixture.php
  176. +2 −2 cake/tests/fixtures/portfolio_fixture.php
  177. +2 −2 cake/tests/fixtures/post_fixture.php
  178. +2 −2 cake/tests/fixtures/posts_tag_fixture.php
  179. +2 −2 cake/tests/fixtures/primary_model_fixture.php
  180. +2 −2 cake/tests/fixtures/product_fixture.php
  181. +2 −2 cake/tests/fixtures/project_fixture.php
  182. +2 −2 cake/tests/fixtures/sample_fixture.php
  183. +2 −2 cake/tests/fixtures/secondary_model_fixture.php
  184. +2 −2 cake/tests/fixtures/session_fixture.php
  185. +2 −2 cake/tests/fixtures/something_else_fixture.php
  186. +2 −2 cake/tests/fixtures/something_fixture.php
  187. +2 −2 cake/tests/fixtures/stories_tag_fixture.php
  188. +2 −2 cake/tests/fixtures/story_fixture.php
  189. +2 −2 cake/tests/fixtures/syfile_fixture.php
  190. +2 −2 cake/tests/fixtures/tag_fixture.php
  191. +2 −2 cake/tests/fixtures/test_plugin_article_fixture.php
  192. +2 −2 cake/tests/fixtures/test_plugin_comment_fixture.php
  193. +2 −2 cake/tests/fixtures/the_paper_monkies_fixture.php
  194. +2 −2 cake/tests/fixtures/thread_fixture.php
  195. +2 −2 cake/tests/fixtures/translate_article_fixture.php
  196. +2 −2 cake/tests/fixtures/translate_fixture.php
  197. +2 −2 cake/tests/fixtures/translate_table_fixture.php
  198. +2 −2 cake/tests/fixtures/translated_article_fixture.php
  199. +2 −2 cake/tests/fixtures/translated_item_fixture.php
  200. +1 −1 cake/tests/fixtures/unconventional_tree_fixture.php
  201. +1 −1 cake/tests/fixtures/underscore_field_fixture.php
  202. +2 −2 cake/tests/fixtures/user_fixture.php
  203. +2 −2 cake/tests/fixtures/uuid_fixture.php
  204. +2 −2 cake/tests/fixtures/uuid_tag_fixture.php
  205. +1 −1 cake/tests/fixtures/uuid_tree_fixture.php
  206. +2 −2 cake/tests/fixtures/uuiditem_fixture.php
  207. +2 −2 cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php
  208. +3 −3 cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php
  209. +2 −2 cake/tests/fixtures/uuidportfolio_fixture.php
  210. +6 −11 cake/tests/groups/acl.group.php
  211. +6 −11 cake/tests/groups/cache.group.php
  212. +6 −11 cake/tests/groups/components.group.php
  213. +6 −11 cake/tests/groups/configure.group.php
  214. +5 −10 cake/tests/groups/console.group.php
  215. +6 −11 cake/tests/groups/helpers.group.php
  216. +6 −11 cake/tests/groups/lib.group.php
  217. +5 −5 cake/tests/groups/lib_controller.group.php
  218. +6 −11 cake/tests/groups/model.group.php
  219. +8 −13 cake/tests/groups/no_database.group.php
  220. +6 −11 cake/tests/groups/routing_system.group.php
  221. +6 −11 cake/tests/groups/socket.group.php
  222. +6 −11 cake/tests/groups/test_suite.group.php
  223. +6 −11 cake/tests/groups/view.group.php
  224. +6 −11 cake/tests/groups/xml.group.php
  225. +1 −1 cake/tests/test_app/controllers/tests_apps_controller.php
  226. +1 −1 cake/tests/test_app/controllers/tests_apps_posts_controller.php
  227. +38 −0 cake/tests/test_app/models/behaviors/persister_one_behavior.php
  228. +38 −0 cake/tests/test_app/models/behaviors/persister_two_behavior.php
  229. +35 −0 cake/tests/test_app/models/persister_one.php
  230. +35 −0 cake/tests/test_app/models/persister_two.php
  231. +1 −1 cake/tests/test_app/plugins/test_plugin/controllers/components/other_component.php
  232. +1 −1 cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php
  233. +1 −1 cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php
  234. +1 −1 cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php
  235. +1 −1 cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php
  236. +1 −1 cake/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php
  237. +1 −1 cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php
  238. +1 −1 cake/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php
  239. +1 −1 cake/tests/test_app/plugins/test_plugin/vendors/shells/example.php
  240. +1 −1 cake/tests/test_app/plugins/test_plugin/vendors/welcome.php
  241. +1 −1 cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php
  242. +1 −1 cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php
  243. +1 −1 cake/tests/test_app/plugins/test_plugin_two/vendors/shells/example.php
  244. +1 −1 cake/tests/test_app/plugins/test_plugin_two/vendors/shells/welcome.php
  245. +1 −1 cake/tests/test_app/vendors/Test/MyTest.php
  246. +1 −1 cake/tests/test_app/vendors/Test/hello.php
  247. +1 −1 cake/tests/test_app/vendors/sample/configure_test_vendor_sample.php
  248. +1 −1 cake/tests/test_app/vendors/shells/sample.php
  249. +1 −1 cake/tests/test_app/vendors/somename/some.name.php
  250. +1 −1 cake/tests/test_app/vendors/welcome.php
View
@@ -6,4 +6,4 @@
// +---------------------------------------------------------------------------------------------------+ //
///////////////////////////////////////////////////////////////////////////////////////////////////////////
-1.2.1.8004
+1.2.2.8120
View
@@ -198,10 +198,14 @@ function _initEnvironment() {
*/
function __buildPaths() {
$paths = array();
-
$pluginPaths = Configure::read('pluginPaths');
+ if (!class_exists('Folder')) {
+ require LIBS . 'folder.php';
+ }
+
foreach ($pluginPaths as $pluginPath) {
- $plugins = Configure::listObjects('plugin', $pluginPath);
+ $Folder =& new Folder($pluginPath);
+ list($plugins,) = $Folder->read(false, true);
foreach ((array)$plugins as $plugin) {
$path = $pluginPath . Inflector::underscore($plugin) . DS . 'vendors' . DS . 'shells' . DS;
if (file_exists($path)) {
@@ -262,7 +266,6 @@ function __bootstrap() {
Configure::write('debug', 1);
return true;
}
-
/**
* Dispatches a CLI request
*
@@ -542,16 +545,19 @@ function help() {
$this->stdout("\nAvailable Shells:");
$_shells = array();
+
foreach ($this->shellPaths as $path) {
if (is_dir($path)) {
$shells = Configure::listObjects('file', $path);
- $path = str_replace(CORE_PATH, 'CORE/', $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);
$path = rtrim($path, DS);
$this->stdout("\n " . $path . ":");
if (empty($shells)) {
$this->stdout("\t - none");
} else {
+ sort($shells);
foreach ($shells as $shell) {
if ($shell !== 'shell.php') {
$this->stdout("\t " . str_replace('.php', '', $shell));
@@ -36,7 +36,7 @@ class AclShell extends Shell {
/**
* Contains instance of AclComponent
*
- * @var object
+ * @var AclComponent
* @access public
*/
var $Acl;
@@ -34,7 +34,7 @@ class Shell extends Object {
/**
* An instance of the ShellDispatcher object that loaded this script
*
- * @var object
+ * @var ShellDispatcher
* @access public
*/
var $Dispatch = null;
@@ -49,7 +49,7 @@ class Shell extends Object {
* Holds the DATABASE_CONFIG object for the app. Null if database.php could not be found,
* or the app does not exist.
*
- * @var object
+ * @var DATABASE_CONFIG
* @access public
*/
var $DbConfig = null;
@@ -135,7 +135,7 @@ function execute() {
} else {
$response = '';
while ($response == '') {
- $response = $this->in("What is the full path you would like to extract?\nExample: " . $this->params['root'] . DS . "myapp\n[Q]uit", null, 'Q');
+ $response = $this->in("What is the full path you would like to extract?\nExample: " . $this->params['root'] . DS . "myapp\n[Q]uit", null, $this->params['working']);
if (strtoupper($response) === 'Q') {
$this->out('Extract Aborted');
$this->_stop();
View
@@ -33,7 +33,7 @@ class Cache extends Object {
/**
* Cache engine to use
*
- * @var object
+ * @var CacheEngine
* @access protected
*/
var $_Engine = null;
@@ -34,7 +34,7 @@ class FileEngine extends CacheEngine {
/**
* Instance of File class
*
- * @var object
+ * @var File
* @access private
*/
var $__File = null;
@@ -33,7 +33,7 @@ class MemcacheEngine extends CacheEngine {
/**
* Memcache wrapper.
*
- * @var object
+ * @var Memcache
* @access private
*/
var $__Memcache = null;
@@ -292,6 +292,32 @@ class Controller extends Object {
*/
var $methods = array();
/**
+ * 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'
+ *
+ * @var string
+ * @access public
+ */
+ var $modelClass = null;
+/**
+ * This controller's model key name, an underscored version of the controller's $modelClass property.
+ *
+ * Example: For a controller named 'ArticleComments', the modelKey would be 'article_comment'
+ *
+ * @var string
+ * @access public
+ */
+ var $modelKey = null;
+/**
+ * Holds any validation errors produced by the last call of the validateErrors() method/
+ *
+ * @var array Validation errors, or false if none
+ * @access public
+ */
+ var $validationErrors = null;
+/**
* Constructor.
*
*/
@@ -39,7 +39,7 @@ class Scaffold extends Object {
/**
* Controller object
*
- * @var object
+ * @var Controller
* @access public
*/
var $controller = null;
View
@@ -70,7 +70,7 @@ class ErrorHandler extends Object {
/**
* Controller instance.
*
- * @var object
+ * @var Controller
* @access public
*/
var $controller = null;
View
@@ -42,7 +42,7 @@ class File extends Object {
/**
* Folder object of the File
*
- * @var object
+ * @var Folder
* @access public
*/
var $Folder = null;
@@ -376,7 +376,7 @@ function md5($maxsize = 5) {
}
/**
* Returns the full path of the File.
- *
+ *
* @return string Full path to file
* @access public
*/
@@ -212,17 +212,18 @@ function findRecursive($pattern = '.*', $sort = false) {
*/
function _findRecursive($pattern, $sort = false) {
list($dirs, $files) = $this->read($sort);
-
$found = array();
+
foreach ($files as $file) {
if (preg_match('/^' . $pattern . '$/i', $file)) {
$found[] = Folder::addPathElement($this->path, $file);
}
}
$start = $this->path;
+
foreach ($dirs as $dir) {
$this->cd(Folder::addPathElement($start, $dir));
- $found = array_merge($found, $this->findRecursive($pattern));
+ $found = array_merge($found, $this->findRecursive($pattern, $sort));
}
return $found;
}
View
@@ -40,7 +40,7 @@ class I18n extends Object {
/**
* Instance of the I10n class for localization
*
- * @var object
+ * @var I10n
* @access public
*/
var $l10n = null;
@@ -205,11 +205,11 @@ function _addToWhitelist(&$model, $field) {
* @subpackage cake.cake.libs.model
*/
class BehaviorCollection extends Object {
-
/**
* Stores a reference to the attached name
*
- * @var object
+ * @var string
+ * @access public
*/
var $modelName = null;
/**
@@ -1,9 +1,9 @@
<?php
/* SVN FILE: $Id$ */
/**
- * Short description for file.
+ * Datasource connection manager
*
- * Long description for file
+ * Provides an interface for loading and enumerating connections defined in app/config/database.php
*
* PHP versions 4 and 5
*
@@ -39,7 +39,7 @@ class ConnectionManager extends Object {
/**
* Holds a loaded instance of the Connections object
*
- * @var object
+ * @var DATABASE_CONFIG
* @access public
*/
var $config = null;
@@ -85,7 +85,7 @@ function &getInstance() {
/**
* Gets a reference to a DataSource object
*
- * @param string $name The name of the DataSource, as defined in app/config/connections
+ * @param string $name The name of the DataSource, as defined in app/config/database.php
* @return object Instance
* @access public
* @static
@@ -145,8 +145,9 @@ function getSourceName(&$source) {
/**
* Loads the DataSource class for the given connection name
*
- * @param mixed $connName A string name of the connection, as defined in Connections config,
- * or an array containing the file and class name of the object.
+ * @param mixed $connName A string name of the connection, as defined in app/config/database.php,
+ * or an array containing the filename (without extension) and class name of the object,
+ * to be found in app/models/datasources/ or cake/libs/model/datasources/.
* @return boolean True on success, null on failure or false if the class is already loaded
* @access public
* @static
@@ -259,4 +260,4 @@ function __destruct() {
}
}
}
-?>
+?>
@@ -221,7 +221,7 @@ class Model extends Overloadable {
/**
* Holds the Behavior objects currently bound to this model.
*
- * @var object
+ * @var BehaviorCollection
* @access public
*/
var $Behaviors = null;
@@ -2343,9 +2343,15 @@ function invalidFields($options = array()) {
$this->exists();
$_validate = $this->validate;
- if (array_key_exists('fieldList', $options) && is_array($options['fieldList']) && !empty($options['fieldList'])) {
+ $whitelist = $this->whitelist;
+
+ if (array_key_exists('fieldList', $options)) {
+ $whitelist = $options['fieldList'];
+ }
+
+ if (!empty($whitelist)) {
$validate = array();
- foreach ($options['fieldList'] as $f) {
+ foreach ((array)$whitelist as $f) {
if (!empty($this->validate[$f])) {
$validate[$f] = $this->validate[$f];
}
View
@@ -38,7 +38,7 @@ class Object {
/**
* Log object
*
- * @var object
+ * @var CakeLog
* @access protected
*/
var $_log = null;
@@ -248,7 +248,11 @@ function _savePersistent($name, &$object) {
$objectArray = array(&$object);
$data = str_replace('\\', '\\\\', serialize($objectArray));
$data = '<?php $' . $name . ' = \'' . str_replace('\'', '\\\'', $data) . '\' ?>';
- cache($file, $data, '+1 day');
+ $duration = '+999 days';
+ if (Configure::read() >= 1) {
+ $duration = '+10 seconds';
+ }
+ cache($file, $data, $duration);
}
/**
* Open the persistent class file for reading
@@ -267,14 +271,16 @@ function __openPersistent($name, $type = null) {
case 'registry':
$vars = unserialize(${$name});
foreach ($vars['0'] as $key => $value) {
- App::import('Model', Inflector::classify($key));
+ if (strpos($key, '_behavior') !== false) {
+ App::import('Behavior', Inflector::classify(substr($key, 0, -9)));
+ } else {
+ App::import('Model', Inflector::classify($key));
+ }
+ unset ($value);
}
unset($vars);
$vars = unserialize(${$name});
foreach ($vars['0'] as $key => $value) {
- foreach ($vars['0'][$key]->Behaviors->_attached as $behavior) {
- App::import('Behavior', $behavior);
- }
ClassRegistry::addObject($key, $value);
unset ($value);
}
@@ -349,7 +349,9 @@ function watch($var) {
if (empty($var)) {
return false;
}
- $this->watchKeys[] = $var;
+ if (!in_array($var, $this->watchKeys, true)) {
+ $this->watchKeys[] = $var;
+ }
}
/**
* Tells Session to stop watching a given key path
@@ -571,10 +573,8 @@ function _checkValid() {
$this->__setError(1, 'Session Highjacking Attempted !!!');
}
} else {
- srand ((double)microtime() * 1000000);
$this->write('Config.userAgent', $this->_userAgent);
$this->write('Config.time', $this->sessionTime);
- $this->write('Config.rand', mt_rand());
$this->write('Config.timeout', 10);
$this->valid = true;
$this->__setError(1, 'Session is valid');
View
@@ -374,12 +374,12 @@ function extract($path, $data = null, $options = array()) {
$data = $path;
$path = $tmp;
}
- if (empty($data)) {
- return array();
- }
if (strpos($path, '/') === false) {
return Set::classicExtract($data, $path);
}
+ if (empty($data)) {
+ return array();
+ }
if ($path === '/') {
return $data;
}
Oops, something went wrong.

0 comments on commit 643651f

Please sign in to comment.