modify plugin name
This commit is contained in:
@@ -13,13 +13,12 @@ namespace Kiri\Abstracts;
|
|||||||
use Exception;
|
use Exception;
|
||||||
use Kiri;
|
use Kiri;
|
||||||
use Kiri\Di\LocalService;
|
use Kiri\Di\LocalService;
|
||||||
use Kiri\Error\{ErrorHandler, StdoutLoggerInterface, StdoutLogger};
|
use Kiri\Error\{ErrorHandler, StdoutLogger, StdoutLoggerInterface};
|
||||||
use Kiri\Exception\{InitException, NotFindClassException};
|
use Kiri\Exception\{InitException};
|
||||||
|
use Kiri\Server\{Server};
|
||||||
use Psr\Container\ContainerExceptionInterface;
|
use Psr\Container\ContainerExceptionInterface;
|
||||||
use Psr\Container\NotFoundExceptionInterface;
|
use Psr\Container\NotFoundExceptionInterface;
|
||||||
use Kiri\Server\{Server};
|
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use ReflectionException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class BaseApplication
|
* Class BaseApplication
|
||||||
@@ -178,7 +177,6 @@ abstract class BaseApplication extends Component
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $key
|
* @param $key
|
||||||
* @param $value
|
* @param $value
|
||||||
@@ -237,7 +235,7 @@ abstract class BaseApplication extends Component
|
|||||||
*/
|
*/
|
||||||
public function initErrorHandler()
|
public function initErrorHandler()
|
||||||
{
|
{
|
||||||
$error = $this->container->get(ErrorHandler::class);
|
$error = Kiri::getDi()->get(ErrorHandler::class);
|
||||||
$error->register();
|
$error->register();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,7 +247,7 @@ abstract class BaseApplication extends Component
|
|||||||
*/
|
*/
|
||||||
public function get($name): mixed
|
public function get($name): mixed
|
||||||
{
|
{
|
||||||
return $this->container->get(LocalService::class)->get($name);
|
return Kiri::getDi()->get(LocalService::class)->get($name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -272,17 +270,7 @@ abstract class BaseApplication extends Component
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Logger
|
*
|
||||||
* @throws
|
|
||||||
*/
|
|
||||||
public function getLogger(): Logger
|
|
||||||
{
|
|
||||||
return $this->get('logger');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Server
|
* @return Server
|
||||||
* @throws
|
* @throws
|
||||||
*/
|
*/
|
||||||
@@ -292,6 +280,20 @@ abstract class BaseApplication extends Component
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $name
|
||||||
|
* @return mixed|null
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function __get(string $name)
|
||||||
|
{
|
||||||
|
$localService = Kiri::getDi()->get(LocalService::class);
|
||||||
|
if ($localService->has($name)) {
|
||||||
|
return $localService->get($name);
|
||||||
|
}
|
||||||
|
return parent::__get($name); // TODO: Change the autogenerated stub
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $id
|
* @param $id
|
||||||
@@ -299,7 +301,7 @@ abstract class BaseApplication extends Component
|
|||||||
*/
|
*/
|
||||||
public function set($id, $definition): void
|
public function set($id, $definition): void
|
||||||
{
|
{
|
||||||
$this->container->get(LocalService::class)->set($id, $definition);
|
Kiri::getDi()->get(LocalService::class)->set($id, $definition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -309,6 +311,6 @@ abstract class BaseApplication extends Component
|
|||||||
*/
|
*/
|
||||||
public function has($id): bool
|
public function has($id): bool
|
||||||
{
|
{
|
||||||
return $this->container->get(LocalService::class)->has($id);
|
return Kiri::getDi()->get(LocalService::class)->has($id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user