示例#1
0
    /**
     * Builds an instance object of this class only if there is no one.
     *
     * @return object
     *    m_instance A CampConfig instance
     */
    public static function singleton()
    {
        if (!isset(self::$m_instance)) {
            self::$m_instance = new CampDatabase();
        }

        return self::$m_instance;
    } // fn singleton
示例#2
0
    public function testIsConnected()
    {
    	global $g_ado_db;

        $this->m_dbObj = CampDatabase::singleton();
    	$this->assertEquals(true, $this->m_dbObj->m_db->IsConnected());
    	$g_ado_db = $this->m_dbObj->m_db;
    	$this->assertEquals(true, $g_ado_db->IsConnected());
    }
示例#3
0
 /**
  * Returns a CampDatabase instance.
  *
  * @return object
  *    A CampDatabase instance.
  */
 public static function GetDatabaseInstance()
 {
     return CampDatabase::singleton();
 } // fn GetDatabase