示例#1
0
            please install PHP ' . APP_PHP_VERSION_REQUIRED . ' or higher on your server!');
}
/** Defines whether app is initializing or initialized. */
define('APP_INIT', true);
// Initialize, load and set up Carbon Core
require_once CARBON_SITE_ROOT . '/carbon/core/init.php';
// Make sure Carbon Core is initialized successfully
if (!defined('CARBON_CORE_INIT_DONE') || CARBON_CORE_INIT_DONE != true) {
    die('Failed to load the application because Carbon Core couldn\'t be initialized');
}
// Include the loader for the app and set it up
require_once APP_ROOT . '/autoloader/loader/AppLoader.php';
use app\autoloader\loader\AppLoader;
use app\registry\Registry;
use carbon\core\autoloader\Autoloader;
Autoloader::addLoader(new AppLoader());
// Load the configuration
use app\config\Config;
Config::load();
// Set up the error handler
use carbon\core\ErrorHandler;
ErrorHandler::init(true, true, Config::getValue('app', 'debug'));
// Connect to the database
use app\database\Database;
Database::connect();
// Set up the cookie manager
use carbon\core\cookie\CookieManager;
CookieManager::setCookieDomain(Config::getValue('cookie', 'domain', ''));
CookieManager::setCookiePath(Config::getValue('cookie', 'path', '/'));
CookieManager::setCookiePrefix(Config::getValue('cookie', 'prefix', ''));
// Set up the language manager
示例#2
0
}
// Define various Carbon Core constants
/** The Carbon Core namespace. */
define('CARBON_CORE_NAMESPACE', 'carbon\\core\\');
/** The required PHP version to run Carbon Core. */
define('CARBON_CORE_PHP_VERSION_REQUIRED', '5.3.1');
/** The root directory of Carbon Core. */
define('CARBON_CORE_ROOT', __DIR__);
/** The version name of the currently installed Carbon Core instance. */
define('CARBON_CORE_VERSION_NAME', '0.1');
/** The version code of the currently installed Carbon Core instance. */
define('CARBON_CORE_VERSION_CODE', 1);
// Make sure the current PHP version is supported
if (version_compare(phpversion(), CARBON_CORE_PHP_VERSION_REQUIRED, '<')) {
    // PHP version the server is running is not supported, show an error message
    // TODO: Show proper error message
    die('This server is running PHP ' . phpversion() . ', the required PHP version to start Carbon Core is PHP 5.3.1 or higher,
            please install PHP 5.3.1 or higher on your server!');
}
/** Defines whether Carbon Core is initializing or initialized. */
define('CARBON_CORE_INIT', true);
// Load and initialize the autoloader
require_once CARBON_CORE_ROOT . '/autoloader/Autoloader.php';
use carbon\core\autoloader\Autoloader;
use carbon\core\autoloader\loader\CarbonCoreLoader;
// Set up the autoloader
Autoloader::init();
Autoloader::addLoader(new CarbonCoreLoader());
// Carbon Core initialized successfully, define the CARBON_CORE_INIT_DONE constant to store the initialization state
/** Defines whether Carbon Core is initialized successfully. */
define('CARBON_CORE_INIT_DONE', true);