diff options
author | Alexander Kampmann <programmer@nurfuerspam.de> | 2012-03-01 11:49:22 +0100 |
---|---|---|
committer | Alexander Kampmann <programmer@nurfuerspam.de> | 2012-03-01 11:49:22 +0100 |
commit | dd9432903ddb3e12381881da44fb84afff832d52 (patch) | |
tree | b499e77cd4faf8157c2e048fb8242bc2ca2720cc /library | |
parent | e0c659b34b8992111bcc64d3f0eea75dfa193412 (diff) | |
parent | bd2c8c92f1b30d8f811bd4aab0fe3a2c5496ec61 (diff) | |
download | volse-hubzilla-dd9432903ddb3e12381881da44fb84afff832d52.tar.gz volse-hubzilla-dd9432903ddb3e12381881da44fb84afff832d52.tar.bz2 volse-hubzilla-dd9432903ddb3e12381881da44fb84afff832d52.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'library')
-rw-r--r-- | library/spam/b8/storage/storage_frndc.php | 54 |
1 files changed, 2 insertions, 52 deletions
diff --git a/library/spam/b8/storage/storage_frndc.php b/library/spam/b8/storage/storage_frndc.php index cbc6fe81a..7702c108b 100644 --- a/library/spam/b8/storage/storage_frndc.php +++ b/library/spam/b8/storage/storage_frndc.php @@ -147,58 +147,8 @@ class b8_storage_frndc extends b8_storage_base public function connect() { - return TRUE; - - # Are we already connected? - if($this->connected === TRUE) - return TRUE; - - # Are we using an existing passed resource? - if($this->config['connection'] === FALSE) { - # ... yes we are, but the connection is not a resource, so return an error - $this->connected = FALSE; - return self::DATABASE_CONNECTION_BAD_RESOURCE; - } - - elseif($this->config['connection'] === NULL) { - - # ... no we aren't so we have to connect. - - if($this->_connection = mysql_connect($this->config['host'], $this->config['user'], $this->config['pass'])) { - if(mysql_select_db($this->config['database'], $this->_connection) === FALSE) { - $this->connected = FALSE; - return self::DATABASE_SELECT_ERROR . ": " . mysql_error(); - } - } - else { - $this->connected = FALSE; - return self::DATABASE_CONNECTION_ERROR; - } - - } - - else { - # ... yes we are - $this->_connection = $this->config['connection']; - } - - # Just in case ... - if($this->_connection === NULL) { - $this->connected = FALSE; - return self::DATABASE_CONNECTION_FAIL; - } - - # Check to see if the wordlist table exists - if(mysql_query('DESCRIBE ' . $this->config['table_name'], $this->_connection) === FALSE) { - $this->connected = FALSE; - return self::DATABASE_TABLE_ACCESS_FAIL . ": " . mysql_error(); - } - - # Everything is okay and connected $this->connected = TRUE; - - # Let's see if this is a b8 database and the version is okay - return $this->check_database(); + return TRUE; } @@ -235,7 +185,7 @@ class b8_storage_frndc extends b8_storage_base # ... and fetch the data $result = q(' - SELECT token, count + SELECT * FROM ' . $this->config['table_name'] . ' WHERE ' . $where . ' AND uid = ' . $uid ); |