diff --git a/VERSION.txt b/VERSION.txt index 607b2bde5..c6c495eba 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -6,4 +6,4 @@ // +---------------------------------------------------------------------------------------------------+ // /////////////////////////////////////////////////////////////////////////////////////////////////////////// -0.10.8.1913 RC 4 \ No newline at end of file +0.10.8.1915 RC 4 \ No newline at end of file diff --git a/app/config/database.php.default b/app/config/database.php.default index 6818afcc6..21afe7aa6 100644 --- a/app/config/database.php.default +++ b/app/config/database.php.default @@ -64,14 +64,16 @@ class DATABASE_CONFIG 'host' => 'localhost', 'login' => 'user', 'password' => 'password', - 'database' => 'project_name' ); + 'database' => 'project_name', + 'prefix' => ''); var $test = array('driver' => 'mysql', 'connect' => 'mysql_pconnect', 'host' => 'localhost', 'login' => 'user', 'password' => 'password', - 'database' => 'project_name-test'); + 'database' => 'project_name-test', + 'prefix' => ''); } ?> \ No newline at end of file diff --git a/cake/basics.php b/cake/basics.php index 7ba9b4d6e..889731f7b 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -238,7 +238,7 @@ function loadController ($name) } if($name === null) { - return; + return true; } if(!class_exists($name.'Controller')) { diff --git a/cake/libs/model/model_php4.php b/cake/libs/model/model_php4.php index ecd45964f..5fcf6a1c0 100644 --- a/cake/libs/model/model_php4.php +++ b/cake/libs/model/model_php4.php @@ -1384,6 +1384,12 @@ class Model extends Object $dataSource = $this->useDbConfig; } $this->db =& ConnectionManager::getDataSource($dataSource); + + if(!empty($this->db->config['prefix'])) + { + $this->tablePrefix = $this->db->config['prefix']; + } + if(empty($this->db) || $this->db == null || !is_object($this->db)) { return $this->cakeError('missingConnection',array(array('className' => $this->name))); diff --git a/cake/libs/model/model_php5.php b/cake/libs/model/model_php5.php index d66e5293d..8795feec3 100644 --- a/cake/libs/model/model_php5.php +++ b/cake/libs/model/model_php5.php @@ -1387,6 +1387,11 @@ class Model extends Object $dataSource = $this->useDbConfig; } $this->db =& ConnectionManager::getDataSource($dataSource); + + if(!empty($this->db->config['prefix'])) + { + $this->tablePrefix = $this->db->config['prefix']; + } if(empty($this->db) || $this->db == null || !is_object($this->db)) { return $this->cakeError('missingConnection',array(array('className' => $this->name)));