Esempio n. 1
0
} else {
    if (\Config::get('cmf.module_urls', false) !== false) {
        \Config::set('security.uri_filter', array_merge(array('\\CMF::module_url_filter'), \Config::get('security.uri_filter')));
    }
}
// Load up the required packages
Package::load(array('email', 'parser'));
// Override some external classes
Autoloader::add_core_namespace('CMF\\Core', true);
Autoloader::add_classes(array('CMF\\Core\\View_Twig' => __DIR__ . '/classes/CMF/Core/View_Twig.php', 'CMF\\Core\\Image_Driver' => __DIR__ . '/classes/CMF/Core/Image_Driver.php', 'CMF\\Core\\Lang' => __DIR__ . '/classes/CMF/Core/Lang.php', 'CMF\\Core\\Format' => __DIR__ . '/classes/CMF/Core/Format.php', 'CMF\\Core\\Error' => __DIR__ . '/classes/CMF/Core/Error.php', 'CMF\\Core\\HttpException' => __DIR__ . '/classes/CMF/Core/HttpException.php'));
// Sort out the language
\Lang::load('errors', true);
\Lang::load('admin', true);
\Lang::load('site', true);
$lang = \CMF::lang();
// Quick and easy profiling using 'debug' in the query string
if (isset($_GET['debug']) && !\Fuel::$profiling) {
    \Fuel::$profiling = true;
    \Profiler::init();
    \Config::load('db', true);
    \Config::set('db.default.profiling', true);
}
// Listen for events at the beginning of the request for caching
\Event::register('controller_started', 'CMF\\Cache::start');
// Add CMF's modules directory so it's modules can be autoloaded
$module_paths = Config::get('module_paths');
$module_paths[] = CMFPATH . 'modules/';
Config::set('module_paths', $module_paths);
if ($isAdmin) {
    \Admin::initialize();
}