本文整理匯總了PHP中Updater::performPostInstallTasks方法的典型用法代碼示例。如果您正苦於以下問題:PHP Updater::performPostInstallTasks方法的具體用法?PHP Updater::performPostInstallTasks怎麽用?PHP Updater::performPostInstallTasks使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Updater
的用法示例。
在下文中一共展示了Updater::performPostInstallTasks方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: install
//.........這裏部分代碼省略.........
$t_total = new Timer();
// If we are installing, then use Installer, otherwise use Updater
$vo_installer = null;
if ($pb_installing) {
$vo_installer = new Installer($vs_profile_directory, $po_opts->getOption('profile-name'), $po_opts->getOption('admin-email'), $po_opts->getOption('overwrite'), $po_opts->getOption('debug'));
} else {
$vo_installer = new Updater($vs_profile_directory, $po_opts->getOption('profile-name'), null, false, $po_opts->getOption('debug'));
}
$vb_quiet = $po_opts->getOption('quiet');
// if profile validation against XSD failed, we already have an error here
if ($vo_installer->numErrors()) {
CLIUtils::addError(_t("There were errors parsing the profile(s): %1", "\n * " . join("\n * ", $vo_installer->getErrors())));
return false;
}
if ($pb_installing) {
if (!$vb_quiet) {
CLIUtils::addMessage(_t("Performing preinstall tasks"));
}
$vo_installer->performPreInstallTasks();
if (!$vb_quiet) {
CLIUtils::addMessage(_t("Loading schema"));
}
$vo_installer->loadSchema();
if ($vo_installer->numErrors()) {
CLIUtils::addError(_t("There were errors loading the database schema: %1", "\n * " . join("\n * ", $vo_installer->getErrors())));
return false;
}
}
if (!$vb_quiet) {
CLIUtils::addMessage(_t("Processing locales"));
}
$vo_installer->processLocales();
if (!$vb_quiet) {
CLIUtils::addMessage(_t("Processing lists"));
}
$vo_installer->processLists();
if (!$vb_quiet) {
CLIUtils::addMessage(_t("Processing relationship types"));
}
$vo_installer->processRelationshipTypes();
if (!$vb_quiet) {
CLIUtils::addMessage(_t("Processing metadata elements"));
}
$vo_installer->processMetadataElements();
if (!$vb_quiet) {
CLIUtils::addMessage(_t("Processing metadata dictionary"));
}
$vo_installer->processMetadataDictionary();
if (!$po_opts->getOption('skip-roles')) {
if (!$vb_quiet) {
CLIUtils::addMessage(_t("Processing access roles"));
}
$vo_installer->processRoles();
}
if (!$vb_quiet) {
CLIUtils::addMessage(_t("Processing user groups"));
}
$vo_installer->processGroups();
if (!$vb_quiet) {
CLIUtils::addMessage(_t("Processing user logins"));
}
$va_login_info = $vo_installer->processLogins();
if (!$vb_quiet) {
CLIUtils::addMessage(_t("Processing user interfaces"));
}
$vo_installer->processUserInterfaces();
if (!$vb_quiet) {
CLIUtils::addMessage(_t("Processing displays"));
}
$vo_installer->processDisplays();
if (!$vb_quiet) {
CLIUtils::addMessage(_t("Processing search forms"));
}
$vo_installer->processSearchForms();
if (!$vb_quiet) {
CLIUtils::addMessage(_t("Setting up hierarchies"));
}
$vo_installer->processMiscHierarchicalSetup();
if (!$vb_quiet) {
CLIUtils::addMessage(_t("Performing post install tasks"));
}
$vo_installer->performPostInstallTasks();
if (!$vb_quiet) {
CLIUtils::addMessage(_t("Installation complete"));
}
$vs_time = _t("Installation took %1 seconds", $t_total->getTime(0));
if ($vo_installer->numErrors()) {
CLIUtils::addError(_t("There were errors during installation: %1\n(%2)", "\n * " . join("\n * ", $vo_installer->getErrors()), $vs_time));
return false;
}
if ($pb_installing) {
CLIUtils::addMessage(_t("Installation was successful!\n\nYou can now login with the following logins: %1\nMake a note of these passwords!", "\n * " . join("\n * ", array_map(function ($username, $password) {
return _t("username %1 and password %2", $username, $password);
}, array_keys($va_login_info), array_values($va_login_info)))));
} else {
CLIUtils::addMessage(_t("Update of installation profile successful"));
}
CLIUtils::addMessage($vs_time);
return true;
}