2020-09-02 18:13:16 +08:00
|
|
|
<?php
|
2020-10-29 18:17:25 +08:00
|
|
|
declare(strict_types=1);
|
2020-09-02 18:13:16 +08:00
|
|
|
|
2021-09-02 13:59:00 +08:00
|
|
|
namespace Server;
|
2020-09-02 18:13:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
use Exception;
|
2021-08-11 01:04:57 +08:00
|
|
|
use Kiri\Abstracts\Providers;
|
|
|
|
|
use Kiri\Application;
|
2021-09-02 11:26:11 +08:00
|
|
|
use Kiri\Kiri;
|
2020-09-02 18:13:16 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class DatabasesProviders
|
|
|
|
|
* @package Database
|
|
|
|
|
*/
|
2020-09-02 18:21:22 +08:00
|
|
|
class ServerProviders extends Providers
|
2020-09-02 18:13:16 +08:00
|
|
|
{
|
|
|
|
|
|
2020-09-02 18:21:22 +08:00
|
|
|
|
2020-09-02 18:13:16 +08:00
|
|
|
/**
|
2021-03-01 16:51:34 +08:00
|
|
|
* @param Application $application
|
2020-09-02 18:13:16 +08:00
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
2021-03-01 16:51:34 +08:00
|
|
|
public function onImport(Application $application)
|
2020-09-02 18:13:16 +08:00
|
|
|
{
|
2020-09-03 00:48:54 +08:00
|
|
|
$application->set('server', ['class' => Server::class]);
|
2020-09-03 00:15:57 +08:00
|
|
|
|
2021-09-02 11:26:11 +08:00
|
|
|
$container = Kiri::getDi();
|
|
|
|
|
|
|
|
|
|
$console = $container->get(\Symfony\Component\Console\Application::class);
|
2021-09-02 13:59:00 +08:00
|
|
|
$console->add($container->get(ServerCommand::class));
|
2021-09-02 11:26:11 +08:00
|
|
|
|
2020-09-02 18:13:16 +08:00
|
|
|
}
|
|
|
|
|
}
|