aboutsummaryrefslogtreecommitdiffstats
path: root/library/ajaxchat/chat/lib/class/AJAXChatMySQLDataBase.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-01-27 18:37:06 -0800
committerfriendica <info@friendica.com>2014-01-27 18:37:06 -0800
commiteb21bbdd550e4d1efc9a4c6e506eb64ba2cf9842 (patch)
tree887fbfc6ba78c4c2e12d0361003b33c6e76926ac /library/ajaxchat/chat/lib/class/AJAXChatMySQLDataBase.php
parent3100b5d93e9f440a17b99d2856ee022b29d73f80 (diff)
downloadvolse-hubzilla-eb21bbdd550e4d1efc9a4c6e506eb64ba2cf9842.tar.gz
volse-hubzilla-eb21bbdd550e4d1efc9a4c6e506eb64ba2cf9842.tar.bz2
volse-hubzilla-eb21bbdd550e4d1efc9a4c6e506eb64ba2cf9842.zip
Ajaxchat package has way too many incompatible assumptions - after a lot of review, we can't work with it without re-writing huge chunks. Think I'll just start fresh. Ajax chat isn't that hard and we can do stuff with it that you just can't do with other chat clients because - well we've got zot.
Diffstat (limited to 'library/ajaxchat/chat/lib/class/AJAXChatMySQLDataBase.php')
-rw-r--r--library/ajaxchat/chat/lib/class/AJAXChatMySQLDataBase.php92
1 files changed, 0 insertions, 92 deletions
diff --git a/library/ajaxchat/chat/lib/class/AJAXChatMySQLDataBase.php b/library/ajaxchat/chat/lib/class/AJAXChatMySQLDataBase.php
deleted file mode 100644
index 6dca348d1..000000000
--- a/library/ajaxchat/chat/lib/class/AJAXChatMySQLDataBase.php
+++ /dev/null
@@ -1,92 +0,0 @@
-<?php
-/*
- * @package AJAX_Chat
- * @author Sebastian Tschan
- * @copyright (c) Sebastian Tschan
- * @license Modified MIT License
- * @link https://blueimp.net/ajax/
- */
-
-// Class to initialize the MySQL DataBase connection:
-class AJAXChatDataBaseMySQL {
-
- var $_connectionID;
- var $_errno = 0;
- var $_error = '';
- var $_dbName;
-
- function __construct(&$dbConnectionConfig) {
- $this->_connectionID = $dbConnectionConfig['link'];
- $this->_dbName = $dbConnectionConfig['name'];
- }
-
- // Method to connect to the DataBase server:
- function connect(&$dbConnectionConfig) {
- $this->_connectionID = @mysql_connect(
- $dbConnectionConfig['host'],
- $dbConnectionConfig['user'],
- $dbConnectionConfig['pass'],
- true
- );
- if(!$this->_connectionID) {
- $this->_errno = null;
- $this->_error = 'Database connection failed.';
- return false;
- }
- return true;
- }
-
- // Method to select the DataBase:
- function select($dbName) {
- if(!@mysql_select_db($dbName, $this->_connectionID)) {
- $this->_errno = mysql_errno($this->_connectionID);
- $this->_error = mysql_error($this->_connectionID);
- return false;
- }
- $this->_dbName = $dbName;
- return true;
- }
-
- // Method to determine if an error has occured:
- function error() {
- return (bool)$this->_error;
- }
-
- // Method to return the error report:
- function getError() {
- if($this->error()) {
- $str = 'Error-Report: ' .$this->_error."\n";
- $str .= 'Error-Code: '.$this->_errno."\n";
- } else {
- $str = 'No errors.'."\n";
- }
- return $str;
- }
-
- // Method to return the connection identifier:
- function &getConnectionID() {
- return $this->_connectionID;
- }
-
- // Method to prevent SQL injections:
- function makeSafe($value) {
- return "'".mysql_real_escape_string($value, $this->_connectionID)."'";
- }
-
- // Method to perform SQL queries:
- function sqlQuery($sql) {
- return new AJAXChatMySQLQuery($sql, $this->_connectionID);
- }
-
- // Method to retrieve the current DataBase name:
- function getName() {
- return $this->_dbName;
- }
-
- // Method to retrieve the last inserted ID:
- function getLastInsertedID() {
- return mysql_insert_id($this->_connectionID);
- }
-
-}
-?> \ No newline at end of file