安装修改
This commit is contained in:
parent
1ce4c7122a
commit
8479522970
@ -17,7 +17,7 @@ class InstallCommand extends Command
|
|||||||
|
|
||||||
protected function configure()
|
protected function configure()
|
||||||
{
|
{
|
||||||
$this->setName('install:project')
|
$this->setName('catch:install')
|
||||||
// ->addArgument('module', Argument::REQUIRED, 'module name')
|
// ->addArgument('module', Argument::REQUIRED, 'module name')
|
||||||
->setDescription('install project');
|
->setDescription('install project');
|
||||||
}
|
}
|
||||||
@ -143,27 +143,29 @@ class InstallCommand extends Command
|
|||||||
*/
|
*/
|
||||||
protected function secondStep(): void
|
protected function secondStep(): void
|
||||||
{
|
{
|
||||||
$connections = \config('database.connections');
|
if (file_exists(root_path() . '.env')) {
|
||||||
|
$connections = \config('database.connections');
|
||||||
|
|
||||||
[
|
[
|
||||||
$connections['mysql']['hostname'],
|
$connections['mysql']['hostname'],
|
||||||
$connections['mysql']['database'],
|
$connections['mysql']['database'],
|
||||||
$connections['mysql']['username'],
|
$connections['mysql']['username'],
|
||||||
$connections['mysql']['password'],
|
$connections['mysql']['password'],
|
||||||
$connections['mysql']['hostport'],
|
$connections['mysql']['hostport'],
|
||||||
$connections['mysql']['charset'],
|
$connections['mysql']['charset'],
|
||||||
$connections['mysql']['prefix'],
|
$connections['mysql']['prefix'],
|
||||||
] = $this->databaseLink;
|
] = $this->databaseLink;
|
||||||
|
|
||||||
\config([
|
\config([
|
||||||
'connections' => $connections,
|
'connections' => $connections,
|
||||||
],'database');
|
], 'database');
|
||||||
|
|
||||||
foreach (CatchAdmin::getModulesDirectory() as $directory) {
|
foreach (CatchAdmin::getModulesDirectory() as $directory) {
|
||||||
$moduleInfo = CatchAdmin::getModuleInfo($directory);
|
$moduleInfo = CatchAdmin::getModuleInfo($directory);
|
||||||
if (is_dir(CatchAdmin::moduleMigrationsDirectory($moduleInfo['alias']))) {
|
if (is_dir(CatchAdmin::moduleMigrationsDirectory($moduleInfo['alias']))) {
|
||||||
$output = Console::call('catch-migrate:run', [$moduleInfo['alias']]);
|
$output = Console::call('catch-migrate:run', [$moduleInfo['alias']]);
|
||||||
$this->output->info(sprintf('module [%s] migrations %s', $moduleInfo['alias'], $output->fetch()));
|
$this->output->info(sprintf('module [%s] migrations %s', $moduleInfo['alias'], $output->fetch()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user