Bitrix API

HttpApplication extends Application

Http application extends application. Contains http specific methods.

Table of Contents

Constants

EXCEPTION_UNKNOWN_CONTROLLER  = 221001
JOB_PRIORITY_LOW  = 50
JOB_PRIORITY_NORMAL  = 100

Methods

addBackgroundJob()  : $this
Adds a job to do after the response was sent.
createExceptionHandlerLog()  : mixed
createExceptionHandlerOutput()  : mixed
end()  : void
Ends work of application.
finish()  : mixed
Finishes request execution.
getCache()  : Cache
Returns new instance of the Cache object.
getCompositeSessionManager()  : CompositeSessionManager
getConnection()  : Connection|Connection
Static method returns database connection for the specified name.
getConnectionPool()  : ConnectionPool
Returns database connections pool object.
getContext()  : Context|HttpContext
Returns context of the current request.
getCurrentRoute()  : Route
getDocumentRoot()  : null|string
Returns server document root.
getExceptionHandler()  : ExceptionHandler
getInstance()  : Application|HttpApplication
Returns current instance of the Application.
getKernelSession()  : SessionInterface
getLicense()  : License
getLocalSession()  : SessionLocalStorage
getManagedCache()  : ManagedCache
Returns manager of the managed cache.
getPersonalRoot()  : null|string
Returns personal root directory (relative to document root)
getRouter()  : Router
getSession()  : SessionInterface
getSessionLocalStorageManager()  : SessionLocalStorageManager
getTaggedCache()  : TaggedCache
Returns manager of the managed cache.
getUserTypeManager()  : CUserTypeManager
Returns UF manager.
hasCurrentRoute()  : bool
hasInstance()  : bool
initializeBasicKernel()  : mixed
initializeExtendedKernel()  : mixed
Does full kernel initialization. Should be called somewhere after initializeBasicKernel().
isInitialized()  : bool
Returns true if the application is fully initialized.
isUtfMode()  : true
Returns true if server is in UTF-8 mode. False - otherwise.
resetAccelerator()  : mixed
Resets accelerator if any.
run()  : void
Runs controller and its action and sends response to the output.
runController()  : void
setContext()  : mixed
Modifies context of the current request.
setCurrentRoute()  : void
setRouter()  : void
start()  : mixed
Starts request execution. Should be called after initialize.
terminate()  : void
Terminates application by invoking exit().

Constants

EXCEPTION_UNKNOWN_CONTROLLER

public mixed EXCEPTION_UNKNOWN_CONTROLLER = 221001

JOB_PRIORITY_NORMAL

public mixed JOB_PRIORITY_NORMAL = 100

Methods

addBackgroundJob()

Adds a job to do after the response was sent.

public addBackgroundJob(callable $job[, array<string|int, mixed> $args = [] ][, int $priority = \self::JOB_PRIORITY_NORMAL ]) : $this
Parameters
$job : callable
$args : array<string|int, mixed> = []
$priority : int = \self::JOB_PRIORITY_NORMAL
Return values
$this

createExceptionHandlerLog()

public createExceptionHandlerLog() : mixed

createExceptionHandlerOutput()

public createExceptionHandlerOutput() : mixed

end()

Ends work of application.

public end([int $status = 0 ][, Response|null $response = null ]) : void

Sends response and then terminates execution. If there is no $response the method will use Context::$response.

Parameters
$status : int = 0
$response : Response|null = null

getCompositeSessionManager()

public final getCompositeSessionManager() : CompositeSessionManager
Return values
CompositeSessionManager

getConnection()

Static method returns database connection for the specified name.

public static getConnection([string $name = "" ]) : Connection|Connection

If name is empty - default connection is returned.

Parameters
$name : string = ""

Name of database connection. If empty - default connection.

Tags
static
Return values
Connection|Connection

getCurrentRoute()

public getCurrentRoute() : Route
Return values
Route

getDocumentRoot()

Returns server document root.

public static getDocumentRoot() : null|string
Return values
null|string

getKernelSession()

public final getKernelSession() : SessionInterface
Return values
SessionInterface

getLicense()

public getLicense() : License
Return values
License

getPersonalRoot()

Returns personal root directory (relative to document root)

public static getPersonalRoot() : null|string
Return values
null|string

getRouter()

public getRouter() : Router
Return values
Router

getSession()

public final getSession() : SessionInterface
Return values
SessionInterface

hasCurrentRoute()

public hasCurrentRoute() : bool
Return values
bool

hasInstance()

public static hasInstance() : bool
Return values
bool

initializeBasicKernel()

public initializeBasicKernel() : mixed

Does nothing, will be removed soon.

initializeExtendedKernel()

Does full kernel initialization. Should be called somewhere after initializeBasicKernel().

public initializeExtendedKernel(array<string|int, mixed> $params) : mixed
Parameters
$params : array<string|int, mixed>

Parameters of the current request (depends on application type)

isInitialized()

Returns true if the application is fully initialized.

public isInitialized() : bool
Return values
bool

isUtfMode()

Returns true if server is in UTF-8 mode. False - otherwise.

public static isUtfMode() : true

Always returns true.

Return values
true

resetAccelerator()

Resets accelerator if any.

public static resetAccelerator([string $filename = null ]) : mixed
Parameters
$filename : string = null

run()

Runs controller and its action and sends response to the output.

public run() : void

setContext()

Modifies context of the current request.

public setContext(Context $context) : mixed
Parameters
$context : Context

setCurrentRoute()

public setCurrentRoute(Route $currentRoute) : void
Parameters
$currentRoute : Route

setRouter()

public setRouter(Router $router) : void
Parameters
$router : Router

start()

Starts request execution. Should be called after initialize.

public start() : mixed

terminate()

Terminates application by invoking exit().

public terminate([int $status = 0 ]) : void

It's the right way to finish application.

Parameters
$status : int = 0

        
On this page

Search results