IBootContext¶
-
interface
OCP\AppFramework\Bootstrap\
IBootContext
¶ Implemented by: OC\AppFramework\Bootstrap\BootContext
Source: lib/public/AppFramework/Bootstrap/IBootContext.php#38
Methods¶
-
public
OCP\AppFramework\Bootstrap\IBootContext::
getAppContainer
()¶ - Get hold of the app’s containerUseful to register and query app-specific services
Source: lib/public/AppFramework/Bootstrap/IBootContext.php#48 Returns: \OCP\AppFramework\IAppContainer
Since: 20.0.0
-
public
OCP\AppFramework\Bootstrap\IBootContext::
getServerContainer
()¶ - Get hold of the server DI containerUseful to register and query system-wide services
Source: lib/public/AppFramework/Bootstrap/IBootContext.php#58 Returns: \OCP\IServerContainer
Since: 20.0.0
-
public
OCP\AppFramework\Bootstrap\IBootContext::
injectFn
($fn)¶ - Invoke the given callable and inject all parameters based on their typesand namesNote: when used with methods, make sure they are public or use \Closure::fromCallableto wrap the private method call, e.g.* `$context->injectFn([$obj, ‘publicMethod’])`* `$context->injectFn([$this, ‘publicMethod’])`* `$context->injectFn(\Closure::fromCallable([$this, ‘privateMethod’]))`Note: the app container will be queried
Source: Parameters: - $fn (callable)
Throws: \Psr\Container\ContainerExceptionInterface
if at least one of the parameter can’t be resolvedThrows: \Throwable
any error the function invocation might causeThrows: \Psr\Container\ContainerExceptionInterface
if at least one of the parameter can’t be resolvedThrows: \Throwable
any error the function invocation might causeReturns: mixed | null the return value of the invoked function, if any
Since: 20.0.0