本文整理匯總了PHP中Install::installAdmin方法的典型用法代碼示例。如果您正苦於以下問題:PHP Install::installAdmin方法的具體用法?PHP Install::installAdmin怎麽用?PHP Install::installAdmin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Install
的用法示例。
在下文中一共展示了Install::installAdmin方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: installationOperation
function installationOperation(&$step)
{
global $errors;
$language = isset($_POST['language']) ? $_POST['language'] : $GLOBALS['language'];
switch ($step) {
case 1:
$errors = Install::check();
break;
case 2:
$errors = Install::check();
Install::installUrl(USVN_CONFIG_FILE, USVN_HTACCESS_FILE, $_SERVER['REQUEST_URI'], $_SERVER['HTTP_HOST'], isset($_SERVER['HTTPS']));
break;
case 3:
Install::installLanguage(USVN_CONFIG_FILE, $language);
Install::installTimezone(USVN_CONFIG_FILE, $_POST['timezone']);
Install::installLocale(USVN_CONFIG_FILE);
$GLOBALS['language'] = $_POST['language'];
USVN_Translation::initTranslation($GLOBALS['language'], USVN_LOCALE_DIRECTORY);
break;
case 4:
if ($_POST['agreement'] != 'ok') {
throw new USVN_Exception(T_('You need to accept the licence to continue installation.'));
}
break;
case 5:
Install::installConfiguration(USVN_CONFIG_FILE, $_POST['title']);
$import = Install::installSubversion(USVN_CONFIG_FILE, $_POST['pathSubversion'], $_POST['passwdFile'], $_POST['authzFile'], $_POST['urlSubversion'], $_FILES['configFile']);
if ($import === true) {
displayWarning(T_("A copy of the old SVN repository has been made, any modification done on the old one won't interact on the new one. You should disable the old repository access."));
$step = 7;
}
break;
case 6:
if (isset($_POST['createdb'])) {
$createdb = true;
} else {
$createdb = false;
}
Install::installDb(USVN_CONFIG_FILE, USVN_APP_DIR . '/install/sql/', $_POST['host'], $_POST['user'], $_POST['password'], $_POST['database'], $_POST['prefix'], $_POST['adapter'], $createdb);
break;
case 7:
Install::installAdmin(USVN_CONFIG_FILE, $_POST['login'], $_POST['password'], $_POST['firstname'], $_POST['lastname'], $_POST['email']);
break;
case 8:
Install::installCheckForUpdate(USVN_CONFIG_FILE, $_POST['update']);
Install::installEnd(USVN_CONFIG_FILE);
$GLOBALS['apacheConfig'] = Install::getApacheConfig(USVN_CONFIG_FILE);
break;
}
}
示例2: catch
*/
echo 'Configuring URL... ';
Install::installUrl(USVN_CONFIG_FILE, $options['htaccess-file'], $options['usvn-url-path'], $options['server-host'], $options['server-useHTTPS']);
echo 'Done!' . "\n";
echo 'Configuring language... ';
Install::installLanguage(USVN_CONFIG_FILE, $config->translation->locale);
Install::installTimezone(USVN_CONFIG_FILE, $config->timezone);
Install::installLocale(USVN_CONFIG_FILE);
echo 'Done!' . "\n";
echo 'Configuring site settings... ';
Install::installConfiguration(USVN_CONFIG_FILE, $config->site->title);
echo 'Done!' . "\n";
echo 'Configuring subversion... ';
Install::installSubversion(USVN_CONFIG_FILE, $config->subversion->path, $config->subversion->passwd, $config->subversion->authz, $config->subversion->url);
echo 'Done!' . "\n";
echo 'Configuring database... ';
Install::installDb(USVN_CONFIG_FILE, $options['database-path'], $config->database->options->host, $config->database->options->username, $config->database->options->password, $config->database->options->dbname, $config->database->prefix, $config->database->adapterName, true);
echo 'Done!' . "\n";
echo 'Configuring admin account... ';
Install::installAdmin(USVN_CONFIG_FILE, $options['admin-login'], $options['admin-password'], $options['admin-firstname'], $options['admin-lastname'], $options['admin-email']);
echo 'Done!' . "\n";
Install::installEnd(USVN_CONFIG_FILE);
echo "\n" . 'Installation is finished!' . "\n";
if ($options['output-apache-config']) {
echo 'Here is the Apache configuration. (You might need to restart your server)' . "\n\n";
echo Install::getApacheConfig(USVN_CONFIG_FILE);
}
} catch (USVN_Exception $e) {
echo $e->getMessage();
exit(1);
}