DIContainer

class OC\AppFramework\DependencyInjection\DIContainer
Source:lib/private/AppFramework/DependencyInjection/DIContainer.php#80
Parent:OC\AppFramework\Utility\SimpleContainer
Implements:OCP\AppFramework\IAppContainer

Properties

Methods

public OC\AppFramework\DependencyInjection\DIContainer::__construct($appName, $urlParams=[], $server=null)
Put your class dependencies in here
Source:

lib/private/AppFramework/DependencyInjection/DIContainer.php#96

Parameters:
  • $appName (string) the name of the app
  • $urlParams (array)
  • $server (OC\ServerContainer | null)
public OC\AppFramework\DependencyInjection\DIContainer::getServer()
Source:lib/private/AppFramework/DependencyInjection/DIContainer.php#337
Returns:\OCP\IServerContainer
public OC\AppFramework\DependencyInjection\DIContainer::registerMiddleWare($middleWare)
Source:

lib/private/AppFramework/DependencyInjection/DIContainer.php#345

Parameters:
  • $middleWare (string)
Returns:

bool | null

public OC\AppFramework\DependencyInjection\DIContainer::getAppName()
used to return the appname of the set application
Source:lib/private/AppFramework/DependencyInjection/DIContainer.php#356
Returns:string the name of your application
public OC\AppFramework\DependencyInjection\DIContainer::isLoggedIn()
Source:lib/private/AppFramework/DependencyInjection/DIContainer.php#364
Deprecated:use IUserSession->isLoggedIn()
Returns:bool
public OC\AppFramework\DependencyInjection\DIContainer::isAdminUser()
Source:lib/private/AppFramework/DependencyInjection/DIContainer.php#372
Deprecated:use IGroupManager->isAdmin($userId)
Returns:bool
public OC\AppFramework\DependencyInjection\DIContainer::log($message, $level)
Source:

lib/private/AppFramework/DependencyInjection/DIContainer.php#387

Parameters:
  • $message (string)
  • $level (string)
Deprecated:

use the ILogger instead

Returns:

mixed

public OC\AppFramework\DependencyInjection\DIContainer::registerCapability($serviceName)
Register a capability
Source:

lib/private/AppFramework/DependencyInjection/DIContainer.php#413

Parameters:
  • $serviceName (string) e.g. ‘OCAFilesCapabilities’
public OC\AppFramework\DependencyInjection\DIContainer::has($id)
Source:lib/private/AppFramework/DependencyInjection/DIContainer.php#419
public OC\AppFramework\DependencyInjection\DIContainer::query($name, $autoload=true)
Source:lib/private/AppFramework/DependencyInjection/DIContainer.php#431
public OC\AppFramework\DependencyInjection\DIContainer::queryNoFallback($name)
Source:

lib/private/AppFramework/DependencyInjection/DIContainer.php#451

Parameters:
  • $name (string)
Returns:

mixed

Throws:

\OCP\AppFramework\QueryException if the query could not be resolved