-
Notifications
You must be signed in to change notification settings - Fork 2
Application
Viames Marino edited this page Sep 11, 2018
·
3 revisions
The Application
class is a singleton that controls the Pair application from above. It is initialized in the index.php file and then then recalled anywhere in the application via:
// start the Application
$app = Application::getInstance();
Application is the first class loaded at startup and performs these preliminary operations:
- Set PHP errors to
E_ALL
and force the display of errors; - Define the constants
APPLICATION_PATH
,PAIR_FOLDER
,BASE_HREF
andDEBUG
; - Check for the config.php file and, if it is missing, start the installation wizard;
- Load the
config.php
file to define the following constants:
- AUTH_SOURCE
- BASE_URI
- DBMS
- PRODUCT_NAME
- PRODUCT_VERSION
- UTC_DATE
- BASE_TIMEZONE
- If defined
DB_UTF8
, set UTF8 flag for all communication with database; - Acquires the HTTP or HTTPS protocol;
- Set up a custom
error_handler
that works on the web, for command line applications or for emulation of Unix daemon with PHP; - Set up gzip compression if available and not in debugging state;
- Recovers messages for the user that have been queued since the previous session;