Documentation

Application

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
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.

Examples

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();


User Comments

User comments are not part of official documentation. Use information provided by other users in the comments at your own risk.

The User Comments section is not to be used as a feature discussion board. Only registered users can post comments. Your comment will be visible once it has been approved by the moderator.
© «Bitrix24», 2001-2022