|
Zhamao Framework
3.0.0-beta1
A high-performance chatbot + web framework
|
结构体 | |
| class | BoundMethod |
| class | ClassAliasHelper |
| class | Container |
| interface | ContainerInterface |
| class | ContainerServicesProvider |
| class | EntryNotFoundException |
| class | EntryResolutionException |
| class | WorkerContainer |
函数 | |
| __construct () | |
| bound (string $abstract) | |
| getAlias (string $abstract) | |
| alias (string $abstract, string $alias) | |
| bind (string $abstract, $concrete=null, bool $shared=false) | |
| bindIf (string $abstract, $concrete=null, bool $shared=false) | |
| singleton (string $abstract, $concrete=null) | |
| singletonIf (string $abstract, $concrete=null) | |
| instance (string $abstract, mixed $instance) | |
| factory (string $abstract) | |
| flush () | |
| make (string $abstract, array $parameters=[]) | |
| build (\Closure|string $concrete) | |
| call (callable|string $callback, array $parameters=[], string $default_method=null) | |
| get (string $id) | |
| has (string $id) | |
| extend (string $abstract, \Closure $closure) | |
| getLogPrefix () | |
| setLogPrefix (string $prefix) | |
| getExtenders (string $abstract) | |
| isAlias (string $name) | |
| dropStaleInstances (string $abstract) | |
| getClosure (string $abstract, string $concrete) | |
| getLastParameterOverride () | |
| notInstantiable (string $concrete, string $reason='') | |
| resolveDependencies (array $dependencies) | |
| hasParameterOverride (\ReflectionParameter $parameter) | |
| getParameterOverride (\ReflectionParameter $parameter) | |
| hasParameterTypeOverride (\ReflectionParameter $parameter) | |
| getParameterTypeOverride (\ReflectionParameter $parameter) | |
| resolvePrimitive (\ReflectionParameter $parameter) | |
| resolveClass (\ReflectionParameter $parameter) | |
| getConcrete (string $abstract) | |
| isBuildable (mixed $concrete, string $abstract) | |
| isShared (string $abstract) | |
| shouldLog () | |
| log (string $message) | |
变量 | |
| trait | ContainerTrait |
| array | $build_stack = [] |
| array | $with = [] |
| string | $log_prefix |
| ZM\Container\__construct | ( | ) |
| ZM\Container\alias | ( | string | $abstract, |
| string | $alias | ||
| ) |
注册一个类别名
| string | $abstract | 类或接口名 |
| string | $alias | 别名 |
| ZM\Container\bind | ( | string | $abstract, |
$concrete = null, |
|||
| bool | $shared = false |
||
| ) |
注册绑定
| string | $abstract | 类或接口名 |
| null | \Closure | string | $concrete | 返回类实例的闭包,或是类名 |
| bool | $shared | 是否共享 |
| ZM\Container\bindIf | ( | string | $abstract, |
$concrete = null, |
|||
| bool | $shared = false |
||
| ) |
注册绑定
在已经绑定时不会重复注册
| string | $abstract | 类或接口名 |
| null | \Closure | string | $concrete | 返回类实例的闭包,或是类名 |
| bool | $shared | 是否共享 |
| ZM\Container\bound | ( | string | $abstract | ) |
判断对应的类或接口是否已经注册
| string | $abstract | 类或接口名 |
| ZM\Container\build | ( | \Closure|string | $concrete | ) |
| ZM\Container\call | ( | callable|string | $callback, |
| array | $parameters = [], |
||
| string | $default_method = null |
||
| ) |
调用对应的方法,并自动注入依赖
| callable | string | $callback | 对应的方法 |
| array | $parameters | 参数 |
| null | string | $default_method | 默认方法 |
|
protected |
抛弃所有过时的实例和别名
| string | $abstract | 类或接口名 |
| ZM\Container\extend | ( | string | $abstract, |
| \Closure | $closure | ||
| ) |
扩展一个类或接口
| string | $abstract | 类或接口名 |
| \Closure | $closure | 扩展闭包 |
| ZM\Container\factory | ( | string | $abstract | ) |
获取一个解析对应类实例的闭包
| string | $abstract | 类或接口名 |
| ZM\Container\flush | ( | ) |
清除所有绑定和实例
| ZM\Container\get | ( | string | $id | ) |
Finds an entry of the container by its identifier and returns it.
| string | $id | identifier of the entry to look for |
| NotFoundExceptionInterface | no entry was found for this identifier |
| ContainerExceptionInterface | error while retrieving the entry |
| ZM\Container\getAlias | ( | string | $abstract | ) |
获取类别名(如存在)
| string | $abstract | 类或接口名 |
|
protected |
获取一个解析对应类的闭包
| string | $abstract | 类或接口名 |
| string | $concrete | 实际类名 |
|
protected |
获取类名的实际类型
| string | $abstract | 类或接口名 |
|
protected |
获取对应类型的所有扩展器
| string | $abstract | 类或接口名 |
|
protected |
获取最后一次的覆盖参数
| ZM\Container\getLogPrefix | ( | ) |
获取日志前缀
|
protected |
获取覆盖参数
|
protected |
获取临时注入的参数
| ZM\Container\has | ( | string | $id | ) |
Returns true if the container can return an entry for the given identifier. Returns false otherwise.
has($id) returning true does not mean that get($id) will not throw an exception. It does however mean that get($id) will not throw a NotFoundExceptionInterface.
| string | $id | identifier of the entry to look for |
|
protected |
判断传入的参数是否存在覆盖参数
|
protected |
判断传入的参数是否存在临时注入的参数
| ZM\Container\instance | ( | string | $abstract, |
| mixed | $instance | ||
| ) |
注册一个已有的实例,效果等同于单例绑定
| string | $abstract | 类或接口名 |
| mixed | $instance | 实例 |
|
protected |
判断传入的是否为别名
|
protected |
判断传入的实际类型是否可以构造
| mixed | $concrete | 实际类型 |
| string | $abstract | 类或接口名 |
|
protected |
判断传入的类型是否为共享实例
| string | $abstract | 类或接口名 |
|
protected |
记录日志(自动附加容器日志前缀)
| ZM\Container\make | ( | string | $abstract, |
| array | $parameters = [] |
||
| ) |
获取一个绑定的实例
@template T
| class-string<T> | $abstract 类或接口名 | |
| array | $parameters | 参数 |
|
protected |
抛出实例化异常
|
protected |
|
protected |
|
protected |
| ZM\Container\setLogPrefix | ( | string | $prefix | ) |
设置日志前缀
|
protected |
判断是否输出日志
| ZM\Container\singleton | ( | string | $abstract, |
$concrete = null |
|||
| ) |
注册一个单例绑定
| string | $abstract | 类或接口名 |
| null | \Closure | string | $concrete | 返回类实例的闭包,或是类名 |
| ZM\Container\singletonIf | ( | string | $abstract, |
$concrete = null |
|||
| ) |
注册一个单例绑定
在已经绑定时不会重复注册
| string | $abstract | 类或接口名 |
| null | \Closure | string | $concrete | 返回类实例的闭包,或是类名 |
|
protected |
|
protected |
日志前缀
|
protected |
| trait ContainerTrait |