This commit is contained in:
as2252258@163.com
2021-04-07 23:50:11 +08:00
parent a0f0f7edd7
commit 3e3124fe22
2 changed files with 39 additions and 0 deletions
+2
View File
@@ -136,7 +136,9 @@ class Application extends BaseApplication
try {
fire(Event::SERVER_BEFORE_START);
/** @var Console $manager */
$manager = Snowflake::app()->get('console');
$manager->register(Runtime::class);
$manager->setParameters($argv);
$class = $manager->search();
response()->send($manager->execCommand($class));
+37
View File
@@ -0,0 +1,37 @@
<?php
namespace Snowflake;
use Console\Command;
use Snowflake\Abstracts\Input;
/**
* Class Runtimer
* @package Snowflake
*/
class Runtime extends Command
{
public string $command = 'runtime:builder';
/**
* @param Input $dtl
*/
public function onHandler(Input $dtl)
{
// TODO: Implement onHandler() method.
$annotation = Snowflake::app()->getAnnotation();
$annotation->read(APP_PATH, 'App');
$runtime = storage('runtime.php');
Snowflake::writeFile($runtime, serialize($annotation->getLoader()));
}
}