Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removing while() loops wrapping in() with concrete options.

  • Loading branch information...
commit fe2e3d82fd1e2185680c64d89967d00b2864d915 1 parent 5843d5e
@markstory markstory authored
Showing with 10 additions and 21 deletions.
  1. +10 −21 cake/console/libs/tasks/db_config.php
View
31 cake/console/libs/tasks/db_config.php
@@ -101,29 +101,22 @@ function __interactive() {
$this->out('The name must start with an unaccented latin character or an underscore');
}
}
- $driver = '';
- while ($driver == '') {
- $driver = $this->in('Driver:', array('db2', 'firebird', 'mssql', 'mysql', 'mysqli', 'odbc', 'oracle', 'postgres', 'sqlite', 'sybase'), 'mysql');
- }
- $persistent = '';
-
- while ($persistent == '') {
- $persistent = $this->in('Persistent Connection?', array('y', 'n'), 'n');
- }
+ $driver = $this->in('Driver:', array('db2', 'firebird', 'mssql', 'mysql', 'mysqli', 'odbc', 'oracle', 'postgres', 'sqlite', 'sybase'), 'mysql');
+ $persistent = $this->in('Persistent Connection?', array('y', 'n'), 'n');
if (low($persistent) == 'n') {
$persistent = 'false';
} else {
$persistent = 'true';
}
- $host = '';
+ $host = '';
while ($host == '') {
$host = $this->in('Database Host:', null, 'localhost');
}
- $port = '';
+ $port = '';
while ($port == '') {
$port = $this->in('Port?', null, 'n');
}
@@ -131,8 +124,8 @@ function __interactive() {
if (low($port) == 'n') {
$port = null;
}
- $login = '';
+ $login = '';
while ($login == '') {
$login = $this->in('User:', null, 'root');
}
@@ -144,43 +137,39 @@ function __interactive() {
if ($password == '') {
$blank = $this->in('The password you supplied was empty. Use an empty password?', array('y', 'n'), 'n');
- if ($blank == 'y')
- {
+ if ($blank == 'y') {
$blankPassword = true;
}
}
}
- $database = '';
+ $database = '';
while ($database == '') {
$database = $this->in('Database Name:', null, 'cake');
}
- $prefix = '';
+ $prefix = '';
while ($prefix == '') {
$prefix = $this->in('Table Prefix?', null, 'n');
}
-
if (low($prefix) == 'n') {
$prefix = null;
}
- $encoding = '';
+ $encoding = '';
while ($encoding == '') {
$encoding = $this->in('Table encoding?', null, 'n');
}
-
if (low($encoding) == 'n') {
$encoding = null;
}
- $schema = '';
+ $schema = '';
if ($driver == 'postgres') {
while ($schema == '') {
$schema = $this->in('Table schema?', null, 'n');
}
}
-
if (low($schema) == 'n') {
$schema = null;
}
Please sign in to comment.
Something went wrong with that request. Please try again.