Esempio n. 1
0
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
// loading configuration
$host = explode('.', $_SERVER['HTTP_HOST']);
$envVar = 'production';
$envVar = 'production';
if (in_array('sandboxes', $host) || in_array('localhost', $host)) {
    $envVar = 'development';
} elseif (in_array('staging', $host)) {
    $envVar = 'staging';
}
$app_config = new Zend_Config_Ini("{$application_path}/config.ini", $envVar);
$imgCfg = new Zend_Config_Ini("{$application_path}/config.ini", 'Images', true);
$config = new Zend_Config_Ini("{$extranet_path}/config.ini", 'general', true);
$config->merge($imgCfg);
$config->readOnly();
$registry = Zend_Registry::getInstance();
$registry->set('config', $config);
$registry->set('relativeRootPath', $web_root);
$registry->set('absolute_web_root', $absolute_web_root);
// establishment of the database
$db = Zend_Db::factory($app_config->db);
Zend_Db_Table::setDefaultAdapter($db);
$db->query('SET NAMES utf8');
$registry->set('db', $db);
$registry->set('extranet_root', $extranet_path);
$registry->set('www_root', $www_root);
$registry->set('lucene_index', realpath(dirname(__FILE__) . '/../') . "/indexation/all_index");
// Enables the loading of helpers from /lib/Cible/View/Helper
$view = new Zend_View();
$view->addHelperPath("Cible/View/Helper", "Cible_View_Helper");