2022-01-09 03:49:02 +08:00
|
|
|
<?php
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2022-01-10 11:39:55 +08:00
|
|
|
namespace Kiri\Server;
|
2022-01-09 03:49:02 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
use Kiri\Abstracts\Providers;
|
2022-06-22 16:29:41 +08:00
|
|
|
use Kiri\Di\LocalService;
|
|
|
|
|
use Psr\Container\ContainerExceptionInterface;
|
|
|
|
|
use Psr\Container\NotFoundExceptionInterface;
|
|
|
|
|
use Symfony\Component\Console\Application;
|
2022-01-12 14:10:32 +08:00
|
|
|
use Kiri;
|
2022-01-09 03:49:02 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class DatabasesProviders
|
|
|
|
|
* @package Database
|
|
|
|
|
*/
|
|
|
|
|
class ServerProviders extends Providers
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2022-06-22 16:29:41 +08:00
|
|
|
* @param LocalService $application
|
|
|
|
|
* @throws ContainerExceptionInterface
|
|
|
|
|
* @throws NotFoundExceptionInterface
|
2022-01-09 03:49:02 +08:00
|
|
|
*/
|
2023-04-21 22:26:43 +08:00
|
|
|
public function onImport(LocalService $application): void
|
2022-01-09 03:49:02 +08:00
|
|
|
{
|
2022-06-22 16:29:41 +08:00
|
|
|
$server = $this->container->get(ServerCommand::class);
|
2022-01-09 03:49:02 +08:00
|
|
|
|
2022-06-22 16:29:41 +08:00
|
|
|
$console = $this->container->get(Application::class);
|
|
|
|
|
$console->add($server);
|
2023-04-18 22:20:20 +08:00
|
|
|
$console->add(new HotReload());
|
2022-01-09 03:49:02 +08:00
|
|
|
}
|
|
|
|
|
}
|