| <?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; | 
| } | 
| ?> |