本文整理汇总了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;
}