mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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
This commit is contained in:
parent
5c796f4dbe
commit
565163303c
3 changed files with 10 additions and 10 deletions
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue