Documentation

IServerContainer extends ContainerInterface, IContainer
in

This is a tagging interface for the server container

The interface currently extends IContainer, but this interface is deprecated as of Nextcloud 20, thus this interface won't extend it anymore once that was removed. So migrate to the ContainerInterface only.

Tags
since
6.0.0

Table of Contents

createEventSource()  : IEventSource
Create a new event source
getActivityManager()  : IManager
Returns the activity manager
getAppConfig()  : IAppConfig
Returns the app config manager
getAppManager()  : IAppManager
Get the app manager
getAvatarManager()  : IAvatarManager
Returns an avatar manager, used for avatar functionality
getCache()  : ICache
Returns an ICache instance
getCalendarManager()  : IManager
The calendar manager will act as a broker between consumers for calendar information and providers which actual deliver the calendar information.
getCalendarResourceBackendManager()  : IBackend
The calendar resource backend manager will act as a broker between consumers for calendar resource information an providers which actual deliver the room information.
getCalendarRoomBackendManager()  : IBackend
The calendar room backend manager will act as a broker between consumers for calendar room information an providers which actual deliver the room information.
getCertificateManager()  : ICertificateManager
Get the certificate manager for the user
getCloudFederationFactory()  : ICloudFederationFactory
getCloudFederationProviderManager()  : ICloudFederationProviderManager
getCloudIdManager()  : ICloudIdManager
getCommandBus()  : IBus
getCommentsManager()  : ICommentsManager
getConfig()  : IConfig
Returns the config manager
getContactsManager()  : IManager
The contacts manager will act as a broker between consumers for contacts information and providers which actual deliver the contact information.
getContentSecurityPolicyManager()  : IContentSecurityPolicyManager
getCredentialsManager()  : ICredentialsManager
Returns a CredentialsManager instance
getCrypto()  : ICrypto
Returns a Crypto instance
getDatabaseConnection()  : IDBConnection
Returns the current session
getDateTimeFormatter()  : IDateTimeFormatter
getDateTimeZone()  : IDateTimeZone
getEncryptionFilesHelper()  : File
getEncryptionKeyStorage()  : IStorage
getEncryptionManager()  : Manager
getEventDispatcher()  : EventDispatcherInterface
Get the EventDispatcher
getEventLogger()  : IEventLogger
Get the active event logger
getGlobalScaleConfig()  : IConfig
getGroupManager()  : IGroupManager
Returns a group manager
getHasher()  : IHasher
Returns a Hasher instance
getHTTPClientService()  : IClientService
Returns an instance of the HTTP client service
getIniWrapper()  : IniGetWrapper
Get the IniWrapper
getJobList()  : IJobList
Returns an job list for controlling background jobs
getL10N()  : IL10N
get an L10N instance
getL10NFactory()  : IFactory
getLockingProvider()  : ILockingProvider
Get the locking provider
getLogFactory()  : ILogFactory
returns a log factory instance
getLogger()  : ILogger
Returns a logger instance
getMailer()  : IMailer
Creates a new mailer
getMemCacheFactory()  : ICacheFactory
Returns an \OCP\CacheFactory instance
getMimeTypeDetector()  : IMimeTypeDetector
Get the MimeTypeDetector
getMimeTypeLoader()  : IMimeTypeLoader
Get the MimeTypeLoader
getMountManager()  : IMountManager
getMountProviderCollection()  : IMountProviderCollection
getNavigationManager()  : INavigationManager
Returns the navigation manager
getNotificationManager()  : IManager
Get the Notification Manager
getPreviewManager()  : IPreview
Returns the preview manager which can create preview images for a given file
getQueryLogger()  : IQueryLogger
Get the active query logger
getRemoteApiFactory()  : IApiFactory
getRemoteInstanceFactory()  : IInstanceFactory
getRequest()  : IRequest
The current request object holding all information about the request currently being processed is returned from this method.
getRootFolder()  : IRootFolder
Returns the root folder of ownCloud's data directory
getRouter()  : IRouter
Returns a router for generating and matching urls
getSearch()  : ISearch
Returns a search instance
getSecureRandom()  : ISecureRandom
Returns a SecureRandom instance
getSession()  : ISession
Returns the current session
getShareManager()  : IManager
Returns the share manager
getStorageFactory()  : IStorageFactory
getSystemTagManager()  : ISystemTagManager
Returns the system-tag manager
getSystemTagObjectMapper()  : ISystemTagObjectMapper
Returns the system-tag object mapper
getTagManager()  : ITagManager
Returns the tag manager which can get and set tags for different object types
getTempManager()  : ITempManager
Get the manager for temporary files and folders
getURLGenerator()  : IURLGenerator
Returns the URL generator
getUserFolder()  : Folder
Returns a view to ownCloud's files folder
getUserManager()  : IUserManager
Returns a user manager
getUserSession()  : IUserSession
Returns the user session
getWebRoot()  : string
Get the webroot
query()  : mixed
Look up a service for a given name in the container.
registerAlias()  : mixed
Shortcut for returning a service from a service under a different key, e.g. to tell the container to return a class when queried for an interface
registerParameter()  : void
A value is stored in the container with it's corresponding name
registerService()  : void
A service is registered in the container where a closure is passed in which will actually create the service on demand.
resolve()  : stdClass
If a parameter is not registered in the container try to instantiate it by using reflection to find out how to build the class

Methods

createEventSource()

Create a new event source

public createEventSource() : IEventSource
Tags
since
8.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IEventSource —

getActivityManager()

Returns the activity manager

public getActivityManager() : IManager
Tags
since
6.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IManager —

getAppConfig()

Returns the app config manager

public getAppConfig() : IAppConfig
Tags
since
7.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IAppConfig —

getAppManager()

Get the app manager

public getAppManager() : IAppManager
Tags
since
8.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IAppManager —

getAvatarManager()

Returns an avatar manager, used for avatar functionality

public getAvatarManager() : IAvatarManager
Tags
since
6.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IAvatarManager —

getCache()

Returns an ICache instance

public getCache() : ICache
Tags
since
6.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
ICache —

getCalendarManager()

The calendar manager will act as a broker between consumers for calendar information and providers which actual deliver the calendar information.

public getCalendarManager() : IManager
Tags
since
13.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IManager —

getCalendarResourceBackendManager()

The calendar resource backend manager will act as a broker between consumers for calendar resource information an providers which actual deliver the room information.

public getCalendarResourceBackendManager() : IBackend
Tags
since
14.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IBackend —

getCalendarRoomBackendManager()

The calendar room backend manager will act as a broker between consumers for calendar room information an providers which actual deliver the room information.

public getCalendarRoomBackendManager() : IBackend
Tags
since
14.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IBackend —

getCertificateManager()

Get the certificate manager for the user

public getCertificateManager([string $userId = null ]) : ICertificateManager
Parameters
$userId : string = null

(optional) if not specified the current loggedin user is used, use null to get the system certificate manager

Tags
since
8.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
ICertificateManager —

| null if $userId is null and no user is logged in

getCommandBus()

public getCommandBus() : IBus
Tags
since
8.1.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IBus —

getConfig()

Returns the config manager

public getConfig() : IConfig
Tags
since
6.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IConfig —

getContactsManager()

The contacts manager will act as a broker between consumers for contacts information and providers which actual deliver the contact information.

public getContactsManager() : IManager
Tags
since
6.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IManager —

getCredentialsManager()

Returns a CredentialsManager instance

public getCredentialsManager() : ICredentialsManager
Tags
since
9.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
ICredentialsManager —

getCrypto()

Returns a Crypto instance

public getCrypto() : ICrypto
Tags
since
8.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
ICrypto —

getDatabaseConnection()

Returns the current session

public getDatabaseConnection() : IDBConnection
Tags
since
6.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IDBConnection —

getDateTimeZone()

public getDateTimeZone() : IDateTimeZone
Tags
since
8.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IDateTimeZone —

getEncryptionFilesHelper()

public getEncryptionFilesHelper() : File
Tags
since
8.1.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
File —

getEncryptionKeyStorage()

public getEncryptionKeyStorage() : IStorage
Tags
since
8.1.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IStorage —

getEncryptionManager()

public getEncryptionManager() : Manager
Tags
since
8.1.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
Manager —

getEventDispatcher()

Get the EventDispatcher

public getEventDispatcher() : EventDispatcherInterface
Tags
deprecated
20.0.0

use \OCP\EventDispatcher\IEventDispatcher

since
8.2.0
Return values
EventDispatcherInterface —

getEventLogger()

Get the active event logger

public getEventLogger() : IEventLogger
Tags
since
8.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IEventLogger —

getGlobalScaleConfig()

public getGlobalScaleConfig() : IConfig
Tags
since
14.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IConfig —

getGroupManager()

Returns a group manager

public getGroupManager() : IGroupManager
Tags
since
8.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IGroupManager —

getHasher()

Returns a Hasher instance

public getHasher() : IHasher
Tags
since
8.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IHasher —

getHTTPClientService()

Returns an instance of the HTTP client service

public getHTTPClientService() : IClientService
Tags
since
8.1.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IClientService —

getIniWrapper()

Get the IniWrapper

public getIniWrapper() : IniGetWrapper
Tags
since
8.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IniGetWrapper —

getJobList()

Returns an job list for controlling background jobs

public getJobList() : IJobList
Tags
since
7.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IJobList —

getL10N()

get an L10N instance

public getL10N(string $app[, string $lang = null ]) : IL10N
Parameters
$app : string

appid

$lang : string = null
Tags
since
6.0.0
  • parameter $lang was added in 8.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IL10N —

getL10NFactory()

public getL10NFactory() : IFactory
Tags
since
8.2.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IFactory —

getLockingProvider()

Get the locking provider

public getLockingProvider() : ILockingProvider
Tags
since
8.1.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
ILockingProvider —

getLogFactory()

returns a log factory instance

public getLogFactory() : ILogFactory
Tags
since
14.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
ILogFactory —

getLogger()

Returns a logger instance

public getLogger() : ILogger
Tags
since
8.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
ILogger —

getMailer()

Creates a new mailer

public getMailer() : IMailer
Tags
since
8.1.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IMailer —

getMemCacheFactory()

Returns an \OCP\CacheFactory instance

public getMemCacheFactory() : ICacheFactory
Tags
since
7.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
ICacheFactory —

getMimeTypeDetector()

Get the MimeTypeDetector

public getMimeTypeDetector() : IMimeTypeDetector
Tags
since
8.2.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IMimeTypeDetector —

getMimeTypeLoader()

Get the MimeTypeLoader

public getMimeTypeLoader() : IMimeTypeLoader
Tags
since
8.2.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IMimeTypeLoader —

getMountManager()

public getMountManager() : IMountManager
Tags
since
8.2.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IMountManager —

getNavigationManager()

Returns the navigation manager

public getNavigationManager() : INavigationManager
Tags
since
6.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
INavigationManager —

getNotificationManager()

Get the Notification Manager

public getNotificationManager() : IManager
Tags
since
9.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IManager —

getPreviewManager()

Returns the preview manager which can create preview images for a given file

public getPreviewManager() : IPreview
Tags
since
6.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IPreview —

getQueryLogger()

Get the active query logger

public getQueryLogger() : IQueryLogger

The returned logger only logs data when debug mode is enabled

Tags
since
8.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IQueryLogger —

getRemoteApiFactory()

public getRemoteApiFactory() : IApiFactory
Tags
since
13.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IApiFactory —

getRequest()

The current request object holding all information about the request currently being processed is returned from this method.

public getRequest() : IRequest

In case the current execution was not initiated by a web request null is returned

Tags
since
6.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IRequest —

getRootFolder()

Returns the root folder of ownCloud's data directory

public getRootFolder() : IRootFolder
Tags
since
6.0.0
  • between 6.0.0 and 8.0.0 this returned \OCP\Files\Folder
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IRootFolder —

getRouter()

Returns a router for generating and matching urls

public getRouter() : IRouter
Tags
since
7.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IRouter —

getSecureRandom()

Returns a SecureRandom instance

public getSecureRandom() : ISecureRandom
Tags
since
8.1.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
ISecureRandom —

getSession()

Returns the current session

public getSession() : ISession
Tags
since
6.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
ISession —

getShareManager()

Returns the share manager

public getShareManager() : IManager
Tags
since
9.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IManager —

getSystemTagManager()

Returns the system-tag manager

public getSystemTagManager() : ISystemTagManager
Tags
since
9.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
ISystemTagManager —

getTagManager()

Returns the tag manager which can get and set tags for different object types

public getTagManager() : ITagManager
Tags
see
ITagManager::load()
since
6.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
ITagManager —

getTempManager()

Get the manager for temporary files and folders

public getTempManager() : ITempManager
Tags
since
8.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
ITempManager —

getURLGenerator()

Returns the URL generator

public getURLGenerator() : IURLGenerator
Tags
since
6.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IURLGenerator —

getUserFolder()

Returns a view to ownCloud's files folder

public getUserFolder([string $userId = null ]) : Folder
Parameters
$userId : string = null

user ID

Tags
since
6.0.0
  • parameter $userId was added in 8.0.0
see
getUserFolder

in \OCP\Files\IRootFolder

deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
Folder —

getUserManager()

Returns a user manager

public getUserManager() : IUserManager
Tags
since
8.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IUserManager —

getUserSession()

Returns the user session

public getUserSession() : IUserSession
Tags
since
6.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
IUserSession —

getWebRoot()

Get the webroot

public getWebRoot() : string
Tags
since
8.0.0
deprecated
20.0.0

have it injected or fetch it through \Psr\Container\ContainerInterface::get

Return values
string —

query()

Look up a service for a given name in the container.

public query(string $name[, bool $autoload = true ]) : mixed
Parameters
$name : string
$autoload : bool = true

Should we try to autoload the service. If we are trying to resolve built in types this makes no sense for example

Tags
throws
ContainerExceptionInterface

if the query could not be resolved

throws
QueryException

if the query could not be resolved

since
6.0.0
deprecated
20.0.0

use \Psr\Container\ContainerInterface::get

Return values
mixed —

registerAlias()

Shortcut for returning a service from a service under a different key, e.g. to tell the container to return a class when queried for an interface

public registerAlias(string $alias, string $target) : mixed
Parameters
$alias : string

the alias that should be registered

$target : string

the target that should be resolved instead

Tags
since
8.2.0
deprecated
20.0.0

use \OCP\AppFramework\Bootstrap\IRegistrationContext::registerServiceAlias

Return values
mixed —

registerParameter()

A value is stored in the container with it's corresponding name

public registerParameter(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed
Tags
since
6.0.0
deprecated
20.0.0

use \OCP\AppFramework\Bootstrap\IRegistrationContext::registerParameter

registerService()

A service is registered in the container where a closure is passed in which will actually create the service on demand.

public registerService(string $name, Closure $closure[, bool $shared = true ]) : void

In case the parameter $shared is set to true (the default usage) the once created service will remain in memory and be reused on subsequent calls. In case the parameter is false the service will be recreated on every call.

Parameters
$name : string
$closure : Closure
$shared : bool = true
Tags
since
6.0.0
deprecated
20.0.0

use \OCP\AppFramework\Bootstrap\IRegistrationContext::registerService

resolve()

If a parameter is not registered in the container try to instantiate it by using reflection to find out how to build the class

public resolve(string $name) : stdClass
Parameters
$name : string

the class name to resolve

Tags
since
8.2.0
deprecated
20.0.0

use \Psr\Container\ContainerInterface::get

throws
ContainerExceptionInterface

if the class could not be found or instantiated

throws
QueryException

if the class could not be found or instantiated

Return values
stdClass —

Search results