Skip to content

Commit

Permalink
Replacing 'driver' with 'datasource'.
Browse files Browse the repository at this point in the history
  • Loading branch information
majna committed Nov 4, 2011
1 parent 1455c59 commit 1b9b90d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions app/Config/database.php.default
Expand Up @@ -27,14 +27,14 @@
* Database configuration class.
* You can specify multiple configurations for production, development and testing.
*
* driver => The name of a supported driver; valid options are as follows:
* datasource => The name of a supported datasource; valid options are as follows:
* Database/Mysql - MySQL 4 & 5,
* Database/Sqlite - SQLite (PHP5 only),
* Database/Postgres - PostgreSQL 7 and higher,
* Database/Sqlserver - Microsoft SQL Server 2005 and higher
*
* You can add custom database drivers (or override existing drivers) by adding the
* appropriate file to app/Model/Datasource/Database. Drivers should be named 'MyDriver.php',
* You can add custom database datasources (or override existing datasources) by adding the
* appropriate file to app/Model/Datasource/Database. Datasources should be named 'MyDatasource.php',
*
*
* persistent => true / false
Expand Down
8 changes: 4 additions & 4 deletions lib/Cake/Console/Command/Task/DbConfigTask.php
Expand Up @@ -104,7 +104,7 @@ protected function _interactive() {
}
}

$driver = $this->in(__d('cake_console', 'Driver:'), array('Mysql', 'Postgres', 'Sqlite', 'Sqlserver'), 'Mysql');
$datasource = $this->in(__d('cake_console', 'Datasource:'), array('Mysql', 'Postgres', 'Sqlite', 'Sqlserver'), 'Mysql');

$persistent = $this->in(__d('cake_console', 'Persistent Connection?'), array('y', 'n'), 'n');
if (strtolower($persistent) == 'n') {
Expand Down Expand Up @@ -167,7 +167,7 @@ protected function _interactive() {
}

$schema = '';
if ($driver == 'postgres') {
if ($datasource == 'postgres') {
while ($schema == '') {
$schema = $this->in(__d('cake_console', 'Table schema?'), null, 'n');
}
Expand All @@ -176,7 +176,7 @@ protected function _interactive() {
$schema = null;
}

$config = compact('name', 'driver', 'persistent', 'host', 'login', 'password', 'database', 'prefix', 'encoding', 'port', 'schema');
$config = compact('name', 'datasource', 'persistent', 'host', 'login', 'password', 'database', 'prefix', 'encoding', 'port', 'schema');

while ($this->_verify($config) == false) {
$this->_interactive();
Expand Down Expand Up @@ -209,7 +209,7 @@ protected function _verify($config) {
$this->out(__d('cake_console', 'The following database configuration will be created:'));
$this->hr();
$this->out(__d('cake_console', "Name: %s", $name));
$this->out(__d('cake_console', "Driver: %s", $driver));
$this->out(__d('cake_console', "Datasource: %s", $datasource));
$this->out(__d('cake_console', "Persistent: %s", $persistent));
$this->out(__d('cake_console', "Host: %s", $host));

Expand Down
6 changes: 3 additions & 3 deletions lib/Cake/Console/Templates/skel/Config/database.php.default
Expand Up @@ -27,14 +27,14 @@
* Database configuration class.
* You can specify multiple configurations for production, development and testing.
*
* driver => The name of a supported driver; valid options are as follows:
* datasource => The name of a supported datasource; valid options are as follows:
* Database/Mysql - MySQL 4 & 5,
* Database/Sqlite - SQLite (PHP5 only),
* Database/Postgres - PostgreSQL 7 and higher,
* Database/Sqlserver - Microsoft SQL Server 2005 and higher
*
* You can add custom database drivers (or override existing drivers) by adding the
* appropriate file to app/Model/Datasource/Database. Drivers should be named 'MyDriver.php',
* You can add custom database datasources (or override existing datasources) by adding the
* appropriate file to app/Model/Datasource/Database. Datasources should be named 'MyDatasource.php',
*
*
* persistent => true / false
Expand Down
Expand Up @@ -115,7 +115,7 @@ public function testExecuteIntoInteractive() {
->with(array(
array(
'name' => 'default',
'driver' => 'mysql',
'datasource' => 'mysql',
'persistent' => 'false',
'host' => 'localhost',
'login' => 'root',
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/Utility/DebuggerTest.php
Expand Up @@ -405,7 +405,7 @@ public function testGetInstance() {
*/
public function testNoDbCredentials() {
$config = array(
'driver' => 'mysql',
'datasource' => 'mysql',
'persistent' => false,
'host' => 'void.cakephp.org',
'login' => 'cakephp-user',
Expand All @@ -417,7 +417,7 @@ public function testNoDbCredentials() {
$output = Debugger::exportVar($config);

$expectedArray = array(
'driver' => 'mysql',
'datasource' => 'mysql',
'persistent' => false,
'host' => '*****',
'login' => '*****',
Expand Down

0 comments on commit 1b9b90d

Please sign in to comment.