Nextcloud PHP API (stable19)

IServerContainer extends IContainer

Class IServerContainer

This container holds all ownCloud services

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
getAppFolder()  : Folder
Returns an app-specific view in ownClouds data directory
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

getAppFolder()

Returns an app-specific view in ownClouds data directory

public getAppFolder() : Folder
Tags
since
6.0.0
deprecated
9.2.0

use IAppData

Return values
Folder

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
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
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
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
Return values
ICertificateManager

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

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
Return values
IManager

getEncryptionFilesHelper()

public getEncryptionFilesHelper() : File
Tags
since
8.1.0
Return values
File

getEncryptionManager()

public getEncryptionManager() : Manager
Tags
since
8.1.0
Return values
Manager

getEventDispatcher()

Get the EventDispatcher

public getEventDispatcher() : EventDispatcherInterface
Tags
since
8.2.0
Return values
EventDispatcherInterface

getIniWrapper()

Get the IniWrapper

public getIniWrapper() : IniGetWrapper
Tags
since
8.0.0
Return values
IniGetWrapper

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
Return values
IL10N

getPreviewManager()

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

public getPreviewManager() : IPreview
Tags
since
6.0.0
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
Return values
IQueryLogger

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
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
Return values
IRootFolder

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

Return values
Folder

getWebRoot()

Get the webroot

public getWebRoot() : string
Tags
since
8.0.0
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
QueryException

if the query could not be resolved

since
6.0.0
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
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

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

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
throws
QueryException

if the class could not be found or instantiated

Return values
stdClass

Search results