} if (isset($config->database->adapterName)) { Zend_Db_Table::setDefaultAdapter(Zend_Db::factory($config->database->adapterName, $config->database->options->toArray())); Zend_Db_Table::getDefaultAdapter()->getProfiler()->setEnabled(true); USVN_Db_Table::$prefix = $config->database->prefix; } Zend_Registry::set('config', $config); } catch (Exception $e) { } } USVN_Translation::initTranslation($GLOBALS['language'], USVN_LOCALE_DIRECTORY); $installSteps = array(1 => 'System Check', 2 => 'Language Selection', 3 => 'License Agreement', 4 => 'USVN Configuration', 5 => 'Database Installation', 6 => 'Administrator User Creation', 7 => 'Check for a Newer Version', 8 => 'Installation is over'); //------------------------------------------------------------------------------------------------ include 'views/head.html'; try { $install_is_possible = Install::installPossible(USVN_CONFIG_FILE); } catch (USVN_Exception $e) { displayError($e->getMessage()); include 'views/footer.html'; exit(0); } if ($install_is_possible) { if (!isset($_GET['step'])) { $step = 0; } else { $step = $_GET['step']; } try { installationOperation($step); } catch (USVN_Exception $e) { displayError($e->getMessage());
break; case '-d': case '--database-path': $options['database-path'] = $argv[++$i]; break; } } foreach ($mandatory_options as $mandatory_option) { if (!array_key_exists($mandatory_option, $options) || empty($options[$mandatory_option])) { echo 'Error: "' . $mandatory_option . '" is a mandatory option, and it was not specified.' . "\n"; echo 'Aborting.' . "\n"; exit(1); } } try { if (!Install::installPossible(USVN_CONFIG_FILE)) { echo 'Error: USVN is already installed.' . "\n"; echo 'Aborting.' . "\n"; exit(1); } USVN_Translation::initTranslation($GLOBALS['language'], USVN_APP_DIR . '/locale'); $config = new USVN_Config_Ini($options['config-file'], USVN_CONFIG_SECTION); Zend_Registry::set('config', $config); /* * Those "echo"s are ugly, but anonymous functions are only available in PHP since versions >= 5.3.0 :( * It would have been nice to be able to do: * * installation_configure('site settings', function() * { * Install::installConfiguration(USVN_CONFIG_FILE, $config->site->title); * });