├── src ├── Tool │ ├── README.md │ ├── Parser │ │ └── ToolParser.php │ ├── ArgType.php │ └── Annotation │ │ ├── Arg.php │ │ ├── Tool.php │ │ └── Operation.php ├── Controller │ ├── README.md │ ├── HttpController.php │ ├── TcpController.php │ ├── UdpController.php │ └── WebSocketController.php ├── Cli │ ├── bin │ │ └── imi-cli │ ├── ImiConsoleOutput.php │ ├── CliAppContexts.php │ ├── Annotation │ │ ├── Arg.php │ │ ├── Tool.php │ │ ├── Operation.php │ │ ├── Command.php │ │ └── CommandAction.php │ ├── Contract │ │ └── BaseCommand.php │ ├── Listener │ │ ├── LoadRuntimeListener.php │ │ └── BuildRuntimeListener.php │ └── ArgType.php ├── Bean │ ├── IBean.php │ ├── Exception │ │ ├── NotFoundException.php │ │ └── ContainerException.php │ ├── Parser │ │ ├── NullParser.php │ │ ├── IParser.php │ │ ├── ClassEventParser.php │ │ ├── PartialParser.php │ │ └── BaseParser.php │ ├── Annotation │ │ ├── Model │ │ │ ├── IAnnotationRelation.php │ │ │ └── ClassAnnotationRelation.php │ │ ├── Parser.php │ │ ├── Partial.php │ │ ├── ClassEventListener.php │ │ ├── Listener.php │ │ ├── Inherit.php │ │ └── Callback.php │ └── Traits │ │ └── TAutoInject.php ├── Cron │ ├── Message │ │ ├── IMessage.php │ │ ├── Clear.php │ │ ├── GetRealTasks.php │ │ ├── GetTask.php │ │ ├── HasTask.php │ │ ├── RemoveCron.php │ │ └── AddCron.php │ ├── Contract │ │ ├── ICronTask.php │ │ └── IScheduler.php │ ├── Consts │ │ ├── CronTaskType.php │ │ └── UniqueLevel.php │ └── Traits │ │ └── TWorkerReport.php ├── Db │ ├── Exception │ │ └── DbException.php │ ├── Query │ │ ├── Interfaces │ │ │ ├── IGroup.php │ │ │ ├── IHaving.php │ │ │ ├── IHavingBrackets.php │ │ │ ├── IWhereFullText.php │ │ │ ├── IPartition.php │ │ │ ├── IWhereCollector.php │ │ │ ├── IWhereBrackets.php │ │ │ ├── IBaseWhere.php │ │ │ ├── IWrapField.php │ │ │ ├── IOrder.php │ │ │ ├── IBase.php │ │ │ ├── IPaginateResult.php │ │ │ ├── IField.php │ │ │ ├── IDatabase.php │ │ │ ├── IWhere.php │ │ │ └── ITable.php │ │ ├── Group.php │ │ ├── Having │ │ │ ├── Having.php │ │ │ └── HavingBrackets.php │ │ ├── Builder │ │ │ └── IBuilder.php │ │ ├── QueryType.php │ │ ├── Result │ │ │ └── BaseChunkResult.php │ │ ├── Raw.php │ │ └── Where │ │ │ └── BaseWhere.php │ ├── Mysql │ │ ├── Contract │ │ │ ├── IMysqlStatement.php │ │ │ └── IMysqlDb.php │ │ ├── Drivers │ │ │ ├── MysqlBaseStatement.php │ │ │ └── PdoMysql │ │ │ │ └── Statement.php │ │ ├── Query │ │ │ ├── Lock │ │ │ │ └── MysqlLock.php │ │ │ └── FullText │ │ │ │ └── SearchModifier.php │ │ └── Consts │ │ │ └── LogicalOperator.php │ ├── Annotation │ │ ├── RollbackType.php │ │ ├── TransactionType.php │ │ └── DbInject.php │ ├── Drivers │ │ ├── BaseStatement.php │ │ └── Base.php │ ├── Event │ │ └── Param │ │ │ └── DbPrepareEventParam.php │ ├── Listener │ │ ├── WorkerStart.php │ │ └── RequestContextDestroy.php │ └── SqlState.php ├── Lock │ ├── Exception │ │ └── LockFailException.php │ └── LockConfigOption.php ├── Main │ ├── IMain.php │ └── AppBaseMain.php ├── Util │ ├── Interfaces │ │ ├── IHashCode.php │ │ └── IArrayable.php │ ├── StaticValueStorage.php │ ├── Traits │ │ ├── TStaticClass.php │ │ ├── TBeanRealClass.php │ │ ├── TAnonymous.php │ │ ├── TNotRequiredDataToProperty.php │ │ ├── THashCode.php │ │ └── TDataToProperty.php │ ├── MemoryTable │ │ └── IMemoryTableOption.php │ ├── Process.php │ ├── Bit.php │ ├── Format │ │ ├── IFormat.php │ │ ├── PhpSerialize.php │ │ └── Json.php │ ├── Http │ │ ├── MessageUtil.php │ │ └── Consts │ │ │ └── RequestMethod.php │ ├── Process │ │ ├── ProcessAppContexts.php │ │ └── ProcessType.php │ ├── ImiPriority.php │ ├── Digital.php │ ├── LazyArrayObject.php │ └── Socket │ │ └── IPEndPoint.php ├── Cache │ ├── CacheException.php │ └── InvalidArgumentException.php ├── Server │ ├── DataParser │ │ └── IParser.php │ ├── Group │ │ └── Exception │ │ │ └── MethodNotFoundException.php │ ├── Http │ │ ├── Message │ │ │ ├── Emitter │ │ │ │ ├── Contract │ │ │ │ │ ├── BaseEmitter.php │ │ │ │ │ └── IResponseBodyEmitter.php │ │ │ │ └── Handler │ │ │ │ │ └── IEmitHandler.php │ │ │ ├── Request.php │ │ │ └── Contract │ │ │ │ └── IHttpRequest.php │ │ ├── Error │ │ │ ├── IErrorHandler.php │ │ │ ├── IExecuteTimeoutHandler.php │ │ │ ├── IHttpNotFoundHandler.php │ │ │ ├── ErrorHandler.php │ │ │ └── ExecuteTimeoutHandler.php │ │ ├── Route │ │ │ ├── Annotation │ │ │ │ ├── Action.php │ │ │ │ └── Middleware.php │ │ │ └── RouteResult.php │ │ ├── Cli │ │ │ └── template.tpl │ │ ├── Parser │ │ │ └── ControllerParser.php │ │ └── Annotation │ │ │ ├── ExtractData.php │ │ │ └── RequestParam.php │ ├── View │ │ ├── Annotation │ │ │ ├── BaseViewOption.php │ │ │ ├── XmlView.php │ │ │ └── HtmlView.php │ │ ├── Engine │ │ │ └── IEngine.php │ │ └── Handler │ │ │ └── IHandler.php │ ├── TcpServer │ │ ├── Route │ │ │ ├── IRoute.php │ │ │ ├── Annotation │ │ │ │ ├── TcpAction.php │ │ │ │ └── TcpController.php │ │ │ ├── RouteResult.php │ │ │ └── RouteItem.php │ │ ├── Error │ │ │ ├── IErrorHandler.php │ │ │ ├── ITcpRouteNotFoundHandler.php │ │ │ ├── ErrorHandler.php │ │ │ └── TcpRouteNotFoundHandler.php │ │ ├── IReceiveHandler.php │ │ ├── Middleware │ │ │ └── IMiddleware.php │ │ ├── Contract │ │ │ └── ITcpServer.php │ │ ├── Message │ │ │ └── IReceiveData.php │ │ └── Parser │ │ │ └── TcpControllerParser.php │ ├── UdpServer │ │ ├── Route │ │ │ ├── IRoute.php │ │ │ ├── Annotation │ │ │ │ ├── UdpAction.php │ │ │ │ └── UdpController.php │ │ │ ├── RouteResult.php │ │ │ └── RouteItem.php │ │ ├── Error │ │ │ ├── IErrorHandler.php │ │ │ ├── IUdpRouteNotFoundHandler.php │ │ │ ├── ErrorHandler.php │ │ │ └── UdpRouteNotFoundHandler.php │ │ ├── IPacketHandler.php │ │ ├── Middleware │ │ │ └── IMiddleware.php │ │ ├── Contract │ │ │ └── IUdpServer.php │ │ ├── Message │ │ │ └── IPacketData.php │ │ ├── Parser │ │ │ └── UdpControllerParser.php │ │ └── Controller │ │ │ └── UdpController.php │ ├── WebSocket │ │ ├── Route │ │ │ ├── IRoute.php │ │ │ ├── Annotation │ │ │ │ ├── WSAction.php │ │ │ │ ├── WSConfig.php │ │ │ │ ├── WSController.php │ │ │ │ └── WSMiddleware.php │ │ │ ├── RouteResult.php │ │ │ └── RouteItem.php │ │ ├── Error │ │ │ ├── IErrorHandler.php │ │ │ ├── IWSRouteNotFoundHandler.php │ │ │ ├── ErrorHandler.php │ │ │ └── WSRouteNotFoundHandler.php │ │ ├── IMessageHandler.php │ │ ├── Middleware │ │ │ └── IMiddleware.php │ │ ├── Enum │ │ │ └── NonControlFrameType.php │ │ ├── Contract │ │ │ └── IWebSocketServer.php │ │ ├── Parser │ │ │ └── WSControllerParser.php │ │ └── Controller │ │ │ └── WebSocketController.php │ ├── ConnectionContext │ │ └── Event │ │ │ ├── Listener │ │ │ └── IConnectionContextRestoreListener.php │ │ │ └── Param │ │ │ └── ConnectionContextRestoreParam.php │ ├── Protocol.php │ └── Route │ │ └── TMiddleware.php ├── Core │ ├── Context │ │ ├── Exception │ │ │ ├── ContextExistsException.php │ │ │ └── ContextNotFoundException.php │ │ └── Contract │ │ │ └── IContextManager.php │ ├── Runtime │ │ ├── Contract │ │ │ └── IRuntimeModeHandler.php │ │ ├── Runtime.php │ │ └── Handler │ │ │ └── DefaultRuntimeModeHandler.php │ ├── App │ │ ├── Enum │ │ │ └── LoadRuntimeResult.php │ │ └── Contract │ │ │ └── IApp.php │ └── Component │ │ └── Listener │ │ ├── LoadRuntimeListener.php │ │ └── BuildRuntimeListener.php ├── Model │ ├── Cli │ │ └── Model │ │ │ ├── Event │ │ │ └── Param │ │ │ │ ├── AfterGenerateModels.php │ │ │ │ ├── BeforeGenerateModels.php │ │ │ │ ├── AfterGenerateModel.php │ │ │ │ └── BeforeGenerateModel.php │ │ │ └── template.tpl │ ├── Event │ │ ├── Listener │ │ │ ├── IInitEventListener.php │ │ │ ├── IAfterFindEventListener.php │ │ │ ├── IAfterSaveEventListener.php │ │ │ ├── IBeforeFindEventListener.php │ │ │ ├── IBeforeSaveEventListener.php │ │ │ ├── IAfterDeleteEventListener.php │ │ │ ├── IAfterInsertEventListener.php │ │ │ ├── IAfterSelectEventListener.php │ │ │ ├── IAfterUpdateEventListener.php │ │ │ ├── IBeforeDeleteEventListener.php │ │ │ ├── IBeforeInsertEventListener.php │ │ │ ├── IBeforeSelectEventListener.php │ │ │ ├── IBeforeUpdateEventListener.php │ │ │ ├── IAfterBatchDeleteEventListener.php │ │ │ ├── IAfterBatchUpdateEventListener.php │ │ │ ├── IBeforeBatchDeleteEventListener.php │ │ │ ├── IBeforeBatchUpdateEventListener.php │ │ │ ├── IAfterParseDataEventListener.php │ │ │ ├── IBeforeParseDataEventListener.php │ │ │ └── IAfterQueryEventListener.php │ │ └── Param │ │ │ ├── AfterQueryEventParam.php │ │ │ ├── AfterSelectEventParam.php │ │ │ ├── BeforeSelectEventParam.php │ │ │ ├── BeforeBatchDeleteEventParam.php │ │ │ ├── AfterBatchDeleteEventParam.php │ │ │ ├── InitEventParam.php │ │ │ ├── AfterFindEventParam.php │ │ │ ├── BeforeFindEventParam.php │ │ │ ├── BeforeParseDataEventParam.php │ │ │ ├── AfterDeleteEventParam.php │ │ │ ├── BeforeDeleteEventParam.php │ │ │ ├── AfterBatchUpdateEventParam.php │ │ │ ├── BeforeBatchUpdateEventParam.php │ │ │ ├── AfterParseDataEventParam.php │ │ │ ├── AfterSaveEventParam.php │ │ │ ├── BeforeSaveEventParam.php │ │ │ ├── AfterInsertEventParam.php │ │ │ ├── AfterUpdateEventParam.php │ │ │ ├── BeforeInsertEventParam.php │ │ │ └── BeforeUpdateEventParam.php │ ├── ModelQuery.php │ ├── Annotation │ │ ├── JsonNotNull.php │ │ ├── Relation │ │ │ ├── RelationBase.php │ │ │ ├── JoinToMiddle.php │ │ │ ├── JoinFromMiddle.php │ │ │ ├── AutoDelete.php │ │ │ ├── AutoInsert.php │ │ │ ├── JoinTo.php │ │ │ ├── JoinFrom.php │ │ │ ├── AutoSave.php │ │ │ ├── AutoUpdate.php │ │ │ └── AutoSelect.php │ │ ├── Sql.php │ │ ├── Serializables.php │ │ ├── Serializable.php │ │ ├── Entity.php │ │ ├── ExtractProperty.php │ │ ├── JsonEncode.php │ │ ├── Id.php │ │ └── Table.php │ ├── IdGenerator │ │ ├── Contract │ │ │ └── IIdGenerator.php │ │ └── UUIDGeneratorType.php │ ├── Enum │ │ ├── RelationPoolName.php │ │ └── RedisStorageMode.php │ ├── Relation │ │ ├── Struct │ │ │ ├── OneToMany.php │ │ │ ├── OneToOne.php │ │ │ ├── PolymorphicOneToOne.php │ │ │ └── PolymorphicOneToMany.php │ │ └── TRelation.php │ ├── Key │ │ └── KeyRule.php │ ├── Contract │ │ └── IModelQuery.php │ ├── Tree │ │ └── Annotation │ │ │ └── TreeModel.php │ └── Traits │ │ └── TSetValue.php ├── Event │ ├── IEventListener.php │ ├── EventItem.php │ └── Listener │ │ ├── LoadRuntimeListener.php │ │ └── BuildRuntimeListener.php ├── Aop │ ├── Annotation │ │ ├── After.php │ │ ├── Around.php │ │ ├── Before.php │ │ ├── AfterReturning.php │ │ ├── BaseInjectValue.php │ │ ├── Aspect.php │ │ ├── AfterThrowing.php │ │ ├── FilterArg.php │ │ ├── InjectArg.php │ │ ├── PointCut.php │ │ └── CallableValue.php │ ├── PointCutType.php │ ├── AfterReturningJoinPoint.php │ └── Listener │ │ └── BuildRuntimeListener.php ├── Async │ ├── Annotation │ │ ├── Async.php │ │ ├── Defer.php │ │ └── DeferAsync.php │ ├── Contract │ │ ├── IAsyncResult.php │ │ └── IAsyncHandler.php │ └── Exception │ │ └── AsyncTimeoutException.php ├── AppContexts.php ├── HttpValidate │ └── Annotation │ │ ├── HttpValidation.php │ │ └── ExtractData.php ├── Log │ ├── LogLevel.php │ └── MonoLogger.php ├── Facade │ ├── Cli │ │ └── template.tpl │ └── Annotation │ │ └── Facade.php ├── Redis │ ├── Enum │ │ └── RedisMode.php │ ├── Annotation │ │ └── RedisInject.php │ └── SyncRedisPool.php ├── Pool │ ├── Listener │ │ ├── RequestContextDestroy.php │ │ ├── ClearListener.php │ │ └── WorkerStart.php │ ├── ResourceConfigMode.php │ ├── Annotation │ │ ├── PoolClean.php │ │ └── PoolResource.php │ ├── BasePoolResource.php │ ├── TUriResourceConfig.php │ └── Interfaces │ │ └── IPoolResource.php ├── Validate │ └── Annotation │ │ ├── AutoValidation.php │ │ ├── Scene.php │ │ ├── ValidateValue.php │ │ └── Required.php ├── Timer │ └── Contract │ │ └── ITimer.php ├── HotUpdate │ └── Monitor │ │ ├── IMonitor.php │ │ └── BaseMonitor.php ├── Contract │ └── IWorker.php ├── Enum │ ├── Annotation │ │ ├── Parser │ │ │ └── EnumParser.php │ │ └── EnumItem.php │ └── Listener │ │ ├── LoadRuntimeListener.php │ │ └── BuildRuntimeListener.php └── RequestContextProxy │ ├── Cli │ └── template.tpl │ └── Annotation │ └── RequestContextProxy.php └── config └── config.php /src/Tool/README.md: -------------------------------------------------------------------------------- 1 | 本目录仅兼容 imi v1 2 | -------------------------------------------------------------------------------- /src/Controller/README.md: -------------------------------------------------------------------------------- 1 | 本目录仅兼容 imi v1 2 | -------------------------------------------------------------------------------- /src/Cli/bin/imi-cli: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | [ 7 | 'Imi\Components\*', 8 | ], 9 | ]; 10 | -------------------------------------------------------------------------------- /src/Cron/Message/Clear.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | declare(strict_types=1); 4 | 5 | namespace ; 6 | 7 | use Imi\Facade\BaseFacade; 8 | use Imi\Facade\Annotation\Facade; 9 | 10 | /** 11 | * 12 | 13 | 14 | * 15 | 16 | 17 | */ 18 | class extends BaseFacade 19 | { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/Server/UdpServer/Contract/IUdpServer.php: -------------------------------------------------------------------------------- 1 | initLeftAndRight($className, $propertyName, $annotation); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Model/Relation/Struct/OneToOne.php: -------------------------------------------------------------------------------- 1 | initLeftAndRight($className, $propertyName, $annotation); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Cron/Consts/CronTaskType.php: -------------------------------------------------------------------------------- 1 | initLeftAndRight($className, $propertyName, $annotation); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Model/Cli/Model/template.tpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | declare(strict_types=1); 6 | 7 | namespace ; 8 | 9 | use Imi\Bean\Annotation\Inherit; 10 | use \Base\Base; 11 | 12 | /** 13 | * . 14 | * 15 | * @Inherit 16 | */ 17 | class extends Base 18 | { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/Model/Relation/Struct/PolymorphicOneToMany.php: -------------------------------------------------------------------------------- 1 | initLeftAndRight($className, $propertyName, $annotation); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Server/TcpServer/Contract/ITcpServer.php: -------------------------------------------------------------------------------- 1 | getArray(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Model/IdGenerator/UUIDGeneratorType.php: -------------------------------------------------------------------------------- 1 | config) 20 | { 21 | return $this->config = Config::get('@app'); 22 | } 23 | 24 | return $this->config; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Model/Event/Param/AfterBatchUpdateEventParam.php: -------------------------------------------------------------------------------- 1 | $v) 17 | { 18 | $this->{$k} = $v; 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Server/TcpServer/Error/ITcpRouteNotFoundHandler.php: -------------------------------------------------------------------------------- 1 | __hashCode; 17 | if (null === $hashCode) 18 | { 19 | $hashCode = spl_object_hash($this); 20 | } 21 | 22 | return $hashCode; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Cli/Annotation/Tool.php: -------------------------------------------------------------------------------- 1 | rule = $rule; 24 | $this->paramNames = $paramNames; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Pool/ResourceConfigMode.php: -------------------------------------------------------------------------------- 1 | $v) 20 | { 21 | $this->{$k} = $v; 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Cron/Consts/UniqueLevel.php: -------------------------------------------------------------------------------- 1 | $values) 17 | { 18 | $result[$name] = implode(', ', $values); 19 | } 20 | 21 | return $result; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Async/Contract/IAsyncHandler.php: -------------------------------------------------------------------------------- 1 | __autoInject(); 18 | } 19 | 20 | /** 21 | * 自动注入属性. 22 | */ 23 | protected function __autoInject(): void 24 | { 25 | BeanProxy::injectProps($this, BeanFactory::getObjectClass($this)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Server/WebSocket/Enum/NonControlFrameType.php: -------------------------------------------------------------------------------- 1 | setRawSQL($raw, $binds); 18 | } 19 | 20 | /** 21 | * {@inheritDoc} 22 | */ 23 | public function toString(IQuery $query): string 24 | { 25 | return $this->rawSQL; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Server/Http/Error/ErrorHandler.php: -------------------------------------------------------------------------------- 1 | handler)->handle($throwable); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Server/WebSocket/Contract/IWebSocketServer.php: -------------------------------------------------------------------------------- 1 | className, $annotation->eventName, $className, $annotation->priority); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Cron/Contract/IScheduler.php: -------------------------------------------------------------------------------- 1 | toArray()); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Server/Http/Cli/template.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | declare(strict_types=1); 4 | 5 | namespace ; 6 | 7 | use Imi\Controller\HttpController; 8 | use Imi\Server\View\Annotation\View; 9 | use Imi\Server\Http\Route\Annotation\Action; 10 | use Imi\Server\Http\Route\Annotation\Controller; 11 | 12 | /** 13 | * @Controller("") 14 | * @View(renderType="") 15 | */ 16 | class extends HttpController 17 | { 18 | /** 19 | * index 20 | * 21 | * @Action 22 | * @return void 23 | */ 24 | public function index() 25 | { 26 | return ['success'=>true]; 27 | } 28 | } -------------------------------------------------------------------------------- /src/Validate/Annotation/Scene.php: -------------------------------------------------------------------------------- 1 | class); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Cli/Contract/BaseCommand.php: -------------------------------------------------------------------------------- 1 | command = $command; 22 | $this->input = $input; 23 | $this->output = $output; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Model/Annotation/Relation/JoinFrom.php: -------------------------------------------------------------------------------- 1 | routeItem = $routeItem; 29 | $this->params = $params; 30 | $this->callable = $routeItem->callable; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Bean/Annotation/Partial.php: -------------------------------------------------------------------------------- 1 | getData()['data']['cli'] ?? []; 25 | CliManager::setMap($data['cli'] ?? []); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Pool/Annotation/PoolResource.php: -------------------------------------------------------------------------------- 1 | name); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Aop/AfterReturningJoinPoint.php: -------------------------------------------------------------------------------- 1 | returnValue = $value; 26 | } 27 | 28 | /** 29 | * 获取返回值 30 | * 31 | * @return mixed 32 | */ 33 | public function getReturnValue() 34 | { 35 | return $this->returnValue; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Enum/Listener/LoadRuntimeListener.php: -------------------------------------------------------------------------------- 1 | getData()['data']['enum'] ?? []; 25 | EnumManager::setMap($data['enum'] ?? []); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Pool/Listener/WorkerStart.php: -------------------------------------------------------------------------------- 1 | getData(); 24 | $data = []; 25 | $data['cli'] = CliManager::getMap(); 26 | $eventData['data']['cli'] = $data; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Redis/Annotation/RedisInject.php: -------------------------------------------------------------------------------- 1 | name); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Validate/Annotation/ValidateValue.php: -------------------------------------------------------------------------------- 1 | getData(); 24 | $data = []; 25 | $data['enum'] = EnumManager::getMap(); 26 | $eventData['data']['enum'] = $data; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Aop/Annotation/PointCut.php: -------------------------------------------------------------------------------- 1 | handler) 23 | { 24 | return RequestContext::getServerBean($this->handler)->handle($throwable); 25 | } 26 | else 27 | { 28 | return false; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Server/UdpServer/Error/ErrorHandler.php: -------------------------------------------------------------------------------- 1 | handler) 23 | { 24 | return RequestContext::getServerBean($this->handler)->handle($throwable); 25 | } 26 | else 27 | { 28 | return false; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Server/TcpServer/Message/IReceiveData.php: -------------------------------------------------------------------------------- 1 | handler) 23 | { 24 | return RequestContext::getServerBean($this->handler)->handle($throwable); 25 | } 26 | else 27 | { 28 | return false; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Bean/Annotation/ClassEventListener.php: -------------------------------------------------------------------------------- 1 | getData()['data']['component']['components'] ?? []); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Db/Query/Interfaces/IField.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | namespace ; 4 | 5 | use Imi\Bean\Annotation\Bean; 6 | use Imi\RequestContextProxy\BaseRequestContextProxy; 7 | use Imi\RequestContextProxy\Annotation\RequestContextProxy; 8 | 9 | /** 10 | 11 | * 12 | 13 | 14 | * 15 | 16 | * 17 | 18 | * 19 | 20 | 21 | */ 22 | class extends BaseRequestContextProxy implements \ 23 | 24 | { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/Redis/SyncRedisPool.php: -------------------------------------------------------------------------------- 1 | initUriResourceConfig(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Server/Http/Parser/ControllerParser.php: -------------------------------------------------------------------------------- 1 | controllerAnnotationClass = Controller::class; 21 | } 22 | 23 | /** 24 | * {@inheritDoc} 25 | */ 26 | public function parse(\Imi\Bean\Annotation\Base $annotation, string $className, string $target, string $targetName): void 27 | { 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Server/TcpServer/Route/RouteResult.php: -------------------------------------------------------------------------------- 1 | routeItem = $routeItem; 31 | $this->params = $params; 32 | $this->callable = $routeItem->callable; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Server/UdpServer/Route/RouteResult.php: -------------------------------------------------------------------------------- 1 | routeItem = $routeItem; 31 | $this->params = $params; 32 | $this->callable = $routeItem->callable; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Db/Listener/WorkerStart.php: -------------------------------------------------------------------------------- 1 | getData(); 24 | $eventData['data']['component'] = [ 25 | 'components' => ComponentManager::getComponents(), 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Model/Annotation/Relation/AutoUpdate.php: -------------------------------------------------------------------------------- 1 | controllerAnnotationClass = WSController::class; 21 | } 22 | 23 | /** 24 | * {@inheritDoc} 25 | */ 26 | public function parse(\Imi\Bean\Annotation\Base $annotation, string $className, string $target, string $targetName): void 27 | { 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/RequestContextProxy/Annotation/RequestContextProxy.php: -------------------------------------------------------------------------------- 1 | controllerAnnotationClass = TcpController::class; 21 | } 22 | 23 | /** 24 | * {@inheritDoc} 25 | */ 26 | public function parse(\Imi\Bean\Annotation\Base $annotation, string $className, string $target, string $targetName): void 27 | { 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Server/UdpServer/Parser/UdpControllerParser.php: -------------------------------------------------------------------------------- 1 | controllerAnnotationClass = UdpController::class; 21 | } 22 | 23 | /** 24 | * {@inheritDoc} 25 | */ 26 | public function parse(\Imi\Bean\Annotation\Base $annotation, string $className, string $target, string $targetName): void 27 | { 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Event/EventItem.php: -------------------------------------------------------------------------------- 1 | callback = $callback; 35 | $this->priority = $priority; 36 | $this->oneTime = $oneTime; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Model/Annotation/Relation/AutoSelect.php: -------------------------------------------------------------------------------- 1 | logicalOperator; 19 | } 20 | 21 | public function setLogicalOperator(string $logicalOperator): void 22 | { 23 | $this->logicalOperator = $logicalOperator; 24 | } 25 | 26 | public function toString(IQuery $query): string 27 | { 28 | throw new \RuntimeException(sprintf('%s object can not be used as string', static::class)); // @codeCoverageIgnore 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Enum/Annotation/EnumItem.php: -------------------------------------------------------------------------------- 1 | getData(); 24 | $eventData['data']['aop'] = [ 25 | 'cache' => AopManager::getArrayCache(), 26 | 'dynamicRulesCache' => AopManager::getDynamicRulesCache(), 27 | ]; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Server/Http/Route/RouteResult.php: -------------------------------------------------------------------------------- 1 | id = $id; 34 | $this->routeItem = $routeItem; 35 | $this->params = $params; 36 | $this->callable = $routeItem->callable; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Server/View/Annotation/HtmlView.php: -------------------------------------------------------------------------------- 1 | setStatus(StatusCode::INTERNAL_SERVER_ERROR)->setBody(new MemoryStream('

Request execute timeout

'))->send(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Server/UdpServer/Controller/UdpController.php: -------------------------------------------------------------------------------- 1 | server = RequestContext::getServer(); 30 | // @phpstan-ignore-next-line 31 | $this->data = $server->getBean('UdpPacketDataProxy'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Event/Listener/LoadRuntimeListener.php: -------------------------------------------------------------------------------- 1 | getData()['data']['event'] ?? []; 26 | EventManager::setMap($data['event'] ?? []); 27 | ClassEventManager::setMap($data['classEvent'] ?? []); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Pool/BasePoolResource.php: -------------------------------------------------------------------------------- 1 | pool = $pool; 23 | } 24 | 25 | /** 26 | * {@inheritDoc} 27 | */ 28 | public function getPool(): IPool 29 | { 30 | return $this->pool; 31 | } 32 | 33 | /** 34 | * {@inheritDoc} 35 | */ 36 | public function isOpened(): bool 37 | { 38 | return true; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Core/App/Contract/IApp.php: -------------------------------------------------------------------------------- 1 | getData(); 25 | $data = []; 26 | $data['event'] = EventManager::getMap(); 27 | $data['classEvent'] = ClassEventManager::getMap(); 28 | $eventData['data']['event'] = $data; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Server/WebSocket/Route/Annotation/WSConfig.php: -------------------------------------------------------------------------------- 1 | resourceConfig as &$config) 14 | { 15 | if (\is_array($config)) 16 | { 17 | continue; 18 | } 19 | $list = explode(';', $config); 20 | $config = []; 21 | foreach ($list as $uri) 22 | { 23 | $uriObj = new Uri($uri); 24 | parse_str($uriObj->getQuery(), $config); 25 | $config['host'] ??= $uriObj->getHost(); 26 | $config['port'] ??= $uriObj->getPort(); 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Server/Http/Annotation/ExtractData.php: -------------------------------------------------------------------------------- 1 | server = RequestContext::getServer(); 30 | // @phpstan-ignore-next-line 31 | $this->frame = $server->getBean('WebSocketFrameProxy'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Db/Query/Interfaces/IDatabase.php: -------------------------------------------------------------------------------- 1 | includePaths = $includePaths; 28 | $this->excludePaths = $excludePaths; 29 | $this->init(); 30 | } 31 | 32 | /** 33 | * 初始化. 34 | */ 35 | abstract protected function init(): void; 36 | } 37 | -------------------------------------------------------------------------------- /src/Db/Query/Interfaces/ITable.php: -------------------------------------------------------------------------------- 1 | annotation = $annotation; 36 | $this->callable = $callable; 37 | $this->options = $options; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Server/UdpServer/Route/RouteItem.php: -------------------------------------------------------------------------------- 1 | annotation = $annotation; 36 | $this->callable = $callable; 37 | $this->options = $options; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Server/WebSocket/Route/RouteItem.php: -------------------------------------------------------------------------------- 1 | annotation = $annotation; 36 | $this->callable = $callable; 37 | $this->options = $options; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Bean/Annotation/Inherit.php: -------------------------------------------------------------------------------- 1 | getArrayCopy(); 27 | } 28 | 29 | /** 30 | * 将当前对象作为数组返回. 31 | */ 32 | public function toArray(): array 33 | { 34 | return $this->getArrayCopy(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Server/WebSocket/Error/WSRouteNotFoundHandler.php: -------------------------------------------------------------------------------- 1 | handler) 30 | { 31 | return App::getBean($this->handler)->handle($frame, $handler); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Server/UdpServer/Error/UdpRouteNotFoundHandler.php: -------------------------------------------------------------------------------- 1 | handler) 30 | { 31 | return App::getBean($this->handler)->handle($data, $handler); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Server/TcpServer/Error/TcpRouteNotFoundHandler.php: -------------------------------------------------------------------------------- 1 | handler) 30 | { 31 | return App::getBean($this->handler)->handle($data, $handler); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Aop/Annotation/CallableValue.php: -------------------------------------------------------------------------------- 1 | callable)(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Model/Traits/TSetValue.php: -------------------------------------------------------------------------------- 1 | getDbPoolName(); 24 | case RelationPoolName::RELATION: 25 | return $relationModel::__getMeta()->getDbPoolName(); 26 | } 27 | throw new \InvalidArgumentException(sprintf('Invalid poolName %s', $poolName)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Bean/Annotation/Model/ClassAnnotationRelation.php: -------------------------------------------------------------------------------- 1 | class = $class; 24 | $this->annotation = $annotation; 25 | } 26 | 27 | /** 28 | * {@inheritDoc} 29 | */ 30 | public function getClass(): string 31 | { 32 | return $this->class; 33 | } 34 | 35 | /** 36 | * {@inheritDoc} 37 | */ 38 | public function getAnnotation(): Base 39 | { 40 | return $this->annotation; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Db/Listener/RequestContextDestroy.php: -------------------------------------------------------------------------------- 1 | getInstance()); 29 | } 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Db/Mysql/Query/FullText/SearchModifier.php: -------------------------------------------------------------------------------- 1 | class, $this->method]; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Pool/Interfaces/IPoolResource.php: -------------------------------------------------------------------------------- 1 | address = $address; 25 | $this->port = $port; 26 | } 27 | 28 | public function __toString(): string 29 | { 30 | return $this->address . ':' . $this->port; 31 | } 32 | 33 | /** 34 | * 获取地址 35 | */ 36 | public function getAddress(): string 37 | { 38 | return $this->address; 39 | } 40 | 41 | /** 42 | * 获取端口. 43 | */ 44 | public function getPort(): int 45 | { 46 | return $this->port; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Cli/Annotation/CommandAction.php: -------------------------------------------------------------------------------- 1 | name, $this->queryType); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Log/MonoLogger.php: -------------------------------------------------------------------------------- 1 | useLoggingLoopDetection(false); 25 | } 26 | elseif (version_compare(InstalledVersions::getVersion('monolog/monolog'), '2.6.0', '>=')) 27 | { 28 | $ref = new \ReflectionClass(parent::class); 29 | $property = $ref->getProperty('logDepth'); 30 | $property->setAccessible(true); 31 | $property->setValue($this, \PHP_INT_MIN); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Db/Drivers/Base.php: -------------------------------------------------------------------------------- 1 | option = $option; 22 | } 23 | 24 | /** 25 | * 获取连接配置. 26 | */ 27 | public function getOption(): array 28 | { 29 | return $this->option; 30 | } 31 | 32 | /** 33 | * 数据库连接后,执行初始化的 SQL. 34 | */ 35 | protected function execInitSqls(): void 36 | { 37 | $sqls = $this->option['initSqls'] ?? []; 38 | if ($sqls) 39 | { 40 | foreach ($sqls as $sql) 41 | { 42 | $this->exec($sql); 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Model/Annotation/Table.php: -------------------------------------------------------------------------------- 1 |