From 565163303c3d0460a3e6971437628548254e52db Mon Sep 17 00:00:00 2001 From: gwoo Date: Wed, 30 Jul 2008 19:53:12 +0000 Subject: [PATCH] changing ClassRegistry::params() to ClassRegistry::config() git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7386 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/class_registry.php | 12 ++++++------ cake/tests/lib/cake_test_case.php | 2 +- cake/tests/lib/cake_test_fixture.php | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cake/libs/class_registry.php b/cake/libs/class_registry.php index 6350d327e..8fdd4656b 100644 --- a/cake/libs/class_registry.php +++ b/cake/libs/class_registry.php @@ -57,7 +57,7 @@ class ClassRegistry { * @var array * @access private */ - var $__params = array(); + var $__config = array(); /** * Return a singleton instance of the ClassRegistry. * @@ -108,7 +108,7 @@ class ClassRegistry { $defaults = array_merge( array('id' => false, 'table' => null, 'ds' => null, 'alias' => null, 'name' => null), - isset($_this->__params[$type]) ? $_this->__params[$type] : array() + isset($_this->__config[$type]) ? $_this->__config[$type] : array() ); $count = count($objects); @@ -258,19 +258,19 @@ class ClassRegistry { * @return mixed Void if $param is being set. Otherwise, if only $type is passed, returns * the previously-set value of $param, or null if not set. */ - function params($type, $param = array()) { + function config($type, $param = array()) { $_this =& ClassRegistry::getInstance(); if (empty($param) && is_array($type)) { $param = $type; $type = 'Model'; } elseif (is_null($param)) { - unset($_this->__params[$type]); + unset($_this->__config[$type]); } elseif (empty($param) && is_string($type)) { - return isset($_this->__params[$type]) ? $_this->__params[$type] : null; + return isset($_this->__config[$type]) ? $_this->__config[$type] : null; } - $_this->__params[$type] = $param; + $_this->__config[$type] = $param; } /** * Checks to see if $alias is a duplicate $class Object diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index ebf6c493d..81b978bad 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -655,7 +655,7 @@ class CakeTestCase extends UnitTestCase { $this->db->cacheSources = false; $this->db->fullDebug = false; - ClassRegistry::params(array('ds' => 'test_suite')); + ClassRegistry::config(array('ds' => 'test_suite')); } /** * Load fixtures specified in var $fixtures. diff --git a/cake/tests/lib/cake_test_fixture.php b/cake/tests/lib/cake_test_fixture.php index 630d4d4a9..34b41f845 100644 --- a/cake/tests/lib/cake_test_fixture.php +++ b/cake/tests/lib/cake_test_fixture.php @@ -81,7 +81,7 @@ class CakeTestFixture extends Object { $connection = isset($import['connection']) ? $import['connection'] : 'test_suite'; - ClassRegistry::params(array('ds' => $connection)); + ClassRegistry::config(array('ds' => $connection)); $model =& ClassRegistry::init($import['model']); $db =& ConnectionManager::getDataSource($model->useDbConfig); @@ -125,7 +125,7 @@ class CakeTestFixture extends Object { if (!isset($this->table)) { $this->table = Inflector::underscore(Inflector::pluralize($this->name)); } - + if (!isset($this->primaryKey) && isset($this->fields['id'])) { $this->primaryKey = 'id'; } @@ -157,7 +157,7 @@ class CakeTestFixture extends Object { return ($db->execute($db->dropSchema($this->Schema)) !== false); } /** - * Run before each tests is executed, should return a set of SQL statements to insert records for the table + * Run before each tests is executed, should return a set of SQL statements to insert records for the table * of this fixture could be executed successfully. * * @param object $db An instance of the database into which the records will be inserted