modify
This commit is contained in:
@@ -136,7 +136,9 @@ class Application extends BaseApplication
|
|||||||
try {
|
try {
|
||||||
fire(Event::SERVER_BEFORE_START);
|
fire(Event::SERVER_BEFORE_START);
|
||||||
|
|
||||||
|
/** @var Console $manager */
|
||||||
$manager = Snowflake::app()->get('console');
|
$manager = Snowflake::app()->get('console');
|
||||||
|
$manager->register(Runtime::class);
|
||||||
$manager->setParameters($argv);
|
$manager->setParameters($argv);
|
||||||
$class = $manager->search();
|
$class = $manager->search();
|
||||||
response()->send($manager->execCommand($class));
|
response()->send($manager->execCommand($class));
|
||||||
|
|||||||
@@ -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()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user