hxp
2025-06-04 f4a514d5ac952110da846636ecbb9de951eaf3d2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
namespace GameDBOperate;
#´´½¨ÈÕÆÚ£º2012-8-23 ÉÏÎç10:20:44
#×÷Õߣºzhouliang
 
include_once '/Common/MongoCommon.php';
include_once '/ProjComm/CommonOperate.php';
 
$g_dbOperate=null;
$g_strLastError='';
 
function Init()
{
    global $g_dbOperate,$g_strLastError;
    if( $g_dbOperate!=null )
    {
        return true;
    }    
    
    \Logging\CreateLogging( "GameDBOperate" );
    
    $strDefaultServerID='';
    $strIniFilePath=dirname(__FILE__).'\\..\\InterfaceConfig.php';
    if( !\CommonOperate\GetDefaultServerID( $strDefaultServerID, $strIniFilePath ) )
    {
        $g_strLastError='»ñµÃÇø·þIDʧ°Ü£¬Çë¼ì²éÅäÖÃ';
        return false;
    }
    
    #¿ªÊ¼Á¬½ÓÊý¾Ý¿â
    $g_dbOperate=new \MongoCommon\MongoDBOpt( $strIniFilePath, $strDefaultServerID );
    
    if( !$g_dbOperate->Init() )
    {
        $g_strLastError='Êý¾Ý¿â³õʼ»¯Ê§°Ü!Ô­Òò:'.$dbOpt->GetLastError().'Çë¼ì²éÅäÖÃ';
        return false;
    }
    
    return true;
}
 
function GetData( $strCollection, $findArray, &$retArray, $arrayRetColumn )
{
    global $g_dbOperate,$g_strLastError;
    return $g_dbOperate->GetData( $strCollection, $findArray, $retArray, $arrayRetColumn );
}
 
function GetLastError()
{
    global $g_strLastError;
    return $g_strLastError;
}
?>