Baikal\Framework::bootstrap PHP Méthode

bootstrap() static public méthode

static public bootstrap ( )
    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");
                }
            }
        }
    }

Usage Example

Exemple #1
0
 public static function bootstrap()
 {
     define("BAIKALADMIN_PATH_ROOT", PROJECT_PATH_ROOT . "Core/Frameworks/BaikalAdmin/");
     # ./
     \Baikal\Framework::bootstrap();
     \Formal\Framework::bootstrap();
     $GLOBALS["ROUTER"]::setURIPath("admin/");
     # Include BaikalAdmin Framework config
     require_once BAIKALADMIN_PATH_ROOT . "config.php";
 }
All Usage Examples Of Baikal\Framework::bootstrap