Subversion Repositories SmartDukaan

Rev

Rev 15403 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15403 Rev 15461
Line 77... Line 77...
77
        {
77
        {
78
                $xml = simplexml_load_string($response);
78
                $xml = simplexml_load_string($response);
79
                return 'http://bit.ly/'.$xml->results->nodeKeyVal->hash;
79
                return 'http://bit.ly/'.$xml->results->nodeKeyVal->hash;
80
        }
80
        }
81
	}
81
	}
-
 
82
   /**
-
 
83
   * Connects to specified database
-
 
84
   *
-
 
85
   * @param String name of different database to connect with.
-
 
86
   * @param String name of existing datasource
-
 
87
   * @return boolean true on success, false on failure
-
 
88
   * @access public
-
 
89
   */
-
 
90
    public function setDatabase($database, $datasource = 'click')
-
 
91
    {
-
 
92
      $nds = $datasource . '_' . $database;      
-
 
93
      $db  = &ConnectionManager::getDataSource($datasource);
-
 
94
 
-
 
95
      $db->setConfig(array(
-
 
96
        'name'       => $nds,
-
 
97
        'database'   => $database,
-
 
98
        'persistent' => false
-
 
99
      ));
-
 
100
 
-
 
101
      if ( $ds = ConnectionManager::create($nds, $db->config) ) {
-
 
102
        $this->useDbConfig  = $nds;
-
 
103
        $this->cacheQueries = false;
-
 
104
        return true;
-
 
105
      }
-
 
106
 
-
 
107
      return false;
-
 
108
    }
82
}
109
}