2008-05-30 11:40:08 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* The DbConfig Task handles creating and updating the database.php
|
|
|
|
*
|
2010-10-03 16:38:58 +00:00
|
|
|
* PHP 5
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-11-06 06:46:59 +00:00
|
|
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
2013-02-08 11:59:49 +00:00
|
|
|
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
|
|
|
* Licensed under The MIT License
|
2013-02-08 12:22:51 +00:00
|
|
|
* For full copyright and license information, please see the LICENSE.txt
|
2008-05-30 11:40:08 +00:00
|
|
|
* Redistributions of files must retain the above copyright notice.
|
|
|
|
*
|
2013-02-08 11:59:49 +00:00
|
|
|
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2009-11-06 06:00:11 +00:00
|
|
|
* @link http://cakephp.org CakePHP(tm) Project
|
2008-10-30 17:30:26 +00:00
|
|
|
* @since CakePHP(tm) v 1.2
|
2009-11-06 06:51:51 +00:00
|
|
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2011-11-25 21:05:00 +00:00
|
|
|
App::uses('AppShell', 'Console/Command');
|
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Task class for creating and updating the database configuration file.
|
|
|
|
*
|
2011-07-26 06:16:14 +00:00
|
|
|
* @package Cake.Console.Command.Task
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2011-11-25 21:05:00 +00:00
|
|
|
class DbConfigTask extends AppShell {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* path to CONFIG directory
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
2010-04-04 07:14:00 +00:00
|
|
|
public $path = null;
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Default configuration settings to use
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
2010-06-09 02:14:48 +00:00
|
|
|
protected $_defaultConfig = array(
|
2010-10-23 04:35:30 +00:00
|
|
|
'name' => 'default',
|
2011-12-01 07:21:31 +00:00
|
|
|
'datasource' => 'Database/Mysql',
|
|
|
|
'persistent' => 'false',
|
|
|
|
'host' => 'localhost',
|
|
|
|
'login' => 'root',
|
|
|
|
'password' => 'password',
|
|
|
|
'database' => 'project_name',
|
|
|
|
'schema' => null,
|
|
|
|
'prefix' => null,
|
2010-10-23 04:35:30 +00:00
|
|
|
'encoding' => null,
|
|
|
|
'port' => null
|
2008-05-30 11:40:08 +00:00
|
|
|
);
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-05-21 03:15:31 +00:00
|
|
|
/**
|
|
|
|
* String name of the database config class name.
|
|
|
|
* Used for testing.
|
|
|
|
*
|
|
|
|
* @var string
|
2009-11-14 12:19:25 +00:00
|
|
|
*/
|
2010-04-04 07:14:00 +00:00
|
|
|
public $databaseClassName = 'DATABASE_CONFIG';
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* initialization callback
|
|
|
|
*
|
2011-07-29 02:03:44 +00:00
|
|
|
* @return void
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function initialize() {
|
2011-05-13 08:06:45 +00:00
|
|
|
$this->path = APP . 'Config' . DS;
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Execution method always used for tasks
|
|
|
|
*
|
2011-07-29 02:03:44 +00:00
|
|
|
* @return void
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function execute() {
|
2008-05-30 11:40:08 +00:00
|
|
|
if (empty($this->args)) {
|
2010-04-24 01:57:59 +00:00
|
|
|
$this->_interactive();
|
2008-06-04 19:04:58 +00:00
|
|
|
$this->_stop();
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Interactive interface
|
|
|
|
*
|
2010-04-24 01:57:59 +00:00
|
|
|
* @return void
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2010-04-24 01:57:59 +00:00
|
|
|
protected function _interactive() {
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->hr();
|
2012-01-16 03:16:45 +00:00
|
|
|
$this->out(__d('cake_console', 'Database Configuration:'));
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->hr();
|
|
|
|
$done = false;
|
|
|
|
$dbConfigs = array();
|
|
|
|
|
2012-09-14 17:26:30 +00:00
|
|
|
while (!$done) {
|
2008-05-30 11:40:08 +00:00
|
|
|
$name = '';
|
|
|
|
|
2012-09-14 17:42:25 +00:00
|
|
|
while (!$name) {
|
2011-04-25 19:17:59 +00:00
|
|
|
$name = $this->in(__d('cake_console', "Name:"), null, 'default');
|
2008-05-30 11:40:08 +00:00
|
|
|
if (preg_match('/[^a-z0-9_]/i', $name)) {
|
|
|
|
$name = '';
|
2011-04-25 19:17:59 +00:00
|
|
|
$this->out(__d('cake_console', 'The name may only contain unaccented latin characters, numbers or underscores'));
|
2012-02-23 13:38:02 +00:00
|
|
|
} elseif (preg_match('/^[^a-z_]/i', $name)) {
|
2008-05-30 11:40:08 +00:00
|
|
|
$name = '';
|
2011-04-25 19:17:59 +00:00
|
|
|
$this->out(__d('cake_console', 'The name must start with an unaccented latin character or an underscore'));
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-11-04 22:07:31 +00:00
|
|
|
$datasource = $this->in(__d('cake_console', 'Datasource:'), array('Mysql', 'Postgres', 'Sqlite', 'Sqlserver'), 'Mysql');
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2011-04-25 19:17:59 +00:00
|
|
|
$persistent = $this->in(__d('cake_console', 'Persistent Connection?'), array('y', 'n'), 'n');
|
2013-02-12 02:38:08 +00:00
|
|
|
if (strtolower($persistent) === 'n') {
|
2008-05-30 11:40:08 +00:00
|
|
|
$persistent = 'false';
|
|
|
|
} else {
|
|
|
|
$persistent = 'true';
|
|
|
|
}
|
|
|
|
|
2009-05-21 03:21:36 +00:00
|
|
|
$host = '';
|
2012-09-14 17:42:25 +00:00
|
|
|
while (!$host) {
|
2011-04-25 19:17:59 +00:00
|
|
|
$host = $this->in(__d('cake_console', 'Database Host:'), null, 'localhost');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
|
2009-05-21 03:21:36 +00:00
|
|
|
$port = '';
|
2012-09-14 17:42:25 +00:00
|
|
|
while (!$port) {
|
2011-04-25 19:17:59 +00:00
|
|
|
$port = $this->in(__d('cake_console', 'Port?'), null, 'n');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
|
2013-02-12 02:38:08 +00:00
|
|
|
if (strtolower($port) === 'n') {
|
2008-05-30 11:40:08 +00:00
|
|
|
$port = null;
|
|
|
|
}
|
|
|
|
|
2009-05-21 03:21:36 +00:00
|
|
|
$login = '';
|
2012-09-14 17:42:25 +00:00
|
|
|
while (!$login) {
|
2011-04-25 19:17:59 +00:00
|
|
|
$login = $this->in(__d('cake_console', 'User:'), null, 'root');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
$password = '';
|
|
|
|
$blankPassword = false;
|
|
|
|
|
2012-09-14 17:42:25 +00:00
|
|
|
while (!$password && !$blankPassword) {
|
2011-04-25 19:17:59 +00:00
|
|
|
$password = $this->in(__d('cake_console', 'Password:'));
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2012-09-14 17:42:25 +00:00
|
|
|
if (!$password) {
|
2011-04-25 19:17:59 +00:00
|
|
|
$blank = $this->in(__d('cake_console', 'The password you supplied was empty. Use an empty password?'), array('y', 'n'), 'n');
|
2013-02-12 02:38:08 +00:00
|
|
|
if ($blank === 'y') {
|
2008-05-30 11:40:08 +00:00
|
|
|
$blankPassword = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-05-21 03:21:36 +00:00
|
|
|
$database = '';
|
2012-09-14 17:42:25 +00:00
|
|
|
while (!$database) {
|
2011-04-25 19:17:59 +00:00
|
|
|
$database = $this->in(__d('cake_console', 'Database Name:'), null, 'cake');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
|
2009-05-21 03:21:36 +00:00
|
|
|
$prefix = '';
|
2012-09-14 17:42:25 +00:00
|
|
|
while (!$prefix) {
|
2011-04-25 19:17:59 +00:00
|
|
|
$prefix = $this->in(__d('cake_console', 'Table Prefix?'), null, 'n');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2013-02-12 02:38:08 +00:00
|
|
|
if (strtolower($prefix) === 'n') {
|
2008-05-30 11:40:08 +00:00
|
|
|
$prefix = null;
|
|
|
|
}
|
|
|
|
|
2009-05-21 03:21:36 +00:00
|
|
|
$encoding = '';
|
2012-09-14 17:42:25 +00:00
|
|
|
while (!$encoding) {
|
2011-04-25 19:17:59 +00:00
|
|
|
$encoding = $this->in(__d('cake_console', 'Table encoding?'), null, 'n');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2013-02-12 02:38:08 +00:00
|
|
|
if (strtolower($encoding) === 'n') {
|
2008-05-30 11:40:08 +00:00
|
|
|
$encoding = null;
|
|
|
|
}
|
|
|
|
|
2009-05-21 03:21:36 +00:00
|
|
|
$schema = '';
|
2013-02-12 02:38:08 +00:00
|
|
|
if ($datasource === 'postgres') {
|
2012-09-14 17:42:25 +00:00
|
|
|
while (!$schema) {
|
2011-04-25 19:17:59 +00:00
|
|
|
$schema = $this->in(__d('cake_console', 'Table schema?'), null, 'n');
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
}
|
2013-02-12 02:38:08 +00:00
|
|
|
if (strtolower($schema) === 'n') {
|
2008-05-30 11:40:08 +00:00
|
|
|
$schema = null;
|
|
|
|
}
|
|
|
|
|
2011-11-04 22:07:31 +00:00
|
|
|
$config = compact('name', 'datasource', 'persistent', 'host', 'login', 'password', 'database', 'prefix', 'encoding', 'port', 'schema');
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2012-09-14 17:26:30 +00:00
|
|
|
while (!$this->_verify($config)) {
|
2010-04-24 01:57:59 +00:00
|
|
|
$this->_interactive();
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2010-06-09 02:14:48 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
$dbConfigs[] = $config;
|
2011-04-25 19:17:59 +00:00
|
|
|
$doneYet = $this->in(__d('cake_console', 'Do you wish to add another database configuration?'), null, 'n');
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-02-12 02:38:08 +00:00
|
|
|
if (strtolower($doneYet === 'n')) {
|
2008-05-30 11:40:08 +00:00
|
|
|
$done = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->bake($dbConfigs);
|
|
|
|
config('database');
|
|
|
|
return true;
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Output verification message and bake if it looks good
|
|
|
|
*
|
2011-07-29 02:03:44 +00:00
|
|
|
* @param array $config
|
2008-05-30 11:40:08 +00:00
|
|
|
* @return boolean True if user says it looks good, false otherwise
|
|
|
|
*/
|
2010-06-09 02:14:48 +00:00
|
|
|
protected function _verify($config) {
|
|
|
|
$config = array_merge($this->_defaultConfig, $config);
|
2008-05-30 11:40:08 +00:00
|
|
|
extract($config);
|
2009-09-26 21:08:37 +00:00
|
|
|
$this->out();
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->hr();
|
2011-04-25 19:17:59 +00:00
|
|
|
$this->out(__d('cake_console', 'The following database configuration will be created:'));
|
2008-05-30 11:40:08 +00:00
|
|
|
$this->hr();
|
2011-04-25 19:17:59 +00:00
|
|
|
$this->out(__d('cake_console', "Name: %s", $name));
|
2013-01-23 23:20:41 +00:00
|
|
|
$this->out(__d('cake_console', "Datasource: %s", $datasource));
|
2011-04-25 19:17:59 +00:00
|
|
|
$this->out(__d('cake_console', "Persistent: %s", $persistent));
|
|
|
|
$this->out(__d('cake_console', "Host: %s", $host));
|
2008-05-30 11:40:08 +00:00
|
|
|
|
|
|
|
if ($port) {
|
2011-04-25 19:17:59 +00:00
|
|
|
$this->out(__d('cake_console', "Port: %s", $port));
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
|
2011-04-25 19:17:59 +00:00
|
|
|
$this->out(__d('cake_console', "User: %s", $login));
|
2011-04-25 19:35:27 +00:00
|
|
|
$this->out(__d('cake_console', "Pass: %s", str_repeat('*', strlen($password))));
|
|
|
|
$this->out(__d('cake_console', "Database: %s", $database));
|
2008-05-30 11:40:08 +00:00
|
|
|
|
|
|
|
if ($prefix) {
|
2011-04-25 19:17:59 +00:00
|
|
|
$this->out(__d('cake_console', "Table prefix: %s", $prefix));
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($schema) {
|
2011-04-25 19:17:59 +00:00
|
|
|
$this->out(__d('cake_console', "Schema: %s", $schema));
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($encoding) {
|
2011-04-25 19:17:59 +00:00
|
|
|
$this->out(__d('cake_console', "Encoding: %s", $encoding));
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$this->hr();
|
2011-04-25 19:17:59 +00:00
|
|
|
$looksGood = $this->in(__d('cake_console', 'Look okay?'), array('y', 'n'), 'y');
|
2008-05-30 11:40:08 +00:00
|
|
|
|
2013-02-12 02:38:08 +00:00
|
|
|
if (strtolower($looksGood) === 'y') {
|
2008-05-30 11:40:08 +00:00
|
|
|
return $config;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
|
|
|
* Assembles and writes database.php
|
|
|
|
*
|
|
|
|
* @param array $configs Configuration settings to use
|
|
|
|
* @return boolean Success
|
|
|
|
*/
|
2010-04-05 03:19:38 +00:00
|
|
|
public function bake($configs) {
|
2008-05-30 11:40:08 +00:00
|
|
|
if (!is_dir($this->path)) {
|
2011-04-25 19:17:59 +00:00
|
|
|
$this->err(__d('cake_console', '%s not found', $this->path));
|
2008-05-30 11:40:08 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
$filename = $this->path . 'database.php';
|
|
|
|
$oldConfigs = array();
|
|
|
|
|
|
|
|
if (file_exists($filename)) {
|
2009-11-09 17:30:09 +00:00
|
|
|
config('database');
|
2009-05-21 03:15:31 +00:00
|
|
|
$db = new $this->databaseClassName;
|
2008-05-30 11:40:08 +00:00
|
|
|
$temp = get_class_vars(get_class($db));
|
|
|
|
|
|
|
|
foreach ($temp as $configName => $info) {
|
2010-06-09 02:14:48 +00:00
|
|
|
$info = array_merge($this->_defaultConfig, $info);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
|
|
|
if (!isset($info['schema'])) {
|
|
|
|
$info['schema'] = null;
|
|
|
|
}
|
|
|
|
if (!isset($info['encoding'])) {
|
|
|
|
$info['encoding'] = null;
|
|
|
|
}
|
|
|
|
if (!isset($info['port'])) {
|
|
|
|
$info['port'] = null;
|
|
|
|
}
|
|
|
|
|
2012-09-14 17:54:29 +00:00
|
|
|
$info['persistent'] = var_export((bool)$info['persistent'], true);
|
2008-05-30 11:40:08 +00:00
|
|
|
|
|
|
|
$oldConfigs[] = array(
|
|
|
|
'name' => $configName,
|
2011-10-30 22:55:43 +00:00
|
|
|
'datasource' => $info['datasource'],
|
2008-05-30 11:40:08 +00:00
|
|
|
'persistent' => $info['persistent'],
|
|
|
|
'host' => $info['host'],
|
|
|
|
'port' => $info['port'],
|
|
|
|
'login' => $info['login'],
|
|
|
|
'password' => $info['password'],
|
|
|
|
'database' => $info['database'],
|
|
|
|
'prefix' => $info['prefix'],
|
|
|
|
'schema' => $info['schema'],
|
|
|
|
'encoding' => $info['encoding']
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($oldConfigs as $key => $oldConfig) {
|
2012-12-20 12:47:03 +00:00
|
|
|
foreach ($configs as $config) {
|
2008-05-30 11:40:08 +00:00
|
|
|
if ($oldConfig['name'] == $config['name']) {
|
|
|
|
unset($oldConfigs[$key]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$configs = array_merge($oldConfigs, $configs);
|
|
|
|
$out = "<?php\n";
|
|
|
|
$out .= "class DATABASE_CONFIG {\n\n";
|
|
|
|
|
|
|
|
foreach ($configs as $config) {
|
2010-10-18 02:54:07 +00:00
|
|
|
$config = array_merge($this->_defaultConfig, $config);
|
2008-05-30 11:40:08 +00:00
|
|
|
extract($config);
|
|
|
|
|
2012-09-20 00:55:39 +00:00
|
|
|
if (strpos($datasource, 'Database/') === false) {
|
|
|
|
$datasource = "Database/{$datasource}";
|
|
|
|
}
|
2010-10-18 02:54:07 +00:00
|
|
|
$out .= "\tpublic \${$name} = array(\n";
|
2012-09-20 00:55:39 +00:00
|
|
|
$out .= "\t\t'datasource' => '{$datasource}',\n";
|
2008-05-30 11:40:08 +00:00
|
|
|
$out .= "\t\t'persistent' => {$persistent},\n";
|
|
|
|
$out .= "\t\t'host' => '{$host}',\n";
|
|
|
|
|
|
|
|
if ($port) {
|
|
|
|
$out .= "\t\t'port' => {$port},\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
$out .= "\t\t'login' => '{$login}',\n";
|
|
|
|
$out .= "\t\t'password' => '{$password}',\n";
|
|
|
|
$out .= "\t\t'database' => '{$database}',\n";
|
|
|
|
|
|
|
|
if ($schema) {
|
|
|
|
$out .= "\t\t'schema' => '{$schema}',\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($prefix) {
|
|
|
|
$out .= "\t\t'prefix' => '{$prefix}',\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($encoding) {
|
|
|
|
$out .= "\t\t'encoding' => '{$encoding}'\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
$out .= "\t);\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
$out .= "}\n";
|
2009-05-21 03:15:31 +00:00
|
|
|
$filename = $this->path . 'database.php';
|
2008-05-30 11:40:08 +00:00
|
|
|
return $this->createFile($filename, $out);
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-04-29 00:44:23 +00:00
|
|
|
/**
|
|
|
|
* Get a user specified Connection name
|
|
|
|
*
|
|
|
|
* @return void
|
2009-11-14 12:19:25 +00:00
|
|
|
*/
|
2010-04-24 01:57:59 +00:00
|
|
|
public function getConfig() {
|
2010-12-09 03:45:18 +00:00
|
|
|
App::uses('ConnectionManager', 'Model');
|
2011-10-03 02:49:48 +00:00
|
|
|
$configs = ConnectionManager::enumConnectionObjects();
|
2009-11-04 18:21:05 +00:00
|
|
|
|
2011-10-03 16:38:08 +00:00
|
|
|
$useDbConfig = key($configs);
|
2011-10-03 02:49:48 +00:00
|
|
|
if (!is_array($configs) || empty($configs)) {
|
2009-04-29 00:44:23 +00:00
|
|
|
return $this->execute();
|
|
|
|
}
|
|
|
|
$connections = array_keys($configs);
|
2011-10-03 02:49:48 +00:00
|
|
|
|
2009-04-29 00:44:23 +00:00
|
|
|
if (count($connections) > 1) {
|
2012-03-03 23:55:07 +00:00
|
|
|
$useDbConfig = $this->in(__d('cake_console', 'Use Database Config') . ':', $connections, $useDbConfig);
|
2009-04-29 00:44:23 +00:00
|
|
|
}
|
|
|
|
return $useDbConfig;
|
|
|
|
}
|
2010-10-13 03:22:37 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* get the option parser
|
|
|
|
*
|
|
|
|
* @return ConsoleOptionParser
|
|
|
|
*/
|
|
|
|
public function getOptionParser() {
|
|
|
|
$parser = parent::getOptionParser();
|
|
|
|
return $parser->description(
|
2011-03-19 17:32:35 +00:00
|
|
|
__d('cake_console', 'Bake new database configuration settings.')
|
2010-10-13 03:22:37 +00:00
|
|
|
);
|
|
|
|
}
|
2012-03-03 23:55:07 +00:00
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|