Application abstract class designed for any applications. Any specific app class is a descendant of this abstract class.

The application is the entry base point (router) for query to kernel (core) global entities: connection with data sources, managed cache, etc. Also, the application contains global data that belongs to the site itself and do not depend on a specific hit. I.e. the application is an unaltered part not dependent on a specific hit.

Query the namespace

Additionally to applications.

Class methods

Method Description Available from version
[link=12296560]addBackgroundJob[/link] Adds a background job, executed after passing content to browser.
getCache Returns new cache object instance.
getConnection Returns connection with database of specified name.
getConnectionPool Returns object of database connection pool.
getContext Returns current connection contents.
getDocumentRoot Returns server's document root.
getInstance Returns current application instance.
getManagedCache Returns managed cache controls.
getPersonalRoot Returns path to personal directory.
getTaggedCache Manages tagged cache.
initializeBasicKernel Performs primary core initialization.
initializeExtendedKernel Fully initializes the kernel.
isUtfMode Returns true when server operates in UTF-8
resetAccelerator Relaunches accelerator.
setContext Updates current query content.
start Launches query execution.


App object can be retrieved as follows:

$application = Application::getInstance();

For example, application class can get connection with database and document_root:

$docRoot = Application::getDocumentRoot()
$connection = Application::getConnection();

© «Bitrix24», 2001-2022