本文整理汇总了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}";