本文整理汇总了PHP中Installer::getConfigFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Installer::getConfigFile方法的具体用法?PHP Installer::getConfigFile怎么用?PHP Installer::getConfigFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Installer
的用法示例。
在下文中一共展示了Installer::getConfigFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: err
echo "Using installation secret from INSTALL_SECRET environmental variable\n";
}
//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";
}
示例2: elseif
$errors['notify'] = __('Check one or more');
}
if (!$errors) {
$_SESSION['ost_installer']['s'] = 'done';
}
break;
}
} elseif ($_GET['s'] && $_GET['s'] == 'ns' && $_SESSION['ost_installer']['s'] == 'subscribe') {
$_SESSION['ost_installer']['s'] = 'done';
}
switch (strtolower($_SESSION['ost_installer']['s'])) {
case 'config':
case 'install':
if (!$installer->config_exists()) {
$inc = 'file-missing.inc.php';
} elseif (!($cFile = file_get_contents($installer->getConfigFile())) || preg_match("/define\\('OSTINSTALLED',TRUE\\)\\;/i", $cFile)) {
//osTicket already installed or empty config file?
$inc = 'file-unclean.inc.php';
} elseif (!$installer->config_writable()) {
//writable config file??
clearstatcache();
$inc = 'file-perm.inc.php';
} else {
//Everything checked out show install form.
$inc = 'install.inc.php';
}
break;
case 'subscribe':
//TODO: Prep for v1.7 RC1
$inc = 'subscribe.inc.php';
break;
示例3: elseif
if(!$errors)
$_SESSION['ost_installer']['s'] = 'done';
break;
}
}elseif($_GET['s'] && $_GET['s']=='ns' && $_SESSION['ost_installer']['s']=='subscribe') {
$_SESSION['ost_installer']['s']='done';
}
switch(strtolower($_SESSION['ost_installer']['s'])) {
case 'config':
case 'install':
if(!$installer->config_exists()) {
$inc='file-missing.inc.php';
} elseif(!($cFile=file_get_contents($installer->getConfigFile()))
|| preg_match("/define\('OSTINSTALLED',TRUE\)\;/i",$cFile)) { //osTicket already installed or empty config file?
$inc='file-unclean.inc.php';
} elseif(!$installer->config_writable()) { //writable config file??
clearstatcache();
$inc='file-perm.inc.php';
} else { //Everything checked out show install form.
$inc='install.inc.php';
}
break;
case 'subscribe': //TODO: Prep for v1.7 RC1
$inc='subscribe.inc.php';
break;
case 'done':
$inc='install-done.inc.php';
if (!$installer->config_exists())