當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Installer::getConfigFile方法代碼示例

本文整理匯總了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";
    }
開發者ID:judouk,項目名稱:docker-osticket,代碼行數:31,代碼來源:install.php

示例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;
開發者ID:gizur,項目名稱:osticket,代碼行數:31,代碼來源:install.php

示例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())
開發者ID:KingsleyGU,項目名稱:osticket,代碼行數:30,代碼來源:install.php


注:本文中的Installer::getConfigFile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。