当前位置: 首页>>代码示例>>PHP>>正文


PHP Installer::getErrors方法代码示例

本文整理汇总了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');
     }
开发者ID:gizur,项目名称:osticket,代码行数:31,代码来源:install.php

示例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";
    }
}
开发者ID:judouk,项目名称:docker-osticket,代码行数:31,代码来源:install.php

示例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");
开发者ID:kai-iak,项目名称:providence,代码行数:31,代码来源:page2.php

示例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>
开发者ID:RogWilco,项目名称:Bedrock-Framework,代码行数:31,代码来源:index.php


注:本文中的Installer::getErrors方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。