This commit is contained in:
2021-09-16 11:51:20 +08:00
parent f5aeab0daf
commit f738099c66
8 changed files with 21 additions and 673 deletions
-7
View File
@@ -13,12 +13,8 @@ namespace Kiri\Abstracts;
use Annotation\Annotation as SAnnotation;
use Database\Connection;
use Exception;
use Http\Context\HttpHeaders;
use Http\Context\HttpParams;
use Http\Route\Router;
use Server\Server;
use Http\Shutdown;
use JetBrains\PhpStorm\Pure;
use Kafka\KafkaProvider;
use Kiri\AspectManager;
use Kiri\Async;
@@ -465,12 +461,9 @@ abstract class BaseApplication extends Component
'annotation' => ['class' => SAnnotation::class],
'databases' => ['class' => Connection::class],
'aop' => ['class' => AspectManager::class],
'input' => ['class' => HttpParams::class],
'header' => ['class' => HttpHeaders::class],
'jwt' => ['class' => Jwt::class],
'async' => ['class' => Async::class],
'kafka-container' => ['class' => KafkaProvider::class],
'shutdown' => ['class' => Shutdown::class],
]);
}
}
-2
View File
@@ -12,7 +12,6 @@ use Http\Client\Curl;
use Http\HttpFilter;
use Http\Route\Router;
use Server\Server;
use Http\Shutdown;
use Kiri\Crontab\Producer;
use Kiri\Async;
use Kiri\Error\Logger;
@@ -34,7 +33,6 @@ use Kiri\Jwt\Jwt;
* @property Curl $curl
* @property Producer $crontab
* @property HttpFilter $filter
* @property Shutdown $shutdown
*/
trait TraitApplication
{
+18 -2
View File
@@ -101,11 +101,27 @@ class Kiri
return static::$service;
}
/**
* @return Application|null
*/
public static function getApplicationContext(): ?Application
{
return static::$service;
}
/**
* @return Container|null
*/
public static function getContainerContext(): ?Container
{
return static::$container;
}
/**
* @param $name
* @return bool
* @throws NotFindClassException
* @throws ReflectionException
*/
public static function has($name): bool
{