diff --git a/composer.json b/composer.json index a7b73f2d..d314fc20 100644 --- a/composer.json +++ b/composer.json @@ -36,8 +36,9 @@ "autoload": { "psr-4": { "Kiri\\": "kiri-engine/", + "Kiri\\Gateway\\": "kiri-gateway/", "Gii\\": "kiri-gii/", - "Annotation\\": "kiri-note/" + "Note\\": "kiri-note/" }, "files": [ "error.php", diff --git a/function.php b/function.php index 6f702313..dc5d905f 100644 --- a/function.php +++ b/function.php @@ -3,8 +3,8 @@ defined('APP_PATH') or define('APP_PATH', realpath(__DIR__ . '/../../')); -use Annotation\Annotation; -use Annotation\Route\Route; +use Note\Note; +use Note\Route\Route; use Http\Handler\Router; use JetBrains\PhpStorm\Pure; use Kiri\Abstracts\Config; @@ -180,12 +180,12 @@ if (!function_exists('annotation')) { /** - * @return Annotation + * @return Note * @throws Exception */ - function annotation(): Annotation + function annotation(): Note { - return Kiri::getAnnotation(); + return Kiri::getNote(); } @@ -204,7 +204,7 @@ if (!function_exists('scan_directory')) { */ function scan_directory($dir, $namespace, array $exclude = []) { - $annotation = Kiri::app()->getAnnotation(); + $annotation = Kiri::app()->getNote(); $annotation->read($dir, $namespace, $exclude); injectRuntime($dir, $exclude); @@ -224,7 +224,7 @@ if (!function_exists('injectRuntime')) { */ function injectRuntime(string $path, array $exclude = []) { - $fileLists = Kiri::getAnnotation()->runtime($path, $exclude); + $fileLists = Kiri::getNote()->runtime($path, $exclude); $di = Kiri::getDi(); $router = []; diff --git a/kiri-engine/Abstracts/BaseApplication.php b/kiri-engine/Abstracts/BaseApplication.php index 05a2d884..15365fb0 100644 --- a/kiri-engine/Abstracts/BaseApplication.php +++ b/kiri-engine/Abstracts/BaseApplication.php @@ -10,7 +10,7 @@ declare(strict_types=1); namespace Kiri\Abstracts; -use Annotation\Annotation as SAnnotation; +use Note\Note as SNote; use Database\Connection; use Exception; use Http\Handler\Router; @@ -392,10 +392,10 @@ abstract class BaseApplication extends Component /** - * @return SAnnotation + * @return SNote * @throws */ - public function getAnnotation(): SAnnotation + public function getNote(): SNote { return $this->get('annotation'); } @@ -450,7 +450,7 @@ abstract class BaseApplication extends Component 'error' => ['class' => ErrorHandler::class], 'config' => ['class' => Config::class], 'logger' => ['class' => Logger::class], - 'annotation' => ['class' => SAnnotation::class], + 'annotation' => ['class' => SNote::class], 'databases' => ['class' => Connection::class], 'jwt' => ['class' => Jwt::class], 'async' => ['class' => Async::class], diff --git a/kiri-engine/Abstracts/Logger.php b/kiri-engine/Abstracts/Logger.php index 417aa5b6..ac018c7a 100644 --- a/kiri-engine/Abstracts/Logger.php +++ b/kiri-engine/Abstracts/Logger.php @@ -2,7 +2,7 @@ namespace Kiri\Abstracts; -use Annotation\Inject; +use Note\Inject; use Exception; use Kiri\Events\EventProvider; use Kiri\Exception\ConfigException; diff --git a/kiri-engine/Abstracts/TraitApplication.php b/kiri-engine/Abstracts/TraitApplication.php index 4cc0d1f5..a551e951 100644 --- a/kiri-engine/Abstracts/TraitApplication.php +++ b/kiri-engine/Abstracts/TraitApplication.php @@ -4,7 +4,7 @@ namespace Kiri\Abstracts; -use Annotation\Annotation as SAnnotation; +use Note\Note as SNote; use Database\Connection; use Database\DatabasesProviders; use Http\Handler\Client\Client; @@ -25,7 +25,7 @@ use Kiri\Jwt\JWTAuth; * @property Async $async * @property Logger $logger * @property JWTAuth $jwt - * @property SAnnotation $annotation + * @property SNote $annotation * @property BaseGoto $goto * @property Client $client * @property Connection $databases diff --git a/kiri-engine/Cache/Redis.php b/kiri-engine/Cache/Redis.php index 79e312d9..a1973e93 100644 --- a/kiri-engine/Cache/Redis.php +++ b/kiri-engine/Cache/Redis.php @@ -9,7 +9,7 @@ declare(strict_types=1); namespace Kiri\Cache; -use Annotation\Inject; +use Note\Inject; use Exception; use Server\Events\OnWorkerExit; use Kiri\Abstracts\Component; diff --git a/kiri-engine/Di/Container.php b/kiri-engine/Di/Container.php index 504c6c68..e0270475 100644 --- a/kiri-engine/Di/Container.php +++ b/kiri-engine/Di/Container.php @@ -9,7 +9,7 @@ declare(strict_types=1); namespace Kiri\Di; -use Annotation\Inject; +use Note\Inject; use Closure; use Exception; use Kiri\Abstracts\BaseObject; diff --git a/kiri-engine/Di/NoteManager.php b/kiri-engine/Di/NoteManager.php index 6ca2a265..504e4de3 100644 --- a/kiri-engine/Di/NoteManager.php +++ b/kiri-engine/Di/NoteManager.php @@ -236,7 +236,7 @@ class NoteManager * @param string $method * @return mixed */ - public static function getPropertyByAnnotation(string $attribute, string $class, string $method): mixed + public static function getPropertyByNote(string $attribute, string $class, string $method): mixed { $class = self::getAttributeTrees($attribute, $class); if (empty($class) || !isset($class['property'])) { diff --git a/kiri-engine/Error/Logger.php b/kiri-engine/Error/Logger.php index b26c9a6d..76d32c93 100644 --- a/kiri-engine/Error/Logger.php +++ b/kiri-engine/Error/Logger.php @@ -9,7 +9,7 @@ declare(strict_types=1); namespace Kiri\Error; -use Annotation\Inject; +use Note\Inject; use Exception; use Kiri\Abstracts\Component; use Kiri\Core\Json; diff --git a/kiri-engine/FileListen/HotReload.php b/kiri-engine/FileListen/HotReload.php index ab95af97..98675f3d 100644 --- a/kiri-engine/FileListen/HotReload.php +++ b/kiri-engine/FileListen/HotReload.php @@ -2,7 +2,7 @@ namespace Kiri\FileListen; -use Annotation\Inject; +use Note\Inject; use Exception; use Kiri\Abstracts\Config; use Kiri\Error\Logger; diff --git a/kiri-engine/Kiri.php b/kiri-engine/Kiri.php index 15847412..ff871c77 100644 --- a/kiri-engine/Kiri.php +++ b/kiri-engine/Kiri.php @@ -5,7 +5,7 @@ declare(strict_types=1); namespace Kiri; -use Annotation\Annotation; +use Note\Note; use Database\Collection; use Database\ModelInterface; use Exception; @@ -156,12 +156,12 @@ class Kiri /** - * @return Annotation + * @return Note * @throws Exception */ - public static function getAnnotation(): Annotation + public static function getNote(): Note { - return static::app()->getAnnotation(); + return static::app()->getNote(); } diff --git a/kiri-engine/Runtime.php b/kiri-engine/Runtime.php index 8979b785..6b5f3ab7 100644 --- a/kiri-engine/Runtime.php +++ b/kiri-engine/Runtime.php @@ -43,7 +43,7 @@ class Runtime extends Command public function execute(InputInterface $input, OutputInterface $output): int { // TODO: Implement onHandler() method. - $annotation = Kiri::app()->getAnnotation(); + $annotation = Kiri::app()->getNote(); $runtime = storage(static::CACHE_NAME); $config = storage(static::CONFIG_NAME); diff --git a/kiri-gateway/Collector.php b/kiri-gateway/Collector.php new file mode 100644 index 00000000..0f0b87a1 --- /dev/null +++ b/kiri-gateway/Collector.php @@ -0,0 +1,14 @@ +addError($e, 'throwable'); @@ -87,11 +87,11 @@ namespace ' . $namespace . '; use Exception; -use Annotation\Target; +use Note\Target; use Kiri\Core\Json; use Database\Connection; -use Database\Annotation\Get; -use Database\Annotation\Set; +use Database\Note\Get; +use Database\Note\Set; use Database\Relation; use Database\Model; ' . PHP_EOL; diff --git a/kiri-gii/GiiRpcClient.php b/kiri-gii/GiiRpcClient.php index b8998a1d..9952ad7c 100644 --- a/kiri-gii/GiiRpcClient.php +++ b/kiri-gii/GiiRpcClient.php @@ -36,9 +36,9 @@ class GiiRpcClient extends GiiBase namespace App\Client\Rpc; -use Annotation\Rpc\Consumer; -use Annotation\Rpc\RpcClient; -use Annotation\Target; +use Note\Rpc\Consumer; +use Note\Rpc\RpcClient; +use Note\Target; use Exception; use Rpc\Client; use Kiri\Core\Json; diff --git a/kiri-gii/GiiRpcService.php b/kiri-gii/GiiRpcService.php index a6b044c7..afb3aa02 100644 --- a/kiri-gii/GiiRpcService.php +++ b/kiri-gii/GiiRpcService.php @@ -33,8 +33,8 @@ class GiiRpcService extends GiiBase namespace App\Rpc; -use Annotation\Route\RpcProducer; -use Annotation\Target; +use Note\Route\RpcProducer; +use Note\Target; use Exception; use Http\Controller; use Kiri\Core\Json; diff --git a/kiri-note/Aspect.php b/kiri-note/Aspect.php index 50761918..1b25a8f3 100644 --- a/kiri-note/Aspect.php +++ b/kiri-note/Aspect.php @@ -1,7 +1,7 @@