Baikal\Core\Tools::configureEnvironment PHP Method

configureEnvironment() static public method

static public configureEnvironment ( )
    static function configureEnvironment()
    {
        set_exception_handler('\\Baikal\\Core\\Tools::handleException');
        ini_set("error_reporting", E_ALL);
    }

Usage Example

Ejemplo n.º 1
0
 public static function bootstrap()
 {
     # Registering Baikal classloader
     define("BAIKAL_PATH_FRAMEWORKROOT", dirname(__FILE__) . "/");
     \Baikal\Core\Tools::assertEnvironmentIsOk();
     \Baikal\Core\Tools::configureEnvironment();
     # Check that a config file exists
     if (!file_exists(PROJECT_PATH_SPECIFIC . "config.php") || !file_exists(PROJECT_PATH_SPECIFIC . "config.system.php")) {
         self::installTool();
     } else {
         require_once PROJECT_PATH_SPECIFIC . "config.php";
         require_once PROJECT_PATH_SPECIFIC . "config.system.php";
         date_default_timezone_set(PROJECT_TIMEZONE);
         # Check that Baïkal is already configured
         if (!defined("BAIKAL_CONFIGURED_VERSION")) {
             self::installTool();
         } else {
             # Check that running version matches configured version
             if (version_compare(BAIKAL_VERSION, BAIKAL_CONFIGURED_VERSION) > 0) {
                 self::installTool();
             } else {
                 # Check that admin password is set
                 if (!defined("BAIKAL_ADMIN_PASSWORDHASH")) {
                     self::installTool();
                 }
                 \Baikal\Core\Tools::assertBaikalIsOk();
                 set_error_handler("\\Baikal\\Framework::exception_error_handler");
             }
         }
     }
 }