loadConfiguration() public méthode

Loads the configuration options.
public loadConfiguration ( string $p_configFile = null )
$p_configFile string The path to the config file
 public function indexAction()
 {
     global $controller;
     $controller = $this;
     require_once $GLOBALS['g_campsiteDir'] . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'campsite_constants.php';
     require_once CS_PATH_CONFIG . DIR_SEP . 'install_conf.php';
     $local_path = dirname(__FILE__) . '/include';
     set_include_path($local_path . PATH_SEPARATOR . get_include_path());
     require_once CS_PATH_INCLUDES . DIR_SEP . 'campsite_init.php';
     // initializes the campsite object
     $campsite = new CampSite();
     // loads site configuration settings
     $campsite->loadConfiguration(CS_PATH_CONFIG . DIR_SEP . 'configuration.php');
     // starts the session
     $campsite->initSession();
     // initiates the context
     $campsite->init();
     // dispatches campsite
     $campsite->dispatch();
     if (APPLICATION_ENV !== 'development' || APPLICATION_ENV !== 'dev') {
         set_error_handler(create_function('', 'return true;'));
     }
     // renders the site
     $campsite->render();
     // triggers an event after displaying
     $campsite->event('afterRender');
 }
Exemple #2
0
 public function indexAction()
 {
     global $controller;
     $controller = $this;
     require_once $GLOBALS['g_campsiteDir'] . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'campsite_constants.php';
     require_once CS_PATH_CONFIG . DIR_SEP . 'install_conf.php';
     $local_path = dirname(__FILE__) . '/include';
     set_include_path($local_path . PATH_SEPARATOR . get_include_path());
     require_once CS_PATH_INCLUDES . DIR_SEP . 'campsite_init.php';
     if (file_exists(CS_PATH_SITE . DIR_SEP . 'reset_cache')) {
         CampCache::singleton()->clear('user');
         @unlink(CS_PATH_SITE . DIR_SEP . 'reset_cache');
     }
     // initializes the campsite object
     $campsite = new CampSite();
     // loads site configuration settings
     $campsite->loadConfiguration(CS_PATH_CONFIG . DIR_SEP . 'configuration.php');
     // starts the session
     $campsite->initSession();
     if (file_exists(CS_PATH_SITE . DIR_SEP . 'conf' . DIR_SEP . 'upgrading.php')) {
         $this->upgrade();
         exit(0);
     }
     // initiates the context
     $campsite->init();
     // dispatches campsite
     $campsite->dispatch();
     // triggers an event before render the page.
     // looks for preview language if any.
     $previewLang = $campsite->event('beforeRender');
     if (!is_null($previewLang)) {
         require_once $GLOBALS['g_campsiteDir'] . '/template_engine/classes/SyntaxError.php';
         set_error_handler('templateErrorHandler');
         // loads translations strings in the proper language for the error messages display
         camp_load_translation_strings('preview', $previewLang);
     } else {
         set_error_handler(create_function('', 'return true;'));
     }
     if ($this->_request->getParam('logout') == 'true') {
         $this->_redirect('/auth/logout/?url=' . urlencode($this->getRequest()->getPathInfo()));
     }
     // renders the site
     $campsite->render();
     // triggers an event after displaying
     $campsite->event('afterRender');
 }
Exemple #3
0
set_time_limit(0);
$dbVersion = '';
$dbRoll = '';
$res = camp_detect_database_version($Campsite['DATABASE_NAME'], $dbVersion, $dbRoll);
if ($res !== 0) {
    $dbVersion = '[unknown]';
}
$dbInfo = $dbVersion;
if (!in_array($dbRoll, array('', '.'))) {
    $dbInfo .= ', roll ' . $dbRoll;
}
echo "Upgrading the database from version {$dbInfo}...";
// initiates the campsite site
$campsite = new CampSite();
// loads site configuration settings
$campsite->loadConfiguration(CS_PATH_CONFIG . DIR_SEP . 'configuration.php');
// starts the session
$campsite->initSession();
$session = CampSite::GetSessionInstance();
$configDb = array('hostname' => $Campsite['db']['host'], 'hostport' => $Campsite['db']['port'], 'username' => $Campsite['db']['user'], 'userpass' => $Campsite['db']['pass'], 'database' => $Campsite['db']['name']);
$session->setData('config.db', $configDb, 'installation');
// upgrading the database
$res = camp_upgrade_database($Campsite['DATABASE_NAME'], true, true);
if ($res !== 0) {
    display_upgrade_error("While upgrading the database: {$res}");
}
CampCache::singleton()->clear('user');
CampCache::singleton()->clear();
SystemPref::DeleteSystemPrefsFromCache();
// replace $campsite by $gimme
require_once $g_documentRoot . '/classes/TemplateConverterNewscoop.php';