本文整理匯總了PHP中Flux::initialize方法的典型用法代碼示例。如果您正苦於以下問題:PHP Flux::initialize方法的具體用法?PHP Flux::initialize怎麽用?PHP Flux::initialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Flux
的用法示例。
在下文中一共展示了Flux::initialize方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Flux_Error
require_once 'Flux/Dispatcher.php';
require_once 'Flux/SessionData.php';
require_once 'Flux/DataObject.php';
require_once 'Flux/Authorization.php';
require_once 'Flux/Installer.php';
require_once 'Flux/PermissionError.php';
// Vendor libraries.
require_once 'markdown/markdown.php';
try {
if (!extension_loaded('pdo')) {
throw new Flux_Error('The PDO extension is required to use Flux, please make sure it is installed along with the PDO_MYSQL driver.');
} elseif (!extension_loaded('pdo_mysql')) {
throw new Flux_Error('The PDO_MYSQL driver for the PDO extension must be installed to use Flux. Please consult the PHP manual for installation instructions.');
}
// Initialize Flux.
Flux::initialize(array('appConfigFile' => FLUX_CONFIG_DIR . '/application.php', 'serversConfigFile' => FLUX_CONFIG_DIR . '/servers.php'));
// Set time limit.
set_time_limit((int) Flux::config('ScriptTimeLimit'));
// Set default timezone for entire app.
$timezone = Flux::config('DateDefaultTimezone');
if ($timezone && !@date_default_timezone_set($timezone)) {
throw new Flux_Error("'{$timezone}' is not a valid timezone. Consult http://php.net/timezones for a list of valid timezones.");
}
// Create some basic directories.
$directories = array(FLUX_DATA_DIR . '/logs/schemas', FLUX_DATA_DIR . '/logs/schemas/logindb', FLUX_DATA_DIR . '/logs/schemas/charmapdb', FLUX_DATA_DIR . '/logs/transactions', FLUX_DATA_DIR . '/logs/mail', FLUX_DATA_DIR . '/logs/mysql', FLUX_DATA_DIR . '/logs/mysql/errors', FLUX_DATA_DIR . '/logs/errors', FLUX_DATA_DIR . '/logs/errors/exceptions', FLUX_DATA_DIR . '/logs/errors/mail');
// Schema log directories.
foreach (Flux::$loginAthenaGroupRegistry as $serverName => $loginAthenaGroup) {
$directories[] = FLUX_DATA_DIR . "/logs/schemas/logindb/{$serverName}";
$directories[] = FLUX_DATA_DIR . "/logs/schemas/charmapdb/{$serverName}";
foreach ($loginAthenaGroup->athenaServers as $athenaServer) {
$directories[] = FLUX_DATA_DIR . "/logs/schemas/charmapdb/{$serverName}/{$athenaServer->serverName}";