Files
kiri-core/Gii/Command.php
T

41 lines
663 B
PHP
Raw Normal View History

2020-09-08 15:59:15 +08:00
<?php
2020-10-30 01:07:28 +08:00
declare(strict_types=1);
2020-09-08 15:59:15 +08:00
namespace Gii;
use Exception;
use Snowflake\Abstracts\Input;
use Snowflake\Exception\ConfigException;
use Snowflake\Snowflake;
/**
* Class Command
* @package HttpServer
*/
class Command extends \Console\Command
{
2020-10-30 01:07:28 +08:00
public string $command = 'sw:gii';
2020-09-08 15:59:15 +08:00
2020-10-30 01:07:28 +08:00
public string $description = 'server start|stop|reload|restart';
2020-09-08 15:59:15 +08:00
/**
* @param Input $dtl
* @return array
* @throws Exception
*/
2020-12-17 14:09:14 +08:00
public function onHandler(Input $dtl): array
2020-09-08 15:59:15 +08:00
{
/** @var Gii $gii */
$gii = Snowflake::app()->get('gii');
$connections = Snowflake::app()->db->get($dtl->get('databases', 'db'));
return $gii->run($connections, $dtl);
}
}