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


PHP getInstallDbInstance函数代码示例

本文整理汇总了PHP中getInstallDbInstance函数的典型用法代码示例。如果您正苦于以下问题:PHP getInstallDbInstance函数的具体用法?PHP getInstallDbInstance怎么用?PHP getInstallDbInstance使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getInstallDbInstance函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: die

if (!isset($install_script) || !$install_script) {
    die($mod_strings['ERR_NO_DIRECT_SCRIPT']);
}
// DB split
$createDbCheckbox = '';
$createDb = !empty($_SESSION['setup_db_create_database']) ? 'checked="checked"' : '';
$dropCreate = !empty($_SESSION['setup_db_drop_tables']) ? 'checked="checked"' : '';
$instanceName = '';
if (isset($_SESSION['setup_db_host_instance']) && !empty($_SESSION['setup_db_host_instance'])) {
    $instanceName = $_SESSION['setup_db_host_instance'];
}
$setupDbPortNum = '';
if (isset($_SESSION['setup_db_port_num']) && !empty($_SESSION['setup_db_port_num'])) {
    $setupDbPortNum = $_SESSION['setup_db_port_num'];
}
$db = getInstallDbInstance();
///////////////////////////////////////////////////////////////////////////////
////	BEGIN PAGE OUTPUT
$langHeader = get_language_header();
$out = <<<EOQ
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html {$langHeader}>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Script-Type" content="text/javascript">
    <meta http-equiv="Content-Style-Type" content="text/css">
    <title>{$mod_strings['LBL_WIZARD_TITLE']} {$mod_strings['LBL_DBCONF_TITLE']}</title>
    <link rel="stylesheet" href="install/install.css" type="text/css" />
    <script type="text/javascript" src="install/installCommon.js"></script>
    <script type="text/javascript" src="install/dbConfig.js"></script>
    <link REL="SHORTCUT ICON" HREF="include/images/sugar_icon.ico">
开发者ID:thsonvt,项目名称:sugarcrm_dev,代码行数:31,代码来源:dbConfig_a.php

示例2: getDbConnection

function getDbConnection()
{
    $dbconfig = array("db_host_name" => $_SESSION['setup_db_host_name'], "db_user_name" => $_SESSION['setup_db_admin_user_name'], "db_password" => $_SESSION['setup_db_admin_password'], "db_host_instance" => $_SESSION['setup_db_host_instance'], "db_port" => $_SESSION['setup_db_port_num']);
    if (empty($_SESSION['setup_db_create_database'])) {
        $dbconfig["db_name"] = $_SESSION['setup_db_database_name'];
    }
    $db = getInstallDbInstance();
    if (!empty($_SESSION['setup_db_options'])) {
        $db->setOptions($_SESSION['setup_db_options']);
    }
    $db->connect($dbconfig, true);
    return $db;
}
开发者ID:stefano6310,项目名称:SuiteCRM,代码行数:13,代码来源:install_utils.php

示例3: copyInputsIntoSession

function copyInputsIntoSession()
{
    if (isset($_REQUEST['setup_db_type'])) {
        $_SESSION['setup_db_type'] = $_REQUEST['setup_db_type'];
    }
    if (isset($_REQUEST['setup_db_admin_user_name'])) {
        $_SESSION['setup_db_admin_user_name'] = $_REQUEST['setup_db_admin_user_name'];
    }
    if (isset($_REQUEST['setup_db_admin_password'])) {
        $_SESSION['setup_db_admin_password'] = $_REQUEST['setup_db_admin_password'];
    }
    if (isset($_REQUEST['setup_db_database_name'])) {
        $_SESSION['setup_db_database_name'] = $_REQUEST['setup_db_database_name'];
    }
    if (isset($_REQUEST['setup_db_host_name'])) {
        $_SESSION['setup_db_host_name'] = $_REQUEST['setup_db_host_name'];
    }
    //FTS Support
    $_SESSION['fts_type'] = isset($_REQUEST['fts_type']) ? $_REQUEST['fts_type'] : "";
    if (isset($_REQUEST['fts_host'])) {
        $_SESSION['fts_host'] = $_REQUEST['fts_host'];
    }
    if (isset($_REQUEST['fts_port'])) {
        $_SESSION['fts_port'] = $_REQUEST['fts_port'];
    }
    if (isset($_SESSION['setup_db_type']) && (!isset($_SESSION['setup_db_manager']) || isset($_REQUEST['setup_db_type']))) {
        $_SESSION['setup_db_manager'] = DBManagerFactory::getManagerByType($_SESSION['setup_db_type']);
    }
    if (isset($_REQUEST['setup_db_host_instance'])) {
        $_SESSION['setup_db_host_instance'] = $_REQUEST['setup_db_host_instance'];
    }
    if (isset($_REQUEST['setup_db_port_num'])) {
        $_SESSION['setup_db_port_num'] = $_REQUEST['setup_db_port_num'];
    }
    // on a silent install, copy values from $_SESSION into $_REQUEST
    if (isset($_REQUEST['goto']) && $_REQUEST['goto'] == 'SilentInstall') {
        if (isset($_SESSION['dbUSRData']) && !empty($_SESSION['dbUSRData'])) {
            $_REQUEST['dbUSRData'] = $_SESSION['dbUSRData'];
        } else {
            $_REQUEST['dbUSRData'] = 'same';
        }
        if (isset($_SESSION['setup_db_sugarsales_user']) && !empty($_SESSION['setup_db_sugarsales_user'])) {
            $_REQUEST['setup_db_sugarsales_user'] = $_SESSION['setup_db_sugarsales_user'];
        } else {
            $_REQUEST['dbUSRData'] = 'same';
        }
        $_REQUEST['setup_db_sugarsales_password'] = $_SESSION['setup_db_sugarsales_password'];
        $_REQUEST['setup_db_sugarsales_password_retype'] = $_SESSION['setup_db_sugarsales_password'];
    }
    //make sure we are creating or using provided user for app db connections
    $_SESSION['setup_db_create_sugarsales_user'] = true;
    //get_boolean_from_request('setup_db_create_sugarsales_user');
    $db = getInstallDbInstance();
    if (!$db->supports("create_user")) {
        //if the DB doesn't support creating users, make the admin user/password same as connecting user/password
        $_SESSION['setup_db_sugarsales_user'] = $_SESSION['setup_db_admin_user_name'];
        $_SESSION['setup_db_sugarsales_password'] = $_SESSION['setup_db_admin_password'];
        $_SESSION['setup_db_sugarsales_password_retype'] = $_SESSION['setup_db_sugarsales_password'];
        $_SESSION['setup_db_create_sugarsales_user'] = false;
        $_SESSION['setup_db_create_database'] = false;
    } else {
        $_SESSION['setup_db_create_database'] = true;
        //retrieve the value from dropdown in order to know what settings the user
        //wants to use for the sugar db user.
        //use provided db admin by default
        $_SESSION['dbUSRData'] = 'same';
        if (isset($_REQUEST['dbUSRData']) && !empty($_REQUEST['dbUSRData'])) {
            $_SESSION['dbUSRData'] = $_REQUEST['dbUSRData'];
        }
        if ($_SESSION['dbUSRData'] == 'auto') {
            //create user automatically
            $_SESSION['setup_db_create_sugarsales_user'] = true;
            $_SESSION['setup_db_sugarsales_user'] = "sugar" . create_db_user_creds(5);
            $_SESSION['setup_db_sugarsales_password'] = create_db_user_creds(10);
            $_SESSION['setup_db_sugarsales_password_retype'] = $_SESSION['setup_db_sugarsales_password'];
        } elseif ($_SESSION['dbUSRData'] == 'provide') {
            //use provided user info
            $_SESSION['setup_db_create_sugarsales_user'] = false;
            $_SESSION['setup_db_sugarsales_user'] = $_REQUEST['setup_db_sugarsales_user'];
            $_SESSION['setup_db_sugarsales_password'] = $_REQUEST['setup_db_sugarsales_password'];
            $_SESSION['setup_db_sugarsales_password_retype'] = $_REQUEST['setup_db_sugarsales_password_retype'];
        } elseif ($_SESSION['dbUSRData'] == 'create') {
            // create user with provided info
            $_SESSION['setup_db_create_sugarsales_user'] = true;
            $_SESSION['setup_db_sugarsales_user'] = $_REQUEST['setup_db_sugarsales_user'];
            $_SESSION['setup_db_sugarsales_password'] = $_REQUEST['setup_db_sugarsales_password'];
            $_SESSION['setup_db_sugarsales_password_retype'] = $_REQUEST['setup_db_sugarsales_password_retype'];
        } else {
            //Use the same login as provided admin user
            $_SESSION['setup_db_create_sugarsales_user'] = false;
            $_SESSION['setup_db_sugarsales_user'] = $_SESSION['setup_db_admin_user_name'];
            $_SESSION['setup_db_sugarsales_password'] = $_SESSION['setup_db_admin_password'];
            $_SESSION['setup_db_sugarsales_retype'] = $_SESSION['setup_db_admin_password'];
        }
    }
    if (!isset($_SESSION['demoData']) || empty($_SESSION['demoData'])) {
        $_SESSION['demoData'] = 'no';
    }
    if (isset($_REQUEST['demoData'])) {
        $_SESSION['demoData'] = $_REQUEST['demoData'];
//.........这里部分代码省略.........
开发者ID:omusico,项目名称:sugar_work,代码行数:101,代码来源:checkDBSettings.php


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