mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-20 23:25:35 +08:00
update to 3.0.0-alpha2 (build 610): refactor driver
This commit is contained in:
@@ -8,7 +8,6 @@ use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use ZM\Config\ZMConfig;
|
||||
use ZM\Utils\DataProvider;
|
||||
|
||||
class SystemdGenerateCommand extends Command
|
||||
{
|
||||
@@ -22,7 +21,7 @@ class SystemdGenerateCommand extends Command
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
ZMConfig::setDirectory(DataProvider::getSourceRootDir() . '/config');
|
||||
ZMConfig::setDirectory(SOURCE_ROOT_DIR . '/config');
|
||||
$path = $this->generate();
|
||||
$output->writeln('<info>成功生成 systemd 文件,位置:' . $path . '</info>');
|
||||
$output->writeln('<info>有关如何使用 systemd 配置文件,请访问 `https://github.com/zhamao-robot/zhamao-framework/issues/36`</info>');
|
||||
@@ -38,8 +37,7 @@ class SystemdGenerateCommand extends Command
|
||||
global $argv;
|
||||
$s .= "\nExecStart=" . PHP_BINARY . " {$argv[0]} server";
|
||||
$s .= "\nRestart=always\n\n[Install]\nWantedBy=multi-user.target\n";
|
||||
@mkdir(getcwd() . '/resources/');
|
||||
file_put_contents(ZMConfig::get('global', 'zm_data') . 'zhamao.service', $s);
|
||||
return ZMConfig::get('global', 'zm_data') . 'zhamao.service';
|
||||
file_put_contents(WORKING_DIR . '/zhamao.service', $s);
|
||||
return WORKING_DIR . '/zhamao.service';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user