Files
kiri-core/System/Runtime.php
T

43 lines
675 B
PHP
Raw Normal View History

2021-04-07 23:50:11 +08:00
<?php
namespace Snowflake;
use Console\Command;
2021-04-14 17:47:10 +08:00
use Exception;
2021-04-07 23:50:11 +08:00
use Snowflake\Abstracts\Input;
/**
2021-04-09 09:55:30 +08:00
* Class Runtime
2021-04-07 23:50:11 +08:00
* @package Snowflake
*/
class Runtime extends Command
{
public string $command = 'runtime:builder';
2021-04-09 09:55:30 +08:00
public string $description = 'create app file cache';
2021-04-07 23:50:11 +08:00
2021-05-04 03:43:22 +08:00
const CACHE_NAME = '.runtime.cache';
2021-04-09 09:51:17 +08:00
/**
* @param Input $dtl
2021-04-14 17:47:10 +08:00
* @throws Exception
2021-04-09 09:51:17 +08:00
*/
2021-04-07 23:50:11 +08:00
public function onHandler(Input $dtl)
{
// TODO: Implement onHandler() method.
$annotation = Snowflake::app()->getAnnotation();
2021-05-04 03:43:22 +08:00
$runtime = storage(static::CACHE_NAME);
2021-04-07 23:50:11 +08:00
Snowflake::writeFile($runtime, serialize($annotation->getLoader()));
}
}