本文整理汇总了PHP中Installer::getErrors方法的典型用法代码示例。如果您正苦于以下问题:PHP Installer::getErrors方法的具体用法?PHP Installer::getErrors怎么用?PHP Installer::getErrors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Installer
的用法示例。
在下文中一共展示了Installer::getErrors方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
break;
case 'config':
if (!$installer->config_exists()) {
$errors['err'] = __('Configuration file does NOT exist. Follow steps below to add one.');
} elseif (!$installer->config_writable()) {
$errors['err'] = __('Write access required to continue');
} else {
$_SESSION['ost_installer']['s'] = 'install';
}
break;
case 'install':
if ($installer->install($_POST)) {
$_SESSION['info'] = array('name' => ucfirst($_POST['fname'] . ' ' . $_POST['lname']), 'email' => $_POST['admin_email'], 'URL' => URL);
//TODO: Go to subscribe step.
$_SESSION['ost_installer']['s'] = 'done';
} elseif (!($errors = $installer->getErrors()) || !$errors['err']) {
$errors['err'] = __('Error installing osTicket - correct the errors below and try again.');
}
break;
case 'subscribe':
if (!trim($_POST['name'])) {
$errors['name'] = __('Required');
}
if (!$_POST['email']) {
$errors['email'] = __('Required');
} elseif (!Validator::is_valid_email($_POST['email'])) {
$errors['email'] = __('Invalid');
}
if (!$_POST['alerts'] && !$_POST['news']) {
$errors['notify'] = __('Check one or more');
}
示例2: err
}
//Always rewrite config file in case MySQL details changed (e.g. ip address)
echo "Updating configuration file\n";
if (!($configFile = file_get_contents($vars['config']))) {
err("Failed to load configuration file: {$vars['config']}");
}
$configFile = str_replace("define('OSTINSTALLED',FALSE);", "define('OSTINSTALLED',TRUE);", $configFile);
$configFile = str_replace('%ADMIN-EMAIL', $vars['admin_email'], $configFile);
$configFile = str_replace('%CONFIG-DBHOST', $vars['dbhost'], $configFile);
$configFile = str_replace('%CONFIG-DBNAME', $vars['dbname'], $configFile);
$configFile = str_replace('%CONFIG-DBUSER', $vars['dbuser'], $configFile);
$configFile = str_replace('%CONFIG-DBPASS', $vars['dbpass'], $configFile);
$configFile = str_replace('%CONFIG-PREFIX', $vars['prefix'], $configFile);
$configFile = str_replace('%CONFIG-SIRI', $vars['siri'], $configFile);
if (!file_put_contents($installer->getConfigFile(), $configFile)) {
err("Failed to write configuration file");
}
//Perform database installation if required
if (!$db_installed) {
echo "Installing database. Please wait...\n";
if (!$installer->install($vars)) {
$errors = $installer->getErrors();
echo "Database installation failed. Errors:\n";
foreach ($errors as $e) {
echo " {$e}\n";
}
exit(1);
} else {
echo "Database installation successful\n";
}
}
示例3: Installer
<script type="text/javascript">
jQuery('#progressbar').progressbar({
value: 0
});
</script>
<div id="installerLog" class="installStatus">
</div>
<?php
$vn_progress = 0;
// parameters: profile dir, profile name, admin email, overwrite y/n, profile debug mode y/n
$vo_installer = new Installer("profiles/xml/", $ps_profile, $ps_email, $pb_overwrite, $pb_debug);
// if profile validation against XSD failed, we already have an error here
if ($vo_installer->numErrors()) {
caSetMessage("There were errors parsing the profile(s): " . join("; ", $vo_installer->getErrors()));
} else {
caIncrementProgress($vn_progress, "Performing preinstall tasks");
$vo_installer->performPreInstallTasks();
caIncrementProgress($vn_progress, "Loading schema");
$vo_installer->loadSchema('caGetTableToBeLoaded');
if ($vo_installer->numErrors()) {
caSetMessage("There were errors loading the database schema: " . join("; ", $vo_installer->getErrors()));
} else {
$vn_progress += 7;
caIncrementProgress($vn_progress, "Processing locales");
$vo_installer->processLocales();
caIncrementProgress($vn_progress, "Processing lists");
$vo_installer->processLists('caGetListToBeLoaded');
$vn_progress += 7;
caIncrementProgress($vn_progress, "Processing relationship types");
示例4: if
});
$('#goto_03_back').click(function() {
$('#goto_03').click()
});
$('#goto_04').click(function() {
$('#goto').val(4);
$('#form').submit();
});
/**
* Validation Errors
*/
<?php if(Installer::hasErrors($step)) { ?>
<?php foreach(Installer::getErrors($step) as $field => $error) { ?>
$('<?php echo '#' . str_pad($step, 2, '0', STR_PAD_LEFT) . '_' . $field ?>').bubble({
msg: '<?php echo $error ?>',
direction: 'e',
width: 300,
height: 100,
type: 'error'
});
<?php } ?>
<?php } ?>
});
//-->
</script>
</head>
<body>