Esempio n. 1
0
 public function test_getLocaleDirectory()
 {
     USVN_Template::initTemplate('default', 'public/medias');
     $this->assertEquals('public/medias', USVN_Template::getLocaleDirectory());
 }
Esempio n. 2
0
    }
    if ($config->version != USVN_CONFIG_VERSION) {
        USVN_Update::runUpdate();
    }
} catch (Exception $e) {
    header('Location: install.php');
    // echo '<pre>' . "\n";
    // echo $e;
    // echo '</pre>' . "\n";
    // exit(0);
}
/* USVN Configuration */
date_default_timezone_set($config->timezone);
USVN_ConsoleUtils::setLocale($config->system->locale);
USVN_Translation::initTranslation($config->translation->locale, USVN_LOCALE_DIR);
USVN_Template::initTemplate($config->template->name, USVN_MEDIAS_DIR);
/* Zend Configuration */
Zend_Registry::set('config', $config);
Zend_Db_Table::setDefaultAdapter(Zend_Db::factory($config->database->adapterName, $config->database->options->toArray()));
if (isset($config->database->prefix)) {
    USVN_Db_Table::$prefix = $config->database->prefix;
}
$front = Zend_Controller_Front::getInstance();
Zend_Layout::startMvc(array('layoutPath' => USVN_LAYOUTS_DIR));
$front->setRequest(new USVN_Controller_Request_Http());
$front->throwExceptions(true);
$front->setBaseUrl($config->url->base);
/* Initialize router */
$router = new Zend_Controller_Router_Rewrite();
$routes_config = new USVN_Config_Ini(USVN_ROUTES_CONFIG_FILE, USVN_CONFIG_SECTION);
$router->addConfig($routes_config, 'routes');