modify
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
||||
namespace PHPSTORM_META {
|
||||
|
||||
// Reflect
|
||||
use Snowflake\Di\Container;
|
||||
use Kiri\Di\Container;
|
||||
|
||||
override(Container::get(0), map('@'));
|
||||
override(Container::newObject(0), map('@'));
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Annotation;
|
||||
use DirectoryIterator;
|
||||
use Exception;
|
||||
use ReflectionException;
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Kiri\Abstracts\Component;
|
||||
|
||||
/**
|
||||
* Class Annotation
|
||||
|
||||
@@ -5,9 +5,9 @@ namespace Annotation;
|
||||
|
||||
|
||||
use Exception;
|
||||
use Snowflake\Aop;
|
||||
use Snowflake\IAspect;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Aop;
|
||||
use Kiri\IAspect;
|
||||
use Kiri\Kiri;
|
||||
|
||||
defined('ASPECT_ERROR') or define('ASPECT_ERROR', 'Aspect annotation must implement ');
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Annotation;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\IInterface\Task;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
|
||||
/**
|
||||
@@ -36,7 +36,7 @@ use Snowflake\Snowflake;
|
||||
*/
|
||||
public function execute(mixed $class, mixed $method = null): bool
|
||||
{
|
||||
$async = Snowflake::app()->getAsync();
|
||||
$async = Kiri::app()->getAsync();
|
||||
$async->addAsync($this->name, $class);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ namespace Annotation;
|
||||
|
||||
|
||||
use Exception;
|
||||
use Snowflake\Exception\ComponentException;
|
||||
use Snowflake\Snowflake;
|
||||
use Snowflake\Event as SEvent;
|
||||
use Kiri\Exception\ComponentException;
|
||||
use Kiri\Kiri;
|
||||
use Kiri\Event as SEvent;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,8 +8,8 @@ use Exception;
|
||||
use HttpServer\Http\Context;
|
||||
use ReflectionException;
|
||||
use ReflectionProperty;
|
||||
use Snowflake\Core\Str;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Core\Str;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class Inject
|
||||
@@ -81,7 +81,7 @@ use Snowflake\Snowflake;
|
||||
return $method;
|
||||
}
|
||||
if (is_object($class)) $class = $class::class;
|
||||
$method = Snowflake::getDi()->getClassReflectionProperty($class, $method);
|
||||
$method = Kiri::getDi()->getClassReflectionProperty($class, $method);
|
||||
if (!$method || $method->isStatic()) {
|
||||
return false;
|
||||
}
|
||||
@@ -99,9 +99,9 @@ use Snowflake\Snowflake;
|
||||
return Context::getContext($this->value);
|
||||
}
|
||||
if (class_exists($this->value)) {
|
||||
return Snowflake::getDi()->get($this->value, $this->args);
|
||||
} else if (Snowflake::app()->has($this->value)) {
|
||||
return Snowflake::app()->get($this->value);
|
||||
return Kiri::getDi()->get($this->value, $this->args);
|
||||
} else if (Kiri::app()->has($this->value)) {
|
||||
return Kiri::app()->get($this->value);
|
||||
} else {
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Annotation;
|
||||
use Exception;
|
||||
use Kafka\ConsumerInterface;
|
||||
use Kafka\KafkaProvider;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class Kafka
|
||||
@@ -39,7 +39,7 @@ use Snowflake\Snowflake;
|
||||
}
|
||||
|
||||
/** @var KafkaProvider $container */
|
||||
$container = Snowflake::getDi()->get(KafkaProvider::class);
|
||||
$container = Kiri::getDi()->get(KafkaProvider::class);
|
||||
$container->addConsumer($this->topic, $class);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -8,8 +8,8 @@ use DirectoryIterator;
|
||||
use Exception;
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
use Snowflake\Abstracts\BaseObject;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Abstracts\BaseObject;
|
||||
use Kiri\Kiri;
|
||||
use Throwable;
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ class Loader extends BaseObject
|
||||
*/
|
||||
public function getProperty(string $class, string $property = ''): \ReflectionProperty|array|null
|
||||
{
|
||||
return Snowflake::getDi()->getClassReflectionProperty($class, $property);
|
||||
return Kiri::getDi()->getClassReflectionProperty($class, $property);
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ class Loader extends BaseObject
|
||||
*/
|
||||
public function injectProperty(string $class, object $handler): static
|
||||
{
|
||||
$di = Snowflake::getDi();
|
||||
$di = Kiri::getDi();
|
||||
|
||||
$reflect = $di->getReflect($class);
|
||||
|
||||
@@ -151,7 +151,7 @@ class Loader extends BaseObject
|
||||
*/
|
||||
private function getReflect(DirectoryIterator $path, string $namespace): ?ReflectionClass
|
||||
{
|
||||
return Snowflake::getDi()->getReflect($this->explodeFileName($path, $namespace));
|
||||
return Kiri::getDi()->getReflect($this->explodeFileName($path, $namespace));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ namespace Annotation;
|
||||
|
||||
|
||||
use Exception;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Event;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class LocalService
|
||||
@@ -29,7 +29,7 @@ use Snowflake\Snowflake;
|
||||
return;
|
||||
}
|
||||
Event::on(Event::SERVER_WORKER_EXIT, function () {
|
||||
Snowflake::app()->remove($this->service);
|
||||
Kiri::app()->remove($this->service);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ use Snowflake\Snowflake;
|
||||
$class = array_merge($class, $this->args);
|
||||
}
|
||||
|
||||
Snowflake::set($this->service, $class);
|
||||
Kiri::set($this->service, $class);
|
||||
return true; // TODO: Change the autogenerated stub
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Annotation\Model;
|
||||
|
||||
use Attribute;
|
||||
use Exception;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
|
||||
/**
|
||||
@@ -34,7 +34,7 @@ use Snowflake\Snowflake;
|
||||
*/
|
||||
public function execute(mixed $class, mixed $method = null): bool
|
||||
{
|
||||
$annotation = Snowflake::getAnnotation();
|
||||
$annotation = Kiri::getAnnotation();
|
||||
$annotation->addGets($class::class, $this->name, $method);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ use Annotation\Attribute;
|
||||
use Database\ActiveRecord;
|
||||
use Exception;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
|
||||
/**
|
||||
@@ -36,7 +36,7 @@ use Snowflake\Snowflake;
|
||||
*/
|
||||
public function execute(mixed $class, mixed $method = null): bool
|
||||
{
|
||||
$annotation = Snowflake::getAnnotation();
|
||||
$annotation = Kiri::getAnnotation();
|
||||
$annotation->addRelate($class::class, $this->name, $method);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Annotation\Model;
|
||||
use Annotation\Attribute;
|
||||
use Database\ActiveRecord;
|
||||
use Exception;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_METHOD)] class Set extends Attribute
|
||||
{
|
||||
@@ -30,7 +30,7 @@ use Snowflake\Snowflake;
|
||||
*/
|
||||
public function execute(mixed $class, mixed $method = null): bool
|
||||
{
|
||||
$annotation = Snowflake::getAnnotation();
|
||||
$annotation = Kiri::getAnnotation();
|
||||
$annotation->addSets($class::class, $this->name, $method);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@ use Annotation\Attribute;
|
||||
use Exception;
|
||||
use HttpServer\HttpFilter;
|
||||
use ReflectionException;
|
||||
use Snowflake\Exception\ComponentException;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Exception\ComponentException;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class Filter
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace Annotation\Route;
|
||||
use Annotation\Attribute;
|
||||
use HttpServer\Route\MiddlewareManager;
|
||||
use ReflectionException;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
use Kiri\Kiri;
|
||||
use HttpServer\IInterface\Middleware as IMiddleware;
|
||||
|
||||
/**
|
||||
@@ -51,7 +51,7 @@ use HttpServer\IInterface\Middleware as IMiddleware;
|
||||
*/
|
||||
public function execute(mixed $class, mixed $method = null): static
|
||||
{
|
||||
$middleware = Snowflake::getDi()->get(MiddlewareManager::class);
|
||||
$middleware = Kiri::getDi()->get(MiddlewareManager::class);
|
||||
$middleware->addMiddlewares($class, $method, $this->middleware);
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Annotation\Route;
|
||||
use Annotation\Attribute;
|
||||
use Exception;
|
||||
use HttpServer\Route\Router;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_METHOD)] class Route extends Attribute
|
||||
{
|
||||
@@ -36,7 +36,7 @@ use Snowflake\Snowflake;
|
||||
public function execute(mixed $class, mixed $method = null): Router
|
||||
{
|
||||
// TODO: Implement setHandler() method.
|
||||
$router = Snowflake::app()->getRouter();
|
||||
$router = Kiri::app()->getRouter();
|
||||
$router->addRoute($this->uri, [$class, $method], $this->method);
|
||||
return $router;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ use HttpServer\Http\Request;
|
||||
use HttpServer\Route\Router;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use Rpc\Actuator;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
|
||||
/**
|
||||
@@ -44,7 +44,7 @@ use Snowflake\Snowflake;
|
||||
public function execute(mixed $class, mixed $method = null): Router
|
||||
{
|
||||
// TODO: Implement setHandler() method.
|
||||
$router = Snowflake::app()->getRouter();
|
||||
$router = Kiri::app()->getRouter();
|
||||
$cmd = $this->cmd;
|
||||
$callback = function (Actuator $actuator) use ($cmd, $class, $method) {
|
||||
$actuator->addListener($cmd, $class::class . '@' . $method);
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Annotation\Route;
|
||||
use Annotation\Attribute;
|
||||
use Exception;
|
||||
use HttpServer\Route\Router;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class Socket
|
||||
@@ -40,7 +40,7 @@ use Snowflake\Snowflake;
|
||||
public function execute(mixed $class, mixed $method = null): Router
|
||||
{
|
||||
// TODO: Implement setHandler() method.
|
||||
$router = Snowflake::app()->getRouter();
|
||||
$router = Kiri::app()->getRouter();
|
||||
|
||||
$path = $this->event . '::' . (is_null($this->uri) ? 'event' : $this->uri);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Annotation\Rpc;
|
||||
|
||||
use Annotation\Attribute;
|
||||
use Exception;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
|
||||
/**
|
||||
@@ -35,7 +35,7 @@ use Snowflake\Snowflake;
|
||||
*/
|
||||
public function execute(mixed $class, mixed $method = ''): bool
|
||||
{
|
||||
$rpc = Snowflake::app()->getRpc();
|
||||
$rpc = Kiri::app()->getRpc();
|
||||
$rpc->addConsumer($this->cmd, [$class, $method]);
|
||||
return true; // TODO: Change the autogenerated stub
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Annotation\Rpc;
|
||||
|
||||
use Annotation\Attribute;
|
||||
use Exception;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
|
||||
/**
|
||||
@@ -45,7 +45,7 @@ use Snowflake\Snowflake;
|
||||
*/
|
||||
public function execute(mixed $class, mixed $method = ''): bool
|
||||
{
|
||||
$rpc = Snowflake::app()->getRpc();
|
||||
$rpc = Kiri::app()->getRpc();
|
||||
$rpc->addProducer($this->cmd, [$class, $method], $this->config);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -5,10 +5,10 @@ namespace Console;
|
||||
|
||||
|
||||
use Exception;
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Snowflake\Abstracts\Input;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Abstracts\Component;
|
||||
use Kiri\Abstracts\Input;
|
||||
use Kiri\Event;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class AbstractConsole
|
||||
@@ -36,7 +36,7 @@ abstract class AbstractConsole extends Component
|
||||
public function __construct(array $config = [])
|
||||
{
|
||||
$this->_config = $config;
|
||||
$this->signCommand(Snowflake::createObject(DefaultCommand::class));
|
||||
$this->signCommand(Kiri::createObject(DefaultCommand::class));
|
||||
|
||||
parent::__construct($config);
|
||||
}
|
||||
@@ -117,7 +117,7 @@ abstract class AbstractConsole extends Component
|
||||
return;
|
||||
}
|
||||
foreach ($kernel as $command) {
|
||||
$this->signCommand(Snowflake::createObject($command));
|
||||
$this->signCommand(Kiri::createObject($command));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -4,11 +4,11 @@ declare(strict_types=1);
|
||||
namespace Console;
|
||||
|
||||
use ReflectionException;
|
||||
use Snowflake\Abstracts\BaseObject;
|
||||
use Snowflake\Abstracts\TraitApplication;
|
||||
use Snowflake\Exception\ComponentException;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Abstracts\BaseObject;
|
||||
use Kiri\Abstracts\TraitApplication;
|
||||
use Kiri\Exception\ComponentException;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class Command
|
||||
@@ -66,7 +66,7 @@ abstract class Command extends BaseObject implements CommandInterface
|
||||
*/
|
||||
private function has($name): bool
|
||||
{
|
||||
return Snowflake::app()->has($name);
|
||||
return Kiri::app()->has($name);
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ abstract class Command extends BaseObject implements CommandInterface
|
||||
*/
|
||||
private function get($name): mixed
|
||||
{
|
||||
return Snowflake::app()->get($name);
|
||||
return Kiri::app()->get($name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Console;
|
||||
|
||||
use Snowflake\Abstracts\Input;
|
||||
use Kiri\Abstracts\Input;
|
||||
|
||||
/**
|
||||
* Interface CommandInterface
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Console;
|
||||
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class Console
|
||||
@@ -21,7 +21,7 @@ class Console extends AbstractConsole
|
||||
public function register($class)
|
||||
{
|
||||
if (is_string($class) || is_callable($class, true)) {
|
||||
$class = Snowflake::createObject($class);
|
||||
$class = Kiri::createObject($class);
|
||||
}
|
||||
$this->signCommand($class);
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ namespace Console;
|
||||
|
||||
|
||||
use Exception;
|
||||
use Snowflake\Abstracts\Providers;
|
||||
use Snowflake\Application;
|
||||
use Kiri\Abstracts\Providers;
|
||||
use Kiri\Application;
|
||||
|
||||
/**
|
||||
* Class ConsoleProviders
|
||||
|
||||
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Console;
|
||||
|
||||
use Snowflake\Abstracts\Input;
|
||||
use Kiri\Abstracts\Input;
|
||||
|
||||
/**
|
||||
* Class DefaultCommand
|
||||
|
||||
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
namespace Console;
|
||||
|
||||
|
||||
use Snowflake\Abstracts\Input;
|
||||
use Kiri\Abstracts\Input;
|
||||
|
||||
interface ICommand
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Database;
|
||||
|
||||
use Database\Traits\QueryTrait;
|
||||
use Exception;
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Kiri\Abstracts\Component;
|
||||
|
||||
/**
|
||||
* Class ActiveQuery
|
||||
|
||||
@@ -14,8 +14,8 @@ use Database\Base\BaseActiveRecord;
|
||||
use Database\Traits\HasBase;
|
||||
use Exception;
|
||||
use ReflectionException;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
use Kiri\Kiri;
|
||||
|
||||
defined('SAVE_FAIL') or define('SAVE_FAIL', 3227);
|
||||
defined('FIND_OR_CREATE_MESSAGE') or define('FIND_OR_CREATE_MESSAGE', 'Create a new model, but the data cannot be empty.');
|
||||
@@ -115,7 +115,7 @@ class ActiveRecord extends BaseActiveRecord
|
||||
*/
|
||||
public static function findOrCreate(array $condition, array $attributes = []): bool|static
|
||||
{
|
||||
$logger = Snowflake::app()->getLogger();
|
||||
$logger = Kiri::app()->getLogger();
|
||||
|
||||
/** @var static $select */
|
||||
$select = static::find()->where($condition)->first();
|
||||
@@ -142,7 +142,7 @@ class ActiveRecord extends BaseActiveRecord
|
||||
*/
|
||||
public static function createOrUpdate(array $condition, array $attributes = []): bool|static
|
||||
{
|
||||
$logger = Snowflake::app()->getLogger();
|
||||
$logger = Kiri::app()->getLogger();
|
||||
if (empty($attributes)) {
|
||||
return $logger->addError(FIND_OR_CREATE_MESSAGE, 'mysql');
|
||||
}
|
||||
@@ -200,7 +200,7 @@ class ActiveRecord extends BaseActiveRecord
|
||||
public static function inserts(array $data): bool
|
||||
{
|
||||
/** @var static $class */
|
||||
$class = Snowflake::createObject(['class' => static::class]);
|
||||
$class = Kiri::createObject(['class' => static::class]);
|
||||
if (empty($data)) {
|
||||
return $class->addError('Insert data empty.', 'mysql');
|
||||
}
|
||||
@@ -288,7 +288,7 @@ class ActiveRecord extends BaseActiveRecord
|
||||
{
|
||||
$data = $this->_attributes;
|
||||
|
||||
$lists = Snowflake::getAnnotation()->getGets(static::class);
|
||||
$lists = Kiri::getAnnotation()->getGets(static::class);
|
||||
foreach ($lists as $key => $item) {
|
||||
$data[$key] = $this->{$item}($data[$key] ?? null);
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@ use Database\ActiveQuery;
|
||||
use Database\ActiveRecord;
|
||||
use Exception;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Abstracts\Component;
|
||||
use Kiri\Kiri;
|
||||
use Traversable;
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,20 +26,20 @@ use Database\Traits\HasBase;
|
||||
use Exception;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use ReflectionException;
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Snowflake\Abstracts\Config;
|
||||
use Snowflake\Abstracts\TraitApplication;
|
||||
use Snowflake\Application;
|
||||
use Snowflake\Events\EventDispatch;
|
||||
use Snowflake\Exception\ConfigException;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Abstracts\Component;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Abstracts\TraitApplication;
|
||||
use Kiri\Application;
|
||||
use Kiri\Events\EventDispatch;
|
||||
use Kiri\Exception\ConfigException;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
use Kiri\Kiri;
|
||||
use validator\Validator;
|
||||
|
||||
/**
|
||||
* Class BOrm
|
||||
*
|
||||
* @package Snowflake\Abstracts
|
||||
* @package Kiri\Abstracts
|
||||
*
|
||||
* @property bool $isCreate
|
||||
* @method rules()
|
||||
@@ -114,7 +114,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
|
||||
*/
|
||||
#[Pure] protected function getContainer(): Application
|
||||
{
|
||||
return Snowflake::app();
|
||||
return Kiri::app();
|
||||
}
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
|
||||
*/
|
||||
protected function getEventDispatch(): EventDispatch
|
||||
{
|
||||
return Snowflake::getDi()->get(EventDispatch::class);
|
||||
return Kiri::getDi()->get(EventDispatch::class);
|
||||
}
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
$an = Snowflake::app()->getAnnotation();
|
||||
$an = Kiri::app()->getAnnotation();
|
||||
$an->injectProperty($this);
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
|
||||
*/
|
||||
public function getLastError(): mixed
|
||||
{
|
||||
return Snowflake::app()->getLogger()->getLastError('mysql');
|
||||
return Kiri::app()->getLogger()->getLastError('mysql');
|
||||
}
|
||||
|
||||
|
||||
@@ -705,7 +705,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
|
||||
*/
|
||||
public function getRelate($name): null|array|string
|
||||
{
|
||||
return Snowflake::getAnnotation()->getRelateMethods(static::class, $name);
|
||||
return Kiri::getAnnotation()->getRelateMethods(static::class, $name);
|
||||
}
|
||||
|
||||
|
||||
@@ -811,7 +811,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
|
||||
*/
|
||||
protected function _get_annotation(string $name = null, string $method = self::GET): ?string
|
||||
{
|
||||
$annotation = Snowflake::app()->getAnnotation();
|
||||
$annotation = Kiri::app()->getAnnotation();
|
||||
if ($method == static::SET) {
|
||||
return $annotation->getSetMethodName(static::class, $name);
|
||||
}
|
||||
@@ -1032,7 +1032,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
|
||||
*/
|
||||
public static function setDatabaseConnect($dbName): Connection
|
||||
{
|
||||
return Snowflake::app()->db->get(static::$connection = $dbName);
|
||||
return Kiri::app()->db->get(static::$connection = $dbName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ namespace Database;
|
||||
use Exception;
|
||||
use PDO;
|
||||
use PDOStatement;
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Snowflake\Core\Json;
|
||||
use Kiri\Abstracts\Component;
|
||||
use Kiri\Core\Json;
|
||||
|
||||
/**
|
||||
* Class Command
|
||||
|
||||
@@ -5,8 +5,8 @@ namespace Database\Condition;
|
||||
|
||||
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use Snowflake\Abstracts\BaseObject;
|
||||
use Snowflake\Core\Str;
|
||||
use Kiri\Abstracts\BaseObject;
|
||||
use Kiri\Core\Str;
|
||||
|
||||
/**
|
||||
* Class Condition
|
||||
|
||||
@@ -3,7 +3,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Database\Condition;
|
||||
|
||||
use Snowflake\Core\Str;
|
||||
use Kiri\Core\Str;
|
||||
|
||||
/**
|
||||
* Class LLikeCondition
|
||||
|
||||
@@ -3,7 +3,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Database\Condition;
|
||||
|
||||
use Snowflake\Core\Str;
|
||||
use Kiri\Core\Str;
|
||||
|
||||
/**
|
||||
* Class LikeCondition
|
||||
|
||||
@@ -3,7 +3,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Database\Condition;
|
||||
|
||||
use Snowflake\Core\Str;
|
||||
use Kiri\Core\Str;
|
||||
|
||||
/**
|
||||
* Class NotLikeCondition
|
||||
|
||||
@@ -3,7 +3,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Database\Condition;
|
||||
|
||||
use Snowflake\Core\Str;
|
||||
use Kiri\Core\Str;
|
||||
|
||||
/**
|
||||
* Class RLikeCondition
|
||||
|
||||
+12
-12
@@ -22,12 +22,12 @@ use PDO;
|
||||
use ReflectionException;
|
||||
use Server\Events\OnWorkerExit;
|
||||
use Server\Events\OnWorkerStop;
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Snowflake\Abstracts\Config;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Events\EventProvider;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Abstracts\Component;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Event;
|
||||
use Kiri\Events\EventProvider;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class Connection
|
||||
@@ -146,7 +146,7 @@ class Connection extends Component
|
||||
public function getSchema(): Schema
|
||||
{
|
||||
if ($this->_schema === null) {
|
||||
$this->_schema = Snowflake::createObject([
|
||||
$this->_schema = Kiri::createObject([
|
||||
'class' => Schema::class,
|
||||
'db' => $this
|
||||
]);
|
||||
@@ -176,7 +176,7 @@ class Connection extends Component
|
||||
if (!$this->enableCache) {
|
||||
return null;
|
||||
}
|
||||
return Snowflake::app()->get($this->cacheDriver);
|
||||
return Kiri::app()->get($this->cacheDriver);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -210,12 +210,12 @@ class Connection extends Component
|
||||
|
||||
|
||||
/**
|
||||
* @return \Snowflake\Pool\Connection
|
||||
* @return \Kiri\Pool\Connection
|
||||
* @throws Exception
|
||||
*/
|
||||
private function connections(): \Snowflake\Pool\Connection
|
||||
private function connections(): \Kiri\Pool\Connection
|
||||
{
|
||||
return Snowflake::getDi()->get(\Snowflake\Pool\Connection::class);
|
||||
return Kiri::getDi()->get(\Kiri\Pool\Connection::class);
|
||||
}
|
||||
|
||||
|
||||
@@ -293,7 +293,7 @@ class Connection extends Component
|
||||
*/
|
||||
public function release()
|
||||
{
|
||||
if (!Snowflake::isWorker() && !Snowflake::isProcess()) {
|
||||
if (!Kiri::isWorker() && !Kiri::isProcess()) {
|
||||
$this->clear_connection();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7,12 +7,12 @@ namespace Database;
|
||||
use Annotation\Inject;
|
||||
use Exception;
|
||||
use Server\Events\OnWorkerStart;
|
||||
use Snowflake\Abstracts\Config;
|
||||
use Snowflake\Abstracts\Providers;
|
||||
use Snowflake\Application;
|
||||
use Snowflake\Events\EventProvider;
|
||||
use Snowflake\Exception\ConfigException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Abstracts\Providers;
|
||||
use Kiri\Application;
|
||||
use Kiri\Events\EventProvider;
|
||||
use Kiri\Exception\ConfigException;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class DatabasesProviders
|
||||
@@ -53,7 +53,7 @@ class DatabasesProviders extends Providers
|
||||
*/
|
||||
public function get($name): Connection
|
||||
{
|
||||
$application = Snowflake::app();
|
||||
$application = Kiri::app();
|
||||
if (!$application->has('databases.' . $name)) {
|
||||
$application->set('databases.' . $name, $this->_settings($this->getConfig($name)));
|
||||
}
|
||||
@@ -71,7 +71,7 @@ class DatabasesProviders extends Providers
|
||||
if (empty($databases)) {
|
||||
return;
|
||||
}
|
||||
$application = Snowflake::app();
|
||||
$application = Kiri::app();
|
||||
foreach ($databases as $name => $database) {
|
||||
/** @var Connection $connection */
|
||||
$application->set('databases.' . $name, $this->_settings($database));
|
||||
|
||||
+3
-3
@@ -14,9 +14,9 @@ use Database\Affair\Commit;
|
||||
use Database\Affair\Rollback;
|
||||
use Database\Traits\QueryTrait;
|
||||
use Exception;
|
||||
use Snowflake\Abstracts\Config;
|
||||
use Snowflake\Events\EventDispatch;
|
||||
use Snowflake\Exception\ConfigException;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Events\EventDispatch;
|
||||
use Kiri\Exception\ConfigException;
|
||||
|
||||
/**
|
||||
* Class Db
|
||||
|
||||
@@ -15,8 +15,8 @@ use Database\Connection;
|
||||
use Database\SqlBuilder;
|
||||
use Exception;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Snowflake\Core\Json;
|
||||
use Kiri\Abstracts\Component;
|
||||
use Kiri\Core\Json;
|
||||
|
||||
/**
|
||||
* Class Columns
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Database\Mysql;
|
||||
|
||||
|
||||
use Exception;
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Kiri\Abstracts\Component;
|
||||
use Database\Connection;
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Database;
|
||||
|
||||
use Closure;
|
||||
use Exception;
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Kiri\Abstracts\Component;
|
||||
|
||||
/**
|
||||
* Class Pagination
|
||||
|
||||
@@ -5,11 +5,11 @@ namespace Database;
|
||||
|
||||
|
||||
use Exception;
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Kiri\Abstracts\Component;
|
||||
|
||||
/**
|
||||
* Class Relation
|
||||
* @package Snowflake\db
|
||||
* @package Kiri\db
|
||||
*/
|
||||
class Relation extends Component
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Database;
|
||||
use Database\Traits\Builder;
|
||||
use Exception;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Kiri\Abstracts\Component;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,8 +13,8 @@ use Database\SqlBuilder;
|
||||
use Exception;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use ReflectionException;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
use Kiri\Kiri;
|
||||
|
||||
|
||||
/**
|
||||
@@ -181,13 +181,13 @@ trait Builder
|
||||
if (!is_string($condition[2])) {
|
||||
$condition[2] = $this->_hashMap($condition[2]);
|
||||
}
|
||||
$builder = Snowflake::createObject(['class' => OrCondition::class, 'value' => $condition[2], 'column' => $condition[1], 'oldParams' => $array]);
|
||||
$builder = Kiri::createObject(['class' => OrCondition::class, 'value' => $condition[2], 'column' => $condition[1], 'oldParams' => $array]);
|
||||
} else if (isset(ConditionClassMap::$conditionMap[$stroppier])) {
|
||||
$defaultConfig = ConditionClassMap::$conditionMap[$stroppier];
|
||||
$create = array_merge($defaultConfig, ['column' => $condition[1], 'value' => $condition[2]]);
|
||||
$builder = Snowflake::createObject($create);
|
||||
$builder = Kiri::createObject($create);
|
||||
} else {
|
||||
$builder = Snowflake::createObject(['class' => HashCondition::class, 'value' => $condition]);
|
||||
$builder = Kiri::createObject(['class' => HashCondition::class, 'value' => $condition]);
|
||||
}
|
||||
|
||||
$array[] = $builder->builder();
|
||||
|
||||
@@ -18,8 +18,8 @@ use Database\Query;
|
||||
use Database\SqlBuilder;
|
||||
use Exception;
|
||||
use ReflectionException;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Trait QueryTrait
|
||||
@@ -737,7 +737,7 @@ trait QueryTrait
|
||||
*/
|
||||
public function makeNewSqlGenerate(): Query
|
||||
{
|
||||
return Snowflake::createObject(['class' => Query::class]);
|
||||
return Kiri::createObject(['class' => Query::class]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+6
-6
@@ -5,10 +5,10 @@ namespace Gii;
|
||||
|
||||
|
||||
use Exception;
|
||||
use Snowflake\Abstracts\Config;
|
||||
use Snowflake\Abstracts\Input;
|
||||
use Snowflake\Exception\ConfigException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Abstracts\Input;
|
||||
use Kiri\Exception\ConfigException;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class Command
|
||||
@@ -31,9 +31,9 @@ class Command extends \Console\Command
|
||||
public function onHandler(Input $dtl): array
|
||||
{
|
||||
/** @var Gii $gii */
|
||||
$gii = Snowflake::app()->get('gii');
|
||||
$gii = Kiri::app()->get('gii');
|
||||
|
||||
$connections = Snowflake::app()->db;
|
||||
$connections = Kiri::app()->db;
|
||||
if ($dtl->exists('databases')) {
|
||||
return $gii->run($connections->get($dtl->get('databases')), $dtl);
|
||||
}
|
||||
|
||||
+6
-6
@@ -12,10 +12,10 @@ namespace Gii;
|
||||
use Database\Connection;
|
||||
use Database\Db;
|
||||
use Exception;
|
||||
use Snowflake\Abstracts\Input;
|
||||
use Snowflake\Exception\ComponentException;
|
||||
use Snowflake\Exception\ConfigException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Abstracts\Input;
|
||||
use Kiri\Exception\ComponentException;
|
||||
use Kiri\Exception\ConfigException;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class gii
|
||||
@@ -123,7 +123,7 @@ class Gii
|
||||
return $this->makeByDatabases($make, $input);
|
||||
}
|
||||
$db = $this->input->get('databases', 'db');
|
||||
$this->db = Snowflake::app()->db->get($db);
|
||||
$this->db = Kiri::app()->db->get($db);
|
||||
|
||||
return $this->makeByDatabases($make, $input);
|
||||
}
|
||||
@@ -138,7 +138,7 @@ class Gii
|
||||
*/
|
||||
private function makeByDatabases($make, $input): array
|
||||
{
|
||||
$redis = Snowflake::app()->getRedis();
|
||||
$redis = Kiri::app()->getRedis();
|
||||
if (!empty($input->get('name'))) {
|
||||
$this->tableName = $input->get('name');
|
||||
$redis->del('column:' . $this->tableName);
|
||||
|
||||
+2
-2
@@ -11,8 +11,8 @@ use JetBrains\PhpStorm\ArrayShape;
|
||||
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
use Snowflake\Abstracts\Input;
|
||||
use Snowflake\Core\Json;
|
||||
use Kiri\Abstracts\Input;
|
||||
use Kiri\Core\Json;
|
||||
|
||||
/**
|
||||
* Class GiiBase
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Gii;
|
||||
|
||||
use Exception;
|
||||
use ReflectionException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class GiiController
|
||||
@@ -66,13 +66,13 @@ namespace {$namespace};
|
||||
exit(logger()->addError($Exception, 'throwable'));
|
||||
}
|
||||
} else {
|
||||
$import = "use Snowflake;
|
||||
$import = "use Kiri;
|
||||
use Exception;
|
||||
use Annotation\Target;
|
||||
use Annotation\Route\Middleware;
|
||||
use Annotation\Route\Route;
|
||||
use Snowflake\Core\Str;
|
||||
use Snowflake\Core\Json;
|
||||
use Kiri\Core\Str;
|
||||
use Kiri\Core\Json;
|
||||
use HttpServer\Http\Request;
|
||||
use HttpServer\Http\Response;
|
||||
use HttpServer\Controller;
|
||||
@@ -127,7 +127,7 @@ use {$model_namespace}\\{$managerName};
|
||||
unlink($file);
|
||||
}
|
||||
|
||||
Snowflake::writeFile($file, $html);
|
||||
Kiri::writeFile($file, $html);
|
||||
return $controllerName . 'Controller.php';
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Gii;
|
||||
|
||||
|
||||
use Exception;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class GiiInterceptor
|
||||
@@ -91,7 +91,7 @@ class ' . $managerName . 'Interceptor implements Interceptor
|
||||
throw new Exception('File exists.');
|
||||
}
|
||||
|
||||
Snowflake::writeFile($file, $html);
|
||||
Kiri::writeFile($file, $html);
|
||||
return [$managerName . 'Interceptor.php'];
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ namespace Gii;
|
||||
|
||||
|
||||
use Exception;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class GiiLimits
|
||||
@@ -68,7 +68,7 @@ class ' . $managerName . 'Limits implements Limits
|
||||
throw new Exception('File exists.');
|
||||
}
|
||||
|
||||
Snowflake::writeFile($file, $html);
|
||||
Kiri::writeFile($file, $html);
|
||||
return [$managerName . 'Limits.php'];
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Gii;
|
||||
|
||||
|
||||
use Exception;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class GiiMiddleware
|
||||
@@ -65,7 +65,7 @@ class ' . $managerName . 'Middleware implements Middleware
|
||||
throw new Exception('File exists.');
|
||||
}
|
||||
|
||||
Snowflake::writeFile($file, $html);
|
||||
Kiri::writeFile($file, $html);
|
||||
return [$managerName . 'Middleware.php'];
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -7,7 +7,7 @@ namespace Gii;
|
||||
use Database\Db;
|
||||
use Exception;
|
||||
use ReflectionException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class GiiModel
|
||||
@@ -57,7 +57,7 @@ class GiiModel extends GiiBase
|
||||
try {
|
||||
$className = str_replace('\\\\', '\\', "{$modelPath['namespace']}\\{$managerName}");
|
||||
|
||||
$class = Snowflake::getDi()->getReflect($className);
|
||||
$class = Kiri::getDi()->getReflect($className);
|
||||
|
||||
$html = '<?php
|
||||
namespace ' . $namespace . ';
|
||||
@@ -87,7 +87,7 @@ namespace ' . $namespace . ';
|
||||
|
||||
use Exception;
|
||||
use Annotation\Target;
|
||||
use Snowflake\Core\Json;
|
||||
use Kiri\Core\Json;
|
||||
use Database\Connection;
|
||||
use Annotation\Model\Get;
|
||||
use Annotation\Model\Set;
|
||||
@@ -147,7 +147,7 @@ use Database\ActiveRecord;
|
||||
unlink($file);
|
||||
}
|
||||
|
||||
Snowflake::writeFile($file, $html);
|
||||
Kiri::writeFile($file, $html);
|
||||
return $managerName . '.php';
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace Gii;
|
||||
|
||||
use Console\Console;
|
||||
use Exception;
|
||||
use Snowflake\Abstracts\Providers;
|
||||
use Snowflake\Application;
|
||||
use Kiri\Abstracts\Providers;
|
||||
use Kiri\Application;
|
||||
|
||||
/**
|
||||
* Class DatabasesProviders
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Gii;
|
||||
|
||||
|
||||
use Exception;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class GiiRpcClient
|
||||
@@ -41,8 +41,8 @@ use Annotation\Rpc\RpcClient;
|
||||
use Annotation\Target;
|
||||
use Exception;
|
||||
use Rpc\Client;
|
||||
use Snowflake\Core\Json;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Core\Json;
|
||||
use Kiri\Kiri;
|
||||
|
||||
';
|
||||
|
||||
@@ -93,7 +93,7 @@ class ' . $managerName . 'Consumer extends \Rpc\Consumer
|
||||
throw new Exception('File exists.');
|
||||
}
|
||||
|
||||
Snowflake::writeFile($file, $html);
|
||||
Kiri::writeFile($file, $html);
|
||||
return [$managerName . 'Middleware.php'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Gii;
|
||||
|
||||
|
||||
use Exception;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class GiiRpcClient
|
||||
@@ -38,7 +38,7 @@ use Annotation\Target;
|
||||
use Exception;
|
||||
use HttpServer\Controller;
|
||||
use HttpServer\Exception\RequestException;
|
||||
use Snowflake\Core\Json;
|
||||
use Kiri\Core\Json;
|
||||
|
||||
';
|
||||
|
||||
@@ -73,7 +73,7 @@ class ' . $managerName . 'Producer extends Controller
|
||||
throw new Exception('File exists.');
|
||||
}
|
||||
|
||||
Snowflake::writeFile($file, $html);
|
||||
Kiri::writeFile($file, $html);
|
||||
return [$managerName . 'Producer.php'];
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||
namespace Gii;
|
||||
|
||||
use Exception;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class GiiModel
|
||||
@@ -83,7 +83,7 @@ class ' . $managerName . ' implements Task
|
||||
throw new Exception('File exists.');
|
||||
}
|
||||
|
||||
Snowflake::writeFile($file, $html);
|
||||
Kiri::writeFile($file, $html);
|
||||
return [$managerName . '.php'];
|
||||
}
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace HttpServer\Abstracts;
|
||||
|
||||
use Database\Connection;
|
||||
use Exception;
|
||||
use Snowflake\Abstracts\Config;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Exception\ConfigException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Event;
|
||||
use Kiri\Exception\ConfigException;
|
||||
use Kiri\Kiri;
|
||||
|
||||
|
||||
/**
|
||||
@@ -72,7 +72,7 @@ abstract class Callback extends HttpService
|
||||
if (empty($databases)) {
|
||||
return;
|
||||
}
|
||||
$application = Snowflake::app();
|
||||
$application = Kiri::app();
|
||||
foreach ($databases as $name => $database) {
|
||||
/** @var Connection $connection */
|
||||
$connection = $application->get('databases.' . $name, false);
|
||||
@@ -101,7 +101,7 @@ abstract class Callback extends HttpService
|
||||
*/
|
||||
protected function clearRedisClient()
|
||||
{
|
||||
$redis = Snowflake::app()->getRedis();
|
||||
$redis = Kiri::app()->getRedis();
|
||||
$redis->destroy();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ namespace HttpServer\Abstracts;
|
||||
|
||||
|
||||
use Exception;
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Abstracts\Component;
|
||||
use Kiri\Kiri;
|
||||
|
||||
|
||||
/**
|
||||
@@ -24,7 +24,7 @@ abstract class HttpService extends Component
|
||||
*/
|
||||
protected function write($message, string $category = 'app')
|
||||
{
|
||||
$logger = Snowflake::app()->getLogger();
|
||||
$logger = Kiri::app()->getLogger();
|
||||
$logger->write($message, $category);
|
||||
$logger->insert();
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ use Swoole\WebSocket\Server;
|
||||
|
||||
/**
|
||||
* Class OnServerDefault
|
||||
* @package Snowflake\Snowflake\Server
|
||||
* @package Kiri\Kiri\Server
|
||||
*/
|
||||
abstract class ServerBase extends HttpService
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ use Swoole\Coroutine\Http\Client as SClient;
|
||||
|
||||
/**
|
||||
* Class Client
|
||||
* @package Snowflake\Snowflake\Http
|
||||
* @package Kiri\Kiri\Http
|
||||
*/
|
||||
class Client extends ClientAbstracts
|
||||
{
|
||||
|
||||
@@ -6,8 +6,8 @@ namespace HttpServer\Client\Help;
|
||||
|
||||
use Closure;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Snowflake\Core\Help;
|
||||
use Kiri\Abstracts\Component;
|
||||
use Kiri\Core\Help;
|
||||
use Swoole\Coroutine\System;
|
||||
|
||||
defined('SPLIT_URL') or define('SPLIT_URL', '/(http[s]?:\/\/)?(([\w\-_]+\.)+\w+(:\d+)?)((\/[a-zA-Z0-9\-]+)+[\/]?(\?[a-zA-Z]+=.*)?)?/');
|
||||
|
||||
@@ -7,13 +7,13 @@ namespace HttpServer\Client;
|
||||
use Exception;
|
||||
use HttpServer\Http\Context;
|
||||
use Server\Events\OnAfterRequest;
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Snowflake\Channel;
|
||||
use Snowflake\Core\Json;
|
||||
use Snowflake\Core\Xml;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Events\EventProvider;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Abstracts\Component;
|
||||
use Kiri\Channel;
|
||||
use Kiri\Core\Json;
|
||||
use Kiri\Core\Xml;
|
||||
use Kiri\Event;
|
||||
use Kiri\Events\EventProvider;
|
||||
use Kiri\Kiri;
|
||||
use Swoole\Coroutine\Http2\Client as H2Client;
|
||||
use Swoole\Http2\Request;
|
||||
use Swoole\Http2\Response;
|
||||
|
||||
@@ -5,8 +5,8 @@ namespace HttpServer\Client;
|
||||
|
||||
|
||||
use Exception;
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Abstracts\Component;
|
||||
use Kiri\Kiri;
|
||||
use Swoole\Coroutine;
|
||||
use HttpServer\Client\Help\IClient;
|
||||
use HttpServer\Client\Help\Client;
|
||||
@@ -34,7 +34,7 @@ class HttpClient extends Component
|
||||
*/
|
||||
public static function http2(): Http2
|
||||
{
|
||||
return Snowflake::app()->get('http2');
|
||||
return Kiri::app()->get('http2');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ namespace HttpServer;
|
||||
|
||||
|
||||
use Exception;
|
||||
use Snowflake\Abstracts\Input;
|
||||
use Snowflake\Exception\ConfigException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Abstracts\Input;
|
||||
use Kiri\Exception\ConfigException;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class Command
|
||||
@@ -33,14 +33,14 @@ class Command extends \Console\Command
|
||||
*/
|
||||
public function onHandler(Input $dtl): string
|
||||
{
|
||||
$manager = Snowflake::app()->getServer();
|
||||
$manager = Kiri::app()->getServer();
|
||||
$manager->setDaemon($dtl->get('daemon', 0));
|
||||
if (!in_array($dtl->get('action'), self::ACTIONS)) {
|
||||
return 'I don\'t know what I want to do.';
|
||||
}
|
||||
|
||||
/** @var Shutdown $shutdown */
|
||||
$shutdown = Snowflake::app()->get('shutdown');
|
||||
$shutdown = Kiri::app()->get('shutdown');
|
||||
if ($shutdown->isRunning() && $dtl->get('action') == 'start') {
|
||||
return 'Service is running. Please use restart.';
|
||||
}
|
||||
|
||||
@@ -8,15 +8,15 @@ use Annotation\Inject;
|
||||
use HttpServer\Http\HttpHeaders;
|
||||
use HttpServer\Http\HttpParams;
|
||||
use HttpServer\Http\Request;
|
||||
use Snowflake\Abstracts\TraitApplication;
|
||||
use Snowflake\Application;
|
||||
use Kiri\Abstracts\TraitApplication;
|
||||
use Kiri\Application;
|
||||
use Server\Constrict\Response as CrResponse;
|
||||
use Server\Constrict\Request as CrRequest;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class WebController
|
||||
* @package Snowflake\Snowflake\Web
|
||||
* @package Kiri\Kiri\Web
|
||||
* @property Application $container
|
||||
*/
|
||||
class Controller
|
||||
|
||||
@@ -6,9 +6,9 @@ namespace HttpServer\Events;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\Callback;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Exception\ComponentException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Event;
|
||||
use Kiri\Exception\ComponentException;
|
||||
use Kiri\Kiri;
|
||||
use Swoole\Server;
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,8 +6,8 @@ namespace HttpServer\Events;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\Callback;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Event;
|
||||
use Kiri\Kiri;
|
||||
use Swoole\Server;
|
||||
use Swoole\Timer;
|
||||
|
||||
@@ -26,8 +26,8 @@ class OnBeforeReload extends Callback
|
||||
{
|
||||
Event::trigger(Event::SERVER_BEFORE_RELOAD, [$server]);
|
||||
|
||||
Snowflake::clearWorkerPid();
|
||||
Snowflake::clearTaskPid();
|
||||
Kiri::clearWorkerPid();
|
||||
Kiri::clearTaskPid();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace HttpServer\Events;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\Callback;
|
||||
use Snowflake\Event;
|
||||
use Kiri\Event;
|
||||
use Swoole\Server;
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace HttpServer\Events;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\Callback;
|
||||
use Snowflake\Event;
|
||||
use Kiri\Event;
|
||||
use Swoole\Server;
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,8 +6,8 @@ namespace HttpServer\Events;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\Callback;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Event;
|
||||
use Kiri\Kiri;
|
||||
use Swoole\Server;
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,10 +13,10 @@ use HttpServer\Http\Request;
|
||||
use HttpServer\Http\Response;
|
||||
use HttpServer\Route\Router;
|
||||
use ReflectionException;
|
||||
use Snowflake\Core\ArrayAccess;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Core\ArrayAccess;
|
||||
use Kiri\Event;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
use Kiri\Kiri;
|
||||
use Swoole\Http\Request as SRequest;
|
||||
use Swoole\Http\Response as SResponse;
|
||||
use Swoole\WebSocket\Server;
|
||||
@@ -57,7 +57,7 @@ class OnHandshake extends Callback
|
||||
foreach ($headers as $key => $val) {
|
||||
$response->header($key, $val);
|
||||
}
|
||||
return Snowflake::app()->getRouter();
|
||||
return Kiri::app()->getRouter();
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ class OnHandshake extends Callback
|
||||
*/
|
||||
private function disconnect(SResponse $response, int $code = 500): void
|
||||
{
|
||||
$server = Snowflake::getWebSocket();
|
||||
$server = Kiri::getWebSocket();
|
||||
if (!$server->isEstablished($response->fd)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ namespace HttpServer\Events;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\Callback;
|
||||
use Snowflake\Abstracts\Config;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Event;
|
||||
use Kiri\Kiri;
|
||||
use Swoole\Server;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class OnManagerStart extends Callback
|
||||
*/
|
||||
public function onHandler(Server $server)
|
||||
{
|
||||
Snowflake::setWorkerId($server->manager_pid);
|
||||
Kiri::setWorkerId($server->manager_pid);
|
||||
|
||||
fire(Event::SERVER_MANAGER_START, [$server]);
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ namespace HttpServer\Events;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\Callback;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Event;
|
||||
use Kiri\Kiri;
|
||||
use Swoole\Server;
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace HttpServer\Events;
|
||||
|
||||
|
||||
use HttpServer\Abstracts\Callback;
|
||||
use Snowflake\Event;
|
||||
use Kiri\Event;
|
||||
use Swoole\WebSocket\Frame;
|
||||
use Swoole\WebSocket\Server;
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ namespace HttpServer\Events;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\Callback;
|
||||
use Snowflake\Core\Json;
|
||||
use Snowflake\Event;
|
||||
use Kiri\Core\Json;
|
||||
use Kiri\Event;
|
||||
use Swoole\Server;
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,10 +7,10 @@ namespace HttpServer\Events;
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\Callback;
|
||||
use Kafka\Struct;
|
||||
use Snowflake\Crontab\Crontab;
|
||||
use Snowflake\Crontab\Producer;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Crontab\Crontab;
|
||||
use Kiri\Crontab\Producer;
|
||||
use Kiri\Event;
|
||||
use Kiri\Kiri;
|
||||
use Swoole\Server;
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,9 +7,9 @@ namespace HttpServer\Events;
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\Callback;
|
||||
use HttpServer\Http\Request;
|
||||
use Snowflake\Abstracts\Config;
|
||||
use Snowflake\Core\Json;
|
||||
use Snowflake\Event;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Core\Json;
|
||||
use Kiri\Event;
|
||||
use Swoole\Server;
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,9 +10,9 @@ use HttpServer\Exception\ExitException;
|
||||
use HttpServer\Http\Request as HRequest;
|
||||
use HttpServer\Http\Response as HResponse;
|
||||
use HttpServer\Route\Router;
|
||||
use Snowflake\Error\Logger;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Error\Logger;
|
||||
use Kiri\Event;
|
||||
use Kiri\Kiri;
|
||||
use Swoole\Error;
|
||||
use Swoole\Http\Request;
|
||||
use Swoole\Http\Response;
|
||||
@@ -38,7 +38,7 @@ class OnRequest extends Callback
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
$this->router = Snowflake::app()->getRouter();
|
||||
$this->router = Kiri::app()->getRouter();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ namespace HttpServer\Events;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\Callback;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Exception\ComponentException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Event;
|
||||
use Kiri\Exception\ComponentException;
|
||||
use Kiri\Kiri;
|
||||
use Swoole\Server;
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,9 +6,9 @@ namespace HttpServer\Events;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\Callback;
|
||||
use Snowflake\Abstracts\Config;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Event;
|
||||
use Kiri\Kiri;
|
||||
use Swoole\Server;
|
||||
|
||||
/**
|
||||
@@ -24,7 +24,7 @@ class OnStart extends Callback
|
||||
*/
|
||||
public function onHandler(Server $server)
|
||||
{
|
||||
if (Snowflake::getPlatform()->isLinux()) {
|
||||
if (Kiri::getPlatform()->isLinux()) {
|
||||
name($server->master_pid, 'master');
|
||||
}
|
||||
fire(Event::SERVER_EVENT_START, [$server]);
|
||||
|
||||
@@ -8,9 +8,9 @@ namespace HttpServer\Events;
|
||||
use HttpServer\Abstracts\Callback;
|
||||
use HttpServer\IInterface\Task;
|
||||
use HttpServer\IInterface\Task as ITask;
|
||||
use Snowflake\Abstracts\Config;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Event;
|
||||
use Kiri\Kiri;
|
||||
use Swoole\Coroutine;
|
||||
use Swoole\Process;
|
||||
use Swoole\Server;
|
||||
@@ -29,7 +29,7 @@ class OnTask extends Callback
|
||||
*/
|
||||
public function onHandler()
|
||||
{
|
||||
$setting = Snowflake::app()->getSwoole();
|
||||
$setting = Kiri::app()->getSwoole();
|
||||
|
||||
$isCoroutineTask = $setting->setting['task_enable_coroutine'] ?? false;
|
||||
if ($isCoroutineTask === true) {
|
||||
|
||||
@@ -6,9 +6,9 @@ namespace HttpServer\Events;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\Callback;
|
||||
use Snowflake\Abstracts\Config;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Event;
|
||||
use Kiri\Kiri;
|
||||
use Swoole\Server;
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,8 +6,8 @@ namespace HttpServer\Events;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\Callback;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Event;
|
||||
use Kiri\Kiri;
|
||||
use Swoole\Timer;
|
||||
|
||||
/**
|
||||
@@ -28,7 +28,7 @@ class OnWorkerExit extends Callback
|
||||
|
||||
Event::trigger(Event::SERVER_WORKER_EXIT, [$server, $worker_id]);
|
||||
|
||||
Snowflake::getApp('logger')->insert();
|
||||
Kiri::getApp('logger')->insert();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@ namespace HttpServer\Events;
|
||||
use Annotation\Annotation;
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\Callback;
|
||||
use Snowflake\Abstracts\Config;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Exception\ConfigException;
|
||||
use Snowflake\Runtime;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Abstracts\Config;
|
||||
use Kiri\Event;
|
||||
use Kiri\Exception\ConfigException;
|
||||
use Kiri\Runtime;
|
||||
use Kiri\Kiri;
|
||||
use Swoole\Server;
|
||||
|
||||
/**
|
||||
@@ -32,7 +32,7 @@ class OnWorkerStart extends Callback
|
||||
{
|
||||
$this->setConfigs($worker_id);
|
||||
|
||||
$annotation = Snowflake::app()->getAnnotation();
|
||||
$annotation = Kiri::app()->getAnnotation();
|
||||
$annotation->setLoader(unserialize(file_get_contents(storage(Runtime::CACHE_NAME))));
|
||||
if ($worker_id >= $server->setting['worker_num']) {
|
||||
$this->onTask($server, $annotation);
|
||||
@@ -78,13 +78,13 @@ class OnWorkerStart extends Callback
|
||||
*/
|
||||
public function onTask(Server $server, Annotation $annotation)
|
||||
{
|
||||
putenv('environmental=' . Snowflake::TASK);
|
||||
putenv('environmental=' . Kiri::TASK);
|
||||
|
||||
$annotation->runtime(APP_PATH, [CONTROLLER_PATH, TASK_PATH, LISTENER_PATH]);
|
||||
|
||||
name($server->worker_pid, 'Task#' . $server->worker_id);
|
||||
|
||||
Snowflake::setTaskId($server->worker_pid);
|
||||
Kiri::setTaskId($server->worker_pid);
|
||||
|
||||
fire(Event::SERVER_TASK_START);
|
||||
}
|
||||
@@ -106,8 +106,8 @@ class OnWorkerStart extends Callback
|
||||
$this->debug('use time.' . (microtime(true) - $time));
|
||||
$annotation->runtime(directory('app'), [CONTROLLER_PATH]);
|
||||
|
||||
Snowflake::setWorkerId($server->worker_pid);
|
||||
putenv('environmental=' . Snowflake::WORKER);
|
||||
Kiri::setWorkerId($server->worker_pid);
|
||||
putenv('environmental=' . Kiri::WORKER);
|
||||
|
||||
fire(Event::SERVER_WORKER_START, [getenv('worker')]);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace HttpServer\Events;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\Callback;
|
||||
use Snowflake\Event;
|
||||
use Kiri\Event;
|
||||
use Swoole\Timer;
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,7 +14,7 @@ use Throwable;
|
||||
|
||||
/**
|
||||
* Class AuthException
|
||||
* @package Snowflake\Snowflake\Exception
|
||||
* @package Kiri\Kiri\Exception
|
||||
*/
|
||||
class AuthException extends \Exception
|
||||
{
|
||||
|
||||
@@ -10,8 +10,8 @@ use HttpServer\Http\Formatter\HtmlFormatter;
|
||||
use HttpServer\Http\Formatter\JsonFormatter;
|
||||
use HttpServer\Http\Formatter\XmlFormatter;
|
||||
use HttpServer\IInterface\IFormatter;
|
||||
use Snowflake\Core\Help;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Core\Help;
|
||||
use Kiri\Kiri;
|
||||
use Swoole\Http\Response as SResponse;
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ class CoroutineResponse extends HttpService
|
||||
/** @var IFormatter $class */
|
||||
$class = $this->_format_maps[$this->format] ?? HtmlFormatter::class;
|
||||
|
||||
$di = Snowflake::getDi()->get($class);
|
||||
$di = Kiri::getDi()->get($class);
|
||||
$context = $di->send($context)->getData();
|
||||
}
|
||||
return $context;
|
||||
|
||||
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
namespace HttpServer\Http;
|
||||
|
||||
use Exception;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class File
|
||||
|
||||
@@ -12,13 +12,13 @@ namespace HttpServer\Http\Formatter;
|
||||
|
||||
use Exception;
|
||||
use HttpServer\Abstracts\HttpService;
|
||||
use Snowflake\Core\Json;
|
||||
use Kiri\Core\Json;
|
||||
use Swoole\Http\Response;
|
||||
use HttpServer\IInterface\IFormatter;
|
||||
|
||||
/**
|
||||
* Class HtmlFormatter
|
||||
* @package Snowflake\Snowflake\Http\Formatter
|
||||
* @package Kiri\Kiri\Http\Formatter
|
||||
*/
|
||||
class HtmlFormatter extends HttpService implements IFormatter
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ use HttpServer\IInterface\IFormatter;
|
||||
|
||||
/**
|
||||
* Class JsonFormatter
|
||||
* @package Snowflake\Snowflake\Http\Formatter
|
||||
* @package Kiri\Kiri\Http\Formatter
|
||||
*/
|
||||
class JsonFormatter extends HttpService implements IFormatter
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ use HttpServer\IInterface\IFormatter;
|
||||
|
||||
/**
|
||||
* Class XmlFormatter
|
||||
* @package Snowflake\Snowflake\Http\Formatter
|
||||
* @package Kiri\Kiri\Http\Formatter
|
||||
*/
|
||||
class XmlFormatter extends HttpService implements IFormatter
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace HttpServer\Http;
|
||||
|
||||
/**
|
||||
* Class HttpHeaders
|
||||
* @package Snowflake\Snowflake\Http
|
||||
* @package Kiri\Kiri\Http
|
||||
*/
|
||||
trait HttpHeaders
|
||||
{
|
||||
|
||||
@@ -12,14 +12,14 @@ namespace HttpServer\Http;
|
||||
use Exception;
|
||||
use HttpServer\Exception\RequestException;
|
||||
use ReflectionException;
|
||||
use Snowflake\Core\Json;
|
||||
use Snowflake\Core\Xml;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use Snowflake\Snowflake;
|
||||
use Kiri\Core\Json;
|
||||
use Kiri\Core\Xml;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
use Kiri\Kiri;
|
||||
|
||||
/**
|
||||
* Class HttpParams
|
||||
* @package Snowflake\Snowflake\Http
|
||||
* @package Kiri\Kiri\Http
|
||||
*/
|
||||
trait HttpParams
|
||||
{
|
||||
@@ -204,7 +204,7 @@ trait HttpParams
|
||||
$param = $this->_files[$name] ?? null;
|
||||
if (!empty($param)) {
|
||||
$param['class'] = File::class;
|
||||
return Snowflake::createObject($param);
|
||||
return Kiri::createObject($param);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ use HttpServer\IInterface\AuthIdentity;
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
use Server\RequestInterface;
|
||||
use Server\ServerManager;
|
||||
use Snowflake\Core\Json;
|
||||
use Kiri\Core\Json;
|
||||
|
||||
defined('REQUEST_OK') or define('REQUEST_OK', 0);
|
||||
defined('REQUEST_FAIL') or define('REQUEST_FAIL', 500);
|
||||
@@ -18,7 +18,7 @@ defined('REQUEST_FAIL') or define('REQUEST_FAIL', 500);
|
||||
/**
|
||||
* Class HttpRequest
|
||||
*
|
||||
* @package Snowflake\Snowflake\HttpRequest
|
||||
* @package Kiri\Kiri\HttpRequest
|
||||
*
|
||||
* @property-read $isPost
|
||||
* @property-read $isGet
|
||||
|
||||
@@ -17,12 +17,12 @@ use HttpServer\Http\Formatter\JsonFormatter;
|
||||
use HttpServer\Http\Formatter\XmlFormatter;
|
||||
use HttpServer\IInterface\IFormatter;
|
||||
use Server\ResponseInterface;
|
||||
use Snowflake\Exception\NotFindClassException;
|
||||
use Kiri\Exception\NotFindClassException;
|
||||
use Swoole\Http\Response as SResponse;
|
||||
|
||||
/**
|
||||
* Class Response
|
||||
* @package Snowflake\Snowflake\Http
|
||||
* @package Kiri\Kiri\Http
|
||||
*/
|
||||
class Response extends HttpService implements ResponseInterface
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace HttpServer;
|
||||
|
||||
|
||||
use Exception;
|
||||
use Snowflake\Abstracts\BaseObject;
|
||||
use Kiri\Abstracts\BaseObject;
|
||||
use validator\Validator;
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace HttpServer\IInterface;
|
||||
|
||||
/**
|
||||
* Interface AuthIdentity
|
||||
* @package Snowflake\Snowflake\Http
|
||||
* @package Kiri\Kiri\Http
|
||||
*/
|
||||
interface AuthIdentity
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace HttpServer\IInterface;
|
||||
|
||||
/**
|
||||
* Interface IFormatter
|
||||
* @package Snowflake\Snowflake\Http\Formatter
|
||||
* @package Kiri\Kiri\Http\Formatter
|
||||
*/
|
||||
interface IFormatter
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user