1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181:
<?php
/**
* Standard interface for database classes
*
* @copyright http://www.impresscms.org/ The ImpressCMS Project
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL)
*
* @category ICMS
* @package Database
*/
/**
*
* @copyright http://www.impresscms.org/ The ImpressCMS Project
* @category ICMS
* @package Database
*/
interface icms_db_legacy_IDatabase {
/**
* assign a {@link icms_core_Logger} object to the database
*
* @see icms_core_Logger
* @param object $logger reference to a {@link icms_core_Logger} object
*/
public function setLogger($logger);
/**
* set the prefix for tables in the database
*
* @param string $value table prefix
*/
public function setPrefix($value);
/**
* attach the prefix.'_' to a given tablename.
*
* if tablename is empty, only prefix will be returned
*
* @param string $tablename tablename
* @return string prefixed tablename, just prefix if tablename is empty
*/
public function prefix($tablename='');
/**
* connect to the database
*
* @param bool $selectdb select the database now?
* @return bool successful?
*/
public function connect($selectdb = true);
/**
* generate an ID for a new row
*
* This is for compatibility only. Will always return 0, because MySQL supports
* autoincrement for primary keys.
*
* @param string $sequence name of the sequence from which to get the next ID
* @return int always 0, because mysql has support for autoincrement
*/
public function genId($sequence);
/**
* Get a result row as an enumerated array
*
* @param resource $result
* @return array the fetched rows
*/
public function fetchRow($result);
/**
* Fetch a result row as an associative array
*
* @return array the fetched associative array
*/
public function fetchArray($result);
/**
* Fetch a result row as an associative array and numerical array
*
* @return array the associative and numerical array
*/
public function fetchBoth($result);
/**
* Get the ID generated from the previous INSERT operation
*
* @return int
*/
public function getInsertId();
/**
* Get number of rows in result
*
* @param resource query result
* @return int the number of rows in the resultset
*/
public function getRowsNum($result);
/**
* Get number of affected rows
*
* @return int number of affected rows
*/
public function getAffectedRows();
/**
* Closes MySQL connection
*
*/
public function close();
/**
* will free all memory associated with the result identifier result.
*
* @param resource query result
* @return bool TRUE on success or FALSE on failure.
*/
public function freeRecordSet($result);
/**
* Returns the text of the error message from previous MySQL operation
*
* @return string Returns the error text from the last MySQL function, or '' (the empty string) if no error occurred.
*/
public function error();
/**
* Returns the numerical value of the error message from previous MySQL operation
*
* @return int Returns the error number from the last MySQL function, or 0 (zero) if no error occurred.
*/
public function errno();
/**
* Returns escaped string text with single quotes around it to be safely stored in database
*
* @param string $str unescaped string text
* @return string escaped string text with single quotes around
*/
public function quoteString($str);
/**
* Quotes a string for use in a query using mysql_real_escape_string.
*
* @param string $str unescaped string text
* @return string escaped string text using mysql_real_escape_string
*/
public function quote($string);
/**
* perform a query on the database
*
* @param string $sql a valid MySQL query
* @param int $limit number of records to return
* @param int $start offset of first record to return
* @return resource query result or FALSE if successful
* or TRUE if successful and no result
*/
public function queryF($sql, $limit = 0, $start = 0);
/**
* perform a query
*
* This method is empty and does nothing! It should therefore only be
* used if nothing is exactly what you want done! ;-)
*
* @param string $sql a valid MySQL query
* @param int $limit number of records to return
* @param int $start offset of first record to return
*
*/
public function query($sql, $limit = 0, $start = 0);
/**
* Get field name
*
* @param resource $result query result
* @param int numerical field index
* @return string the fieldname
*/
public function getFieldName($result, $offset);
/**
* Get field type
*
* @param resource $result query result
* @param int $offset numerical field index
* @return string the fieldtype
*/
public function getFieldType($result, $offset);
/**
* Get number of fields in result
*
* @param resource $result query result
* @return int number of fields in the resultset
*/
public function getFieldsNum($result);
}