• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getDoliDBInstance函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: connectSpip

 /**
  * Function used to connect to SPIP
  *
  * @return boolean|DoliDB		Boolean of DoliDB
  */
 function connectSpip()
 {
     $resource = getDoliDBInstance('mysql', ADHERENT_SPIP_SERVEUR, ADHERENT_SPIP_USER, ADHERENT_SPIP_PASS, ADHERENT_SPIP_DB, ADHERENT_SPIP_PORT);
     if ($resource->ok) {
         return $resource;
     }
     dol_syslog('Error when connecting to SPIP ' . ADHERENT_SPIP_SERVEUR . ' ' . ADHERENT_SPIP_USER . ' ' . ADHERENT_SPIP_PASS . ' ' . ADHERENT_SPIP_DB, LOG_ERR);
     return false;
 }
开发者ID:Samara94,项目名称:dolibarr,代码行数:14,代码来源:mailmanspip.class.php


示例2: dol_decode

    else $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
}

// $conf is already instancied inside inc.php
$conf->db->type = $dolibarr_main_db_type;
$conf->db->host = $dolibarr_main_db_host;
$conf->db->port = $dolibarr_main_db_port;
$conf->db->name = $dolibarr_main_db_name;
$conf->db->user = $dolibarr_main_db_user;
$conf->db->pass = $dolibarr_main_db_pass;

// For encryption
$conf->db->dolibarr_main_db_encryption	= isset($dolibarr_main_db_encryption)?$dolibarr_main_db_encryption:'';
$conf->db->dolibarr_main_db_cryptkey	= isset($dolibarr_main_db_cryptkey)?$dolibarr_main_db_cryptkey:'';

$db=getDoliDBInstance($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);

if ($db->connected)
{
    print '<tr><td class="nowrap">';
    print $langs->trans("ServerConnection")." : $dolibarr_main_db_host</td><td align=\"right\">".$langs->trans("OK")."</td></tr>";
    dolibarr_install_syslog("repair: " . $langs->transnoentities("ServerConnection") . ": " . $dolibarr_main_db_host . $langs->transnoentities("OK"));
    $ok = 1;
}
else
{
    print "<tr><td>".$langs->trans("ErrorFailedToConnectToDatabase",$dolibarr_main_db_name)."</td><td align=\"right\">".$langs->transnoentities("Error")."</td></tr>";
    dolibarr_install_syslog("repair: " . $langs->transnoentities("ErrorFailedToConnectToDatabase", $dolibarr_main_db_name));
    $ok = 0;
}
开发者ID:NoisyBoy86,项目名称:Dolibarr_test,代码行数:30,代码来源:repair.php


示例3: getDoliDBInstance

/* Copyright (C) 2004-2007 Laurent Destailleur  <[email protected]>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
/**
 *       \file       htdocs/boutique/osc_master.inc.php
 *       \brief      File of preparation of the environment Dolibarr for OSCommerce
 */
/*
 * Creation objet $dbosc
 */
$dbosc = getDoliDBInstance($conf->db->type, $conf->global->OSC_DB_HOST, $conf->global->OSC_DB_USER, $conf->global->OSC_DB_PASS, $conf->global->OSC_DB_NAME, $conf->global->OSC_DB_PORT);
if (!$dbosc->connected) {
    dol_syslog($dbosc, "host=" . $conf->global->OSC_DB_HOST . ", user=" . $conf->global->OSC_DB_USER . ", databasename=" . $conf->global->OSC_DB_NAME . ", " . $db->error, LOG_ERR);
    llxHeader("", $langs->trans("OSCommerceShop"), "");
    print '<div class="error">' . $langs->trans('FailedConnectDBCheckModuleSetup') . '</div>';
    llxFooter();
    exit;
}
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:30,代码来源:osc_master.inc.php


示例4: getDoliDBInstance

// After this $db is a defined handler to database.
// Main
$version = '3.2';
@set_time_limit(0);
$error = 0;
$langs->load("main");
print "***** {$script_file} ({$version}) *****\n";
// -------------------- START OF BUILD_CLASS_FROM_TABLE SCRIPT --------------------
// Check parameters
if (!isset($argv[1]) || isset($argv[2]) && !isset($argv[6])) {
    print "Usage: {$script_file} tablename [server port databasename user pass]\n";
    exit;
}
if (isset($argv[2]) && isset($argv[3]) && isset($argv[4]) && isset($argv[5]) && isset($argv[6])) {
    print 'Use specific database ids' . "\n";
    $db = getDoliDBInstance('mysqli', $argv[2], $argv[5], $argv[6], $argv[4], $argv[3]);
}
if ($db->type != 'mysql' && $db->type != 'mysqli') {
    print "Error: This script works with mysql or mysqli driver only\n";
    exit;
}
// Show parameters
print 'Tablename=' . $argv[1] . "\n";
print "Current dir is " . getcwd() . "\n";
// Define array with list of properties
$property = array();
$table = $argv[1];
$foundprimary = 0;
$resql = $db->DDLDescTable($table);
if ($resql) {
    $i = 0;
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:31,代码来源:build_class_from_table.php


示例5: is_in_spip

    /**
     *  Fonction qui dit si cet utilisateur est un redacteur existant dans spip
     *
     *	@param	Object	$object		Object with data (->login)
     *  @return int     			1=exists, 0=does not exists, -1=error
     */
    function is_in_spip($object)
    {
        if (defined("ADHERENT_USE_SPIP") && ADHERENT_USE_SPIP ==1 &&
        defined('ADHERENT_SPIP_SERVEUR') && ADHERENT_SPIP_SERVEUR != '' &&
        defined('ADHERENT_SPIP_USER') && ADHERENT_SPIP_USER != '' &&
        defined('ADHERENT_SPIP_PASS') && ADHERENT_SPIP_PASS != '' &&
        defined('ADHERENT_SPIP_DB') && ADHERENT_SPIP_DB != '')
        {
            $query = "SELECT login FROM spip_auteurs WHERE login='".$object->login."'";

            $mydb=getDoliDBInstance('mysql',ADHERENT_SPIP_SERVEUR,ADHERENT_SPIP_USER,ADHERENT_SPIP_PASS,ADHERENT_SPIP_DB,ADHERENT_SPIP_PORT);

            if ($mydb->ok)
            {
                $result = $mydb->query($query);

                if ($result)
                {
                    if ($mydb->num_rows($result))
                    {
                        // nous avons au moins une reponse
                        $mydb->close($result);
                        return 1;
                    }
                    else
                    {
                        // nous n'avons pas de reponse => n'existe pas
                        $mydb->close($result);
                        return 0;
                    }
                }
                else
                {
                    $this->error=$mydb->lasterror();
                    $mydb->close();
                    return -1;
                }
            }
            else
            {
                $this->error="Failed to connect ".ADHERENT_SPIP_SERVEUR." ".ADHERENT_SPIP_USER." ".ADHERENT_SPIP_PASS." ".ADHERENT_SPIP_DB;
                return -1;
            }
        }
    }
开发者ID:nrjacker4,项目名称:crm-php,代码行数:51,代码来源:mailmanspip.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getDomain函数代码示例发布时间:2022-05-15
下一篇:
PHP getDocumentType函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap