This commit is contained in:
as2252258@163.com
2021-08-11 01:04:57 +08:00
parent 63d8eaa4a5
commit 682246df28
219 changed files with 790 additions and 791 deletions
+21 -21
View File
@@ -7,7 +7,7 @@
*/
declare(strict_types=1);
namespace Snowflake\Abstracts;
namespace Kiri\Abstracts;
use Annotation\Annotation as SAnnotation;
@@ -28,22 +28,22 @@ use ReflectionException;
use Rpc\Producer;
use Rpc\Service;
use Server\ServerManager;
use Snowflake\Aop;
use Snowflake\Async;
use Snowflake\Cache\Redis;
use Snowflake\Di\LocalService;
use Snowflake\Error\ErrorHandler;
use Snowflake\Error\Logger;
use Snowflake\Event;
use Snowflake\Exception\InitException;
use Snowflake\Exception\NotFindClassException;
use Snowflake\Jwt\Jwt;
use Snowflake\Snowflake;
use Kiri\Aop;
use Kiri\Async;
use Kiri\Cache\Redis;
use Kiri\Di\LocalService;
use Kiri\Error\ErrorHandler;
use Kiri\Error\Logger;
use Kiri\Event;
use Kiri\Exception\InitException;
use Kiri\Exception\NotFindClassException;
use Kiri\Jwt\Jwt;
use Kiri\Kiri;
use Swoole\Table;
/**
* Class BaseApplication
* @package Snowflake\Snowflake\Base
* @package Kiri\Kiri\Base
*/
abstract class BaseApplication extends Component
{
@@ -66,7 +66,7 @@ abstract class BaseApplication extends Component
*/
public function __construct()
{
Snowflake::init($this);
Kiri::init($this);
$config = sweep(APP_PATH . '/config');
@@ -170,7 +170,7 @@ abstract class BaseApplication extends Component
* @param $name
* @return mixed
* @throws \ReflectionException
* @throws \Snowflake\Exception\NotFindClassException
* @throws \Kiri\Exception\NotFindClassException
*/
public function __get($name): mixed
{
@@ -193,7 +193,7 @@ abstract class BaseApplication extends Component
}
foreach ($config['events'] as $key => $value) {
if (is_string($value)) {
$value = Snowflake::createObject($value);
$value = Kiri::createObject($value);
}
$this->addEvent($key, $value);
}
@@ -225,7 +225,7 @@ abstract class BaseApplication extends Component
}
if (is_string($value[0])) {
$value[0] = Snowflake::createObject($value[0]);
$value[0] = Kiri::createObject($value[0]);
Event::on($key, $value, true);
return;
}
@@ -265,7 +265,7 @@ abstract class BaseApplication extends Component
* @param $name
* @return mixed
* @throws \ReflectionException
* @throws \Snowflake\Exception\NotFindClassException
* @throws \Kiri\Exception\NotFindClassException
*/
public function get($name): mixed
{
@@ -422,7 +422,7 @@ abstract class BaseApplication extends Component
/**
* @param $array
* @throws \ReflectionException
* @throws \Snowflake\Exception\NotFindClassException
* @throws \Kiri\Exception\NotFindClassException
*/
private function setComponents($array): void
{
@@ -434,7 +434,7 @@ abstract class BaseApplication extends Component
* @param $id
* @param $definition
* @throws \ReflectionException
* @throws \Snowflake\Exception\NotFindClassException
* @throws \Kiri\Exception\NotFindClassException
*/
public function set($id, $definition): void
{
@@ -446,7 +446,7 @@ abstract class BaseApplication extends Component
* @param $id
* @param $definition
* @throws \ReflectionException
* @throws \Snowflake\Exception\NotFindClassException
* @throws \Kiri\Exception\NotFindClassException
*/
public function has($id): bool
{
+3 -3
View File
@@ -1,16 +1,16 @@
<?php
declare(strict_types=1);
namespace Snowflake\Abstracts;
namespace Kiri\Abstracts;
use Exception;
use HttpServer\Exception\ExitException;
use Snowflake\Core\Json;
use Kiri\Core\Json;
/**
* Class BaseGoto
* @package Snowflake\Abstracts
* @package Kiri\Abstracts
*/
class BaseGoto extends Component
{
+6 -6
View File
@@ -7,17 +7,17 @@
*/
declare(strict_types=1);
namespace Snowflake\Abstracts;
namespace Kiri\Abstracts;
use Exception;
use JetBrains\PhpStorm\Pure;
use Snowflake\Error\Logger;
use Snowflake\Snowflake;
use Kiri\Error\Logger;
use Kiri\Kiri;
use Swoole\Coroutine;
/**
* Class BaseObject
* @package Snowflake\Snowflake\Base
* @package Kiri\Kiri\Base
*/
class BaseObject implements Configure
{
@@ -31,7 +31,7 @@ class BaseObject implements Configure
public function __construct(array $config = [])
{
if (!empty($config) && is_array($config)) {
Snowflake::configure($this, $config);
Kiri::configure($this, $config);
}
}
@@ -128,7 +128,7 @@ class BaseObject implements Configure
*/
private function logger(): Logger
{
return Snowflake::app()->getLogger();
return Kiri::app()->getLogger();
}
+1 -1
View File
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
namespace Snowflake\Abstracts;
namespace Kiri\Abstracts;
abstract class Command extends Component
+4 -4
View File
@@ -7,18 +7,18 @@
*/
declare(strict_types=1);
namespace Snowflake\Abstracts;
namespace Kiri\Abstracts;
use Exception;
use JetBrains\PhpStorm\Pure;
use Snowflake\Exception\ComponentException;
use Snowflake\Snowflake;
use Kiri\Exception\ComponentException;
use Kiri\Kiri;
/**
* Class Component
* @package Snowflake\Snowflake\Base
* @package Kiri\Kiri\Base
*/
class Component extends BaseObject
{
+8 -8
View File
@@ -7,16 +7,16 @@
*/
declare(strict_types=1);
namespace Snowflake\Abstracts;
namespace Kiri\Abstracts;
use Exception;
use Snowflake\Exception\ConfigException;
use Snowflake\Snowflake;
use Kiri\Exception\ConfigException;
use Kiri\Kiri;
/**
* Class Config
* @package Snowflake\Snowflake\Base
* @package Kiri\Kiri\Base
*/
class Config extends Component
{
@@ -52,7 +52,7 @@ class Config extends Component
*/
public static function sets(array $configs)
{
$config = Snowflake::app()->getConfig();
$config = Kiri::app()->getConfig();
if (empty($configs)) {
return;
}
@@ -68,7 +68,7 @@ class Config extends Component
*/
public static function get($key, mixed $default = null, bool $try = FALSE): mixed
{
$instance = Snowflake::app()->getConfig()->getData();
$instance = Kiri::app()->getConfig()->getData();
if (!str_contains($key, '.')) {
return $instance[$key] ?? $default;
}
@@ -98,7 +98,7 @@ class Config extends Component
*/
public static function set($key, $value): mixed
{
$config = Snowflake::app()->getConfig();
$config = Kiri::app()->getConfig();
return $config->setData($key, $value);
}
@@ -110,7 +110,7 @@ class Config extends Component
*/
public static function has($key, bool $must_not_null = false): bool
{
$config = Snowflake::app()->getConfig();
$config = Kiri::app()->getConfig();
if (!isset($config->data[$key])) {
return false;
}
+2 -2
View File
@@ -6,11 +6,11 @@
* Time: 14:11
*/
declare(strict_types=1);
namespace Snowflake\Abstracts;
namespace Kiri\Abstracts;
/**
* Interface Configure
* @package Snowflake\Snowflake\Base
* @package Kiri\Kiri\Base
*/
interface Configure
{
+3 -3
View File
@@ -2,15 +2,15 @@
declare(strict_types=1);
namespace Snowflake\Abstracts;
namespace Kiri\Abstracts;
use Snowflake\Core\Dtl;
use Kiri\Core\Dtl;
/**
* Interface IListener
* @package Snowflake\Abstracts
* @package Kiri\Abstracts
*/
interface IListener
{
+1 -1
View File
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
namespace Snowflake\Abstracts;
namespace Kiri\Abstracts;
use Exception;
+1 -1
View File
@@ -1,7 +1,7 @@
<?php
namespace Snowflake\Abstracts;
namespace Kiri\Abstracts;
interface Kernel
+2 -2
View File
@@ -1,14 +1,14 @@
<?php
declare(strict_types=1);
namespace Snowflake\Abstracts;
namespace Kiri\Abstracts;
use Exception;
/**
* Class Listener
* @package Snowflake\Abstracts
* @package Kiri\Abstracts
* 监听的名称
*/
abstract class Listener extends Component implements IListener
+2 -2
View File
@@ -1,10 +1,10 @@
<?php
declare(strict_types=1);
namespace Snowflake\Abstracts;
namespace Kiri\Abstracts;
use Snowflake\Application;
use Kiri\Application;
interface Provider
{
+2 -2
View File
@@ -1,12 +1,12 @@
<?php
declare(strict_types=1);
namespace Snowflake\Abstracts;
namespace Kiri\Abstracts;
/**
* Class Providers
* @package Snowflake\Abstracts
* @package Kiri\Abstracts
*/
abstract class Providers extends Component implements Provider
{
+10 -10
View File
@@ -1,7 +1,7 @@
<?php
namespace Snowflake\Abstracts;
namespace Kiri\Abstracts;
use Annotation\Annotation as SAnnotation;
@@ -16,17 +16,17 @@ use HttpServer\Route\Router;
use HttpServer\Server;
use HttpServer\Shutdown;
use Rpc\Producer as RPCProducer;
use Snowflake\Async;
use Snowflake\Cache\Redis;
use Snowflake\Error\Logger;
use Snowflake\Event;
use Snowflake\Jwt\Jwt;
use Snowflake\Pool\Connection;
use Snowflake\Pool\Pool;
use Kiri\Async;
use Kiri\Cache\Redis;
use Kiri\Error\Logger;
use Kiri\Event;
use Kiri\Jwt\Jwt;
use Kiri\Pool\Connection;
use Kiri\Pool\Pool;
/**
* Trait TraitApplication
* @package Snowflake\Abstracts
* @package Kiri\Abstracts
* @property Event $event
* @property Router $router
* @property \Redis|Redis $redis
@@ -43,7 +43,7 @@ use Snowflake\Pool\Pool;
* @property Client $client
* @property \Database\Connection $databases
* @property Curl $curl
* @property \Snowflake\Crontab\Producer $crontab
* @property \Kiri\Crontab\Producer $crontab
* @property HttpFilter $filter
* @property RPCProducer $rpc
* @property Shutdown $shutdown