当前位置: 首页>>代码示例>>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;未经允许,请勿转载。