mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
SchemaShell always uses --file param when present.
Addresses **part** of the problem described in #4174. Corrects SchemaShell's startup logic so that when a `--file` param is provided by the user, it is always used even in the case that it matches the default file name (schema.php). This solves a problem when a user wishes to provide a classname using `--name`, but still wants to use the default filename.
This commit is contained in:
parent
ffefa6425f
commit
f93029b29f
1 changed files with 3 additions and 7 deletions
|
@ -66,13 +66,10 @@ class SchemaShell extends AppShell {
|
|||
list($this->params['plugin'], $splitName) = pluginSplit($name);
|
||||
$name = $this->params['name'] = $splitName;
|
||||
}
|
||||
|
||||
$defaultFile = 'schema.php';
|
||||
if (empty($this->params['file'])) {
|
||||
$this->params['file'] = $defaultFile;
|
||||
}
|
||||
if ($name && $this->params['file'] === $defaultFile) {
|
||||
if ($name && empty($this->params['file']) {
|
||||
$this->params['file'] = Inflector::underscore($name);
|
||||
} else {
|
||||
$this->params['file'] = 'schema.php';
|
||||
}
|
||||
if (strpos($this->params['file'], '.php') === false) {
|
||||
$this->params['file'] .= '.php';
|
||||
|
@ -483,7 +480,6 @@ class SchemaShell extends AppShell {
|
|||
);
|
||||
$file = array(
|
||||
'help' => __d('cake_console', 'File name to read and write.'),
|
||||
'default' => 'schema.php'
|
||||
);
|
||||
$name = array(
|
||||
'help' => __d('cake_console',
|
||||
|
|
Loading…
Add table
Reference in a new issue