if ($cfg_rea_portal['enabled'] && file_exists(cfgEngineFolder . 'rea.portal.php')) { define('REA_RUNMODE_PORTAL', true); require_once cfgEngineFolder . 'rea.portal.php'; rea_portal::initializeWithConfig($cfg_rea_portal); rea_app::rebuildAppConfigEntry(); } } else { define('REA_RUNMODE_PORTAL', false); } $location = isset($config->application['location_id']) ? $config->application['location_id'] : '*'; $u = rea_sp_rel2dr(REA_BASE_PATH, $location); if (substr($u, -1, 1) != '/') { $u .= '/'; } define('REA_BASE_URL', $u); define('REA_ENGINE_URL', rea_sp_rel2dr(cfgEngineFolder, $location)); define('REA_SELF_URL', $config->application['attributes']['action']); rea_app::loadStorageConnections(); $rea_controller->raiseEvent("rea_storage_configure"); $rea_controller->raiseEvent('rea_app_config_ready', array($config)); storage::dao_initializeEntries(); if (REA_RUNMODE_SERVICE) { rea_app::lock(); } //print "<b>DONE</b><br>"; function rea_sp_rel2dr($f, $location = '*') { ///N:Converts an absolute path to relative assuming is under document root $s = str_replace($_SERVER['DOCUMENT_ROOT'], '', $f); if (substr($s, 0, 1) != '/') { $s = '/' . $s;
public static function rebuildAppConfigEntry() { global $rea_app_config_rewrite; $config = self::getConfig(); foreach ($rea_app_config_rewrite as $field) { $config->application['attributes'][$field] = rea_sp_rel2dr($config->application['attributes'][$field], $config->application['location_id']); } }